# `Electric.LogItems`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.2/packages/sync-service/lib/electric/log_items.ex#L1)

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.

# `log_item`

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

# `expected_offset_after_split`

# `from_change`

```elixir
@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(), ...]
```

# `keep_generic_headers`

# `merge_updates`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
