1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-09-05 14:50:21 +00:00

Add connection pool for db.

This commit is contained in:
Jiaqiang Xu
2016-08-20 15:12:17 +08:00
parent 9e422626fd
commit 48c3f5edef
11 changed files with 146 additions and 30 deletions

View File

@@ -114,7 +114,6 @@ pgsql_get_db_connection (DBConnPool *vpool, GError **error)
conn = g_new0 (PGDBConnection, 1);
conn->db = db;
conn->parent.pool = vpool;
return (DBConnection *)conn;
}
@@ -132,6 +131,14 @@ pgsql_db_connection_close (DBConnection *vconn)
g_free (conn);
}
gboolean
pgsql_db_connection_ping (DBConnection *vconn)
{
PGDBConnection *conn = (PGDBConnection *)vconn;
return (PQstatus(conn->db) == CONNECTION_OK);
}
gboolean
pgsql_db_connection_execute (DBConnection *vconn, const char *sql, GError **error)
{