mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
* fix: estimate number of users when count is large In the Auth Users table, we always fetch an exact count of users. This can be a problem for projects with many (>50K) users as the count(*) might cause performance issues on the database. We already have logic on the Table Editor to only run automatic count estimates (fetching the exact count only if usr requests it), this change ports the same logic over to Auth Users. * Nit refactor --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
export const authKeys = {
|
|
users: (
|
|
projectRef: string | undefined,
|
|
params?: {
|
|
page: number | undefined
|
|
keywords: string | undefined
|
|
filter: string | undefined
|
|
}
|
|
) => ['projects', projectRef, 'users', ...(params ? [params] : [])] as const,
|
|
|
|
usersInfinite: (
|
|
projectRef: string | undefined,
|
|
params?: {
|
|
keywords: string | undefined
|
|
filter: string | undefined
|
|
providers: string[] | undefined
|
|
sort: string | undefined
|
|
order: string | undefined
|
|
}
|
|
) =>
|
|
[
|
|
'projects',
|
|
projectRef,
|
|
'users-infinite',
|
|
...(params ? [params].filter(Boolean) : []),
|
|
] as const,
|
|
usersCount: (
|
|
projectRef: string | undefined,
|
|
params?: {
|
|
keywords: string | undefined
|
|
filter: string | undefined
|
|
providers: string[] | undefined
|
|
forceExactCount?: boolean
|
|
}
|
|
) =>
|
|
['projects', projectRef, 'users-count', ...(params ? [params].filter(Boolean) : [])] as const,
|
|
|
|
authConfig: (projectRef: string | undefined) => ['projects', projectRef, 'auth-config'] as const,
|
|
accessToken: () => ['access-token'] as const,
|
|
}
|