MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / execAndGet

Method execAndGet

Source/3rdParty/sqlite/SQLiteCpp/Database.cpp:124–129  ·  view source on GitHub ↗

Shortcut to execute a one step query and fetch the first column of the result. WARNING: Be very careful with this dangerous method: you have to make a COPY OF THE result, else it will be destroy before the next line (when the underlying temporary Statement and Column objects are destroyed) this is an issue only for pointer type result (ie. char* and blob) (use the Column copy-constructor)

Source from the content-addressed store, hash-verified

122// this is an issue only for pointer type result (ie. char* and blob)
123// (use the Column copy-constructor)
124Column Database::execAndGet(const char* apQuery)
125{
126 Statement query(*this, apQuery);
127 (void)query.executeStep(); // Can return false if no result, which will throw next line in getColumn()
128 return query.getColumn(0);
129}
130
131// Shortcut to test if a table exists.
132bool Database::tableExists(const char* apTableName) const

Callers

nothing calls this directly

Calls 2

getColumnMethod · 0.80
executeStepMethod · 0.45

Tested by

no test coverage detected