Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

feat(editor): support tab indentation

t8y2b8b4ef2e5a9c
diff --git a/package.json b/package.json
index 97e4929d25..5cbaa8d9fc 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,7 @@
"dependencies": {
"@babel/runtime": "^7.29.2",
"@codemirror/autocomplete": "^6.20.1",
+ "@codemirror/commands": "^6.10.3",
"@codemirror/lang-sql": "^6.10.0",
"@codemirror/state": "^6.6.0",
"@codemirror/theme-one-dark": "^6.1.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e6f23bb982..7b3b39e346 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -14,6 +14,9 @@ importers:
'@codemirror/autocomplete':
specifier: ^6.20.1
version: 6.20.1
+ '@codemirror/commands':
+ specifier: ^6.10.3
+ version: 6.10.3
'@codemirror/lang-sql':
specifier: ^6.10.0
version: 6.10.0
diff --git a/src/components/editor/QueryEditor.vue b/src/components/editor/QueryEditor.vue
index ef5e5cbe20..f6e9b934ef 100644
--- a/src/components/editor/QueryEditor.vue
+++ b/src/components/editor/QueryEditor.vue
@@ -210,12 +210,14 @@ onMounted(async () => {
{ sql, MySQL, PostgreSQL, SQLDialect },
{ basicSetup },
{ autocompletion, startCompletion },
+ { indentWithTab },
] = await Promise.all([
import("@codemirror/view"),
import("@codemirror/state"),
import("@codemirror/lang-sql"),
import("codemirror"),
import("@codemirror/autocomplete"),
+ import("@codemirror/commands"),
]);
editorViewModule = { EditorView, keymap } as typeof import("@codemirror/view");
fontThemeComp = new Compartment();
@@ -281,6 +283,7 @@ onMounted(async () => {
override: [async (context: CompletionContext) => provideSqlCompletions(context.state, context.pos)],
}),
codeMirrorTheme.of(theme),
+ keymap.of([indentWithTab]),
runKeymap,
EditorView.updateListener.of((update) => {
if (update.docChanged) {