@@ -2560,6 +2578,10 @@ function openExternalUrl(url: string) {
{{ t("connection.jdbcPluginHint") }}
+
+
+
+
+
+
+
+
+
+
{{ t("connection.jdbcManualClasspath") }}
+
+ {{ t("connection.jdbcManualClasspathCount", { count: jdbcManualClasspathCount }) }}
+
+
+
+
+
+
+
+
+
+
+ {{ t("connection.jdbcDriverBrowse") }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t("connection.jdbcPluginHint") }}
+
+
+
+
+
+
+
+
diff --git a/apps/desktop/src/components/editor/QueryEditor.vue b/apps/desktop/src/components/editor/QueryEditor.vue
index 0e1c1b4cb4..9661682ef1 100644
--- a/apps/desktop/src/components/editor/QueryEditor.vue
+++ b/apps/desktop/src/components/editor/QueryEditor.vue
@@ -40,6 +40,7 @@ import { trimmedSelectionLayer } from "@/lib/codemirrorTrimmedSelectionLayer";
import { selectionMatchOccurrences } from "@/lib/codemirrorSelectionMatches";
import { createDbxCodeMirrorSqlDialect } from "@/lib/codemirrorSqlDialect";
import { isSchemaAware, isSingleDatabase } from "@/lib/databaseFeatureSupport";
+import { usesLocalOnlyEditorCompletionMetadata, usesOnDemandOnlyEditorColumnMetadata } from "@/lib/completionMetadataPolicy";
import { qualifiedTableNameAtSqlPosition } from "@/lib/queryCursorTableTarget";
import * as api from "@/lib/api";
import { areSqlSemanticDiagnosticsEqual, buildSqlParserErrorDiagnostic, buildSqlSemanticDiagnostics, shouldRunSqlSemanticDiagnostics, type SqlSemanticDiagnostic } from "@/lib/sqlSemanticDiagnostics";
@@ -579,6 +580,14 @@ function supportsDatabaseQualifierCompletion(): boolean {
return !!props.databaseType && !isSchemaAware(props.databaseType) && !isSingleDatabase(props.databaseType);
}
+function usesLocalOnlyCompletionMetadata(): boolean {
+ return usesLocalOnlyEditorCompletionMetadata(props.databaseType);
+}
+
+function usesOnDemandOnlyCompletionColumns(): boolean {
+ return usesOnDemandOnlyEditorColumnMetadata(props.databaseType);
+}
+
function completionMetadataTarget(table: { name: string; schema?: string | null }): { database: string; schema?: string } | null {
if (props.database == null) return null;
if (supportsDatabaseQualifierCompletion() && table.schema) {
@@ -711,11 +720,13 @@ async function resolveSqlHoverTooltip(currentView: EditorViewType, pos: number)
try {
if (cachedTables.length === 0) {
- cachedTables = await connectionStore.listCompletionTables(props.connectionId, props.database, name, MAX_COMPLETION_TABLES, props.schema);
+ cachedTables = usesLocalOnlyCompletionMetadata()
+ ? connectionStore.lookupLocalCompletionTables(props.connectionId, props.database, name, MAX_COMPLETION_TABLES, props.schema)
+ : await connectionStore.listCompletionTables(props.connectionId, props.database, name, MAX_COMPLETION_TABLES, props.schema);
}
let table = matchTable(identifier, cachedTables) ?? matchTable(name, cachedTables);
- if (!table) {
+ if (!table && !usesLocalOnlyCompletionMetadata()) {
const hoverTables = await connectionStore.listCompletionTables(props.connectionId, props.database, name, MAX_COMPLETION_TABLES, props.schema);
cachedTables = [...cachedTables, ...hoverTables];
table = matchTable(identifier, hoverTables) ?? matchTable(name, hoverTables);
@@ -824,6 +835,12 @@ async function enrichSemanticDiagnosticTables(tables: SqlTableReference[]) {
continue;
}
try {
+ if (usesLocalOnlyCompletionMetadata()) {
+ const matches = connectionStore.lookupLocalCompletionTables(props.connectionId, props.database, table.name, MAX_COMPLETION_TABLES, props.schema);
+ const match = matches.find((item) => item.name.toLowerCase() === table.name.toLowerCase());
+ enriched.push(match?.schema ? { ...table, schema: match.schema } : table);
+ continue;
+ }
const matches = await connectionStore.listCompletionTables(props.connectionId, props.database, table.name, MAX_COMPLETION_TABLES, props.schema);
cachedTables = [...cachedTables, ...matches];
const match = matches.find((item) => item.name.toLowerCase() === table.name.toLowerCase());
@@ -875,7 +892,9 @@ async function refreshSemanticDiagnostics() {
if (runId !== semanticDiagnosticRunId) return;
const tables = await enrichSemanticDiagnosticTables(analysis.tables);
- await Promise.all(tables.map((table) => ensureColumnsForTable(table)));
+ if (!usesOnDemandOnlyCompletionColumns()) {
+ await Promise.all(tables.map((table) => ensureColumnsForTable(table)));
+ }
if (runId !== semanticDiagnosticRunId) return;
const enrichedAnalysis: SqlReferenceAnalysis = { ...analysis, tables };
@@ -1359,10 +1378,12 @@ function buildLocalSqlCompletionResult(completionContext: ReturnType