PostgresDriver.borrow constructor

PostgresDriver.borrow(
  1. Pool<void> pool, {
  2. Future<Connection> cancellationConnection()?,
  3. Duration? queryTimeout,
  4. bool temporal = false,
})

Uses a caller-owned pool, which remains open when this driver closes.

Supply cancellationConnection to support statement cancellation. Enable temporal only if the pool was created with postgresTypeRegistry.

Implementation

PostgresDriver.borrow(
  pg.Pool<void> pool, {
  Future<pg.Connection> Function()? cancellationConnection,
  this._queryTimeout,
  // Enable only when the pool uses postgresTypeRegistry().
  this._temporal = false,
}) : _pool = pool,
     _ownsPool = false,
     _connectTimeout = null,
     _cancelConnection = cancellationConnection;