12/30/2021, 9:40 PM
right on. the thing that complicates that on my team is that we use a variant of the clean architecture, so we don't know if a particular function is going to produce spicedb changes or not since that is an implementation detail. something we could do, though, is rather than making individual calls to spicedb within repo methods that a function might call, aggregate the relationship update structs into a single list and then write them all at once when the business logic finishes. like a custom transaction implementation. it would be tougher to validate that relationship updates will be valid within the business logic but it would work