access library

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. [...]

Constants

pgCheckViolation → const String
"23514"
pgDuplicateTable → const String
"42P07"
pgFailedInTransaction → const String
"25P02"
pgForeignKeyViolation → const String
"23503"
pgIntegrityConstraintViolation → const String
"23000"
pgNoData → const String
"020000"
pgNotNullViolation → const String
"23502"
pgSuccessfulCompletion → const String
"00000"
pgUndefinedObject → const String
"42704"
pgUndefinedTable → const String
"42P01"
pgUniqueViolation → const String
"23505"
pgWarning → const String
"010000"

Functions

access<T>(Future<T> command(DBAccess access)) → Future<T>
Executes a command within a transaction. [...]
configure(Pool pool, { Duration slowSql, void onSlowSql(DBAccess access, Duration timeSpent, String sql, dynamic values), String getErrorMessage(String sql, dynamic values), void onTag(DBAccess access, dynamic cause, String sql, dynamic values), bool shallLogError(DBAccess access, dynamic ex) }) Pool
Configures the access library. [...]
firstColumns(Iterable<Row> rows) → List
Collects the first column of Row into a list.
isForeignKeyViolation(dynamic ex) → bool
Whether it is PostgresqlException about the violation of foreign keys.
isNotNullViolation(dynamic ex) → bool
Whether it is PostgresqlException about the violation of foreign keys.
isUniqueViolation(dynamic ex) → bool
Whether it is PostgresqlException about the violation of uniqueness. It is useful with select-for-update
isViolation(dynamic 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, [ String append ]) → String
Returns the where criteria (without where) by anding whereValues.

Exceptions / Errors

PostgresqlException