The main database class. More...
#include <sqlitepp.h>
Public Member Functions | |
| Database (void) | |
| empty constructor. Does not open a database | |
| Database (const std::string &path, const OpenFlags flag=CREATE) | |
| Opens a sqlite3 database with the passed flag. More... | |
| ~Database (void) | |
| destructor | |
| void | open (const std::string &path, const OpenFlags flag=CREATE) |
| Opens a database with the passed flag. More... | |
| bool | isOpen (void) |
| returns true, when a database has been opened, false otherwise | |
| void | close (void) |
| closes the database | |
| void | activateForeignKeys (void) |
| activates foreign keys | |
| void | deactivateForeignKeys (void) |
| deactivates foreign keys | |
| int | exec (const std::string &sql) |
| executes a single statement without return values More... | |
| void | beginTransaction (const TransactionFlags=DEFERRED) |
| Begins a transaction. | |
| void | endTransaction (void) |
| commits a transaction | |
| void | rollback (void) |
| executes a rollback on the current transaction | |
| int | getLastRowId (void) |
| gets the last ID, that has been inserted More... | |
Friends | |
| class | Statement |
The main database class.
Definition at line 73 of file sqlitepp.h.
| sqlitepp::Database::Database | ( | const std::string & | path, |
| const OpenFlags | flag = CREATE |
||
| ) |
Opens a sqlite3 database with the passed flag.
| path | |
| flag |
Definition at line 38 of file database.cpp.
| int sqlitepp::Database::exec | ( | const std::string & | sql | ) |
executes a single statement without return values
| sql | SQL statement |
Definition at line 98 of file database.cpp.
| int sqlitepp::Database::getLastRowId | ( | void | ) |
| void sqlitepp::Database::open | ( | const std::string & | path, |
| const OpenFlags | flag = CREATE |
||
| ) |
Opens a database with the passed flag.
| path | |
| flag |
Definition at line 53 of file database.cpp.
1.8.5