Ecto v1.1.0 Ecto.Adapter.Transaction behaviour
Specifies the adapter transactions API.
Summary
Callbacks
Rolls back the current transaction. The transaction will return the value
given as {:error, value}
Runs the given function inside a transaction. Returns {:ok, value}
if the
transaction was successful where value
is the value return by the function
or {:error, value}
if the transaction was rolled back where value
is the
value given to rollback/1
Callbacks
Specs
rollback(Ecto.Repo.t, any) :: no_return
Rolls back the current transaction. The transaction will return the value
given as {:error, value}
.
See Ecto.Repo.rollback/1
.
Specs
transaction(Ecto.Repo.t, Keyword.t, (... -> any)) ::
{:ok, any} |
{:error, any}
Runs the given function inside a transaction. Returns {:ok, value}
if the
transaction was successful where value
is the value return by the function
or {:error, value}
if the transaction was rolled back where value
is the
value given to rollback/1
.
See Ecto.Repo.transaction/1
.