add ready connection

This commit is contained in:
chatlanin 2024-07-18 10:27:17 +03:00
parent 4ff7f0eee9
commit 49661fdea6
2 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,8 @@ namespace pgxx
std::map<std::string, pool_connection> m_data_connections;
public:
bool ready() { return m_data_connections.size() != 0; }
void init(std::string connection_name, int connection_count, std::string connection_url)
{
m_data_connections[connection_name] = pool_connection { connection_count, connection_url };

View File

@ -18,6 +18,9 @@ auto main(int argc, char* args[]) -> int
throw;
}
if (!PGXX().ready())
hack::log()("error connection");
// pgxx::JSON j {
// {
// "params", { { "key_1", 1 }, { "key2", "value" } }