New UI layout and UI improvements. Fixes #50

This commit is contained in:
emeric
2020-05-10 13:11:43 +02:00
parent 8277b9c82b
commit 74fc4e058e
79 changed files with 3003 additions and 1987 deletions
+18 -2
View File
@@ -46,9 +46,25 @@ Db::Db(const std::filesystem::path& dbPath)
void
Db::executeSql(const std::string& sql)
{
auto connection {_connectionPool->getConnection()};
ScopedConnection connection {*_connectionPool};
connection->executeSql(sql);
_connectionPool->returnConnection(std::move(connection));
}
Db::ScopedConnection::ScopedConnection(Wt::Dbo::SqlConnectionPool& pool)
: _connectionPool {pool}
, _connection {_connectionPool.getConnection()}
{
}
Db::ScopedConnection::~ScopedConnection()
{
_connectionPool.returnConnection(std::move(_connection));
}
Wt::Dbo::SqlConnection* Db::ScopedConnection::operator->() const
{
return _connection.get();
}
} // namespace Database