PostgresDriver class final

Owns a native postgres pool; each callback pins one physical connection.

The connection opens lazily on acquisition. Configuration is independent of SQLite. Use pg.PoolSettings for limits, TLS, timeouts and application name. Every isolation level and read-only transaction mode is supported.

SQL uses PostgreSQL's native $1, $2, ... placeholders without rewriting. Each call executes one statement using the extended protocol, regardless of the pool's queryMode. Prepared transactions are unsupported and rejected. Parameters support int, String, bool, double, DateTime, Uint8List and null. Dates are bound as UTC timestamptz; byte arrays use bytea. Unsupported values fail before SQL execution. Native PostgreSQL result types are preserved. Native exceptions propagate unchanged. PostgreSQL server errors retain pg.ServerException codes and constraint metadata. SQLSTATE 23505 and 23503 retain their native unique and foreign-key exception subclasses. Application SQL follows PostgreSQL session-setting persistence rules. Use SET LOCAL inside Database.transaction for scoped configuration.

Implemented types

Constructors

PostgresDriver(Endpoint endpoint, {String schema = 'public', PoolSettings? settings})
Creates an owned pool for endpoint; opening happens on first use.

Properties

capabilities → Capabilities
no setteroverride
engine → Engine
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schema → String
Fixed application schema used by typed queries and migration histories.
final

Methods

close() → Future<void>
Drains admitted callbacks and then releases every pooled connection.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withConnection<T>(Future<T> action(Connection connection)) → Future<T>
Pins a pooled connection until action and its issued statements finish.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited