#ifndef WS_PG_RESOURCE_H
#define WS_PG_RESOURCE_H
#include "../../public/nsapi.h"
#include <libpq-fe.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PgResourcePool {
pblock *param;
pool_handle_t *pool;
const char *name;
char *connection;
} PgResourcePool;
typedef struct PgResource {
PGconn *connection;
} PgResource;
ResourceType* pg_get_resource_type(
void);
void * pg_resourcepool_init(
pool_handle_t *pool,
const char *rpname, pblock *pb);
void pg_resourcepool_destroy(PgResourcePool *pg);
void * pg_resourcepool_createresource(PgResourcePool *pg);
void pg_resourcepool_freeresource(PgResourcePool *pg, PgResource *res);
int pg_resourcepool_prepare(PgResourcePool *pg, PgResource *res);
int pg_resourcepool_finish(PgResourcePool *pg, PgResource *res);
void * pg_resourcepool_getresourcedata(PgResource *res);
int pg_check_connection(
int loglevel,
const char *rpname, PGconn *connection);
#ifdef __cplusplus
}
#endif
#endif