MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / prepareStatement

Function prepareStatement

src/loggers/bt_sqlite_logger.cpp:34–43  ·  view source on GitHub ↗

Helper function to prepare a statement

Source from the content-addressed store, hash-verified

32
33// Helper function to prepare a statement
34sqlite3_stmt* prepareStatement(sqlite3* db, const std::string& sql)
35{
36 sqlite3_stmt* stmt = nullptr;
37 const int rc = sqlite3_prepare_v2(db, sql.c_str(), -1, &stmt, nullptr);
38 if(rc != SQLITE_OK)
39 {
40 throw RuntimeError(std::string("Failed to prepare statement: ") + sqlite3_errmsg(db));
41 }
42 return stmt;
43}
44
45// Helper function to execute a prepared statement
46void execStatement(sqlite3_stmt* stmt)

Callers 2

SqliteLoggerMethod · 0.85
writerLoopMethod · 0.85

Calls 2

RuntimeErrorClass · 0.85
stringFunction · 0.85

Tested by

no test coverage detected