class
CQL::Postgres::TransactionScope
- CQL::Postgres::TransactionScope
- Reference
- Object
Overview
An open transaction on one pooled connection. Statements run using(scope)
join it, and #savepoint nests inside it. The scope is only good for the
block it was given to: afterwards the connection is back in the pool, so
using it again raises TransactionClosed.
Included Modules
Defined in:
postgres/transaction_scope.crConstructors
Instance Method Summary
- #adapter : CQL::Adapter
- #exec_query(& : DB::Connection -> _)
-
#savepoint(& : TransactionScope -> T) : T | Nil forall T
Runs the block inside a SAVEPOINT: if it raises, only its own work is rolled back to the savepoint and the exception propagates (raise
DB::Rollbackto undo it quietly, which makes this return nil).
Instance methods inherited from module CQL::Postgres::QueryStreaming
stream(query : String, args : Array(DB::Any) = [] of ::DB::Any, fetch_size : Int32 = 1000, timeout : Time::Span | Nil = nil, & : DB::ResultSet -> T) : T forall Tstream(query : Q, fetch_size : Int32 = 1000, timeout : Time::Span | Nil = nil, & : DB::ResultSet -> T) : T forall Q, T stream
Instance methods inherited from module CQL::Executor
adapter : Adapter
adapter,
exec_query(& : DB::Connection -> _)
exec_query
Constructor Detail
Instance Method Detail
def savepoint(& : TransactionScope -> T) : T | Nil forall T
#
Runs the block inside a SAVEPOINT: if it raises, only its own work is
rolled back to the savepoint and the exception propagates (raise
DB::Rollback to undo it quietly, which makes this return nil). The
yielded scope can open savepoints of its own.