Files
supabase/apps/studio/data/content/keys.ts
Joshen Lim 0129c94cf1 ReportsV2 P2: Support adding SQL snippets to Reports (#32851)
* midway

* Render, save, and save configuration of SQL blocks

* Fix re ordering of blocks not showing save UI

* Remove console log

* Smol fix

* Add queryHeight param to queryBlock

* Reinstate telemetry for run query clicked from assistant

* Add

* Add resizing

* Change compactType

* Fix switching reports doesnt update

* ONly show date picker if theres a chart thats using daily stats or infra monitoring

* Fix client crash

* Smol update
2025-01-20 15:49:32 +08:00

36 lines
1.4 KiB
TypeScript

import type { ContentType } from './content-query'
import type { SqlSnippet } from './sql-snippets-query'
export const contentKeys = {
allContentLists: (projectRef: string | undefined) => ['projects', projectRef, 'content'] as const,
list: (
projectRef: string | undefined,
options: { type: ContentType | undefined; name: string | undefined }
) => ['projects', projectRef, 'content', options] as const,
sqlSnippets: (
projectRef: string | undefined,
options?: {
sort?: 'inserted_at' | 'name'
name?: string
visibility?: SqlSnippet['visibility']
favorite?: boolean
}
) => ['projects', projectRef, 'content', 'sql', options].filter(Boolean),
folders: (
projectRef: string | undefined,
options?: { sort?: 'inserted_at' | 'name'; name?: string }
) => ['projects', projectRef, 'content', 'folders', options].filter(Boolean),
folderContents: (
projectRef: string | undefined,
id?: string,
options?: { sort?: 'inserted_at' | 'name'; name?: string }
) => ['projects', projectRef, 'content', 'folders', id, options].filter(Boolean),
resource: (projectRef: string | undefined, id?: string) =>
['projects', projectRef, 'content', id] as const,
count: (
projectRef: string | undefined,
type?: string,
options?: { visibility?: SqlSnippet['visibility']; favorite?: boolean; name?: string }
) => ['projects', projectRef, 'content', 'count', type, options].filter(Boolean),
}