https://authzed.com logo
Title
j

Joey

02/21/2023, 3:58 PM
without knowing more details about the use case, I can say that calling LS for each resource ID would be slow, at least. I imagine there is a better approach
a

Antoine

02/21/2023, 4:05 PM
Here's some more detail: i have this schema, and I need to query spicedb to synchronise permission on an other database
So if I know the database beforehand, I can call LS for a specific database, e.g. to list all subjects who have the "only_read" permission
But if I don't, I have to find a way to know them all and query each one (which would indeed be slow but is not a dealbreaker in my configuration)
j

Joey

02/21/2023, 4:09 PM
is that the only permission you want synchronized?
a

Antoine

02/21/2023, 4:09 PM
Yes
j

Joey

02/21/2023, 4:09 PM
and this is to determine which user(s) have access to which database(s)?
if so, https://github.com/authzed/spicedb/issues/207 is a proposal that might help once ready
a

Antoine

02/21/2023, 4:12 PM
Interesting, thanks
I'll keep an eye on this, and hack something in the meantime
Thank you for your time
j

Joey

02/21/2023, 4:13 PM
> I have to find a way to know them all probably doable just by ReadRelationships to get the resource IDs for the database
or getting the IDs on your side
a

Antoine

02/21/2023, 4:15 PM
Yeah i thought about that, or I might go with a direct query to the datastore
Something like
select distinct namespace as objectType, object_id as objectId from relation_tuple where namespace = 'database'