dbd/postgresql/dbd_postgresql.h

Wed, 03 Dec 2008 08:44:40 +0000

author
nrich@ii.net
date
Wed, 03 Dec 2008 08:44:40 +0000
changeset 13
10c8c6f0da14
parent 2
c4f02fc67e5a
child 30
8599f34c139b
permissions
-rw-r--r--

Added connection:autocommit(), connection:commit(), and connection:rollback() to control transactions.

#include <libpq-fe.h>
#include <postgres.h>
#include <catalog/pg_type.h>
#include <dbd/common.h>

/* 
 * length of a prepared statement ID
 * \d{17}\0
 */
#define IDLEN 18

#define DBD_POSTGRESQL_CONNECTION   "DBD.PostgreSQL.Connection"
#define DBD_POSTGRESQL_STATEMENT    "DBD.PostgreSQL.Statement"

/*
 * connection object implentation
 */
typedef struct _connection {
    PGconn *postgresql;
    int autocommit;
    unsigned int statement_id; /* sequence for statement IDs */
} connection_t;

/*
 * statement object implementation
 */
typedef struct _statement {
    PGconn *postgresql;
    PGresult *result;
    char name[IDLEN]; /* statement ID */
    int tuple; /* number of rows returned */
} statement_t;

mercurial