talira

postgres (Dart)

PostgreSQL driver for Dart and Flutter

open sourceBSD-3-Clausefree

postgres is a PostgreSQL client library for Dart. It speaks the extended query format of the PostgreSQL protocol, with the binary protocol and statement reuse, and runs queries with positional or named parameters, returning rows as lists or column maps. It has transactions, connection pooling, connection strings for single connections and pools (with SSL modes, timeouts, keep-alives and several hosts), custom type codecs and the streaming replication protocol. It began as StableKernel's postgres library and was overhauled and partly rewritten. Install it from pub.dev as postgres.

Problems it solves

  • connect a Dart backend server to a Postgres database
  • run parameterized SQL against PostgreSQL from a Dart CLI without string concatenation
  • Postgres connection pool for a Dart service

Features

  • extended query protocol with binary encoding and statement reuse
  • named and positional parameters
  • transactions
  • connection pooling
  • connection string URLs with SSL modes and timeouts
  • custom type codecs
  • streaming replication protocol