Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: split standard and admin mode's statements (#13425)

Liu Ji16e1152f9d56
diff --git a/frontend/src/store/modules/sqlEditor/webTerminal.ts b/frontend/src/store/modules/sqlEditor/webTerminal.ts
index 9bec5e42d9..c1a2e13093 100644
--- a/frontend/src/store/modules/sqlEditor/webTerminal.ts
+++ b/frontend/src/store/modules/sqlEditor/webTerminal.ts
@@ -63,7 +63,7 @@ const createQueryState = (tab: SQLEditorTab): WebTerminalQueryState => {
const createInitialQueryItemByTab = (
tab: SQLEditorTab
): WebTerminalQueryItemV1 => {
- return createQueryItemV1(tab.statement);
+ return createQueryItemV1("");
};
export const createQueryItemV1 = (
@@ -252,9 +252,6 @@ const useQueryStateLogic = (qs: WebTerminalQueryState) => {
qs.timer.stop();
pushQueryItem();
- // Clear the tab's statement and keep it sync with the latest query
- qs.tab.statement = "";
- qs.tab.selectedStatement = "";
};
qs.controller.events.on("query", (input) => {
diff --git a/frontend/src/views/sql-editor/EditorCommon/AdminModeButton.vue b/frontend/src/views/sql-editor/EditorCommon/AdminModeButton.vue
index 96eba79573..e04b612a5b 100644
--- a/frontend/src/views/sql-editor/EditorCommon/AdminModeButton.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/AdminModeButton.vue
@@ -59,7 +59,6 @@ const enterAdminMode = async () => {
tabStore.updateCurrentTab({
mode: "ADMIN",
- statement: "",
});
emit("enter");
diff --git a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
index 8e441f7764..5311b2033f 100644
--- a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
@@ -275,7 +275,6 @@ const handleRunQuery = () => {
const exitAdminMode = () => {
tabStore.updateCurrentTab({
mode: DEFAULT_SQL_EDITOR_TAB_MODE,
- statement: "",
});
};
diff --git a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/CompactSQLEditor.vue b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/CompactSQLEditor.vue
index 5945c130fb..363a82391c 100644
--- a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/CompactSQLEditor.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/CompactSQLEditor.vue
@@ -16,7 +16,6 @@
max: MAX_EDITOR_HEIGHT,
}"
@update:content="handleChange"
- @select-content="handleChangeSelection"
@ready="handleEditorReady"
/>
</div>
@@ -110,20 +109,10 @@ const handleChange = (value: string) => {
if (isSwitchingTab.value) {
return;
}
- tabStore.updateCurrentTab({
- statement: value,
- status: "DIRTY",
- });
emit("update:sql", value);
};
-const handleChangeSelection = (value: string) => {
- tabStore.updateCurrentTab({
- selectedStatement: value,
- });
-};
-
const execute = (explain = false) => {
emit("execute", {
connection: { ...connection.value },