Gabriel
09/01/2025, 10:49 AMselect * from relation_tuple where object_id = any (....) and relation = ?. But even when combining several relations, it could be done in one query, at least for cockroachdb. Something like: select * from relation_tuple where (object_id, relation, userset_object_id) = any(?) and the ? contains an array of [custom types](https://www.cockroachlabs.com/docs/stable/create-type).
In this particular case, I have a tree of shared directories (more like a forest) in spicedb. To avoid the problem with double state in a different db, I want to get not only the data available, but the tree itself. I was thinking on doing two calls: give me my resources, give me the parents for all those. With that I would have enough information to return the whole tree of directories.
Cheersvroldanbet
09/01/2025, 11:04 AMvroldanbet
09/01/2025, 11:05 AMhttps://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.RelationshipFilter.optional_resource_id_prefixvroldanbet
09/01/2025, 11:06 AMGabriel
09/01/2025, 12:34 PMyetitwo
09/01/2025, 9:35 PM