electric
electric copied to clipboard
Materialise Shape
Elixir implementation of the typescript client function.
Should be droppable into a supervision tree, something like:
`{Electric.Client.Materialise, client: client, shape: shape, target: target}
Should be able to reduce the sync stream into anything (the target target) that supports %{primary_key => %{column: value}}:
- Simple map
- SQLite table?
- PG table backed by Ecto
- PG table using raw Postgrex
If we implement as a behaviour or protocol then it's easily extensible by the user.
Need to think about what key is used -- is it the key field in the sync stream, or the primary key as returned by the shape stream's schema or some other user-definable value/mapping function.