Skip to main content

dox_postgres_native 3.0.0-alpha.3 copy "dox_postgres_native: ^3.0.0-alpha.3" to clipboard
dox_postgres_native: ^3.0.0-alpha.3 copied to clipboard

Fast native Postgres client for Dart, the default Postgres driver of the Dox ORM. Rust (tokio-postgres) owns the connections, your code stays in Dart.

dox_postgres_native #

A fast Postgres client for Dart. It is the default Postgres driver of the Dox ORM. Rust (tokio-postgres) owns the connections. Your code stays in Dart.

Values come back with the same Dart types as with the postgres package, and errors are the same ServerException classes.

import 'package:dox_postgres_native/dox_postgres_native.dart';

void main() async {
  PgNativePool pool = PgNativePool.open(
    host: 'localhost',
    user: 'postgres',
    password: 'postgres',
    database: 'postgres',
  );
  PgNativeResult result = await pool.query(
    'SELECT id, name FROM users WHERE id = @id',
    parameters: <String, dynamic>{'id': 1},
  );
  print(result.rows);
}

With the Dox ORM you do not add this package. dox_orm depends on it and uses it by default. Set DOX_DB_DRIVER=dart to use the Dart driver.

  • The build hook downloads a ready-built library when one exists for your system. Else it builds it with cargo (install Rust with rustup).
  • Use dart run, dart test or dart build cli. dart compile exe does not run build hooks.
  • Not yet: SSL.

More: Native Postgres driver.

0
likes
0
points
0
downloads

Publisher

verified publisherdartondox.dev

Weekly Downloads

Fast native Postgres client for Dart, the default Postgres driver of the Dox ORM. Rust (tokio-postgres) owns the connections, your code stays in Dart.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

code_assets, crypto, hooks, postgres

More

Packages that depend on dox_postgres_native