Made some more progress on theming
This commit is contained in:
@@ -33,9 +33,9 @@ Db::Db(const std::filesystem::path& dbPath)
|
||||
LMS_LOG(DB, INFO) << "Creating connection pool on file " << dbPath.string();
|
||||
|
||||
std::unique_ptr<Wt::Dbo::backend::Sqlite3> connection {std::make_unique<Wt::Dbo::backend::Sqlite3>(dbPath.string())};
|
||||
// connection->setProperty("show-queries", "true");
|
||||
connection->executeSql("pragma journal_mode=WAL");
|
||||
connection->executeSql("pragma synchronous=normal");
|
||||
// connection->setProperty("show-queries", "true");
|
||||
|
||||
auto connectionPool = std::make_unique<Wt::Dbo::FixedSqlConnectionPool>(std::move(connection), 10);
|
||||
connectionPool->setTimeout(std::chrono::seconds(10));
|
||||
@@ -43,6 +43,14 @@ Db::Db(const std::filesystem::path& dbPath)
|
||||
_connectionPool = std::move(connectionPool);
|
||||
}
|
||||
|
||||
void
|
||||
Db::executeSql(const std::string& sql)
|
||||
{
|
||||
auto connection {_connectionPool->getConnection()};
|
||||
connection->executeSql(sql);
|
||||
_connectionPool->returnConnection(std::move(connection));
|
||||
}
|
||||
|
||||
} // namespace Database
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user