Minor db cleanup
This commit is contained in:
@@ -50,12 +50,6 @@ namespace lms::db
|
||||
prepare();
|
||||
}
|
||||
|
||||
~Connection() override
|
||||
{
|
||||
// make use of per-connection usage stats to optimize
|
||||
optimize();
|
||||
}
|
||||
|
||||
private:
|
||||
Connection& operator=(const Connection&) = delete;
|
||||
|
||||
@@ -72,13 +66,6 @@ namespace lms::db
|
||||
LMS_LOG(DB, DEBUG, "Setting per-connection settings done!");
|
||||
}
|
||||
|
||||
void optimize()
|
||||
{
|
||||
LMS_LOG(DB, DEBUG, "connection close: Running pragma optimize...");
|
||||
executeSql("PRAGMA optimize");
|
||||
LMS_LOG(DB, DEBUG, "connection close: pragma optimize complete");
|
||||
}
|
||||
|
||||
std::filesystem::path _dbPath;
|
||||
};
|
||||
}
|
||||
@@ -119,6 +106,9 @@ namespace lms::db
|
||||
}
|
||||
}
|
||||
|
||||
// For now, multiple databases are not handled
|
||||
assert(&tlsSession->getDb() == this);
|
||||
|
||||
return *tlsSession;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,13 +73,12 @@ namespace lms::db::Migration
|
||||
{
|
||||
_db.executeSql("PRAGMA foreign_keys=ON");
|
||||
}
|
||||
|
||||
private:
|
||||
ScopedNoForeignKeys(const ScopedNoForeignKeys&) = delete;
|
||||
ScopedNoForeignKeys(ScopedNoForeignKeys&&) = delete;
|
||||
ScopedNoForeignKeys& operator=(const ScopedNoForeignKeys&) = delete;
|
||||
ScopedNoForeignKeys& operator=(ScopedNoForeignKeys&&) = delete;
|
||||
|
||||
private:
|
||||
Db& _db;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "database/Session.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "core/Exception.hpp"
|
||||
#include "core/ILogger.hpp"
|
||||
#include "core/ITraceLogger.hpp"
|
||||
|
||||
Reference in New Issue
Block a user