|
Lightweight 0.20261105.1
|
The driver-owned state of one SQLite statement: everything mutable behind a Statement. More...
#include <State.hpp>
Public Attributes | |
| ConnectionState * | connection {} |
The connection the statement belongs to; null once orphaned by that connection's Close. | |
| ::sqlite3_stmt * | native {} |
| The prepared statement; null when nothing is prepared, and after the connection closed. | |
| StatementState * | previousOfConnection {} |
| The previous statement in the connection's statement list; null for the first one. | |
| StatementState * | nextOfConnection {} |
| The next statement in the connection's statement list; null for the last one. | |
| int | columnCount {} |
| int | parameterCount {} |
| StatementPhase | phase {} |
| Where the statement stands in its result set. | |
| bool | readOnly = true |
| std::vector< bool > | boundParameters {} |
| int | boundParameterCount {} |
The number of true entries of boundParameters, so the check before every execution is one compare. | |
| std::int64_t | rowsAffected {} |
The change count of the statement's last completed execution (see NumRowsAffected); 0 until it completed. | |
| std::int64_t | totalChangesAtExecute {} |
| std::vector< BoundColumn > | boundColumns {} |
The registered output readers, indexed by column - 1; grown by RegisterOutputReader only. | |
| std::optional< SqlErrorInfo > | lastError {} |
| std::string | pendingTail {} |
The driver-owned state of one SQLite statement: everything mutable behind a Statement.
Created by the statement's Allocate with std::make_unique, released into its handle struct and registered with its connection's state (AttachStatement); destroyed only by the statement's Free, which finalizes native, unregisters it and re-adopts it. Its connection never destroys it: closing the connection (or connecting it again) finalizes native and orphans the state (connection becomes null), so a statement or cursor destroyed after its connection still touches valid memory.
Invariant: native is non-null only while connection is non-null and has an open database, so a non-null native is all a per-row operation needs to check.
| ConnectionState* Lightweight::Driver::Sqlite3::StatementState::connection {} |
| ::sqlite3_stmt* Lightweight::Driver::Sqlite3::StatementState::native {} |
| StatementState* Lightweight::Driver::Sqlite3::StatementState::previousOfConnection {} |
| StatementState* Lightweight::Driver::Sqlite3::StatementState::nextOfConnection {} |
| int Lightweight::Driver::Sqlite3::StatementState::columnCount {} |
| int Lightweight::Driver::Sqlite3::StatementState::parameterCount {} |
| StatementPhase Lightweight::Driver::Sqlite3::StatementState::phase {} |
| bool Lightweight::Driver::Sqlite3::StatementState::readOnly = true |
| std::vector<bool> Lightweight::Driver::Sqlite3::StatementState::boundParameters {} |
| int Lightweight::Driver::Sqlite3::StatementState::boundParameterCount {} |
The number of true entries of boundParameters, so the check before every execution is one compare.
| std::int64_t Lightweight::Driver::Sqlite3::StatementState::rowsAffected {} |
| std::int64_t Lightweight::Driver::Sqlite3::StatementState::totalChangesAtExecute {} |
| std::vector<BoundColumn> Lightweight::Driver::Sqlite3::StatementState::boundColumns {} |
| std::optional<SqlErrorInfo> Lightweight::Driver::Sqlite3::StatementState::lastError {} |
| std::string Lightweight::Driver::Sqlite3::StatementState::pendingTail {} |
The statements of an ExecuteDirect text not run yet: the text after the statement whose result set is current. A copy owned here (the caller's text dies when ExecuteDirect returns), run by MoreResults, DiscardResults, Prepare and ExecuteDirect; empty when nothing is pending. Orphaning the statement (DetachStatement) drops it unrun. Only one sqlite3_stmt of the text exists at any time, in native.