1
Retrieve list of users by ID
Source: supabase/supabase#39640 · opened by @jtrollkarl
I was curious if it would be possible to implement such a function? I've currently written
suspend fun AdminApi.retrieveUsersByIds(uids: List<String>): List<UserInfo> = coroutineScope { uids.map { uid -> async { retrieveUserById(uid) } }.awaitAll() }
but was curious if there would be a more efficient method instead of doing individual calls and waiting? I see in AdminApi there is:
override suspend fun retrieveUserById(uid: String): UserInfo { return api.get("admin/users/$uid").safeBody() }
I don't know if there currently exists an API function/path to achieve the behaviour i want (select multiple UserInfo objects by a list of IDs). My implementation is basically doing multiple calls to the admin/users/uidhere endpoint - but is it possible to request and receive a list?
Original feature request was posted in the kotlin wrapper library:
suspend fun AdminApi.retrieveUsersByIds(uids: List<String>): List<UserInfo> = coroutineScope { uids.map { uid -> async { retrieveUserById(uid) } }.awaitAll() }
but was curious if there would be a more efficient method instead of doing individual calls and waiting? I see in AdminApi there is:
override suspend fun retrieveUserById(uid: String): UserInfo { return api.get("admin/users/$uid").safeBody() }
I don't know if there currently exists an API function/path to achieve the behaviour i want (select multiple UserInfo objects by a list of IDs). My implementation is basically doing multiple calls to the admin/users/uidhere endpoint - but is it possible to request and receive a list?
Original feature request was posted in the kotlin wrapper library:
No pledges yet. Be the first to back this.
Comments
Similar requests
Support for Retrieving Multiple Users by IDs in supabase-js
5 votes · 0 comments
Retrieve subcollections from firebase wrapper
1 vote · 0 comments
Feature Request: Port storage functions to plpgsql
1 vote · 0 comments
Add beter ways to query users as an admin
2 votes · 0 comments
Return user metadata from Storage API "list" endpoint
1 vote · 0 comments
No comments yet.