-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support run-time parameters in connection strings
Commit 423884a made it superficially look like the startup message sent by pq included more parameters than just "user" and "database", and commit 6c7918f subsequently fell into the trap and attempted to introduce support for a number of environment variables. Fix the startup procedure to actually send the parameters to the server backend, thus adding support for a number of environment variables as well as connection string parameters. This behaviour is slightly different from libpq, which only allows a specific subset of run-time parameters to be set directly in the connection string, requiring the rest to be set in the "options" parameter using a clumsy syntax. libpq's behaviour was deemed inconsistent, and therefore was not faithfully reproduced. This change is not fully backwards compatible as the previous behaviour was to silently ignore invalid parameters in the connection string. These applications will fail with ErrBadConn when attempting to operate on the sql.DB handle.
- Loading branch information
Showing
3 changed files
with
144 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters