View Source Electric.LogItems (electric v1.0.1)

Defines the structure and how to create the items in the log that the electric client reads.

The log_item() data structure is a map for ease of consumption in the Elixir code, however when JSON encoded (not done in this module) it's the format that the electric client accepts.

Summary

Types

@type log_item() ::
  {Electric.Replication.LogOffset.t(),
   %{key: String.t(), value: map(), headers: map()}}

Functions

Link to this function

from_change(change, txids, pk_cols, replica)

View Source
@spec from_change(
  Electric.Replication.Changes.data_change(),
  txids :: nil | non_neg_integer() | [non_neg_integer(), ...],
  pk_cols :: [String.t()],
  replica :: Electric.Shapes.Shape.replica()
) :: [log_item(), ...]
Link to this function

keep_generic_headers(item)

View Source