()
| 7 | } from "@/types"; |
| 8 | |
| 9 | export const defaultSQLEditorTab = (): SQLEditorTab => { |
| 10 | return { |
| 11 | id: uuidv1(), |
| 12 | // Tabs are created untitled. The UI renders a localized "Untitled" |
| 13 | // placeholder when the title is empty; users name worksheets explicitly |
| 14 | // when (and if) they save. |
| 15 | title: "", |
| 16 | connection: emptySQLEditorConnection(), |
| 17 | statement: "", |
| 18 | selectedStatement: "", |
| 19 | status: "CLEAN", |
| 20 | mode: DEFAULT_SQL_EDITOR_TAB_MODE, |
| 21 | worksheet: "", |
| 22 | treeState: { |
| 23 | database: UNKNOWN_DATABASE_NAME, |
| 24 | keys: [], |
| 25 | }, |
| 26 | editorState: { |
| 27 | selection: null, |
| 28 | }, |
| 29 | viewState: defaultViewState(), |
| 30 | batchQueryContext: { |
| 31 | databases: [], |
| 32 | }, |
| 33 | }; |
| 34 | }; |
| 35 | |
| 36 | export const emptySQLEditorConnection = (): SQLEditorConnection => { |
| 37 | return { |
no test coverage detected