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

Method doesColumnExist

sources/db/SQLite.cpp:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129bool SqlDatabase::doesColumnExist(QString table, QString column)
130{
131 bool hasRow = false;
132 QString query = QString("SELECT * FROM pragma_table_info('%1') WHERE name='%2';").arg(table).arg(column);
133 const QByteArray& text = query.toUtf8().constData();
134 sqlite3_exec(_handle, text, [](void* _hasRow, int argc, char** argv, char** azColName) {
135 *(reinterpret_cast<bool*>(_hasRow)) = true;
136 return 0;
137 }, &hasRow, NULL);
138 return hasRow;
139}
140
141bool SqlDatabase::doesTableExist(QString table)
142{

Callers 1

createTableMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected