Older/WebApplication/model/BlogSession.cpp

17 lines
691 B
C++
Raw Normal View History

2024-11-01 19:05:20 +08:00
#include "BlogSession.h"
#include <Wt/Dbo/FixedSqlConnectionPool.h>
BlogSession::BlogSession(Wt::Dbo::SqlConnectionPool &connectionPool)
: m_connectionPool(connectionPool), m_users(*this) {
}
std::unique_ptr<Wt::Dbo::SqlConnectionPool> BlogSession::createConnectionPool(const std::string &sqlite3) {
auto connection = std::make_unique<Wt::Dbo::backend::Sqlite3>(sqlite3);
connection->setProperty("show-queries", "true");
connection->setDateTimeStorage(Wt::Dbo::SqlDateTimeType::DateTime,
Wt::Dbo::backend::DateTimeStorage::PseudoISO8601AsText);
return std::make_unique<Wt::Dbo::FixedSqlConnectionPool>(std::move(connection), 10);
}