Project:dool
Class List Class Hierarchy
Summary: Ctors Methods

Module dool.sql.dpq.DPQConnect

Class DPQConnect

Implemented interfaces:
Connection
public class DPQConnect

Connection to a postgresql database

Constructor Summary
(PGconn* pgConn)
          Creates a new DPQConnect from a pq PGconn
(char dbName)
          Creates a new database connection
(String dbName)
          Creates a new database connection
(String pghost, String pgport, String pgoptions, String pgtty, String dbName, String login, String pwd)
          Creates a new database connection

Methods Summary
public PGconn* getConn()
          Makes the PGconn public
~this ()
          Close the connect if still open
bit valid()
          Test if this DPQConnec has a PGconn
Statement getStatement()
          
void dump()
          Prints the user valus to stdout
static DPQConnect connectStart(String conninfo)
          make a new client connection to the backend Asynchronous (non-blocking)
PostgresPollingStatusType connectPoll()
          connect poll
static DPQConnect connectdb(String conninfo)
          connectDB Synchronous (blocking)
static DPQConnect setdbLogin(String pghost, String pgport, String pgoptions, String pgtty, String dbName, String login, String pwd)
          setdbLogin
static DPQConnect setdb(String pghost, String pgport, String pgoptions, String pgtty, String dbName)
          Sets the database to use
int close()
          
void finish()
          close the current connection and free the PGconn data structure
PQconninfoOption* connDefaults()
          get info about connection options known to PQconnectdb \todo create object DPQConnectInto
void connInfoFree(PQconninfoOption *connOptions)
          free the data structure returned by PQconndefaults() \todo create object DPQConnectInto
int resetStart()
          close the current connection and restablish a new one with the same parameters Asynchronous (non-blocking)
PostgresPollingStatusType resetPoll()
          reset Poll
void reset()
          reset.
bit requestCancel()
          Request that PostgreSQL abandon processing of the current command.
String dbName()
          /* Accessor functions for PGconn objects get db name
String user()
          get user name
String pass()
          get pass
String host()
          get host name
String port()
          get port
String tty()
          get tty
String options()
          get options
SQLStatus status()
          Gets the current status of this connection
int subStatus()
          Gets the current status of this connection
String errorMessage()
          Get this connection last error message
String subErrorMessage()
          Get this connection last error message
int socket()
          Obtain the file descriptor number for the backend connection socket.
int backendPID()
          backendPID
int clientEncoding()
          client encoding
int setClientEncoding(String encoding)
          client encoding
void trace(File file)
          Enable tracing
void untreace()
          disable tracing
void onNoticeProcess(void delegate(String))
          Set a delegate to override default notice processor
void delegate(String )
          
void dispatchNoticeProcessor(String message)
          Application can override this to receive notices or set a delegate by calling onNoticeProcessor


public PGconn* getConn()
/** * Makes the PGconn public * @return this DPQConnect PGconn connection */
this (PGconn* pgConn)
/** * Creates a new DPQConnect from a pq PGconn * @param pgConn */
this (char[] dbName)
/** * Creates a new database connection * @param dbName */
this (String dbName)
/** * Creates a new database connection * @param dbName */
this (String pghost, String pgport, String pgoptions, String pgtty, String dbName, String login, String pwd)
/** * Creates a new database connection * @param pghost * @param pgport * @param pgoptions * @param pgtty * @param dbName * @param login * @param pwd */
~this ()
/** * Close the connect if still open */
bit valid()
/** * Test if this DPQConnec has a PGconn * @return true if there is a PGconn !== null */
Statement getStatement()

void dump()
/** * Prints the user valus to stdout */
static DPQConnect connectStart(String conninfo)
/** * make a new client connection to the backend * Asynchronous (non-blocking) */
PostgresPollingStatusType connectPoll()
/** * connect poll */
static DPQConnect connectdb(String conninfo)
/** * connectDB * Synchronous (blocking) */
static DPQConnect setdbLogin(String pghost, String pgport, String pgoptions, String pgtty, String dbName, String login, String pwd)
/** * setdbLogin * @param pghost * @param pgport * @param pgoptions * @param pgtty * @param dbName * @param login * @param pwd * @return a new DPQConnect */
static DPQConnect setdb(String pghost, String pgport, String pgoptions, String pgtty, String dbName)
/** * Sets the database to use * @param pghost * @param pgport * @param pgoptions * @param pgtty * @param dbName */
int close()

void finish()
/** * close the current connection and free the PGconn data structure */
PQconninfoOption* connDefaults()
/** * get info about connection options known to PQconnectdb * \todo create object DPQConnectInto */
void connInfoFree(PQconninfoOption *connOptions)
/** * free the data structure returned by PQconndefaults() * \todo create object DPQConnectInto */
int resetStart()
/** * close the current connection and restablish a new one with the same * parameters * * Asynchronous (non-blocking) */
PostgresPollingStatusType resetPoll()
/** * reset Poll */
void reset()
/** * reset. * Synchronous (blocking) */
bit requestCancel()
/** * Request that PostgreSQL abandon processing of the current command. * @return true if the cancel request was successfully dispatched, false if not. * (If not, errorMessage tells why not.) */
String dbName()
/* Accessor functions for PGconn objects */ /** * get db name * @return */
String user()
/** * get user name * @return */
String pass()
/** * get pass * @return */
String host()
/** * get host name * @return */
String port()
/** * get port * @return */
String tty()
/** * get tty * @return */
String options()
/** * get options * @return */
SQLStatus status()
/** * Gets the current status of this connection */
int subStatus()
/** * Gets the current status of this connection */
String errorMessage()
/** * Get this connection last error message * @return the error message text */
String subErrorMessage()
/** * Get this connection last error message * @return the error message text */
int socket()
/** * Obtain the file descriptor number for the backend connection socket. * PQsocket should be used to obtain the backend socket descriptor in preparation for executing select(). * This allows an application using a blocking connection to wait for either * backend responses or other conditions. If the result of select() indicates that data can be read * from the backend socket, then PQconsumeInput should be called to read the data; * after which, PQisBusy, PQgetResult, and/or PQnotifies can be used to process the response. * Nonblocking connections (that have used PQsetnonblocking) should not use select() * until PQflush has returned 0 indicating that there is no buffered data waiting to be sent * to the backend. * * @return A valid descriptor will be >= 0; * a result of -1 indicates that no backend connection is currently open. */
int backendPID()
/** * backendPID */
int clientEncoding()
/** * client encoding */
int setClientEncoding(String encoding)
/** * client encoding */
void trace(File file)
/** * Enable tracing */
void untreace()
/** * disable tracing */
void onNoticeProcess(void delegate(String))
/** * Set a delegate to override default notice processor */
void delegate(String)

void dispatchNoticeProcessor(String message)
/** * Application can override this to receive notices * or set a delegate by calling onNoticeProcessor */