Module

Effect.Postgres.Pool

Package
purescript-postgresql
Repository
cakekindel/purescript-postgresql

#Pool Source

data Pool

Database connection pool

#Config Source

type Config :: Row Type -> Row Typetype Config r = Config + (allowExitOnIdle :: Boolean, idleTimeout :: Milliseconds, max :: Int | r)

Pool construction config

Includes all Client config options

#clientCount Source

clientCount :: Pool -> Int

The total number of clients existing within the pool.

#clientIdleCount Source

clientIdleCount :: Pool -> Int

The number of clients which are not checked out but are currently idle in the pool.

#clientWaitingCount Source

clientWaitingCount :: Pool -> Int

The number of queued requests waiting on a client when all clients are checked out. It can be helpful to monitor this number to see if you need to adjust the size of the pool.

#make Source

make :: forall @r @missing @trash. Union r missing (Config trash) => Record r -> Effect Pool

Creates a new pool

The config parameter r is Config with all keys optional.

https://node-postgres.com/apis/pool#new-pool

#PoolConfigRaw Source

data PoolConfigRaw

FFI type for import('pg').PoolConfig

#__make Source

__make :: PoolConfigRaw -> Effect Pool

FFI binding to new Pool()

#__release Source

__release :: Pool -> Client -> Boolean -> Effect Unit

FFI binding to Client#release for clients created from pools

Accepts a Pool as a type-level hint that the Client should have come from a Pool

#__uncfg Source

__uncfg :: { unwrapMillis :: Milliseconds -> Number } -> Foreign -> PoolConfigRaw

partial Config to import('pg').PoolConfig