|
RhythmGame 1.4.3
|
Database wrapper for SQLiteCpp. More...
#include <SqliteCppDb.h>
Classes | |
| class | Statement |
| Wrapper for SQLiteCpp::Statement. More... | |
| class | Transaction |
| Isolates a transaction from other users of this connection. More... | |
Public Types | |
| enum class | Durability { Normal , Full } |
Public Member Functions | |
| auto | transaction () -> Transaction |
| SqliteCppDb (const std::filesystem::path &dbPath, std::chrono::milliseconds busyTimeout=std::chrono::milliseconds{ 0 }, Durability durability=Durability::Normal) | |
| Constructs a database wrapper. | |
| void | execute (const std::string &query) |
| Executes a query. | |
| auto | createStatement (const std::string &query) -> Statement |
| auto | hasTable (const std::string &table) const -> bool |
| Queries the database to inspect whether the table with the provided name exists. | |
Static Public Member Functions | |
| static auto | openReadOnly (const std::filesystem::path &dbPath, std::chrono::milliseconds busyTimeout=std::chrono::milliseconds{ 0 }) -> SqliteCppDb |
Database wrapper for SQLiteCpp.
|
strong |
|
explicit |
Constructs a database wrapper.
| dbPath | Path to the database file. The database file will be created if it does not exist. |
| busyTimeout | How long to wait for locks held by other connections. Shared-connection transactions are serialized independently of this timeout. |
| durability | Full synchronizes each WAL commit for persistent user data. |
| auto db::SqliteCppDb::createStatement | ( | const std::string & | query | ) | -> Statement |
| void db::SqliteCppDb::execute | ( | const std::string & | query | ) |
Executes a query.
| query | Query to execute. |
| auto db::SqliteCppDb::hasTable | ( | const std::string & | table | ) | const -> bool |
Queries the database to inspect whether the table with the provided name exists.
| table | Name of the table. |
|
static |
Opens an existing database for reads, without write-side maintenance.
| auto db::SqliteCppDb::transaction | ( | ) | -> Transaction |