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.

/home/runner/work/rotor/rotor/src/adapter.qz:5

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.

/home/runner/work/rotor/rotor/src/adapter.qz:9

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.

/home/runner/work/rotor/rotor/src/adapter.qz:14

def in_transaction? -> Bool

Whether a transaction is open on the connection this adapter holds (false when it holds none, over a pool).

/home/runner/work/rotor/rotor/src/adapter.qz:18

def pooled? -> Bool

Whether the adapter takes its connections from a pool, so that one hold gives back is its to reset.

/home/runner/work/rotor/rotor/src/adapter.qz:22