MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / countTableRows

Method countTableRows

src/openms/source/FORMAT/SqliteConnector.cpp:92–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 Size SqliteConnector::countTableRows(const String& table_name)
93 {
94 sqlite3_stmt* stmt;
95 String select_runs = "SELECT count(*) FROM " + table_name + ";";
96 this->prepareStatement(&stmt, select_runs);
97 sqlite3_step(stmt);
98 if (sqlite3_column_type(stmt, 0) == SQLITE_NULL)
99 {
100 throw Exception::SqlOperationFailed(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Could not retrieve " + table_name + " table count!");
101 }
102 Size res = sqlite3_column_int64(stmt, 0);
103 sqlite3_finalize(stmt);
104 return res;
105 }
106
107 void SqliteConnector::executeStatement(sqlite3 *db, const String& statement)
108 {

Callers 1

readTransitions_Method · 0.80

Calls 1

prepareStatementMethod · 0.95

Tested by

no test coverage detected