spicedb
spicedb copied to clipboard
Implement support for metadata associated with read-write transactions
This will allow callers of APIs such as WriteRelationships and DeleteRelationships to assign metadata to the transaction that will be mirrored back out in the Watch API, to provide a means for correlating updates
First part of #966
Each datastore has a different means of correlating between the transaction and the associated change(s) coming out of the watch API:
- Memdb: The metadata is stored on the changes struct
- Postgres: A
metadatacolumn was added to the transactions table - MySQL: A
metadatacolumn was added to the transactions table - Spanner: A transaction tag is used to correlate the transaction and the metadata is stored in an auto-GC-ing table, indexed by the transaction tag
- CRDB: A row is inserted into a metadata table as part of the transaction, which includes the metadata. When seen at the same revision as the other changes, the metadata becomes correlated with that transaction. The rows are set to auto-GC after a period of time in CRDB >= v22
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
recheck
Updated
Rebased