fix(sqlite): support .db3 file extension
This commit is contained in:
1 parent
95b03998d1
commit
65114c64c4
4 files changed
+8
-7
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user