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:
t8y2
2026-05-07 02:36:50 +08:00
parent fde76d5576
commit 629bd02b0f
11 changed files with 153 additions and 155 deletions
+2 -8
View File
@@ -1,5 +1,6 @@
import { ref } from "vue";
import { useConnectionStore } from "@/stores/connectionStore";
import { isSchemaAware as isSchemaAwareType } from "@/lib/databaseCapabilities";
import * as api from "@/lib/api";
export function useSchemaOptions() {
@@ -13,14 +14,7 @@ export function useSchemaOptions() {
}
function isSchemaAware(connectionId: string): boolean {
const dbType = connectionStore.getConfig(connectionId)?.db_type;
return (
dbType === "postgres" ||
dbType === "sqlserver" ||
dbType === "oracle" ||
dbType === "dameng" ||
dbType === "gaussdb"
);
return isSchemaAwareType(connectionStore.getConfig(connectionId)?.db_type);
}
async function loadSchemaOptions(connectionId: string, database: string) {