import { type PgConn } from "https://deno.land/x/pgc4d@v1.3.6/src/mod.ts";
Properties
Process ID of the server process attached to the current session.
Same as the number returned by pg_backend_pid()
function using SQL.
The current setting of server parameters such as client_encoding
or DateStyle
.
Methods
Executes a query and returns a buffered result once all the rows are received.
Executes a query and returns a streaming result as soon as the query has been accepted by the server. Rows will be retrieved as you consume them.
Creates a prepared statement on the server which you can later execute several times using different parameter values. Should offer improved performance compared to executing completely independent queries.
Adds a listener for a channel. If this is the first listener for the channel,
issues a LISTEN
query against the database. Returned promise resolves after
the connection is confirmed to be subscribed.
Removes a listener for a channel. Listener is removed immediately and will not
receive any further events. If this is the last listener for the channel, issues
an UNLISTEN
query against the database. Returned promise resolves after
the connection is unsubscribed if the last listener is being removed, immediately
otherwise.
pgc4d loads the pg_type
table to obtain the definitions of user-defined types.
You can call reloadTypes()
after doing e.g. CREATE TYPE ... AS ENUM
to
have the type recognized without re-connecting.