#include <StormByte/database/sqlite/sqlite3.hxx>


Public Member Functions | |
| SQLite3 (const SQLite3 &db)=delete | |
| Copy constructor (deleted). | |
| SQLite3 (SQLite3 &&db) noexcept | |
| Move constructor that transfers the database connection. | |
| SQLite3 & | operator= (const SQLite3 &db)=delete |
| Copy assignment (deleted). | |
| SQLite3 & | operator= (SQLite3 &&db) noexcept |
| Move assignment that transfers the database connection. | |
| ~SQLite3 () noexcept override | |
| Destructor. | |
| ExpectedRows | Query (std::string_view query) noexcept override |
| Execute a query that returns rows. | |
| bool | SilentQuery (std::string_view query) noexcept override |
| Execute a query that does not return rows. | |
Public Member Functions inherited from StormByte::Database::Database | |
| Database (const StormByte::Shared< Logger::Log > &logger) | |
| Construct with an optional logger. | |
| Database (const Database &)=delete | |
| Copy constructor (deleted). | |
| Database (Database &&other) noexcept | |
| Move constructor. | |
| Database & | operator= (const Database &)=delete |
| Copy assignment (deleted). | |
| Database & | operator= (Database &&other) noexcept |
| Move assignment. | |
| virtual | ~Database () noexcept |
| Destructor. | |
| StormByte::Shared< Telemetry > | GetTelemetry () const noexcept |
| Obtain the cumulative connection telemetry handle. | |
| bool | Connect () noexcept |
| Connect. | |
| void | Disconnect () noexcept |
| Disconnect. | |
| bool | IsConnected () const noexcept |
| Whether the connection is open. | |
| void | SetSslMode (SslMode mode) noexcept |
| TLS policy for the next Connect(). | |
| SslMode | GetSslMode () const noexcept |
| Current TLS policy. | |
| template<typename... Args> | |
| ExpectedRows | ExecuteSTMT (std::string_view name, Args &&...args) |
| Execute a prepared statement by name. | |
| Expected< Transaction, TransactionError > | BeginTransaction (IsolationLevel level=IsolationLevel::Default) |
| Begin a transaction. | |
| void | CommitTransaction () |
| Commit the current transaction. | |
| void | RollbackTransaction () |
| Roll back the current transaction. | |
Protected Member Functions | |
| SQLite3 (const StormByte::Shared< Logger::Log > &logger) | |
| In-memory database. | |
| SQLite3 (const std::filesystem::path &dbfile, const StormByte::Shared< Logger::Log > &logger) | |
| File-backed database. | |
| SQLite3 (std::filesystem::path &&dbfile, const StormByte::Shared< Logger::Log > &logger) | |
| File-backed database (moved path and logger). | |
| void | EnableForeignKeys () |
| Enable foreign keys (off by default in SQLite). | |
| bool | DoSilentQuery (std::string_view query) noexcept override |
| Internal silent query. | |
Protected Member Functions inherited from StormByte::Database::Database | |
| void | SetTelemetry (StormByte::Shared< Telemetry > telemetry) noexcept |
| Replace the telemetry implementation, normally in a concrete backend constructor. | |
| void | RecordBackendEvent (BackendEvent event) noexcept |
| Record a categorized event reported by the active backend. | |
| Telemetry::OperationScope | TrackOperation (Operation operation) const noexcept |
| Start timing a Database operation without invoking user callbacks. | |
| void | ClearPreparedSTMTs () noexcept |
| Destroy all registered statements inside the Database module. | |
| void | PrepareSTMT (std::string_view name, std::string_view query) noexcept |
Register a prepared statement under name. | |
| void | DoPrepareSTMT (std::string_view name, std::string_view query) noexcept |
| Same as PrepareSTMT; kept for hook symmetry. | |
| virtual void | DoPreConnect () noexcept |
| Pre-connect hook. | |
| virtual void | DoPostConnect () noexcept |
| Post-connect hook. | |
Additional Inherited Members | |
Protected Attributes inherited from StormByte::Database::Database | |
| StormByte::Shared< std::recursive_mutex > | m_operation_mutex |
| DLL-safe owner of the connection mutex. | |
| StormByte::Shared< Telemetry > | m_telemetry |
| Shared cumulative counters for this connection. | |
| bool | m_connected |
| Connection state. | |
| SslMode | m_ssl_mode |
| TLS policy for network backends. | |
| StormByte::Shared< Logger::Log > | m_logger |
| Shared logger, safe across the DLL boundary. | |
SQLite3 backend.
@note Built-in connection operations are serialized. Transactions must stay on their creating thread.
|
delete |
Copy constructor (deleted).
|
noexcept |
Move constructor that transfers the database connection.
| db | Database to move from. |
|
overridenoexcept |
Destructor.
|
protected |
In-memory database.
| logger | Logger instance. |
|
protected |
File-backed database.
| dbfile | Path to the database file. |
| logger | Logger instance. |
|
protected |
File-backed database (moved path and logger).
| dbfile | Path to the database file. |
| logger | Logger instance. |
|
overrideprotectedvirtualnoexcept |
Internal silent query.
| query | SQL text. |
Implements StormByte::Database::Database.
|
protected |
Enable foreign keys (off by default in SQLite).
Copy assignment (deleted).
Move assignment that transfers the database connection.
| db | Database to move from. |
|
overridevirtualnoexcept |
Execute a query that returns rows.
| query | SQL text. |
Implements StormByte::Database::Database.
|
overridevirtualnoexcept |
Execute a query that does not return rows.
| query | SQL text. |
Implements StormByte::Database::Database.