mirror of
https://github.com/t8y2/dbx.git
synced 2026-11-01 08:26:35 +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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user