1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-08 18:59:03 +00:00

Add connection pool for db.

This commit is contained in:
Jiaqiang Xu
2016-08-20 14:58:51 +08:00
parent 6a5e0804b9
commit f52ffdfb23
19 changed files with 145 additions and 91 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)
{