Skip to content
pubscout

postgres

3.6.0, released 2 weeks ago by agilord.com

PostgreSQL driver for Dart supporting binary protocol, pooling and statement reuse.

Rock solid
$ flutter pub add postgres
Source repository

What it does

Provides a Dart API to connect to PostgreSQL servers, execute queries, and manage transactions. Includes connection‑pool support and custom type codecs.

AI-written summary of version 3.6.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need direct SQL access to a PostgreSQL database from a Flutter or Dart app
  • You require connection pooling or custom type handling
  • You prefer a pure‑Dart driver without native plugins

Skip it when

  • You need a higher‑level ORM or query builder
  • You target only NoSQL or local storage solutions
  • You require automatic schema migrations

Strengths

  • Binary protocol for efficiency
  • Built‑in connection pooling with configurable parameters
  • Supports custom type codecs and streaming replication

Weaknesses

  • Low‑level API may require manual query construction
  • No built‑in ORM or query abstraction
  • Only works with PostgreSQL, not other databases

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
9
final conn = await Connection.open(Endpoint(host:'localhost',database:'postgres',username:'user',password:'pass'));
final result = await conn.execute('SELECT \"foo\"');
print(result[0][0]);

Alternatives

Packages that do the same job and could replace postgres.

  • postgrest

    If you expose a PostgREST API and prefer a REST client over raw SQL

Works with

Packages commonly used together with postgres: ones it builds on, ones built on it, and its own family.