Connection constructor
Calls nextResult until the value returned is null, the returns them as an array.
Begins a transaction block.
Close the connection manually
Commits current transaction
Returns a count of the rows matching the filter in the specified relation. Filter can be empty or not given to select a count of all the rows in the relation.
Generates and runs the DDL from the given structures
Escapes an identifier (column, function, table name, ...) to be used in a query.
Escapes a string, to be used in a query
Executes the given string directly
Executes the given string with given params
ditto, but taking an array of params, instead of variadic template
Returns an array of the specified type, filtered with the given filter and params
Returns an array of the specified type, filtered with the given filter and params with length limited by limit
Returns the requested structure or a Nullable null value if no rows are returned
Returns the requested structure, searches by the specified filter with given params
Returns the requested structure, searches by the given column name with the given value If not rows are returned, a Nullable null value is returned
Inserts the given structure to the DB
Inserts the given array of structures to the DB as one query
ditto, async
Inserts the given structure, returning whatever columns are specified by the second param as a normal Result.
Inserts the given array structures in a singl query, returning whatever columns are specified by the second param as a normal Result.
Equivalent to calling PQisBusy from libpq. Only useful if you're doing async stuff manually.
Calls nextResult until null is returned, then retuns only the last non-null result.
Blocks until a result is read, then returns it
Destroys savepoint in the current transaction block.
Deletes the record in the given table, by its PK
Deletes rows in the specified relation, filtered by the given filter string and values
ditto, async
Rollback the current transaction to savepoint.
Creates savepoint in the current transaction block.
ditto, async
ditty, but async
ditto, async
Updates records filtered by the filter string, setting the values as specified in the update string. Both should be SQL-syntax
Similar to above update, but instead of acceptign a filter and and update string, always filters by the PK and updates with absolute values from the updates AA.
Similar to above, but accepts the whole structure as an update param. Filters by the PK, updates ALL the values in the filtered rows.
ditto, async
Returns the name of the database currently selected
Returns the last error message
ditto, but host
ditto, but password
ditto, but port
Returns the name of the current user
Represents the PostgreSQL connection and allows executing queries on it.