PgGetConnectionId

Name

PgGetConnectionId -- Provides access to the underlying libpq SQL connection handle.

Synopsis

extern PGconn *PgGetConnectionId(Tcl_Interp *interp, const char *handle, Pg_ConnectionId **connid);

Description

PgGetConnectionId returns the underlying PGconn handle. This is intended to allow Tcl extensions to Pgtcl to use the existing database connection.

The Pg_ConnectionId structure provides access to more internals of the Pgtcl handle, but may be ignored in most cases.

Parameters

Tcl_Interp *interp

Pointer to Tcl interpreter.

char *handle

The name of the Pgtcl database handle command.

Pg_ConnectionId **connid

Pointer to address to hold Pgtcl connection handle. Must be provided even if not used.

Returns

PGconn *conn is a pointer to the libpq SQL database connection.