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。

refactor: remove ODBC dependency entirely

t8y226245514bbbe
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7f370cfe06..8a9d0b2ff5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -53,7 +53,7 @@ jobs:
- name: Install system dependencies (Linux)
run: |
sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev unixodbc-dev
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev
- name: Cargo fmt check
run: cargo fmt --check
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 411d8e01c1..aa67e3f424 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -67,20 +67,6 @@ jobs:
add-rust-environment-hash-key: false
cache-on-failure: true
- - name: Install system dependencies (macOS)
- if: startsWith(matrix.platform, 'macos')
- run: brew install unixodbc
-
- - name: Bundle ODBC library (macOS)
- if: startsWith(matrix.platform, 'macos')
- run: |
- ODBC_LIB="$(brew --prefix unixodbc)/lib/libodbc.2.dylib"
- LTDL_LIB="$(brew --prefix libtool)/lib/libltdl.7.dylib"
- install_name_tool -id "@rpath/libodbc.2.dylib" "$ODBC_LIB"
- install_name_tool -id "@rpath/libltdl.7.dylib" "$LTDL_LIB"
- install_name_tool -change "$LTDL_LIB" "@rpath/libltdl.7.dylib" "$ODBC_LIB"
- cp "$ODBC_LIB" "$LTDL_LIB" src-tauri/
-
- name: Install Apple certificate (macOS)
if: startsWith(matrix.platform, 'macos')
env:
@@ -101,7 +87,7 @@ jobs:
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev unixodbc-dev
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev
- name: Setup Tauri signing key
shell: bash
diff --git a/README.md b/README.md
index dbad4d33ae..a11f0d7f76 100644
--- a/README.md
+++ b/README.md
@@ -168,19 +168,17 @@ Open `http://localhost:4224` in your browser. Multi-arch images (amd64 / arm64)
**macOS:**
-```bash
-brew install unixodbc
-```
+No additional dependencies required.
**Linux (Ubuntu/Debian):**
```bash
-sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev unixodbc-dev
+sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev
```
**Windows:**
-No additional dependencies required (ODBC is built into Windows).
+No additional dependencies required.
### Development
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 563d32e5a4..ba1660c0f8 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -168,19 +168,17 @@ volumes:
**macOS:**
-```bash
-brew install unixodbc
-```
+无需额外安装。
**Linux (Ubuntu/Debian):**
```bash
-sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev unixodbc-dev
+sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev
```
**Windows:**
-无需额外安装(ODBC 已内置于 Windows)。
+无需额外安装。
### 开发
diff --git a/crates/dbx-core/Cargo.toml b/crates/dbx-core/Cargo.toml
index 9c55515cae..699f543979 100644
--- a/crates/dbx-core/Cargo.toml
+++ b/crates/dbx-core/Cargo.toml
@@ -31,7 +31,6 @@ russh = "0.60"
portpicker = "0.1.1"
csv = "1"
calamine = "0.30.1"
-odbc-api = "25"
rust-gaussdb = { git = "https://github.com/t8y2/rust-gaussdb", branch = "main" }
base64 = "0.22"
async-trait = "0.1"
diff --git a/crates/dbx-core/src/db/mod.rs b/crates/dbx-core/src/db/mod.rs
index 17d7183425..96c465ac05 100644
--- a/crates/dbx-core/src/db/mod.rs
+++ b/crates/dbx-core/src/db/mod.rs
@@ -25,19 +25,6 @@ pub use file_validator::validate_file_path;
pub const CONNECTION_TIMEOUT_SECS: u64 = 5;
pub const TCP_PROBE_TIMEOUT_SECS: u64 = 3;
-pub static ODBC_ENV: std::sync::LazyLock<odbc_api::Environment> = std::sync::LazyLock::new(|| {
- if std::env::var("ODBCSYSINI").is_err() {
- for dir in &["/opt/homebrew/etc", "/usr/local/etc", "/etc"] {
- let path = std::path::Path::new(dir).join("odbcinst.ini");
- if path.exists() {
- std::env::set_var("ODBCSYSINI", dir);
- break;
- }
- }
- }
- odbc_api::Environment::new().expect("Failed to initialize ODBC environment")
-});
-
pub fn connection_timeout() -> Duration {
Duration::from_secs(CONNECTION_TIMEOUT_SECS)
}