mirror of
https://github.com/t8y2/dbx.git
synced 2026-11-01 16:28:46 +00:00
refactor: centralize database type groups into databaseCapabilities.ts
Extract all inline database type checks (schema-aware, pagination style, feature support sets, etc.) into a single source of truth. Adding a new database type now requires updating only one file instead of 15+.
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
import type { SqlCompletionColumn, SqlCompletionTable } from "@/lib/sqlCompletion";
|
||||
import * as api from "@/lib/api";
|
||||
import { isTauriRuntime } from "@/lib/tauriRuntime";
|
||||
import { isSchemaAware } from "@/lib/databaseCapabilities";
|
||||
|
||||
const PINNED_TREE_NODES_STORAGE_KEY = "dbx-pinned-tree-nodes";
|
||||
|
||||
@@ -653,14 +654,7 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
}
|
||||
|
||||
function isSchemaAwareDatabase(connectionId: string): boolean {
|
||||
const dbType = getConfig(connectionId)?.db_type;
|
||||
return (
|
||||
dbType === "postgres" ||
|
||||
dbType === "sqlserver" ||
|
||||
dbType === "oracle" ||
|
||||
dbType === "dameng" ||
|
||||
dbType === "gaussdb"
|
||||
);
|
||||
return isSchemaAware(getConfig(connectionId)?.db_type);
|
||||
}
|
||||
|
||||
async function listCompletionTables(connectionId: string, database: string): Promise<SqlCompletionTable[]> {
|
||||
|
||||
Reference in New Issue
Block a user