mirror of
https://github.com/haiwen/ccnet-server.git
synced 2025-09-07 07:40:31 +00:00
Add connection pool for db.
This commit is contained in:
@@ -91,15 +91,13 @@ sqlite3_blocking_exec(sqlite3 *db, const char *sql, int (*callback)(void *, int,
|
||||
typedef struct SQLiteDBConnPool {
|
||||
DBConnPool parent;
|
||||
char *db_path;
|
||||
int max_connections;
|
||||
} SQLiteDBConnPool;
|
||||
|
||||
DBConnPool *
|
||||
sqlite_db_conn_pool_new (const char *db_path, int max_connections)
|
||||
sqlite_db_conn_pool_new (const char *db_path)
|
||||
{
|
||||
SQLiteDBConnPool *pool = g_new0 (SQLiteDBConnPool, 1);
|
||||
pool->db_path = g_strdup(db_path);
|
||||
pool->max_connections = max_connections;
|
||||
|
||||
return (DBConnPool *)pool;
|
||||
}
|
||||
@@ -158,6 +156,12 @@ sqlite_db_connection_close (DBConnection *vconn)
|
||||
g_free (conn);
|
||||
}
|
||||
|
||||
gboolean
|
||||
sqlite_db_connection_ping (DBConnection *vconn)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
sqlite_db_connection_execute (DBConnection *vconn, const char *sql, GError **error)
|
||||
{
|
||||
|
Reference in New Issue
Block a user