Carbonite.Change (Carbonite v0.6.0) View Source
A Carbonite.Change records a mutation on a database table.
INSERT statements lead to a Change where the data field contains the inserted row as a
JSON object while the changed field is an empty list.
UPDATE statements contain the updated record in data while the changed field is a list
of attributes that have changed. The changed_from field may additionally contain a partial
representation of the replaced record, showing only the diff to the updated record. This
behaviour is optional and can be enabled with the store_changed_from trigger option.
DELETE statements have the deleted data in data while changed is again an empty list.
Link to this section Summary
Link to this section Types
Specs
id() :: non_neg_integer()
Specs
t() :: %Carbonite.Change{
__meta__: term(),
changed: [String.t()],
changed_from: nil | map(),
data: map(),
id: id(),
op: :insert | :update | :delete,
table_name: String.t(),
table_pk: nil | [String.t()],
table_prefix: String.t(),
transaction: Ecto.Association.NotLoaded.t() | Carbonite.Transaction.t(),
transaction_id: term(),
transaction_xact_id: non_neg_integer()
}