abstract class Rotor::Adapter
What a repository runs its statements through: a database and its
driver. Rotor::Adapters::PG is PostgreSQL's, over pg.
/home/runner/work/rotor/rotor/src/adapter.qz:3
Methods
abstract def query(sql: String, params: Array[Object?]) -> Rotor::Rows
Runs sql with params ($1...): its rows, or what it changed.
abstract def transaction(&: (Rotor::Adapter) -> Object?) -> Object?
Runs the block in a transaction, given an adapter bound to it: committed when the block returns, rolled back when it raises.
def hold(&: (Rotor::Adapter) -> Object?) -> Object?
Runs the block with an adapter whose statements all go through one connection (a session's state, an advisory lock, stays theirs): this one when it has a single connection.
def in_transaction? -> Bool
Whether a transaction is open on the connection this adapter holds (false when it holds none, over a pool).
def pooled? -> Bool
Whether the adapter takes its connections from a pool, so that one
hold gives back is its to reset.