Fix parsing of ssl=false connection string parameter - #2423
Conversation
ssl was mistakenly set to the string "false" instead of the Boolean false.
|
( |
|
Alternatively, we could remove support for all |
|
I agree that since the other non-libpq modes are supported, ssl=false should be supported. When This is very surprising behavior, especially because the docs actually explicitly state this is allowed. If feature parity with libpq is more important, it could at least log a warning or throw an exception if the user uses this ssl flag in an unsupported way. |
|
It could possibly throw an uncaught exception without this patch. Reproduce Steps
const client = new Client({
connectionString: "postgres://postgres:postgres@localhost:5432/postgres?ssl=false",
});
client.connect();
// Throw uncaught exception
Since my application allows people to input any connection strings freely, throw an uncaught exception is not nice. Possible solutionsMethod 1: Merge this pull request. |
I observe that libpq throws an error when I think this is the behavior we want to match. Muting causes "spooky action at a distance" problems. |
|
Interested as this affects knex at the moment |
|
@mercmobily If this affects knex, knex should stop passing |
|
Ah, now, this is something I was missing! |
Cherry-picks iceddev/pg-connection-string#39 to this monorepo.