mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Extra statement constructor.
This commit is contained in:
@@ -279,6 +279,14 @@ SqliteStatement::SqliteStatement(SqliteDatabase* db, const char *sql)
|
||||
throw j;
|
||||
}
|
||||
|
||||
SqliteStatement::SqliteStatement(SqliteDatabase* db, const std::string& sql)
|
||||
{
|
||||
assert(db);
|
||||
int j = sqlite3_prepare_v2(db->peekConnection(), sql.c_str(), sql.size() + 1, &statement, NULL);
|
||||
if (j != SQLITE_OK)
|
||||
throw j;
|
||||
}
|
||||
|
||||
SqliteStatement::~SqliteStatement()
|
||||
{
|
||||
sqlite3_finalize(statement);
|
||||
|
||||
@@ -73,6 +73,7 @@ protected:
|
||||
|
||||
public:
|
||||
SqliteStatement(SqliteDatabase* db, const char *statement);
|
||||
SqliteStatement(SqliteDatabase* db, const std::string& statement);
|
||||
~SqliteStatement();
|
||||
|
||||
sqlite3_stmt* peekStatement();
|
||||
|
||||
Reference in New Issue
Block a user