Removed some dead code in Connection

This commit is contained in:
casey langen 2017-11-01 13:43:59 -07:00
parent 9e2672627d
commit c5432baa5a
2 changed files with 0 additions and 48 deletions

View File

@ -53,26 +53,6 @@ Connection::~Connection() {
this->UpdateReferenceCount(false);
}
int Connection::Open(const char *database, unsigned int options, unsigned int cache) {
if (!this->connection) {
int error;
#ifdef UTF_WIDECHAR
error = sqlite3_open16(database, &this->connection);
#else
error = sqlite3_open(database, &this->connection);
#endif
if (error == SQLITE_OK) {
this->Initialize(cache);
}
return error;
}
return SQLITE_OK;
}
int Connection::Open(const std::string &database, unsigned int options, unsigned int cache) {
int error;
@ -124,32 +104,6 @@ int Connection::Execute(const char* sql) {
return Okay;
}
int Connection::Execute(const wchar_t* sql) {
sqlite3_stmt *stmt = nullptr;
{
std::unique_lock<std::mutex> lock(this->mutex);
int err = sqlite3_prepare16_v2(this->connection, sql, -1, &stmt, nullptr);
if (err != SQLITE_OK) {
sqlite3_finalize(stmt);
return Error;
}
}
int error = this->StepStatement(stmt);
if (error != SQLITE_OK && error != SQLITE_DONE) {
sqlite3_finalize(stmt);
return Error;
}
sqlite3_reset(stmt);
sqlite3_finalize(stmt);
return Okay;
}
void Connection::Checkpoint() {
sqlite3_wal_checkpoint(this->connection, nullptr);
}

View File

@ -60,11 +60,9 @@ namespace musik { namespace core { namespace db {
Connection();
~Connection();
int Open(const char *database, unsigned int options = 0, unsigned int cache = 0);
int Open(const std::string &database, unsigned int options = 0, unsigned int cache = 0);
int Close();
int Execute(const char* sql);
int Execute(const wchar_t* sql);
int64_t LastInsertedId();