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。

fix(oracle): quote routine parameter aliases

zipg1c0e97b52a37
diff --git a/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts b/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts
index c350ab571e..dcbc446f76 100644
--- a/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts
+++ b/apps/desktop/src/lib/__tests__/table/routineExecutionSql.spec.ts
@@ -152,6 +152,13 @@ describe("SQL Server routine execution SQL", () => {
expect(metadataSql).toContain("p.precision AS precision");
expect(metadataSql).toContain("p.scale AS scale");
});
+
+ it("quotes Oracle routine metadata aliases for legacy Oracle syntax", () => {
+ const sql = routineParametersQuery({ database: "XE", databaseType: "oracle", schema: "DBX_TEST", routineName: "demo" });
+
+ expect(sql).toContain('ARGUMENT_NAME AS "name"');
+ expect(sql).toContain('DEFAULTED AS "has_default"');
+ });
});
describe("XuguDB routine parameter metadata", () => {
diff --git a/apps/desktop/src/lib/table/routineParameters.ts b/apps/desktop/src/lib/table/routineParameters.ts
index 285eec1bcb..9a8df67866 100644
--- a/apps/desktop/src/lib/table/routineParameters.ts
+++ b/apps/desktop/src/lib/table/routineParameters.ts
@@ -128,11 +128,11 @@ ORDER BY p.parameter_id;`.trim();
if (options.databaseType === "oracle" || options.databaseType === "dameng" || options.databaseType === "oceanbase-oracle") {
return `
SELECT
- ARGUMENT_NAME AS name,
- DATA_TYPE AS data_type,
- IN_OUT AS mode,
- POSITION AS ordinal,
- DEFAULTED AS has_default
+ ARGUMENT_NAME AS "name",
+ DATA_TYPE AS "data_type",
+ IN_OUT AS "mode",
+ POSITION AS "ordinal",
+ DEFAULTED AS "has_default"
FROM ALL_ARGUMENTS
WHERE OWNER = UPPER(${schema})
AND OBJECT_NAME = UPPER(${name})