feat(completion): support OceanBase Oracle alias columns

Closes #7126
This commit is contained in:
t8y2 committed 2026-08-25 05:33:12 +00:00
1 parent e977e886c3
commit cf652f212e
2 files changed
+86 -2

No files matched your search

+2 -2
View File
@@ -6634,7 +6634,7 @@ export const useConnectionStore = defineStore("connection", () => {
function completionColumnsKey(connectionId: string, database: string, table: string, schema?: string, catalog?: string, context?: { tableQuoted?: boolean; schemaQuoted?: boolean }): string {
const databaseType = getConfig(connectionId)?.db_type;
if (databaseType === "oracle") {
if (databaseType === "oracle" || databaseType === "oceanbase-oracle") {
const normalizedTable = context?.tableQuoted === false ? table.toUpperCase() : table;
const normalizedSchema = schema && context?.schemaQuoted === false ? schema.toUpperCase() : (schema ?? "");
return `${connectionId}:${database}:${catalog ?? ""}:${normalizedSchema}:${normalizedTable}`;
@@ -7736,7 +7736,7 @@ export const useConnectionStore = defineStore("connection", () => {
async function listCompletionColumns(connectionId: string, database: string, table: string, schema?: string, context?: { clientSessionId?: string; version?: number; tableQuoted?: boolean; schemaQuoted?: boolean }, catalog?: string): Promise<SqlCompletionColumn[]> {
const config = getConfig(connectionId);
const oracleIdentifier = config?.db_type === "oracle";
const oracleIdentifier = config?.db_type === "oracle" || config?.db_type === "oceanbase-oracle";
const uppercaseUnquotedIdentifier = oracleIdentifier || config?.db_type === "saphana";
const completionTable = uppercaseUnquotedIdentifier && context?.tableQuoted === false ? table.toUpperCase() : table;
const rawCompletionSchema = schema?.trim() || (config?.db_type === "dameng" ? config.username?.trim() || undefined : undefined);