0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 12:51:13 +08:00
sqlpp11/examples/connection_pool/src/db_global.cpp

13 lines
295 B
C++
Raw Normal View History

#include <db_connection.h>
#include <sqlpp11/postgresql/postgresql.h>
static sqlpp::postgresql::connection_pool g_db_pool{};
thread_local db_connection g_dbc{g_db_pool};
void db_global_init(std::shared_ptr<sqlpp::postgresql::connection_config> config)
{
g_db_pool.initialize(config, 5);
}