module Marten::DB::Model::Connection
Direct including types
Defined in:
marten/db/model/connection.crInstance Method Summary
-
#transaction(using : Nil | String | Symbol = nil, &block)
Allows to run the underlying block in a database transaction.
Instance Method Detail
def transaction(using : Nil | String | Symbol = nil, &block)
#
Allows to run the underlying block in a database transaction.
A optional database alias can be specified in order to define the database connection to use in the context of
the transaction (otherwise it defaults to the default connection). If the passed database alias doesn't
correspond to any defined connections, a Marten::DB::Errors::UnknownConnection
error will be raised.