View Source Electric.LogItems (electric v0.7.7)
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() :: %{ key: String.t(), value: map(), headers: map(), offset: Electric.Replication.LogOffset.t() }
Functions
@spec from_change( Electric.Replication.Changes.data_change(), txid :: non_neg_integer() | nil, pk_cols :: [String.t()] ) :: [log_item(), ...]
@spec from_snapshot_row_stream( row_stream :: Enumerable.t(list()), offset :: Electric.Replication.LogOffset.t(), shape :: Electric.Shapes.Shape.t(), query_info :: Postgrex.Query.t() ) :: Enumerable.t(log_item())