MIRA
List of all members
SQLiteDB Class Reference

An exception that occurs whenever accessing the SQLite db results in an error. More...

#include <database/SQLiteDB.h>

Inheritance diagram for SQLiteDB:
Inheritance graph
[legend]

Public Member Functions

Constructors and destructor
 SQLiteDB (const Path &db)
 Constructs a SQLite database by loading a db file. More...
 
 ~SQLiteDB ()
 Destructor. More...
 
Database operations
bool tableExists (const std::string &table)
 Asks if a given table exists in the database. More...
 
SQLiteQuery query (const std::string &sql)
 Executes a database query and returns the query object. More...
 
int exec (const std::string &sql)
 Executes a statement on the database. More...
 

Detailed Description

An exception that occurs whenever accessing the SQLite db results in an error.

Wrapper class for the SQLite C API. Used for constructing and accessing file based SQLite databases.

Constructor & Destructor Documentation

◆ SQLiteDB()

SQLiteDB ( const Path db)

Constructs a SQLite database by loading a db file.

The database is created if not exist.

Parameters
[in]dbThe path to the database file

◆ ~SQLiteDB()

~SQLiteDB ( )

Destructor.

Member Function Documentation

◆ tableExists()

bool tableExists ( const std::string &  table)

Asks if a given table exists in the database.

Parameters
[in]tableThe table name.
Returns
true if table exists, false otherwise

◆ query()

SQLiteQuery query ( const std::string &  sql)

Executes a database query and returns the query object.

Parameters
[in]sqlThe query in SQL syntax.
Returns
The query object.

◆ exec()

int exec ( const std::string &  sql)

Executes a statement on the database.

Parameters
[in]sqlThe statement
Returns
Counter of how many rows have been affected.

The documentation for this class was generated from the following file: