World's first open-source enterprise world model.
Rust agent-memorybitemporalgraphragknowledge-baseknowledge-graphllmontologypgvectorpostgresqlragrustself-hostedsemantic-searchtemporal-knowledge-graphworld-model
Preserve reserved characters in datasource path identifiers (#1157)
Rudy Mizrahi Celekliba2f424593bb
diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsxindex 58a46384..dad10ed3 100644--- a/web/src/pages/Settings.tsx+++ b/web/src/pages/Settings.tsx@@ -462,7 +462,7 @@ export function dsSpecs(): EngineSpec[] {{ key: "password", label: D.fPassword, secret: true },],build: (v) =>- `postgres://${auth(v.user, v.password)}${v.host}:${v.port || "5432"}/${v.database}`,+ `postgres://${auth(v.user, v.password)}${v.host}:${v.port || "5432"}/${enc(v.database)}`,},{id: "mysql",@@ -475,7 +475,7 @@ export function dsSpecs(): EngineSpec[] {{ key: "password", label: D.fPassword, secret: true },],build: (v) =>- `mysql://${auth(v.user, v.password)}${v.host}:${v.port || "3306"}/${v.database}`,+ `mysql://${auth(v.user, v.password)}${v.host}:${v.port || "3306"}/${enc(v.database)}`,},{id: "clickhouse",@@ -507,8 +507,8 @@ export function dsSpecs(): EngineSpec[] {{ key: "password", label: D.fPassword, optional: true, secret: true },],build: (v) =>- `trino://${auth(v.user, v.password)}${v.host}:${v.port || "8080"}/${v.catalog}` +- (v.schema ? `/${v.schema}` : ""),+ `trino://${auth(v.user, v.password)}${v.host}:${v.port || "8080"}/${enc(v.catalog)}` ++ (v.schema ? `/${enc(v.schema)}` : ""),},{id: "databricks",@@ -538,7 +538,7 @@ export function dsSpecs(): EngineSpec[] {{ key: "warehouse", label: D.fWarehouse },],build: (v) =>- `snowflake://:${enc(v.token)}@${v.account}/${v.database}/${v.schema}` ++ `snowflake://:${enc(v.token)}@${v.account}/${enc(v.database)}/${enc(v.schema)}` +`?warehouse=${enc(v.warehouse)}`,},{diff --git a/web/src/pages/dsSpecs.identifiers.test.ts b/web/src/pages/dsSpecs.identifiers.test.tsnew file mode 100644index 00000000..e9129eb0--- /dev/null+++ b/web/src/pages/dsSpecs.identifiers.test.ts@@ -0,0 +1,13 @@+import { expect, it } from "vitest";+import { dsSpecs } from "./Settings";++it.each(["postgres", "mysql", "trino", "snowflake"])("preserves reserved characters in %s path identifiers", (id) => {+ const name = "sales#2026?forecast%";+ const spec = dsSpecs().find((s) => s.id === id)!;+ const url = new URL(spec.build({ host: "db.internal", account: "acme.snowflakecomputing.com", database: name, catalog: name, schema: name, warehouse: "compute" }));+ expect(decodeURIComponent(url.pathname.split("/")[1])).toBe(name);+ expect(url.hash).toBe("");+ if (id === "trino" || id === "snowflake") {+ expect(decodeURIComponent(url.pathname.split("/")[2])).toBe(name);+ }+});