electric icon indicating copy to clipboard operation
electric copied to clipboard

Helper to return the write id

Open magnetised opened this issue 11 months ago • 1 comments

Something like:

{:ok, write_id} = 
  Electric.Client.transaction_with_write_id(Repo, fn ->
      Repo.update(changeset) 
  end)

(?)

Write id implementation:

  • transaction xid
  • metadata column in table

For the latter then we could add helpers to create the column in migrations, much like ecto's timestamps()

I think it makes sense to add this functionality here, rather than in electric phoenix as this is not phoenix specific.

magnetised avatar Jan 28 '25 13:01 magnetised

Implemented here: https://github.com/electric-sql/phoenix_sync/pull/14

magnetised avatar Apr 03 '25 13:04 magnetised