Constants

PG_CHECK_VIOLATION → String

"23514"
PG_DUPLICATE_TABLE → String

"42P07"
PG_FAILED_IN_TRANSACTION → String

"25P02"
PG_FOREIGN_KEY_VIOLATION → String

"23503"
PG_INTEGRITY_CONSTRAINT_VIOLATION → String

"23000"
PG_NO_DATA → String

"020000"
PG_NOT_NULL_VIOLATION → String

"23502"
PG_SUCCESSFUL_COMPLETION → String

"00000"
PG_UNDEFINED_OBJECT → String

"42704"
PG_UNDEFINED_TABLE → String

"42P01"
PG_UNIQUE_VIOLATION → String

"23505"
PG_WARNING → String

"010000"

Functions

access(dynamic command(DBAccess access)) → Future

Executes a command within a transaction.

firstColumns(Iterable<Row> rows) → List

Collects the first column of Row into a list.

isForeignKeyViolation(ex) → bool

Whether it is PostgresqlException about the violation of foreign keys.

isNotNullViolation(ex) → bool

Whether it is PostgresqlException about the violation of foreign keys.

isUniqueViolation(ex) → bool

Whether it is PostgresqlException about the violation of uniqueness. It is useful with select-for-update

isViolation(ex, String code) → bool

Whether it is PostgresqlException about the violation of the given code.

setPool(Pool pool) → Pool

Sets the pool used to instantiate DBAccess.

sqlColumns(Iterable<String> fields) → String

Converts a list of fields to a SQL fragment separated by comma.

sqlWhereBy(Map<String, dynamic> whereValues, [int option, String append]) → String

Returns the where criteria (without where) by anding whereValues.

Classes

Connection

A connection to a PostgreSQL database.

DBAccess

The database access.

Row

Row allows field values to be retrieved as if they were getters.

Exceptions / Errors

PostgresqlException