|
lintel 0.2.0
|
#include <Cursor.h>
Public Member Functions | |
| Cursor (const Connection &connection, const std::string &query, const std::vector< std::string > ¶ms, std::size_t fetchSize=kDefaultFetchSize) | |
| Cursor (Cursor &cursor)=delete | |
| ~Cursor () | |
| std::vector< db::Arguments > | fetchNext (std::size_t maxRows) |
Static Public Attributes | |
| static constexpr std::size_t | kDefaultFetchSize = 64 |
Forward-only cursor over an SQLite query result. Rows are fetched lazily via sqlite3_step() instead of buffering the whole result set. The cursor owns its statement and finalizes it on destruction; the underlying Connection must outlive the cursor.
The fetchSize parameter controls the client-side prefetch buffer size (how many rows are buffered per fetchNext() call). SQLite has no server-side cursor concept, so fetchSize only affects client memory usage, not server behaviour.
|
explicit |
Prepares and binds the query for streaming execution.
| connection | the SQLite connection (must outlive the cursor) |
| query | the SQL query with '?' placeholders |
| params | the parameter values to bind |
| fetchSize | client-side prefetch buffer size (default 64) |
| db::SQLException | on prepare or bind failure |
|
delete |
| lintel::sqlite::Cursor::~Cursor | ( | ) |
Destructor, finalizes the statement.
| std::vector< db::Arguments > lintel::sqlite::Cursor::fetchNext | ( | std::size_t | maxRows | ) |
Fetches up to maxRows further rows from the query. Internally buffers up to fetchSize rows per sqlite3_step() call.
| maxRows | maximum number of rows to fetch (must be > 0) |
| db::SQLException | on step failure |
|
staticconstexpr |
Default client-side prefetch buffer size