MCPcopy Create free account
hub / github.com/awawa-dev/HyperHDR / doesTableExist

Method doesTableExist

sources/db/SQLite.cpp:141–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141bool SqlDatabase::doesTableExist(QString table)
142{
143 bool hasRow = false;
144 QString query = QString("SELECT name FROM sqlite_master WHERE type = 'table' AND name = '%1';").arg(table);
145 const QByteArray& text = query.toUtf8().constData();
146 sqlite3_exec(_handle, text, [](void* _hasRow, int argc, char** argv, char** azColName) {
147 *(reinterpret_cast<bool*>(_hasRow)) = true;
148 return 0;
149 }, &hasRow, NULL);
150 return hasRow;
151}
152
153bool SqlDatabase::isEmpty()
154{

Callers 1

tableExistsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected