drift_postgres 1.2.0 copy "drift_postgres: ^1.2.0" to clipboard
drift_postgres: ^1.2.0 copied to clipboard

Postgres implementation and APIs for the drift database package.

package:drift_postgres extends drift to support talking to PostgreSQL databases by using the postgres package.

Using this #

For general notes on using drift, see this guide.

To use drift_postgres, add this to your pubspec.yaml

dependencies:
  drift: "$latest version"
  drift_postgres: ^0.1.0

To connect your drift database class to postgres, use a PgDatabase from package:drift_postgres/postgres.dart:

final database = AppDatabase(PgDatabase(
  endpoint: PgEndpoint(
    host: 'localhost',
    database: 'postgres',
    username: 'postgres',
    password: 'postgres',
  ),
));

Running tests #

To test this package, first run

docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres

It can then be tested with dart test -j 1 (concurrency needs to be disabled since tests are using the same database).

14
likes
0
pub points
85%
popularity

Publisher

verified publishersimonbinder.eu

Postgres implementation and APIs for the drift database package.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, drift, meta, postgres, uuid

More

Packages that depend on drift_postgres