PGCommand

Class encapsulating prepared or non-prepared statements (commands).

Members

Functions

bind
void bind()

Binds values to parameters and updates list of returned fields.

executeNonQuery
ulong executeNonQuery()

Executes a non query command, i.e. query which doesn't return any rows. Commonly used with data manipulation commands, such as INSERT, UPDATE and DELETE.

executeQuery
PGResultSet!Specs executeQuery()

Executes query which returns row sets, such as SELECT command.

executeRow
DBRow!Specs executeRow(bool throwIfMoreRows = true)

Executes query and returns only first row of the result.

executeScalar
T executeScalar(bool throwIfMoreRows = true)

Executes query returning exactly one row and field. By default, returns Variant type.

prepare
void prepare()

Prepare this statement, i.e. cache query plan.

unprepare
void unprepare()

Unprepare this statement. Goes back to normal query planning.

Properties

fields
PGFields fields [@property getter]

List of fields that will be returned from the server. Available after successful call to bind().

isPrepared
bool isPrepared [@property getter]
isQuery
bool isQuery [@property getter]

Checks if this is query or non query command. Available after successful call to bind().

lastInsertOid
uint lastInsertOid [@property getter]

If table is with OIDs, it contains last inserted OID.

parameters
PGParameters parameters [@property getter]

List of parameters bound to this command

query
string query [@property getter]
string query [@property setter]

Query assigned to this command.

Meta