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
MeanSquaredError 7f04435576
Connection pools documentation and example (#533)
* Add an example of using a connection pool.

* Add documentation about the connection pools. Expand the documentation about multi-threading issues.
2023-10-03 09:45:21 +02:00

13 lines
295 B
C++

#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);
}