--- a/src/Connection.cpp Wed Dec 25 01:37:05 2019 +0100
+++ b/src/Connection.cpp Fri Jan 31 23:22:56 2020 +0100
@@ -24,32 +24,32 @@
namespace sql {
void Connection::begin() {
- sqlite3_exec(db, "BEGIN", nullptr, nullptr, nullptr);
+ sqlite3_exec((sqlite3*) db, "BEGIN", nullptr, nullptr, nullptr);
}
Connection::Connection(const char* filename) {
- int result = sqlite3_open(filename, &db);
+ int result = sqlite3_open(filename, (sqlite3**) & db);
if (result != SQLITE_OK) {
- sqlite3_close(db);
+ sqlite3_close((sqlite3*) db);
throw SqlException(L"Unable to open SQLite database.");
}
begin();
}
Connection::~Connection() {
- sqlite3_close(db);
+ sqlite3_close((sqlite3*) db);
}
PreparedStatement* Connection::prepareStatement(const char* sql) {
const char* remaining;
sqlite3_stmt *stmt;
- int result = sqlite3_prepare(db, sql, -1, &stmt, &remaining);
+ int result = sqlite3_prepare((sqlite3*) db, sql, -1, &stmt, &remaining);
if (result == SQLITE_OK) return new PreparedStatement(stmt);
else throw SqlException(L"Unable to prepare SQLite statement.");
}
bool Connection::getAutoCommit() {
- return sqlite3_get_autocommit(db);
+ return sqlite3_get_autocommit((sqlite3*) db);
}
void Connection::setAutoCommit(bool autoCommit) {
@@ -59,11 +59,11 @@
}
void Connection::commit() {
- sqlite3_exec(db, "COMMIT", nullptr, nullptr, nullptr);
+ sqlite3_exec((sqlite3*) db, "COMMIT", nullptr, nullptr, nullptr);
}
void Connection::rollback() {
- sqlite3_exec(db, "ROLLBACK", nullptr, nullptr, nullptr);
+ sqlite3_exec((sqlite3*) db, "ROLLBACK", nullptr, nullptr, nullptr);
}
}