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(sqlite): support .db3 file extension

t8y265114c64c4f6
diff --git a/apps/desktop/src/App.vue b/apps/desktop/src/App.vue
index 008662326b..8cc6323d9f 100644
--- a/apps/desktop/src/App.vue
+++ b/apps/desktop/src/App.vue
@@ -592,7 +592,7 @@ async function openPendingSqlFiles() {
}
}
-const DB_EXTENSIONS = [".db", ".sqlite", ".sqlite3", ".duckdb"];
+const DB_EXTENSIONS = [".db", ".db3", ".sqlite", ".sqlite3", ".duckdb"];
function getDbTypeFromPath(path: string): "sqlite" | "duckdb" | null {
const lower = path.toLowerCase();
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue
index e2939582da..9a7234c9dc 100644
--- a/apps/desktop/src/components/connection/ConnectionDialog.vue
+++ b/apps/desktop/src/components/connection/ConnectionDialog.vue
@@ -2001,7 +2001,7 @@ async function createDuckDbFilePath() {
}
function ensureSqliteFileExtension(path: string): string {
- return /\.(db|sqlite|sqlite3)$/i.test(path) ? path : `${path}.db`;
+ return /\.(db|db3|sqlite|sqlite3)$/i.test(path) ? path : `${path}.db`;
}
async function createSqliteFilePath() {
@@ -2010,7 +2010,7 @@ async function createSqliteFilePath() {
const selected = await save({
title: t("connection.createSqliteFile"),
defaultPath: "database.db",
- filters: [{ name: "SQLite", extensions: ["db", "sqlite", "sqlite3"] }],
+ filters: [{ name: "SQLite", extensions: ["db", "db3", "sqlite", "sqlite3"] }],
});
if (!selected) return;
diff --git a/apps/desktop/src/composables/useFileDrop.ts b/apps/desktop/src/composables/useFileDrop.ts
index 3765d25898..77d9ab73e0 100644
--- a/apps/desktop/src/composables/useFileDrop.ts
+++ b/apps/desktop/src/composables/useFileDrop.ts
@@ -7,7 +7,7 @@ import { useToast } from "@/composables/useToast";
import * as api from "@/lib/api";
import type { ConnectionConfig } from "@/types/database";
-const DB_EXTENSIONS = [".db", ".sqlite", ".sqlite3", ".duckdb"];
+const DB_EXTENSIONS = [".db", ".db3", ".sqlite", ".sqlite3", ".duckdb"];
function getDbType(path: string): "sqlite" | "duckdb" | null {
const lower = path.toLowerCase();
diff --git a/src-tauri/src/commands/external_db.rs b/src-tauri/src/commands/external_db.rs
index 8808b61212..ca5b65080e 100644
--- a/src-tauri/src/commands/external_db.rs
+++ b/src-tauri/src/commands/external_db.rs
@@ -1,7 +1,7 @@
use std::path::{Path, PathBuf};
use std::sync::Mutex;
-const DB_EXTENSIONS: &[&str] = &["db", "sqlite", "sqlite3", "duckdb"];
+const DB_EXTENSIONS: &[&str] = &["db", "db3", "sqlite", "sqlite3", "duckdb"];
#[derive(Default)]
pub struct ExternalDbOpenState {
@@ -77,11 +77,11 @@ mod tests {
#[test]
fn filters_db_file_args_case_insensitively() {
let paths = db_file_paths_from_args(
- ["/tmp/a.db", "--flag", "/tmp/b.SQLITE", "/tmp/c.sqlite3", "/tmp/d.duckdb", "/tmp/e.txt"],
+ ["/tmp/a.db", "--flag", "/tmp/b.SQLITE", "/tmp/c.sqlite3", "/tmp/d.duckdb", "/tmp/e.db3", "/tmp/f.txt"],
Path::new("/work"),
);
- assert_eq!(paths, vec!["/tmp/a.db", "/tmp/b.SQLITE", "/tmp/c.sqlite3", "/tmp/d.duckdb"]);
+ assert_eq!(paths, vec!["/tmp/a.db", "/tmp/b.SQLITE", "/tmp/c.sqlite3", "/tmp/d.duckdb", "/tmp/e.db3"]);
}
#[test]
@@ -103,6 +103,7 @@ mod tests {
#[test]
fn is_db_file_path_recognizes_extensions() {
assert!(is_db_file_path(Path::new("test.db")));
+ assert!(is_db_file_path(Path::new("test.db3")));
assert!(is_db_file_path(Path::new("test.sqlite")));
assert!(is_db_file_path(Path::new("test.sqlite3")));
assert!(is_db_file_path(Path::new("test.duckdb")));