class

SqlConnPool

const class SqlConnPool : Obj

SqlConnPool manages a pool of reusable SQL connections

constructors make

It-block construtor

fields password

Connection password

linger

Time to linger an idle connection before closing it

log

Logger

maxConns

Max number of simultaneous connections to allow before blocking threads

autoCommit

autoCommit sets the autoCommit field on a connection just after it is opened by the pool

uri

Connection URI

timeout

Max time to block waiting for a connection before raising TimeoutErr

username

Connection username

methods onClose

onClose is invoked just before a connection is closed by the pool

isClosed

Return if close has been called

onOpen

onOpen is invoked just after a connection is opened by the pool

checkLinger

Close idle connections that have lingered past the linger timeout

close

Close all connections and raise exception on any new executes

execute

Allocate a SQL connection inside the given callback

autoCommit Bool : autoCommit

autoCommit sets the autoCommit field on a connection just after it is opened by the pool.

If auto-commit is true then each statement is executed and committed as an individual transaction. Otherwise statements are grouped into transaction which must be closed via SqlConn.commit or SqlConn.rollback.

checkLinger Void checkLinger()

Close idle connections that have lingered past the linger timeout.

close Void close()

Close all connections and raise exception on any new executes

execute Void execute(|SqlConn| f)

Allocate a SQL connection inside the given callback. If a connection cannot be acquired before timeout elapses then a TimeoutErr is raised. Do not close the connection inside the callback.

isClosed Bool isClosed()

Return if close has been called.

linger const Duration : linger

Time to linger an idle connection before closing it. An external actor must call checkLinger periodically to close idle connetions.

log const Log : log

Logger

make new make(|This|? f)

It-block construtor

maxConns const Int : maxConns

Max number of simultaneous connections to allow before blocking threads

onClose virtual Void onClose(SqlConn c)

onClose is invoked just before a connection is closed by the pool.

onOpen virtual Void onOpen(SqlConn c)

onOpen is invoked just after a connection is opened by the pool.

password const Str? : password

Connection password

timeout const Duration : timeout

Max time to block waiting for a connection before raising TimeoutErr

uri const Str : uri

Connection URI

username const Str? : username

Connection username

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST