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。

fix(mcp): support DBX_DATA_DIR env for portable mode

t8y2213162aad32a
diff --git a/packages/node-core/src/paths.ts b/packages/node-core/src/paths.ts
index d46c37da99..ec1cdfe934 100644
--- a/packages/node-core/src/paths.ts
+++ b/packages/node-core/src/paths.ts
@@ -2,6 +2,12 @@ import { homedir, platform } from "node:os";
import { join } from "node:path";
export function appDataDir(): string {
+ // 支持 DBX_DATA_DIR 环境变量(与 Rust 侧 data_dir.rs 保持一致)
+ const envDir = process.env.DBX_DATA_DIR;
+ if (envDir && envDir.trim() !== "") {
+ return envDir;
+ }
+
const home = homedir();
switch (platform()) {
case "darwin":