chore(): remove ssl_mode from url and also use sslmode (#13568)

* chore(): remove ssl_mode from url and also use sslmode

* improve regexp

* chore(): remove ssl_mode from url and also use sslmode

* chore(): remove ssl_mode from url and also use sslmode

* Update SSL mode configuration in changeset

Removed 'ssl_mode' from URL and replaced it with 'sslmode'.
This commit is contained in:
Adrien de Peretti
2025-09-22 12:11:43 +02:00
committed by GitHub
parent 730d73306d
commit 92d30b28f4
4 changed files with 60 additions and 5 deletions

View File

@@ -38,8 +38,18 @@ export async function pgConnectionLoader(): Promise<
delete driverOptions.pool
const clientUrl = connectionString?.replace(
/(\?|&)ssl_mode=[^&]*(&|$)/gi,
(match, prefix, suffix) => {
if (prefix === "?" && suffix === "&") return "?"
if (prefix === "?" && suffix === "") return ""
if (prefix === "&") return suffix
return ""
}
)
const pgConnection = ModulesSdkUtils.createPgConnection({
clientUrl: connectionString,
clientUrl,
schema,
driverOptions,
pool: {