View Source Carbonite.Transaction (Carbonite v0.14.2)
A Carbonite.Transaction
is the binding link between change records of tables.
As such, it contains a set of optional metadata that describes the transaction.
Summary
Functions
Builds a changeset for a new Carbonite.Transaction
.
Returns the currently stored metadata.
Stores a piece of metadata in the process dictionary.
Types
@type id() :: non_neg_integer()
@type meta() :: map()
@type t() :: %Carbonite.Transaction{ __meta__: term(), changes: Ecto.Association.NotLoaded.t() | [Carbonite.Change.t()], id: id(), inserted_at: DateTime.t(), meta: meta(), xact_id: non_neg_integer() }
Functions
@spec changeset(params :: map()) :: Ecto.Changeset.t()
Builds a changeset for a new Carbonite.Transaction
.
The :meta
map from the params will be merged with the metadata currently stored in the
process dictionary.
@spec current_meta() :: meta()
Returns the currently stored metadata.
Stores a piece of metadata in the process dictionary.
This can be useful in situations where you want to record a value at a system boundary (say,
the user's account_id
) without having to pass it through to the database transaction.
Returns the currently stored metadata.