MCPcopy Create free account
hub / github.com/blizzard4591/openMittsu / doesTableExist

Method doesTableExist

src/database/SimpleDatabase.cpp:412–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 }
411
412 bool SimpleDatabase::doesTableExist(Tables const& table) {
413 QSqlQuery tableExistanceQuery(database);
414 tableExistanceQuery.prepare("SELECT `name` FROM `sqlite_master` WHERE `type` = 'table' AND `name` = :tableName");
415
416 QString const tableName(getTableName(table));
417 tableExistanceQuery.bindValue(QStringLiteral(":tableName"), QVariant(tableName));
418
419 if (tableExistanceQuery.exec() && tableExistanceQuery.isSelect()) {
420 return tableExistanceQuery.next();
421 } else {
422 throw openmittsu::exceptions::InternalErrorException() << "Could not execute table existance query for table " << tableName.toStdString() << ".";
423 return false;
424 }
425 }
426
427 void SimpleDatabase::setTableVersion(Tables const& table, int tableVersion) {
428 QSqlQuery query(database);

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected