postgres 0.9.6

  • Installing
  • Versions
  • 88


Build Status codecov

A library for connecting to and querying PostgreSQL databases.

This driver uses the more efficient and secure extended query format of the PostgreSQL protocol.


Create PostgreSQLConnections and open them:

var connection = new PostgreSQLConnection("localhost", 5432, "dart_test", username: "dart", password: "dart");

Execute queries with query:

var results = await connection.query("SELECT a, b FROM table WHERE a = @aValue", substitutionValues: {
    "aValue" : 3

Execute queries in a transaction:

await connection.transaction((ctx) async {
    var result = await ctx.query("SELECT id FROM table");
    await ctx.query("INSERT INTO table (id) VALUES (@a:int4)", {
        "a" : result.last[0] + 1

See the API documentation:

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Adds Connection.notifications to listen for NOTIFY events (thanks @andrewst)
  • Adds better error reporting.
  • Adds support for JSONB columns.
  • Fixes issue when encoding UTF16 characters (thanks @andrewst)


  • Allow connect via SSL.


  • Fixed issue with buffer length


  • Fixed issue with UTF8 encoding


  • Bump for documentation


  • Added transactions: PostgreSQLConnection.transaction and PostgreSQLConnection.cancelTransaction.


  • Initial version

1. Depend on it

Add this to your package's pubspec.yaml file:

  postgres: "^0.9.6"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:postgres/postgres.dart';
Version Uploaded Documentation Archive
0.9.6 Oct 5, 2017 Go to the documentation of postgres 0.9.6 Download postgres 0.9.6 archive
0.9.5 Mar 15, 2017 Go to the documentation of postgres 0.9.5 Download postgres 0.9.5 archive
0.9.4+1 Dec 13, 2016 Go to the documentation of postgres 0.9.4+1 Download postgres 0.9.4+1 archive
0.9.4 Dec 6, 2016 Go to the documentation of postgres 0.9.4 Download postgres 0.9.4 archive
0.9.3 Nov 30, 2016 Go to the documentation of postgres 0.9.3 Download postgres 0.9.3 archive
0.9.2 Nov 21, 2016 Go to the documentation of postgres 0.9.2 Download postgres 0.9.2 archive
0.9.1 Oct 14, 2016 Go to the documentation of postgres 0.9.1 Download postgres 0.9.1 archive
0.9.0 Sep 30, 2016 Go to the documentation of postgres 0.9.0 Download postgres 0.9.0 archive


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
76 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, other

Primary library: package:postgres/postgres.dart with components: io.


  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use postgres.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <2.0.0
crypto ^2.0.0 2.0.2+1
Transitive dependencies
charcode 1.1.1
collection 1.14.5
convert 2.0.1
typed_data 1.1.5
Dev dependencies
coverage any
test >=0.12.0 <0.13.0