Made some more progress on theming

This commit is contained in:
emeric
2020-04-17 17:37:26 +02:00
parent 4f560fe015
commit 27320054e5
26 changed files with 476 additions and 185 deletions
+9 -1
View File
@@ -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