MCPcopy Create free account
hub / github.com/colmap/colmap / ExistsTable

Method ExistsTable

src/colmap/scene/database_sqlite.cc:2284–2303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2282 }
2283
2284 bool ExistsTable(const std::string& table_name) const {
2285 const std::string sql =
2286 "SELECT name FROM sqlite_master WHERE type='table' AND name = ?;";
2287
2288 sqlite3_stmt* sql_stmt;
2289 SQLITE3_CALL(sqlite3_prepare_v2(
2290 THROW_CHECK_NOTNULL(database_), sql.c_str(), -1, &sql_stmt, 0));
2291
2292 SQLITE3_CALL(sqlite3_bind_text(sql_stmt,
2293 1,
2294 table_name.c_str(),
2295 static_cast<int>(table_name.size()),
2296 SQLITE_STATIC));
2297
2298 const bool exists = SQLITE3_CALL(sqlite3_step(sql_stmt)) == SQLITE_ROW;
2299
2300 SQLITE3_CALL(sqlite3_finalize(sql_stmt));
2301
2302 return exists;
2303 }
2304
2305 bool ExistsColumn(const std::string& table_name,
2306 const std::string& column_name) const {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected