Wed, 03 Dec 2008 08:44:40 +0000
Added connection:autocommit(), connection:commit(), and connection:rollback() to control transactions.
1 | 1 | #include <libpq-fe.h> |
2 | #include <postgres.h> | |
3 | #include <catalog/pg_type.h> | |
4 | #include <dbd/common.h> | |
5 | ||
2 | 6 | /* |
7 | * length of a prepared statement ID | |
8 | * \d{17}\0 | |
9 | */ | |
1 | 10 | #define IDLEN 18 |
11 | ||
12 | #define DBD_POSTGRESQL_CONNECTION "DBD.PostgreSQL.Connection" | |
13 | #define DBD_POSTGRESQL_STATEMENT "DBD.PostgreSQL.Statement" | |
14 | ||
2 | 15 | /* |
16 | * connection object implentation | |
17 | */ | |
1 | 18 | typedef struct _connection { |
19 | PGconn *postgresql; | |
13
10c8c6f0da14
Added connection:autocommit(), connection:commit(), and connection:rollback() to control transactions.
nrich@ii.net
parents:
2
diff
changeset
|
20 | int autocommit; |
2 | 21 | unsigned int statement_id; /* sequence for statement IDs */ |
1 | 22 | } connection_t; |
23 | ||
2 | 24 | /* |
25 | * statement object implementation | |
26 | */ | |
1 | 27 | typedef struct _statement { |
28 | PGconn *postgresql; | |
29 | PGresult *result; | |
2 | 30 | char name[IDLEN]; /* statement ID */ |
31 | int tuple; /* number of rows returned */ | |
1 | 32 | } statement_t; |
33 |