PQConnection

PostgreSQL specific connection type. Although it can use different data base backend, the class is defined to support only PostgreSQL.

Members

Functions

clearRaisedMsgs
void clearRaisedMsgs()

Cleaning inner buffer for info/warning/error messages.

connect
void connect(string connString)

Tries to establish connection with a SQL server described in connString.

dateFormat
DateFormat dateFormat()

Returns current date output format and ambitious values converting behavior.

disconnect
void disconnect()

Closes connection to the SQL server instantly.

getQueryResult
InputRange!(shared IPGresult) getQueryResult()

Returns query result, if pollQueringStatus shows that query is processed without errors, else blocks the caller until the answer is arrived.

hasRaisedMsgs
bool hasRaisedMsgs()

Returns true if the connection stores info/warning/error messages.

pollConnectionException
void pollConnectionException()

If connection process is ended with error state, then throws ConnectException, else do nothing.

pollConnectionStatus
ConnectionStatus pollConnectionStatus()

Returns current status of connection.

pollQueringStatus
QueringStatus pollQueringStatus()

Returns quering status of connection.

pollQueryException
void pollQueryException()

If quering process is ended with error state, then throws QueryException, else do nothing.

postQuery
void postQuery(string com, string[] params = [])

Initializes querying process in non-blocking manner.

raisedMsgs
InputRange!string raisedMsgs()

Returns all saved info/warning/error messages from the connection.

reconnect
void reconnect()

Tries to establish connection with a SQL server described in previous call of connect.

server
string server()

Returns SQL server name (domain) the connection is desired to connect to. If connection isn't ever established (or tried) the method returns empty string.

testAlive
bool testAlive()

Sending senseless query to the server to check if the connection is actually alive (e.g. nothing can detect fail after postgresql restart but query).

timeZone
immutable(TimeZone) timeZone()

Returns server time zone. This value is important to handle time stamps with time zone specified as libpq doesn't send the information with time stamp.

timestampFormat
TimestampFormat timestampFormat()

Returns actual timestamp representation format used in server.

Inherited Members

From IConnection

connect
void connect(string connString)

Tries to establish connection with a SQL server described in connString.

reconnect
void reconnect()

Tries to establish connection with a SQL server described in previous call of connect.

pollConnectionStatus
ConnectionStatus pollConnectionStatus()

Returns current status of connection.

pollConnectionException
void pollConnectionException()

If connection process is ended with error state, then throws ConnectException, else do nothing.

postQuery
void postQuery(string com, string[] params = [])

Initializes querying process in non-blocking manner.

pollQueringStatus
QueringStatus pollQueringStatus()

Returns quering status of connection.

pollQueryException
void pollQueryException()

If quering process is ended with error state, then throws QueryException, else do nothing.

getQueryResult
InputRange!(shared IPGresult) getQueryResult()

Returns query result, if pollQueringStatus shows that query is processed without errors, else blocks the caller until the answer is arrived.

disconnect
void disconnect()

Closes connection to the SQL server instantly.

server
string server()

Returns SQL server name (domain) the connection is desired to connect to. If connection isn't ever established (or tried) the method returns empty string.

dateFormat
DateFormat dateFormat()

Returns current date output format and ambitious values converting behavior.

timestampFormat
TimestampFormat timestampFormat()

Returns actual time stamp representation format used in server.

timeZone
immutable(TimeZone) timeZone()

Returns server time zone. This value is important to handle time stamps with time zone specified as libpq doesn't send the information with time stamp.

testAlive
bool testAlive()

Sending senseless query to the server to check if the connection is actually alive (e.g. nothing can detect fail after postgresql restart but query).

execQuery
InputRange!(shared IPGresult) execQuery(string com, string[] params = [])

Blocking wrapper to one-command query execution.

hasRaisedMsgs
bool hasRaisedMsgs()

Returns true if the connection stores info/warning/error messages.

raisedMsgs
InputRange!string raisedMsgs()

Returns all saved info/warning/error messages from the connection.

clearRaisedMsgs
void clearRaisedMsgs()

Cleaning inner buffer for info/warning/error messages.

Meta