mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
fc7fb50aa2
## Context
We reached to a consensus that we'll keep manually written queries
within the `pg-meta` package
I'll shift queries over in several PRs but wanted to double check if the
changes here is a good folder structure
## Changes involved
- Am organizing dashboard queries in `pg-meta` based on product
- So folder structure will be `/sql/studio/[product]/*.ts`
- Every constant will be exported directly from `pg-meta`'s index
- So consumption in dashboard will just be `import { xxx } from
'@supabase/pg-meta`
cc @avallete and @soedirgo on this one - lemme know if this is alright,
or if there's a preferred way to do this
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import type { OptimizedSearchColumns } from '@supabase/pg-meta'
|
|
|
|
export const authKeys = {
|
|
user: (projectRef: string | undefined, userId?: string | null) =>
|
|
['projects', projectRef, 'user', userId] as const,
|
|
usersInfinite: (
|
|
projectRef: string | undefined,
|
|
params?: {
|
|
keywords?: string
|
|
filter?: string
|
|
providers?: string[]
|
|
sort?: string
|
|
order?: string
|
|
column?: OptimizedSearchColumns
|
|
}
|
|
) => ['projects', projectRef, 'users-infinite', params].filter(Boolean),
|
|
usersCount: (
|
|
projectRef: string | undefined,
|
|
params?: {
|
|
keywords?: string
|
|
filter?: string
|
|
providers?: string[]
|
|
forceExactCount?: boolean
|
|
column?: OptimizedSearchColumns
|
|
}
|
|
) => ['projects', projectRef, 'users-count', params].filter(Boolean),
|
|
|
|
usersIndexStatuses: (projectRef: string | undefined) =>
|
|
['projects', projectRef, 'users-index-statuses'] as const,
|
|
indexWorkerStatus: (projectRef: string | undefined) =>
|
|
['projects', projectRef, 'index-worker-status'] as const,
|
|
authConfig: (projectRef: string | undefined) => ['projects', projectRef, 'auth-config'] as const,
|
|
accessToken: () => ['access-token'] as const,
|
|
overviewMetrics: (projectRef: string | undefined) =>
|
|
['projects', projectRef, 'auth-overview-metrics'] as const,
|
|
}
|