mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
- EditorPanel can now load, save, and rename SQL snippets inline - New SaveSnippetDialog component for saving snippets with AI-generated titles - EditorPanel state tracks active snippet ID and pending reset - EditQueryButton opens the inline editor panel instead of navigating to SQL editor page - AIEditor exposes onMount callback for editor instance access - SnippetDropdown label updated to "Create snippet" ## TO TEST ### Normal CRUD - open inline SQL Editor - try creating a new snippet - try editing an existing snippet ### Homepage V2 Report - Try adding a new block → create snippet - create the snippet in inline sql editor - select the snippet in the report block section
10 lines
388 B
TypeScript
10 lines
388 B
TypeScript
import type { SqlError } from 'state/editor-panel-state'
|
|
|
|
export function formatSqlError(error: SqlError): { header: string | undefined; lines: string[] } {
|
|
if (error.formattedError) {
|
|
const lines = error.formattedError.split('\n').filter((l) => l.length > 0)
|
|
return { header: lines[0], lines: lines.slice(1) }
|
|
}
|
|
return { header: undefined, lines: [error.message ?? ''] }
|
|
}
|