mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 12:51:13 +08:00
7f04435576
* Add an example of using a connection pool. * Add documentation about the connection pools. Expand the documentation about multi-threading issues.
13 lines
295 B
C++
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);
|
|
}
|