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.

configure(Pool pool, { Duration slowSql, void onSlowSql(DBAccess access, Duration timeSpent, String sql, Map<String, dynamic> values), String getErrorMessage(String sql, values), void onTag(DBAccess access, cause, String sql, Map<String, dynamic> values), bool shallLogError(ex) }) → Pool

Configures the access library.

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.

sqlColumns(Iterable<String> fields, [ String shortcut ]) → 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. It is designed to used with access.

Row

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

Exceptions / Errors

PostgresqlException