ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
npostgresql_pool.h File Reference

PostgreSQL连接池,支持自动借出和健康检查。 More...

#include "tools/db/sql/postgresql/npostgresql.h"
#include "tools/tools/tools_thread.h"
#include "actor/tab/ttab_servers.h"
#include "tools/log/nlog.h"
#include <memory>
#include <utility>

Classes

class  ngl::npostgresql_pool

Detailed Description

PostgreSQL连接池,支持自动借出和健康检查。

管理一组npostgresql连接实例,通过索引路由实现负载均衡。 使用单例模式,通过instance()获取全局连接池。

Note
通过init()初始化连接池,get()按索引获取连接。