mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Removed some dead code in Connection
This commit is contained in:
parent
9e2672627d
commit
c5432baa5a
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user