116 PQfinish(res->connection); |
116 PQfinish(res->connection); |
117 } |
117 } |
118 } |
118 } |
119 |
119 |
120 int pg_resourcepool_prepare(PgResourcePool *pg, PgResource *res) { |
120 int pg_resourcepool_prepare(PgResourcePool *pg, PgResource *res) { |
|
121 PGresult *result = PQexec(res->connection, "BEGIN"); |
|
122 PQclear(result); // TODO: handle error |
121 return 0; |
123 return 0; |
122 } |
124 } |
123 |
125 |
124 int pg_resourcepool_finish(PgResourcePool *pg, PgResource *res) { |
126 int pg_resourcepool_finish(PgResourcePool *pg, PgResource *res) { |
|
127 PGresult *result = PQexec(res->connection, "COMMIT"); |
|
128 PQclear(result); // TODO: handle error |
125 return 0; |
129 return 0; |
126 } |
130 } |
127 |
131 |
128 void * pg_resourcepool_getresourcedata(PgResource *res) { |
132 void * pg_resourcepool_getresourcedata(PgResource *res) { |
129 return res->connection; |
133 return res->connection; |