postgres
3.6.0, released 2 weeks ago by agilord.com
PostgreSQL driver for Dart supporting binary protocol, pooling and statement reuse.
Rock solid
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.
Works with
Packages commonly used together with postgres: ones it builds on, ones built on it, and its own family.
- cryptopostgres depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- stack_tracepostgres depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- poolpostgres depends on itManage a finite pool of resources to control concurrent operations.
- asyncpostgres depends on itUtility classes and helpers that extend Dart's async library.
- stream_channelpostgres depends on itAn abstraction for two-way communication channels based on the Dart Stream class.
- charcodepostgres depends on itProvides named integer constants for ASCII and HTML character codes.
- bufferpostgres depends on itUtilities and classes for reading and writing byte buffers and binary data streams.
- http_clientSame familyPlatform‑independent HTTP client for browser, console and curl with SOCKS proxy support