File: dbd_postgresql.h

package info (click to toggle)
lua-dbi 0.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 448 kB
  • sloc: ansic: 3,946; sql: 291; makefile: 129
file content (31 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <libpq-fe.h>
#include <dbd/common.h>

/*
 * length of a prepared statement ID
 * dbd-postgresql-\d{17}\0
 */
#define IDLEN 15+17+1

#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 {
	connection_t *conn;
	PGresult *result;
	char name[IDLEN]; /* statement ID */
	int tuple; /* number of rows returned */
} statement_t;