MCPcopy Create free account
hub / github.com/bytebase/bytebase / defaultSQLEditorTab

Function defaultSQLEditorTab

frontend/src/utils/sqlEditor.ts:9–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7} from "@/types";
8
9export 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
36export const emptySQLEditorConnection = (): SQLEditorConnection => {
37 return {

Callers 5

useSchemaPaneActionsFunction · 0.90
addTabFunction · 0.90
hydrateProjectTabsFunction · 0.90
loadStoredTabFunction · 0.90
migrateDraftsFromCacheFunction · 0.90

Calls 2

defaultViewStateFunction · 0.90
emptySQLEditorConnectionFunction · 0.85

Tested by

no test coverage detected