Mercurial > hg > orthanc
diff OrthancFramework/Sources/SQLite/Connection.cpp @ 4304:50b0c69b653a
continued abi
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 06 Nov 2020 16:33:52 +0100 |
parents | c7bd2f21ccc3 |
children | c847b0dfd255 |
line wrap: on
line diff
--- a/OrthancFramework/Sources/SQLite/Connection.cpp Fri Nov 06 15:37:30 2020 +0100 +++ b/OrthancFramework/Sources/SQLite/Connection.cpp Fri Nov 06 16:33:52 2020 +0100 @@ -175,15 +175,14 @@ } } - int Connection::ExecuteAndReturnErrorCode(const char* sql) + bool Connection::Execute(const std::string &sql) { - CheckIsOpen(); - return sqlite3_exec(db_, sql, NULL, NULL, NULL); + return Execute(sql.c_str()); } // Info querying ------------------------------------------------------------- - bool Connection::IsSQLValid(const char* sql) + bool Connection::IsSQLValid(const char* sql) { sqlite3_stmt* stmt = NULL; if (sqlite3_prepare_v2(db_, sql, -1, &stmt, NULL) != SQLITE_OK) @@ -260,6 +259,22 @@ } + int Connection::ExecuteAndReturnErrorCode(const char* sql) + { + CheckIsOpen(); + return sqlite3_exec(db_, sql, NULL, NULL, NULL); + } + + bool Connection::HasCachedStatement(const StatementId &id) const + { + return cachedStatements_.find(id) != cachedStatements_.end(); + } + + int Connection::GetTransactionNesting() const + { + return transactionNesting_; + } + bool Connection::BeginTransaction() { if (needsRollback_)