Serialized access to instance of resource for `AshPostgres`
Pursuant to the discussion in #general , I'd like to create a macro which uses the
Usage:
Two things:
- This relies on the changeset and its children happening inside a transaction. Is that the case?
- I'm using the resource as if it's an Ecto schema. This is...maybe not legit. The Ash changeset (or parts of it) will end up as an Ecto changeset at some point, though. Is there an escape hatch I can use here to inject this or raw SQL into the changeset?
changes hook to ensure that change actions to an instance (row) of a resource are serialized. For now I'm only looking at Postgres support, but if the lock primitive comes into play, happy to update. Primary changes are the addition of a definitely-not-working locking statement and or changeset.type == :read to not block read actions.Usage:
Two things:
- This relies on the changeset and its children happening inside a transaction. Is that the case?
- I'm using the resource as if it's an Ecto schema. This is...maybe not legit. The Ash changeset (or parts of it) will end up as an Ecto changeset at some point, though. Is there an escape hatch I can use here to inject this or raw SQL into the changeset?
