electric icon indicating copy to clipboard operation
electric copied to clipboard

Materialise Shape

Open magnetised opened this issue 11 months ago • 0 comments

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.

magnetised avatar Jan 28 '25 13:01 magnetised