Carbonite.Change (Carbonite v0.3.1) 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.

DELETE statements have the delete data in data while changed is again an empty list.

Link to this section Summary

Link to this section Types

Specs

t() :: %Carbonite.Change{
  __meta__: term(),
  changed: [String.t()],
  data: nil | map(),
  id: non_neg_integer(),
  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()
}