Types
Pool[T] = ref object
PoolExhaustedError = object of CatchableError
PoolExhaustedPolicy = enum pepRaise, pepExtend
Procs
func defaultSize(pool: Pool): Natural
proc newPool[T: postgres.DbConn](defaultSize: Positive; getDbProc = postgres.getDb; poolExhaustedPolicy = pepRaise): Pool[T]
-
Create a Postgres connection pool of the given size.
poolExhaustedPolicy defines how the pool reacts when a connection is requested but the pool has no connection available:
- pepRaise (default) means throw PoolExhaustedError
- pepExtend means “add another connection to the pool.”
proc newPool[T: sqlite.DbConn](defaultSize: Positive; getDbProc = sqlite.getDb; poolExhaustedPolicy = pepRaise): Pool[T]
-
Create an SQLite connection pool of the given size.
poolExhaustedPolicy defines how the pool reacts when a connection is requested but the pool has no connection available:
- pepRaise (default) means throw PoolExhaustedError
- pepExtend means “add another connection to the pool.”