|
Lightweight 0.20261105.1
|
The driver-owned state of one SQLite connection: everything mutable behind a Connection. More...
#include <State.hpp>
Public Attributes | |
| ::sqlite3 * | database {} |
The open database; null before a successful Connect and after a failed one. | |
| bool | transactionBegun = false |
| std::string | databaseName {} |
The database the connection was opened on (SqliteConnectInfo::database), as DatabaseName reports it. | |
| std::optional< SqlErrorInfo > | lastError {} |
| StatementState * | firstStatement {} |
The driver-owned state of one SQLite connection: everything mutable behind a Connection.
Created by Allocate(Connection&) with std::make_unique and released into the handle struct, so the handle is its only owner; Close(Connection&) re-adopts it into a std::unique_ptr and destroys it. A connection and its statements are used by one thread at a time, their destruction included (the public contract, stated on Driver::Sqlite3::Connection), so the state carries no lock.
| ::sqlite3* Lightweight::Driver::Sqlite3::ConnectionState::database {} |
| bool Lightweight::Driver::Sqlite3::ConnectionState::transactionBegun = false |
Whether SetAutoCommit(false) began (or adopted) a transaction that no Commit, Rollback or SetAutoCommit(true) has ended yet. SQLite rolls a transaction back by itself on some failures (ON CONFLICT ROLLBACK, RAISE(ROLLBACK, ...), a full disk); this flag is how Commit tells that case (fails with 25000) from a commit with no transaction begun (succeeds).
| std::string Lightweight::Driver::Sqlite3::ConnectionState::databaseName {} |
The database the connection was opened on (SqliteConnectInfo::database), as DatabaseName reports it.
| std::optional<SqlErrorInfo> Lightweight::Driver::Sqlite3::ConnectionState::lastError {} |
| StatementState* Lightweight::Driver::Sqlite3::ConnectionState::firstStatement {} |
The first of the statements allocated on this connection and not yet freed; an intrusive list through StatementState::nextOfConnection, so attaching and detaching are O(1) and never allocate.