add ready connection
This commit is contained in:
parent
4ff7f0eee9
commit
49661fdea6
@ -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 };
|
||||
|
@ -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" } }
|
||||
|
Loading…
Reference in New Issue
Block a user