PgConnection

A connection to Postgres.

@author <a href="mailto:julien@julienviet.com">Julien Viet</a> @author <a href="mailto:emad.albloushi@gmail.com">Emad Alblueshi</a>

Members

Functions

cancelRequest
PgConnection cancelRequest(VoidHandler handler)

Send a request cancellation message to tell the server to cancel processing request in this connection. <br>Note: Use this with caution because the cancellation signal may or may not have any effect.

notificationHandler
PgConnection notificationHandler(PgNotificationHandler handler)

Set an handler called when the connection receives notification on a channel. <p/> The handler is called with the {@link PgNotification} and has access to the channel name and the notification payload.

processId
int processId()

@return The process ID of the target backend

secretKey
int secretKey()

@return The secret key for the target backend

Inherited Members

From SqlConnection

exceptionHandler
SqlConnection exceptionHandler(ExceptionHandler handler)

Set an handler called with connection errors.

closeHandler
SqlConnection closeHandler(VoidHandler handler)

Set an handler called when the connection is closed.

begin
Transaction begin()

Begin a transaction and returns a {@link Transaction} for controlling and tracking this transaction. <p/> When the connection is explicitely closed, any inflight transaction is rollbacked.

begin
Transaction begin(bool closeOnEnd)
Undocumented in source.
isSSL
bool isSSL()

@return whether the connection uses SSL

isConnected
bool isConnected()
Undocumented in source.
close
void close()

Close the current connection after all the pending commands have been processed.

query
SqlConnection query(string sql, RowSetHandler handler)
Undocumented in source.
query
alias query = SqlClient.query
Undocumented in source.
prepare
SqlConnection prepare(string sql, PreparedQueryHandler handler)

Create a prepared query.

prepareAsync
Future!PreparedQuery prepareAsync(string sql)
Undocumented in source.
prepare
PreparedQuery prepare(string sql)
Undocumented in source.
preparedQuery
SqlConnection preparedQuery(string sql, RowSetHandler handler)
preparedQuery
SqlConnection preparedQuery(string sql, Tuple arguments, RowSetHandler handler)
Undocumented in source.
prepareNamedQueryAsync
Future!NamedQuery prepareNamedQueryAsync(string sql)
prepareNamedQuery
NamedQuery prepareNamedQuery(string sql)
Undocumented in source.
escapeIdentifier
string escapeIdentifier(string identifier)

Return the given string suitably quoted to be used as an identifier in an SQL statement string. Quotes are added only if necessary (i.e., if the string contains non-identifier characters or would be case-folded). Embedded quotes are properly doubled.

escapeLiteral
string escapeLiteral(string literal)

Return the given string suitably quoted to be used as a string literal in an SQL statement string. Embedded single-quotes and backslashes are properly doubled. Note that quote_literal returns null on null input.

Meta