Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

feat(editor): 对象悬浮查找范围覆盖存储过程/函数 (#12797)

Mo-Mooree6f29b4aa01b
diff --git a/apps/desktop/src/components/editor/__tests__/useQueryEditorObjectNavigation.spec.ts b/apps/desktop/src/components/editor/__tests__/useQueryEditorObjectNavigation.spec.ts
index ef3a646862..15ac3ad73f 100644
--- a/apps/desktop/src/components/editor/__tests__/useQueryEditorObjectNavigation.spec.ts
+++ b/apps/desktop/src/components/editor/__tests__/useQueryEditorObjectNavigation.spec.ts
@@ -25,12 +25,13 @@ afterEach(() => {
vi.restoreAllMocks();
});
-async function createHarness(overrides: Partial<QueryEditorProps> = {}, semanticCompletionEnabled = false) {
+async function createHarness(overrides: Partial<QueryEditorProps> = {}, semanticCompletionEnabled = false, tableHoverLookupMode: "current" | "fallback" | "always" = "current") {
const props = reactive<QueryEditorProps>({ modelValue: "SELECT * FROM users", databaseType: "postgres", dialect: "postgres", connectionId: "connection", database: "demo", schema: "public", ...overrides });
const host = document.createElement("div");
document.body.append(host);
const currentView = new EditorView({ parent: host, state: EditorState.create({ doc: props.modelValue }) });
- const position = vi.spyOn(currentView, "posAtCoords").mockReturnValue(props.modelValue.lastIndexOf("users") + 2);
+ const defaultToken = props.modelValue.includes("users") ? "users" : (props.modelValue.match(/[A-Za-z_][\w$]*/g)?.at(-1) ?? "users");
+ const position = vi.spyOn(currentView, "posAtCoords").mockReturnValue(Math.max(0, props.modelValue.lastIndexOf(defaultToken)) + Math.min(2, defaultToken.length));
vi.spyOn(currentView, "focus").mockImplementation(() => {});
const view = shallowRef<EditorView | null>(currentView);
const store = {
@@ -47,7 +48,7 @@ async function createHarness(overrides: Partial<QueryEditorProps> = {}, semantic
const runtime = createQueryEditorCodeMirrorRuntime();
await runtime.load();
runtime.setResultSourceRangeEffect = StateEffect.define<{ from: number; to: number } | null>();
- const settings = { editorSettings: { tableHoverLookupMode: "current" } } as Options["settingsStore"];
+ const settings = { editorSettings: { tableHoverLookupMode } } as Options["settingsStore"];
const emit = vi.fn();
const dismissHoverTooltip = vi.fn();
const startEditorSelectionDrag = vi.fn(() => false);
@@ -128,6 +129,60 @@ describe("QueryEditor object navigation ownership", () => {
expect(store.listCompletionTables).not.toHaveBeenCalled();
});
+ it("falls back across schemas for unqualified routines in fallback mode", async () => {
+ const sql = "CALL cleanup()";
+ const { store, position, emit, click } = await createHarness({ modelValue: sql, schema: "public" }, false, "fallback");
+ position.mockReturnValue(sql.indexOf("cleanup") + 2);
+ store.listCompletionObjects.mockImplementation(async (_connectionId, _database, _filter, _limit, schema, _parent, globalSearch) => {
+ if (globalSearch) return [{ name: "cleanup", schema: "reporting", type: "procedure" }];
+ if (schema === "public") return [];
+ return [];
+ });
+ await click();
+ expect(store.listCompletionObjects).toHaveBeenCalledWith("connection", "demo", "cleanup", 20, "public", undefined, false, "public", ["routine"]);
+ expect(store.listCompletionObjects).toHaveBeenCalledWith("connection", "demo", "cleanup", 20, undefined, undefined, true, "public", ["routine"]);
+ expect(emit).toHaveBeenCalledWith("openObjectSource", expect.objectContaining({ name: "cleanup", schema: "reporting", type: "procedure" }), false);
+ });
+
+ it("does not cross schemas for unqualified routines in current mode", async () => {
+ const sql = "CALL cleanup()";
+ const { store, position, emit, click } = await createHarness({ modelValue: sql, schema: "public" }, false, "current");
+ position.mockReturnValue(sql.indexOf("cleanup") + 2);
+ store.listCompletionObjects.mockResolvedValue([]);
+ await click();
+ expect(store.listCompletionObjects).toHaveBeenCalledWith("connection", "demo", "cleanup", 20, "public", undefined, false, "public", ["routine"]);
+ expect(store.listCompletionObjects.mock.calls.some((call) => call[6] === true)).toBe(false);
+ expect(emit).toHaveBeenCalledWith("openObjectSource", expect.objectContaining({ name: "cleanup", schema: "public", type: "procedure" }), false);
+ });
+
+ it("searches all schemas first for unqualified routines in always mode", async () => {
+ const sql = "CALL cleanup()";
+ const { store, position, emit, click } = await createHarness({ modelValue: sql, schema: "public" }, false, "always");
+ position.mockReturnValue(sql.indexOf("cleanup") + 2);
+ store.listCompletionObjects.mockResolvedValue([
+ { name: "cleanup", schema: "reporting", type: "procedure" },
+ { name: "cleanup", schema: "public", type: "procedure" },
+ ]);
+ await click();
+ expect(store.listCompletionObjects).toHaveBeenCalledWith("connection", "demo", "cleanup", 20, undefined, undefined, true, "public", ["routine"]);
+ expect(store.listCompletionObjects.mock.calls.some((call) => call[4] === "public" && call[6] === false)).toBe(false);
+ expect(emit).toHaveBeenCalledWith("openObjectSource", expect.objectContaining({ name: "cleanup", schema: "public", type: "procedure" }), false);
+ });
+
+ it("keeps qualified routine lookups scoped without global fallback", async () => {
+ const sql = "CALL reporting.cleanup()";
+ const { store, position, emit, click } = await createHarness({ modelValue: sql, schema: "public" }, false, "fallback");
+ position.mockReturnValue(sql.indexOf("cleanup") + 2);
+ store.listCompletionObjects.mockImplementation(async (_connectionId, _database, _filter, _limit, schema, parent) => {
+ if (schema === "public" && parent === "reporting") return [];
+ if (schema === "reporting") return [{ name: "cleanup", schema: "reporting", type: "procedure" }];
+ return [];
+ });
+ await click();
+ expect(store.listCompletionObjects.mock.calls.some((call) => call[6] === true)).toBe(false);
+ expect(emit).toHaveBeenCalledWith("openObjectSource", expect.objectContaining({ name: "cleanup", schema: "reporting", type: "procedure" }), false);
+ });
+
it("jumps to CTE definitions without querying physical table metadata", async () => {
const sql = "WITH picked AS (SELECT id FROM users) SELECT id FROM picked";
const { position, currentView, runtime, emit, click, store } = await createHarness({ modelValue: sql }, true);
diff --git a/apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts b/apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts
index f211729f70..268e03561c 100644
--- a/apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts
+++ b/apps/desktop/src/components/editor/useQueryEditorObjectNavigation.ts
@@ -2,11 +2,11 @@ import type { EditorView as EditorViewType } from "@codemirror/view";
import { getSqlCompletionContext } from "@/lib/sql/sqlCompletion";
import { findCteColumnResolution, findCteReferenceAt } from "@/lib/sql/semantic/cteNavigation";
import { extractIdentifierDetailsAt, isSqlKeyword, matchSqlObject, matchTable, resolveSqlObjectNavigationIdentity, sqlObjectNavigationTarget, sqlObjectNavigationTargetFromIdentity, sqlObjectNavigationTypeFromCompletionObjectType, type SqlObjectNavigationTarget } from "@/lib/sql/sqlNavigation";
-import { matchHoverTableCandidates, resolveHoverTableLookupTarget } from "@/lib/editor/hoverTableLookup";
+import { matchHoverTableCandidates, pickHoverObjectMatch, resolveHoverTableLookupTarget } from "@/lib/editor/hoverTableLookup";
import { stabilizeUnfocusedQueryEditorPointerDown } from "@/lib/editor/queryEditorUnfocusedPointer";
import { usesQueryEditorObjectNavigationModifier } from "@/lib/editor/queryEditorPointerSelection";
import { queryTableNavigationTargetAtSqlPosition } from "@/lib/sql/queryCursorTableTarget";
-import type { SqlCompletionReferencedTable, SqlCompletionTable } from "@/lib/sql/sqlCompletion";
+import type { SqlCompletionObject, SqlCompletionReferencedTable, SqlCompletionTable } from "@/lib/sql/sqlCompletion";
import type { Ref, ShallowRef } from "vue";
import type { QueryEditorProps } from "./queryEditorTypes";
import type { useConnectionStore } from "@/stores/connectionStore";
@@ -241,15 +241,18 @@ export function useQueryEditorObjectNavigation(options: QueryEditorObjectNavigat
return true;
};
- // 1b. Local routine cache — skip for pure relation column lists (INSERT INTO t(...)).
+ // 1b. Routine cache — skip for pure relation column lists (INSERT INTO t(...)).
+ // Unqualified names honor tableHoverLookupMode (same scope as tables); qualified names stay scoped.
if (!isRelationColumnList) {
- const localObjects = connectionStore.lookupLocalCompletionObjects(props.connectionId!, props.database!, objectNameFilter, MAX_COMPLETION_TABLES, props.schema);
- let matchedObject = matchSqlObject(identifier, localObjects);
- if (matchedObject && openMatchedObject(matchedObject)) return;
+ const matchNavigationObject = (objects: readonly SqlCompletionObject[]) => (identity.parts.length === 1 ? pickHoverObjectMatch(objectNameFilter, objects, props.schema) : matchSqlObject(identifier, objects));
+ const unqualifiedObjectSchema = tableLookup.preferGlobalFirst ? undefined : (tableLookup.schema ?? props.schema);
- if (!usesLocalOnlyCompletionMetadata()) {
- // Disambiguate schema.routine vs package.member with small scoped lookups (no global scan).
- if (identity.parts.length === 2 && identity.qualifier) {
+ if (identity.parts.length === 2 && identity.qualifier) {
+ const localObjects = connectionStore.lookupLocalCompletionObjects(props.connectionId!, props.database!, objectNameFilter, MAX_COMPLETION_TABLES, props.schema);
+ let matchedObject = matchNavigationObject(localObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+
+ if (!usesLocalOnlyCompletionMetadata()) {
// Prefer package.member under session schema (Oracle common: PKG.MEMBER()).
const packageObjects = await connectionStore.listCompletionObjects(props.connectionId!, props.database!, objectNameFilter, 20, props.schema, identity.qualifier, false, props.schema, ["routine"]);
matchedObject = matchSqlObject(identifier, packageObjects);
@@ -259,11 +262,45 @@ export function useQueryEditorObjectNavigation(options: QueryEditorObjectNavigat
const schemaObjects = await connectionStore.listCompletionObjects(props.connectionId!, props.database!, objectNameFilter, 20, identity.qualifier, undefined, false, props.schema, ["routine"]);
matchedObject = matchSqlObject(identifier, schemaObjects);
if (matchedObject && openMatchedObject(matchedObject)) return;
- } else {
+ }
+ } else if (identity.parts.length >= 3) {
+ const localObjects = connectionStore.lookupLocalCompletionObjects(props.connectionId!, props.database!, objectNameFilter, MAX_COMPLETION_TABLES, objectSchemaHint);
+ let matchedObject = matchNavigationObject(localObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+
+ if (!usesLocalOnlyCompletionMetadata()) {
const scopedObjects = await connectionStore.listCompletionObjects(props.connectionId!, props.database!, objectNameFilter, 20, objectSchemaHint, objectParentHint, false, props.schema, ["routine"]);
matchedObject = matchSqlObject(identifier, scopedObjects);
if (matchedObject && openMatchedObject(matchedObject)) return;
}
+ } else {
+ const localObjects = connectionStore.lookupLocalCompletionObjects(props.connectionId!, props.database!, objectNameFilter, MAX_COMPLETION_TABLES, unqualifiedObjectSchema);
+ let matchedObject = matchNavigationObject(localObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+
+ if (!matchedObject && tableLookup.allowGlobalFallback && !tableLookup.preferGlobalFirst) {
+ const localGlobalObjects = connectionStore.lookupLocalCompletionObjects(props.connectionId!, props.database!, objectNameFilter, MAX_COMPLETION_TABLES, undefined);
+ matchedObject = matchNavigationObject(localGlobalObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+ }
+
+ if (!usesLocalOnlyCompletionMetadata()) {
+ if (!tableLookup.preferGlobalFirst) {
+ const scopedObjects = await connectionStore.listCompletionObjects(props.connectionId!, props.database!, objectNameFilter, 20, unqualifiedObjectSchema, objectParentHint, false, props.schema, ["routine"]);
+ matchedObject = matchNavigationObject(scopedObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+
+ if (tableLookup.allowGlobalFallback) {
+ const globalObjects = await connectionStore.listCompletionObjects(props.connectionId!, props.database!, objectNameFilter, 20, undefined, objectParentHint, true, props.schema, ["routine"]);
+ matchedObject = matchNavigationObject(globalObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+ }
+ } else {
+ const globalObjects = await connectionStore.listCompletionObjects(props.connectionId!, props.database!, objectNameFilter, 20, undefined, objectParentHint, true, props.schema, ["routine"]);
+ matchedObject = matchNavigationObject(globalObjects);
+ if (matchedObject && openMatchedObject(matchedObject)) return;
+ }
+ }
}
}
diff --git a/apps/desktop/src/i18n/locales/az.ts b/apps/desktop/src/i18n/locales/az.ts
index b67b935229..7634a0573c 100644
--- a/apps/desktop/src/i18n/locales/az.ts
+++ b/apps/desktop/src/i18n/locales/az.ts
@@ -8159,14 +8159,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Aktiv olduqda, obyekt bələdçisində obyektə kliklədikdə sağ tərəfdə təfərrüat və ya mənbə paneli avtomatik açılır. Deaktiv olduqda, panel açılmadan sətir seçilir.",
showTableDdlHoverPreview: "Kursor üzərinə gətirildikdə cədvəlin DDL-ini göstər",
showTableDdlHoverPreviewDescription: "SQL redaktorunda kursor cədvəl adının üzərinə gətirildikdə DDL önbaxışını göstər.",
- tableHoverLookupMode: "Cədvəl üzərinə gəlmə axtarış əhatəsi",
- tableHoverLookupModeDescription: "SQL redaktorunda ixtisassız cədvəl adlarına gəldikdə və ya Ctrl/Cmd+klik edəndə sxemin necə həll olunması.",
+ tableHoverLookupMode: "Obyekt üzərinə gəlmə axtarış əhatəsi",
+ tableHoverLookupModeDescription: "SQL redaktorunda ixtisassız cədvəl, prosedur və funksiya adlarına gəldikdə və ya Ctrl/Cmd+klik edəndə sxemin necə həll olunması.",
tableHoverLookupModeCurrent: "Yalnız cari sxem",
tableHoverLookupModeFallback: "Əvvəl cari sxem, sonra hamısı",
tableHoverLookupModeAlways: "Əvvəl bütün sxemlər",
- tableHoverLookupModeCurrentDescription: "Cədvəlləri yalnız alət panelində seçilmiş sxemdə axtarır.",
- tableHoverLookupModeFallbackDescription: "Əvvəl seçilmiş sxemi yoxlayır; tapılmasa cədvəl adına görə digər sxemləri axtarır.",
- tableHoverLookupModeAlwaysDescription: "Cədvəl adına görə bütün sxemləri əvvəl axtarır. Çarpaz sxem proseduru yazarkən faydalıdır.",
+ tableHoverLookupModeCurrentDescription: "Cədvəl və rutinləri yalnız alət panelində seçilmiş sxemdə axtarır.",
+ tableHoverLookupModeFallbackDescription: "Əvvəl seçilmiş sxemi yoxlayır; tapılmasa obyekt adına görə digər sxemləri axtarır.",
+ tableHoverLookupModeAlwaysDescription: "Obyekt adına görə bütün sxemləri əvvəl axtarır. Çarpaz sxem SQL yazarkən faydalıdır.",
sqlVariableSyntax: "SQL dəyişənlərinin və yer tutucularının əvəzlənməsi",
sqlVariableSyntaxDescription: "DBX-in SQL-i işlətməzdən əvvəl hansı dəyişən və yer tutucu sintaksislərini əvəzləyəcəyini verilənlər bazası növünə görə seçin. Hamısı standart olaraq aktivdir.",
sqlVariableSubstitutionEnabled: "Aktiv",
diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.ts
index 09771ad531..e713085054 100644
--- a/apps/desktop/src/i18n/locales/en.ts
+++ b/apps/desktop/src/i18n/locales/en.ts
@@ -9856,14 +9856,14 @@ export default {
objectBrowserAutoOpenDetailPanelDescription: "When enabled, clicking an object in the object browser automatically opens its detail or source panel on the right. When disabled, rows are selected without opening the panel.",
showTableDdlHoverPreview: "Show table DDL on hover",
showTableDdlHoverPreviewDescription: "Show a DDL preview when hovering over a table name in the SQL editor.",
- tableHoverLookupMode: "Table hover lookup scope",
- tableHoverLookupModeDescription: "How unqualified table names are resolved when hovering or Ctrl/Cmd+clicking in the SQL editor.",
+ tableHoverLookupMode: "Object hover lookup scope",
+ tableHoverLookupModeDescription: "How unqualified table, procedure, and function names are resolved when hovering or Ctrl/Cmd+clicking in the SQL editor.",
tableHoverLookupModeCurrent: "Current schema only",
tableHoverLookupModeFallback: "Current schema, then all schemas",
tableHoverLookupModeAlways: "All schemas first",
- tableHoverLookupModeCurrentDescription: "Only look up tables in the schema selected in the toolbar.",
- tableHoverLookupModeFallbackDescription: "Try the selected schema first, then search other schemas by table name if not found.",
- tableHoverLookupModeAlwaysDescription: "Search all schemas by table name first. Prefer when writing cross-schema procedures.",
+ tableHoverLookupModeCurrentDescription: "Only look up tables and routines in the schema selected in the toolbar.",
+ tableHoverLookupModeFallbackDescription: "Try the selected schema first, then search other schemas by object name if not found.",
+ tableHoverLookupModeAlwaysDescription: "Search all schemas by object name first. Prefer when writing cross-schema SQL.",
sqlVariableSyntax: "SQL variable & placeholder substitution",
sqlVariableSyntaxDescription: "Choose which variable and placeholder syntaxes DBX substitutes before running SQL, per database type. All are enabled by default.",
sqlVariableSubstitutionEnabled: "Enabled",
diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.ts
index ae434038a4..aceeb90c6f 100644
--- a/apps/desktop/src/i18n/locales/es.ts
+++ b/apps/desktop/src/i18n/locales/es.ts
@@ -8817,14 +8817,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Cuando está activado, al hacer clic en un objeto del explorador de objetos se abre automáticamente su panel de detalles o código fuente a la derecha. Cuando está desactivado, las filas se seleccionan sin abrir el panel.",
showTableDdlHoverPreview: "Mostrar DDL de tabla al pasar el cursor",
showTableDdlHoverPreviewDescription: "Muestra una vista previa del DDL al pasar el cursor sobre el nombre de una tabla en el editor SQL.",
- tableHoverLookupMode: "Alcance de búsqueda al pasar el cursor",
- tableHoverLookupModeDescription: "Cómo se resuelven los nombres de tabla sin calificar al pasar el cursor o al hacer Ctrl/Cmd+clic en el editor SQL.",
+ tableHoverLookupMode: "Alcance de búsqueda de objetos al pasar el cursor",
+ tableHoverLookupModeDescription: "Cómo se resuelven los nombres sin calificar de tablas, procedimientos y funciones al pasar el cursor o al hacer Ctrl/Cmd+clic en el editor SQL.",
tableHoverLookupModeCurrent: "Solo esquema actual",
tableHoverLookupModeFallback: "Esquema actual, luego todos",
tableHoverLookupModeAlways: "Todos los esquemas primero",
- tableHoverLookupModeCurrentDescription: "Busca tablas solo en el esquema seleccionado en la barra de herramientas.",
- tableHoverLookupModeFallbackDescription: "Prueba primero el esquema seleccionado; si no aparece, busca por nombre en otros esquemas.",
- tableHoverLookupModeAlwaysDescription: "Busca primero por nombre en todos los esquemas. Útil al escribir procedimientos entre esquemas.",
+ tableHoverLookupModeCurrentDescription: "Busca tablas y rutinas solo en el esquema seleccionado en la barra de herramientas.",
+ tableHoverLookupModeFallbackDescription: "Prueba primero el esquema seleccionado; si no aparece, busca por nombre de objeto en otros esquemas.",
+ tableHoverLookupModeAlwaysDescription: "Busca primero por nombre de objeto en todos los esquemas. Útil al escribir SQL entre esquemas.",
sqlVariableSyntax: "Sustitución de variables y marcadores SQL",
sqlVariableSyntaxDescription: "Elige qué sintaxis de variables y marcadores sustituye DBX antes de ejecutar SQL, por tipo de base de datos. Todas están habilitadas de forma predeterminada.",
sqlVariableSubstitutionEnabled: "Activada",
diff --git a/apps/desktop/src/i18n/locales/id.ts b/apps/desktop/src/i18n/locales/id.ts
index fd18b1c611..2228c07b0e 100644
--- a/apps/desktop/src/i18n/locales/id.ts
+++ b/apps/desktop/src/i18n/locales/id.ts
@@ -8963,14 +8963,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Saat diaktifkan, mengeklik objek di peramban objek akan otomatis membuka panel detail atau sumber di sebelah kanan. Saat dinonaktifkan, baris dipilih tanpa membuka panel.",
showTableDdlHoverPreview: "Tampilkan DDL tabel saat hover",
showTableDdlHoverPreviewDescription: "Tampilkan pratinjau DDL saat kursor diarahkan ke nama tabel di editor SQL.",
- tableHoverLookupMode: "Cakupan pencarian hover tabel",
- tableHoverLookupModeDescription: "Bagaimana nama tabel tanpa kualifikasi diselesaikan saat hover atau Ctrl/Cmd+klik di editor SQL.",
+ tableHoverLookupMode: "Cakupan pencarian hover objek",
+ tableHoverLookupModeDescription: "Bagaimana nama tabel, prosedur, dan fungsi tanpa kualifikasi diselesaikan saat hover atau Ctrl/Cmd+klik di editor SQL.",
tableHoverLookupModeCurrent: "Hanya skema saat ini",
tableHoverLookupModeFallback: "Skema saat ini, lalu semua skema",
tableHoverLookupModeAlways: "Semua skema terlebih dahulu",
- tableHoverLookupModeCurrentDescription: "Hanya mencari tabel pada skema yang dipilih di bilah alat.",
- tableHoverLookupModeFallbackDescription: "Coba skema terpilih terlebih dahulu, lalu cari skema lain berdasarkan nama tabel jika tidak ditemukan.",
- tableHoverLookupModeAlwaysDescription: "Cari semua skema berdasarkan nama tabel terlebih dahulu. Pilih ini saat menulis prosedur lintas skema.",
+ tableHoverLookupModeCurrentDescription: "Hanya mencari tabel dan rutin pada skema yang dipilih di bilah alat.",
+ tableHoverLookupModeFallbackDescription: "Coba skema terpilih terlebih dahulu, lalu cari skema lain berdasarkan nama objek jika tidak ditemukan.",
+ tableHoverLookupModeAlwaysDescription: "Cari semua skema berdasarkan nama objek terlebih dahulu. Pilih ini saat menulis SQL lintas skema.",
sqlVariableSyntax: "Substitusi variabel & placeholder SQL",
sqlVariableSyntaxDescription: "Pilih sintaks variabel dan placeholder mana yang disubstitusi DBX sebelum menjalankan SQL, per jenis database. Semuanya diaktifkan secara default.",
sqlVariableSubstitutionEnabled: "Diaktifkan",
diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.ts
index 5431764f12..f83449782a 100644
--- a/apps/desktop/src/i18n/locales/it.ts
+++ b/apps/desktop/src/i18n/locales/it.ts
@@ -8580,14 +8580,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Quando abilitato, cliccando su un oggetto nel browser degli oggetti si apre automaticamente il relativo pannello dei dettagli o del codice sorgente a destra. Quando disabilitato, le righe vengono selezionate senza aprire il pannello.",
showTableDdlHoverPreview: "Mostra DDL tabella al passaggio del mouse",
showTableDdlHoverPreviewDescription: "Mostra un'anteprima DDL quando si passa sul nome di una tabella nell'editor SQL.",
- tableHoverLookupMode: "Ambito di ricerca al passaggio del mouse",
- tableHoverLookupModeDescription: "Come risolvere i nomi di tabella non qualificati al passaggio del mouse o con Ctrl/Cmd+clic nell'editor SQL.",
+ tableHoverLookupMode: "Ambito di ricerca oggetti al passaggio del mouse",
+ tableHoverLookupModeDescription: "Come risolvere i nomi non qualificati di tabelle, procedure e funzioni al passaggio del mouse o con Ctrl/Cmd+clic nell'editor SQL.",
tableHoverLookupModeCurrent: "Solo schema corrente",
tableHoverLookupModeFallback: "Schema corrente, poi tutti",
tableHoverLookupModeAlways: "Tutti gli schemi prima",
- tableHoverLookupModeCurrentDescription: "Cerca le tabelle solo nello schema selezionato nella barra degli strumenti.",
- tableHoverLookupModeFallbackDescription: "Prova prima lo schema selezionato; se non trovato, cerca per nome in altri schemi.",
- tableHoverLookupModeAlwaysDescription: "Cerca prima per nome in tutti gli schemi. Utile per procedure cross-schema.",
+ tableHoverLookupModeCurrentDescription: "Cerca tabelle e routine solo nello schema selezionato nella barra degli strumenti.",
+ tableHoverLookupModeFallbackDescription: "Prova prima lo schema selezionato; se non trovato, cerca per nome oggetto in altri schemi.",
+ tableHoverLookupModeAlwaysDescription: "Cerca prima per nome oggetto in tutti gli schemi. Utile per SQL cross-schema.",
sqlVariableSyntax: "Sostituzione di variabili e segnaposto SQL",
sqlVariableSyntaxDescription: "Scegli quali sintassi di variabili e segnaposto DBX sostituisce prima di eseguire SQL, per tipo di database. Tutte abilitate per impostazione predefinita.",
sqlVariableSubstitutionEnabled: "Attiva",
diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.ts
index 7554e8deae..90576973b7 100644
--- a/apps/desktop/src/i18n/locales/ja.ts
+++ b/apps/desktop/src/i18n/locales/ja.ts
@@ -8577,14 +8577,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "有効にすると、オブジェクトブラウザでオブジェクトをクリックしたときに右側に詳細またはソースパネルが自動的に開きます。無効にすると、パネルを開かずに選択のみ行います。",
showTableDdlHoverPreview: "ホバー時にテーブル DDL を表示",
showTableDdlHoverPreviewDescription: "SQL エディターでテーブル名にホバーしたときに DDL プレビューを表示します。",
- tableHoverLookupMode: "テーブルホバーの検索範囲",
- tableHoverLookupModeDescription: "SQL エディターで未修飾のテーブル名にホバーまたは Ctrl/Cmd+クリックしたときのスキーマ解決方法。",
+ tableHoverLookupMode: "オブジェクトホバーの検索範囲",
+ tableHoverLookupModeDescription: "SQL エディターで未修飾のテーブル・プロシージャ・関数名にホバーまたは Ctrl/Cmd+クリックしたときのスキーマ解決方法。",
tableHoverLookupModeCurrent: "現在のスキーマのみ",
tableHoverLookupModeFallback: "現在のスキーマ優先、次に全体",
tableHoverLookupModeAlways: "全スキーマを先に検索",
- tableHoverLookupModeCurrentDescription: "ツールバーで選択中のスキーマ内だけを検索します。",
- tableHoverLookupModeFallbackDescription: "選択中のスキーマを先に試し、見つからなければテーブル名で他スキーマも検索します。",
- tableHoverLookupModeAlwaysDescription: "テーブル名で全スキーマを先に検索します。クロススキーマのプロシージャ作成向け。",
+ tableHoverLookupModeCurrentDescription: "ツールバーで選択中のスキーマ内だけでテーブルとルーチンを検索します。",
+ tableHoverLookupModeFallbackDescription: "選択中のスキーマを先に試し、見つからなければオブジェクト名で他スキーマも検索します。",
+ tableHoverLookupModeAlwaysDescription: "オブジェクト名で全スキーマを先に検索します。クロススキーマの SQL 作成向け。",
sqlVariableSyntax: "SQL 変数・プレースホルダー置換",
sqlVariableSyntaxDescription: "SQL 実行前に置換する変数・プレースホルダー構文をデータベース種別ごとに選択します。既定ではすべて有効です。",
sqlVariableSubstitutionEnabled: "置換を有効化",
diff --git a/apps/desktop/src/i18n/locales/ko.ts b/apps/desktop/src/i18n/locales/ko.ts
index 3bcbf76f68..97bfe0fbd0 100644
--- a/apps/desktop/src/i18n/locales/ko.ts
+++ b/apps/desktop/src/i18n/locales/ko.ts
@@ -7704,14 +7704,14 @@ export default withEnglishFallback({
editorTab: "편집기",
showTableDdlHoverPreview: "호버 시 테이블 DDL 표시",
showTableDdlHoverPreviewDescription: "SQL 편집기에서 테이블 이름에 마우스를 올리면 DDL 미리 보기를 표시합니다.",
- tableHoverLookupMode: "테이블 호버 조회 범위",
- tableHoverLookupModeDescription: "SQL 편집기에서 한정되지 않은 테이블 이름에 호버하거나 Ctrl/Cmd+클릭할 때 스키마를 해석하는 방식입니다.",
+ tableHoverLookupMode: "객체 호버 조회 범위",
+ tableHoverLookupModeDescription: "SQL 편집기에서 한정되지 않은 테이블·프로시저·함수 이름에 호버하거나 Ctrl/Cmd+클릭할 때 스키마를 해석하는 방식입니다.",
tableHoverLookupModeCurrent: "현재 스키마만",
tableHoverLookupModeFallback: "현재 스키마 우선, 이후 전체",
tableHoverLookupModeAlways: "전체 스키마 우선 검색",
- tableHoverLookupModeCurrentDescription: "도구 모음에서 선택한 스키마에서만 테이블을 찾습니다.",
- tableHoverLookupModeFallbackDescription: "선택한 스키마를 먼저 찾고, 없으면 테이블 이름으로 다른 스키마도 검색합니다.",
- tableHoverLookupModeAlwaysDescription: "테이블 이름으로 모든 스키마를 먼저 검색합니다. 크로스 스키마 프로시저 작성에 적합합니다.",
+ tableHoverLookupModeCurrentDescription: "도구 모음에서 선택한 스키마에서만 테이블과 루틴을 찾습니다.",
+ tableHoverLookupModeFallbackDescription: "선택한 스키마를 먼저 찾고, 없으면 객체 이름으로 다른 스키마도 검색합니다.",
+ tableHoverLookupModeAlwaysDescription: "객체 이름으로 모든 스키마를 먼저 검색합니다. 크로스 스키마 SQL 작성에 적합합니다.",
globalConnectTimeout: "전역 연결 제한 시간 (초)",
globalConnectTimeoutDescription: "전역 설정을 상속하는 연결에 사용됩니다.",
globalQueryTimeout: "전역 쿼리 제한 시간 (초)",
diff --git a/apps/desktop/src/i18n/locales/pl.ts b/apps/desktop/src/i18n/locales/pl.ts
index 72874274b0..e6a6be9cf3 100644
--- a/apps/desktop/src/i18n/locales/pl.ts
+++ b/apps/desktop/src/i18n/locales/pl.ts
@@ -9000,14 +9000,14 @@ export default withEnglishFallback({
clickTableNavigationTargetDescription: "Gdy włączone, kliknięcie nazwy tabeli z klawiszem Ctrl/Cmd otwiera edytor struktury tabeli (DDL). Gdy wyłączone, otwiera widok danych tabeli.",
showTableDdlHoverPreview: "Pokaż DDL tabeli po najechaniu",
showTableDdlHoverPreviewDescription: "Pokazuj podgląd DDL po najechaniu kursorem na nazwę tabeli w edytorze SQL.",
- tableHoverLookupMode: "Zakres wyszukiwania tabeli po najechaniu",
- tableHoverLookupModeDescription: "Sposób rozwiązywania niekwalifikowanych nazw tabel podczas najeżdżania lub klikania z klawiszem Ctrl/Cmd w edytorze SQL.",
+ tableHoverLookupMode: "Zakres wyszukiwania obiektu po najechaniu",
+ tableHoverLookupModeDescription: "Sposób rozwiązywania niekwalifikowanych nazw tabel, procedur i funkcji podczas najeżdżania lub klikania z klawiszem Ctrl/Cmd w edytorze SQL.",
tableHoverLookupModeCurrent: "Tylko bieżący schemat",
tableHoverLookupModeFallback: "Bieżący schemat, następnie wszystkie schematy",
tableHoverLookupModeAlways: "Najpierw wszystkie schematy",
- tableHoverLookupModeCurrentDescription: "Szukaj tabel tylko w schemacie wybranym na pasku narzędzi.",
- tableHoverLookupModeFallbackDescription: "Sprawdź najpierw wybrany schemat; jeśli nie znaleziono, szukaj w innych schematach po nazwie tabeli.",
- tableHoverLookupModeAlwaysDescription: "Przeszukuj najpierw wszystkie schematy według nazwy tabeli. Preferowane przy pisaniu procedur operujących na wielu schematach.",
+ tableHoverLookupModeCurrentDescription: "Szukaj tabel i procedur tylko w schemacie wybranym na pasku narzędzi.",
+ tableHoverLookupModeFallbackDescription: "Sprawdź najpierw wybrany schemat; jeśli nie znaleziono, szukaj w innych schematach po nazwie obiektu.",
+ tableHoverLookupModeAlwaysDescription: "Przeszukuj najpierw wszystkie schematy według nazwy obiektu. Preferowane przy pisaniu SQL operującego na wielu schematach.",
sqlVariableSyntax: "Podstawianie zmiennych i symboli zastępczych w SQL",
sqlVariableSyntaxDescription: "Wybierz, które składnie zmiennych i symboli zastępczych DBX podstawia przed uruchomieniem SQL dla każdego typu bazy. Wszystkie są domyślnie włączone.",
sqlVariableSubstitutionEnabled: "Włączone",
diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.ts
index 69e2fa8f9c..28af871993 100644
--- a/apps/desktop/src/i18n/locales/pt-BR.ts
+++ b/apps/desktop/src/i18n/locales/pt-BR.ts
@@ -8578,14 +8578,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Quando ativado, clicar em um objeto no navegador de objetos abre automaticamente o painel de detalhes ou código-fonte à direita. Quando desativado, as linhas são selecionadas sem abrir o painel.",
showTableDdlHoverPreview: "Mostrar DDL da tabela ao passar o mouse",
showTableDdlHoverPreviewDescription: "Mostra uma prévia do DDL ao passar o mouse sobre o nome de uma tabela no editor SQL.",
- tableHoverLookupMode: "Escopo de busca ao passar o mouse",
- tableHoverLookupModeDescription: "Como nomes de tabela sem qualificação são resolvidos ao passar o mouse ou com Ctrl/Cmd+clique no editor SQL.",
+ tableHoverLookupMode: "Escopo de busca de objetos ao passar o mouse",
+ tableHoverLookupModeDescription: "Como nomes sem qualificação de tabelas, procedures e funções são resolvidos ao passar o mouse ou com Ctrl/Cmd+clique no editor SQL.",
tableHoverLookupModeCurrent: "Apenas o schema atual",
tableHoverLookupModeFallback: "Schema atual, depois todos",
tableHoverLookupModeAlways: "Todos os schemas primeiro",
- tableHoverLookupModeCurrentDescription: "Procura tabelas apenas no schema selecionado na barra de ferramentas.",
- tableHoverLookupModeFallbackDescription: "Tenta o schema selecionado primeiro; se não achar, busca pelo nome em outros schemas.",
- tableHoverLookupModeAlwaysDescription: "Busca primeiro pelo nome em todos os schemas. Útil ao escrever procedures entre schemas.",
+ tableHoverLookupModeCurrentDescription: "Procura tabelas e rotinas apenas no schema selecionado na barra de ferramentas.",
+ tableHoverLookupModeFallbackDescription: "Tenta o schema selecionado primeiro; se não achar, busca pelo nome do objeto em outros schemas.",
+ tableHoverLookupModeAlwaysDescription: "Busca primeiro pelo nome do objeto em todos os schemas. Útil ao escrever SQL entre schemas.",
sqlVariableSyntax: "Substituição de variáveis e espaços reservados SQL",
sqlVariableSyntaxDescription: "Escolha quais sintaxes de variáveis e espaços reservados o DBX substitui antes de executar SQL, por tipo de banco de dados. Todas ativadas por padrão.",
sqlVariableSubstitutionEnabled: "Ativada",
diff --git a/apps/desktop/src/i18n/locales/ru.ts b/apps/desktop/src/i18n/locales/ru.ts
index 3546ad5ec9..d45b540e0b 100644
--- a/apps/desktop/src/i18n/locales/ru.ts
+++ b/apps/desktop/src/i18n/locales/ru.ts
@@ -10043,14 +10043,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Если включено, нажатие на объект в обозревателе объектов автоматически открывает его панель сведений или исходного кода справа. Если отключено, строки выбираются без открытия панели.",
showTableDdlHoverPreview: "Показывать DDL таблицы при наведении",
showTableDdlHoverPreviewDescription: "Показывать предпросмотр DDL при наведении на имя таблицы в SQL-редакторе.",
- tableHoverLookupMode: "Область поиска таблиц при наведении",
- tableHoverLookupModeDescription: "Как разрешаются имена таблиц без квалификатора при наведении или Ctrl/Cmd+клике в SQL-редакторе.",
+ tableHoverLookupMode: "Область поиска объектов при наведении",
+ tableHoverLookupModeDescription: "Как разрешаются имена таблиц, процедур и функций без квалификатора при наведении или Ctrl/Cmd+клике в SQL-редакторе.",
tableHoverLookupModeCurrent: "Только текущая схема",
tableHoverLookupModeFallback: "Текущая схема, затем все схемы",
tableHoverLookupModeAlways: "Сначала все схемы",
- tableHoverLookupModeCurrentDescription: "Искать таблицы только в схеме, выбранной на панели инструментов.",
- tableHoverLookupModeFallbackDescription: "Сначала искать в выбранной схеме, затем, если не найдено, искать другие схемы по имени таблицы.",
- tableHoverLookupModeAlwaysDescription: "Сначала искать все схемы по имени таблицы. Предпочтительно при написании межсхемных процедур.",
+ tableHoverLookupModeCurrentDescription: "Искать таблицы и подпрограммы только в схеме, выбранной на панели инструментов.",
+ tableHoverLookupModeFallbackDescription: "Сначала искать в выбранной схеме, затем, если не найдено, искать другие схемы по имени объекта.",
+ tableHoverLookupModeAlwaysDescription: "Сначала искать все схемы по имени объекта. Предпочтительно при написании межсхемного SQL.",
sqlVariableSyntax: "Подстановка переменных и заполнителей SQL",
sqlVariableSyntaxDescription: "Выберите, какие синтаксисы переменных и заполнителей DBX подставляет перед выполнением SQL, для каждого типа базы данных. По умолчанию включены все.",
sqlVariableSubstitutionEnabled: "Включено",
diff --git a/apps/desktop/src/i18n/locales/th.ts b/apps/desktop/src/i18n/locales/th.ts
index 6ca54fe6dd..3a8e7a8586 100644
--- a/apps/desktop/src/i18n/locales/th.ts
+++ b/apps/desktop/src/i18n/locales/th.ts
@@ -10472,14 +10472,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "เมื่อเปิดใช้งาน การคลิกวัตถุในเบราว์เซอร์วัตถุจะเปิดแผงรายละเอียดหรือซอร์สโค้ดทางด้านขวาโดยอัตโนมัติ เมื่อปิดใช้งาน แถวจะถูกเลือกโดยไม่เปิดแผง",
showTableDdlHoverPreview: "แสดง DDL ตารางเมื่อวางเมาส์",
showTableDdlHoverPreviewDescription: "แสดงตัวอย่าง DDL เมื่อวางเมาส์เหนือชื่อตารางใน SQL Editor",
- tableHoverLookupMode: "ขอบเขตการค้นหาเมื่อวางเมาส์เหนือตาราง",
- tableHoverLookupModeDescription: "วิธีค้นหาตารางจากชื่อที่ไม่ระบุ Schema เมื่อวางเมาส์หรือ Ctrl/Cmd+คลิกใน SQL Editor",
+ tableHoverLookupMode: "ขอบเขตการค้นหาเมื่อวางเมาส์เหนืออ็อบเจ็กต์",
+ tableHoverLookupModeDescription: "วิธีค้นหาตาราง โปรซีเจอร์ และฟังก์ชันจากชื่อที่ไม่ระบุ Schema เมื่อวางเมาส์หรือ Ctrl/Cmd+คลิกใน SQL Editor",
tableHoverLookupModeCurrent: "เฉพาะ Schema ปัจจุบัน",
tableHoverLookupModeFallback: "Schema ปัจจุบัน แล้วจึงทุก Schema",
tableHoverLookupModeAlways: "ทุก Schema ก่อน",
- tableHoverLookupModeCurrentDescription: "ค้นหาตารางเฉพาะใน Schema ที่เลือกใน Toolbar",
- tableHoverLookupModeFallbackDescription: "ลอง Schema ที่เลือกก่อน แล้วค้นหา Schema อื่นตามชื่อตารางหากไม่พบ",
- tableHoverLookupModeAlwaysDescription: "ค้นหาทุก Schema ตามชื่อตารางก่อน เหมาะเมื่อเขียน Procedure ข้าม Schema",
+ tableHoverLookupModeCurrentDescription: "ค้นหาตารางและรูทีนเฉพาะใน Schema ที่เลือกใน Toolbar",
+ tableHoverLookupModeFallbackDescription: "ลอง Schema ที่เลือกก่อน แล้วค้นหา Schema อื่นตามชื่ออ็อบเจ็กต์หากไม่พบ",
+ tableHoverLookupModeAlwaysDescription: "ค้นหาทุก Schema ตามชื่ออ็อบเจ็กต์ก่อน เหมาะเมื่อเขียน SQL ข้าม Schema",
sqlVariableSyntax: "การแทนที่ตัวแปรและ Placeholder ของ SQL",
sqlVariableSyntaxDescription: "เลือก Syntax ของตัวแปรและ Placeholder ที่ DBX จะแทนค่าก่อนเรียกใช้ SQL แยกตามชนิดฐานข้อมูล ทั้งหมดเปิดใช้โดยค่าเริ่มต้น",
sqlVariableSubstitutionEnabled: "เปิดใช้งาน",
diff --git a/apps/desktop/src/i18n/locales/tr.ts b/apps/desktop/src/i18n/locales/tr.ts
index be1459d168..2f325c9179 100644
--- a/apps/desktop/src/i18n/locales/tr.ts
+++ b/apps/desktop/src/i18n/locales/tr.ts
@@ -8057,14 +8057,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "Etkinleştirildiğinde, nesne tarayıcısında bir nesneye tıklamak sağdaki ayrıntı veya kaynak panelini otomatik olarak açar. Devre dışı bırakıldığında, panel açılmadan satırlar seçilir.",
showTableDdlHoverPreview: "Üzerine gelindiğinde tablo DDL'ini göster",
showTableDdlHoverPreviewDescription: "SQL düzenleyicisinde bir tablo adının üzerine gelindiğinde DDL önizlemesi göster.",
- tableHoverLookupMode: "Tablo üzerine gelince arama kapsamı",
- tableHoverLookupModeDescription: "SQL düzenleyicisinde nitelendirilmemiş tablo adlarına gelindiğinde veya Ctrl/Cmd+tıklandığında şemanın nasıl çözüleceği.",
+ tableHoverLookupMode: "Nesne üzerine gelince arama kapsamı",
+ tableHoverLookupModeDescription: "SQL düzenleyicisinde nitelendirilmemiş tablo, yordam ve işlev adlarına gelindiğinde veya Ctrl/Cmd+tıklandığında şemanın nasıl çözüleceği.",
tableHoverLookupModeCurrent: "Yalnızca geçerli şema",
tableHoverLookupModeFallback: "Önce geçerli şema, sonra tümü",
tableHoverLookupModeAlways: "Önce tüm şemalar",
- tableHoverLookupModeCurrentDescription: "Tabloları yalnızca araç çubuğunda seçili şemada arar.",
- tableHoverLookupModeFallbackDescription: "Önce seçili şemayı dener; bulunamazsa tablo adına göre diğer şemaları arar.",
- tableHoverLookupModeAlwaysDescription: "Tablo adına göre tüm şemaları önce arar. Çapraz şema yordamları yazarken kullanışlıdır.",
+ tableHoverLookupModeCurrentDescription: "Tablo ve yordamları yalnızca araç çubuğunda seçili şemada arar.",
+ tableHoverLookupModeFallbackDescription: "Önce seçili şemayı dener; bulunamazsa nesne adına göre diğer şemaları arar.",
+ tableHoverLookupModeAlwaysDescription: "Nesne adına göre tüm şemaları önce arar. Çapraz şema SQL yazarken kullanışlıdır.",
sqlVariableSyntax: "SQL değişken ve yer tutucu değiştirme",
sqlVariableSyntaxDescription: "DBX'in SQL çalıştırmadan önce hangi değişken ve yer tutucu sözdizimlerini değiştireceğini veritabanı türüne göre seçin. Varsayılan olarak tümü etkindir.",
sqlVariableSubstitutionEnabled: "Etkin",
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index f102d92de9..c0ffb20690 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -9820,14 +9820,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "开启后,在对象浏览器中点击对象会自动在右侧展开其详情或源码面板;关闭后仅选中行,不自动展开。",
showTableDdlHoverPreview: "悬浮表名时显示 DDL",
showTableDdlHoverPreviewDescription: "在 SQL 编辑器中悬浮表名时显示 DDL 预览。",
- tableHoverLookupMode: "表悬浮查找范围",
- tableHoverLookupModeDescription: "在 SQL 编辑器中悬浮或 Ctrl/Cmd+点击未限定表名时,如何解析所属模式。",
+ tableHoverLookupMode: "对象悬浮查找范围",
+ tableHoverLookupModeDescription: "在 SQL 编辑器中悬浮或 Ctrl/Cmd+点击未限定的表名、存储过程或函数名时,如何解析所属模式。",
tableHoverLookupModeCurrent: "仅当前模式",
tableHoverLookupModeFallback: "当前模式优先,再查全部",
tableHoverLookupModeAlways: "优先全库按名查找",
- tableHoverLookupModeCurrentDescription: "只在工具栏选中的模式中查找表。",
- tableHoverLookupModeFallbackDescription: "先查选中模式,未找到再按表名跨模式查找。",
- tableHoverLookupModeAlwaysDescription: "直接按表名跨模式查找。适合编写跨模式存储过程。",
+ tableHoverLookupModeCurrentDescription: "只在工具栏选中的模式中查找表与过程。",
+ tableHoverLookupModeFallbackDescription: "先查选中模式,未找到再按对象名跨模式查找。",
+ tableHoverLookupModeAlwaysDescription: "直接按对象名跨模式查找。适合编写跨模式 SQL。",
sqlVariableSyntax: "SQL 变量与占位符替换",
sqlVariableSyntaxDescription: "按数据库类型选择执行 SQL 前替换哪些变量与占位符语法,默认全部开启。",
sqlVariableSubstitutionEnabled: "启用替换",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index a87e81e9a3..59fb46bc7b 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -7918,14 +7918,14 @@ export default withEnglishFallback({
objectBrowserAutoOpenDetailPanelDescription: "開啟後,在物件瀏覽器中點擊物件會自動在右側展開其詳情或源碼面板;關閉後僅選取列,不自動展開。",
showTableDdlHoverPreview: "滑過表名時顯示 DDL",
showTableDdlHoverPreviewDescription: "在 SQL 編輯器中滑過表名時顯示 DDL 預覽。",
- tableHoverLookupMode: "資料表懸停查詢範圍",
- tableHoverLookupModeDescription: "在 SQL 編輯器中懸停或 Ctrl/Cmd+點擊未限定資料表名稱時,如何解析所屬結構描述。",
+ tableHoverLookupMode: "物件懸停查詢範圍",
+ tableHoverLookupModeDescription: "在 SQL 編輯器中懸停或 Ctrl/Cmd+點擊未限定的資料表、預存程序或函數名稱時,如何解析所屬結構描述。",
tableHoverLookupModeCurrent: "僅目前結構描述",
tableHoverLookupModeFallback: "目前結構描述優先,再查全部",
tableHoverLookupModeAlways: "優先全庫依名稱查詢",
- tableHoverLookupModeCurrentDescription: "只在工具列選取的結構描述中查詢資料表。",
- tableHoverLookupModeFallbackDescription: "先查選取的結構描述,找不到再依資料表名稱跨結構描述查詢。",
- tableHoverLookupModeAlwaysDescription: "直接依資料表名稱跨結構描述查詢。適合撰寫跨結構描述預存程序。",
+ tableHoverLookupModeCurrentDescription: "只在工具列選取的結構描述中查詢資料表與程序。",
+ tableHoverLookupModeFallbackDescription: "先查選取的結構描述,找不到再依物件名稱跨結構描述查詢。",
+ tableHoverLookupModeAlwaysDescription: "直接依物件名稱跨結構描述查詢。適合撰寫跨結構描述 SQL。",
sqlVariableSyntax: "SQL 變數與佔位符替換",
sqlVariableSyntaxDescription: "依資料庫類型選擇執行 SQL 前替換哪些變數與佔位符語法,預設全部開啟。",
sqlVariableSubstitutionEnabled: "啟用替換",
diff --git a/apps/desktop/src/lib/editor/__tests__/hoverTableLookup.spec.ts b/apps/desktop/src/lib/editor/__tests__/hoverTableLookup.spec.ts
index 9bd2766681..8ccdea7d14 100644
--- a/apps/desktop/src/lib/editor/__tests__/hoverTableLookup.spec.ts
+++ b/apps/desktop/src/lib/editor/__tests__/hoverTableLookup.spec.ts
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
-import { matchHoverTableCandidates, normalizeTableHoverLookupMode, pickHoverTableMatch, resolveHoverTableLookupTarget } from "@/lib/editor/hoverTableLookup";
+import { matchHoverTableCandidates, normalizeTableHoverLookupMode, pickHoverObjectMatch, pickHoverTableMatch, resolveHoverTableLookupTarget } from "@/lib/editor/hoverTableLookup";
describe("normalizeTableHoverLookupMode", () => {
it("defaults to fallback", () => {
@@ -156,6 +156,31 @@ describe("pickHoverTableMatch", () => {
});
});
+describe("pickHoverObjectMatch", () => {
+ const objects = [
+ { name: "cleanup", schema: "reporting", type: "procedure" },
+ { name: "cleanup", schema: "public", type: "procedure" },
+ { name: "cleanup", schema: "public", parentName: "PKG", type: "procedure" },
+ ];
+
+ it("prefers the selected schema and standalone routines over package members", () => {
+ expect(pickHoverObjectMatch("cleanup", objects, "public")).toEqual({ name: "cleanup", schema: "public", type: "procedure" });
+ });
+
+ it("falls back to package members when no standalone routine matches", () => {
+ expect(pickHoverObjectMatch("cleanup", [{ name: "cleanup", schema: "app", parentName: "PKG", type: "procedure" }], "app")).toEqual({
+ name: "cleanup",
+ schema: "app",
+ parentName: "PKG",
+ type: "procedure",
+ });
+ });
+
+ it("returns null when the object name is missing", () => {
+ expect(pickHoverObjectMatch("missing", objects, "public")).toBeNull();
+ });
+});
+
describe("matchHoverTableCandidates", () => {
const tables = [
{ name: "users", schema: "reporting" },
diff --git a/apps/desktop/src/lib/editor/hoverTableLookup.ts b/apps/desktop/src/lib/editor/hoverTableLookup.ts
index 45c6531177..bc20053b22 100644
--- a/apps/desktop/src/lib/editor/hoverTableLookup.ts
+++ b/apps/desktop/src/lib/editor/hoverTableLookup.ts
@@ -37,7 +37,8 @@ export interface HoverTableLookupTarget {
}
/**
- * Resolve the metadata scope for table hover / Ctrl+click navigation.
+ * Resolve the metadata scope for object hover / Ctrl+click navigation
+ * (tables, procedures, and functions).
*
* Qualified names (`schema.table`, `db.schema.table`, MySQL-style `db.table`)
* always use the SQL qualifier. Unqualified names follow `mode`:
@@ -101,6 +102,23 @@ export function pickHoverTableMatch<T extends { name: string; schema?: string }>
return nameMatches[0] ?? null;
}
+/**
+ * Prefer the selected schema when the same routine name exists in multiple schemas.
+ * Standalone routines win over package members for unqualified names (same as {@link matchSqlObject}).
+ */
+export function pickHoverObjectMatch<T extends { name: string; schema?: string; parentName?: string }>(objectName: string, objects: readonly T[], preferredSchema?: string): T | null {
+ const nameLower = objectName.toLowerCase();
+ const nameMatches = objects.filter((object) => object.name.toLowerCase() === nameLower);
+ if (nameMatches.length === 0) return null;
+ const standalone = nameMatches.filter((object) => !object.parentName);
+ const pool = standalone.length > 0 ? standalone : nameMatches;
+ if (preferredSchema) {
+ const preferred = pool.find((object) => object.schema?.toLowerCase() === preferredSchema.toLowerCase());
+ if (preferred) return preferred;
+ }
+ return pool[0] ?? null;
+}
+
export interface MatchHoverTableCandidatesOptions {
/** Qualified forms to try first (e.g. `schema.table` from the token or semantic model). */
lookups?: string[];