mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 07:09:07 +03:00
* improve table editor headers * sql editor horizontal scroll auto in headers * fix headers in tablelist * fix headers in db roles * fix database functions in smol screens * fix table list headers * fix trigger lists table * fix enum types headers * Update Extensions component styling with flex-wrap * Update Indexes component UI layout and styling * fix publications table * move sql editor pagination tobottom * rm unused imports, add correct label to db selector * fix layout shift in run button * add tooltip to results limitter * make header in sql editor results scrollable * Fix Button tooltip and table header formatting for database/tables/[id] ColumnList * Fix SQL editor footer disappearing with resizable panel --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import type { SqlSnippets, UserContent } from 'types'
|
|
|
|
const SQL_SNIPPET_SCHEMA_VERSION = '1.0'
|
|
|
|
export const NEW_SQL_SNIPPET_SKELETON: UserContent<SqlSnippets.Content> = {
|
|
name: 'New Query',
|
|
description: '',
|
|
type: 'sql',
|
|
visibility: 'user', // default to user scope
|
|
content: {
|
|
schema_version: SQL_SNIPPET_SCHEMA_VERSION,
|
|
content_id: '',
|
|
sql: 'this is a test',
|
|
favorite: false,
|
|
},
|
|
}
|
|
|
|
export const sqlAiDisclaimerComment = `
|
|
-- Supabase AI is experimental and may produce incorrect answers
|
|
-- Always verify the output before executing
|
|
`.trim()
|
|
|
|
export const untitledSnippetTitle = 'Untitled query'
|
|
|
|
export const destructiveSqlRegex = [/^(.*;)?\s*(drop|delete|truncate)\s/is]
|
|
|
|
export const ASSISTANT_TEMPLATES = [
|
|
{
|
|
name: 'Twitter clone',
|
|
description: 'Simplified schema that mimics the Twitter application',
|
|
prompt: 'Create a twitter clone',
|
|
},
|
|
{
|
|
name: 'Chat application',
|
|
description: 'Send messages through channels or direct messages',
|
|
prompt:
|
|
'Create a chat application that supports sending messages either through channels or directly between users',
|
|
},
|
|
{
|
|
name: 'User management schema',
|
|
description: 'With role based access control',
|
|
prompt: 'Create a simple user management schema that supports role based access control',
|
|
},
|
|
{
|
|
name: 'Countries and Cities',
|
|
description: 'With each city belonging to a country',
|
|
prompt:
|
|
'Create a table of countries and a table of cities, with each city belonging to a country',
|
|
},
|
|
]
|
|
|
|
export const ROWS_PER_PAGE_OPTIONS = [
|
|
{ value: -1, label: 'No limit' },
|
|
{ value: 100, label: '100 rows' },
|
|
{ value: 500, label: '500 rows' },
|
|
{ value: 1000, label: '1,000 rows' },
|
|
]
|