| 77 | } |
| 78 | |
| 79 | bool SqliteConnector::tableExists(sqlite3 *db, const String& tablename) |
| 80 | { |
| 81 | sqlite3_stmt* stmt; |
| 82 | prepareStatement(db, &stmt, "SELECT 1 FROM sqlite_master WHERE type='table' AND name='" + tablename + "';"); |
| 83 | |
| 84 | sqlite3_step(stmt); |
| 85 | // if we get a row back, the table exists: |
| 86 | bool found = (sqlite3_column_type(stmt, 0) != SQLITE_NULL); |
| 87 | sqlite3_finalize(stmt); |
| 88 | |
| 89 | return found; |
| 90 | } |
| 91 | |
| 92 | Size SqliteConnector::countTableRows(const String& table_name) |
| 93 | { |
no test coverage detected