Files
supabase/apps/studio/components/ui/AIAssistantPanel/AiAssistant.constants.ts
Joshen LimandSaxon Fletcher 0710d62665 ReportsV2 P1: Add Query block component (#32738)
* Create QueryBlock component which will be a shared component used in AI Assistant and Reports

* Deprecate AIAssistantPanel/SqlSnippet.ts

* Fix user messages not getting persisted, only assistant messages

* Add loading state to for query results in QueryBlock + hide block view configuration if query block is not chart

* Address feedback

* Fix TS

* fix double border

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2025-01-15 13:08:26 +08:00

35 lines
639 B
TypeScript

import { SupportedAssistantEntities } from './AIAssistant.types'
export const ASSISTANT_SUPPORT_ENTITIES: {
id: SupportedAssistantEntities
label: string
name: string
}[] = [
{ id: 'rls-policies', label: 'RLS Policies', name: 'RLS policy' },
{ id: 'functions', label: 'Functions', name: 'database function' },
]
export const SAFE_FUNCTIONS = [
'count(',
'sum(',
'avg(',
'min(',
'max(',
'coalesce(',
'nullif(',
'current_timestamp',
'current_date',
'length(',
'lower(',
'upper(',
'trim(',
'substring(',
'to_char(',
'to_date(',
'extract(',
'date(',
'date_trunc(',
'string_agg(',
'in (',
]