Lindenii Project Forge
Login

hare-pq

Hare bindings for libpq

Warning: Due to various recent migrations, viewing non-HEAD refs may be broken.

/pq/ffi/conn.ha (raw)

use types::c;

export type conn = opaque;

export @symbol("PQconnectdb") fn connectdb(conninfo: const *c::char) *conn;
export @symbol("PQfinish") fn finish(conn: *conn) void;
export @symbol("PQstatus") fn status(conn: *conn) ConnStatusType;

export type ConnStatusType = enum int {
	OK,
	BAD,

	STARTED,
	MADE,
	AWAITING_RESPONSE,

	AUTH_OK,

	SETENV,
	SSL_STARTUP,
	NEEDED,
	CHECK_WRITABLE,
	CONSUME,
	GSS_STARTUP,
	CHECK_TARGET,

	CHECK_STANDBY,
	ALLOCATED,
};