MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / StatementIterator

Method StatementIterator

src/objects/statement-iterator.cpp:1–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1StatementIterator::StatementIterator(Statement* stmt, bool bound) :
2 node::ObjectWrap(),
3 stmt(stmt),
4 handle(stmt->handle),
5 db_state(stmt->db->GetState()),
6 bound(bound),
7 safe_ints(stmt->safe_ints),
8 mode(stmt->mode),
9 alive(true),
10 logged(!db_state->has_logger) {
11 assert(stmt != NULL);
12 assert(handle != NULL);
13 assert(stmt->bound == bound);
14 assert(stmt->alive == true);
15 assert(stmt->locked == false);
16 assert(db_state->iterators < USHRT_MAX);
17 stmt->locked = true;
18 db_state->iterators += 1;
19}
20
21// The ~Statement destructor currently covers any state this object creates.
22// Additionally, we actually DON'T want to revert stmt->locked or db_state

Callers

nothing calls this directly

Calls 1

GetStateMethod · 0.80

Tested by

no test coverage detected