Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to pgx4 library #77

Merged
merged 1 commit into from
Sep 1, 2023
Merged

Update to pgx4 library #77

merged 1 commit into from
Sep 1, 2023

Conversation

amotl
Copy link
Member

@amotl amotl commented Aug 31, 2023

About

The transition from pgx3 to pgx4 introduces a few interface changes.

@amotl amotl changed the base branch from main to amo/update-golang-ci August 31, 2023 10:28
@amotl amotl force-pushed the amo/pgx4 branch 4 times, most recently from 681ec84 to f7ef05c Compare August 31, 2023 11:08
Base automatically changed from amo/update-golang-ci to main August 31, 2023 11:08
@amotl amotl force-pushed the amo/pgx4 branch 2 times, most recently from 65a068e to a9df2d0 Compare August 31, 2023 11:48
@amotl amotl marked this pull request as ready for review August 31, 2023 11:54
// postgres://jack:[email protected]:5432/mydb?sslmode=verify-ca
connectionString := fmt.Sprintf(
"postgres://%s:%s@%s:%v/%s?connect_timeout=%v&pool_max_conns=%v",
ep.User, ep.Password, ep.Host, ep.Port, ep.Schema, ep.ConnectTimeout, ep.MaxConnections)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a password in this context may need to be URL encoded for special characters to work.

Copy link
Member Author

@amotl amotl Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

a) Do you suggest to encode it, or do you suggest to use the DSN notation instead?
b) FYI: In a subsequent patch, I would like to add functionality to obtain the connection string from the configuration file 1:1, and document all other options supported by pgx4 out of the box. Up until then, we need to converge it from the discrete options in one way or another.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi again. Later down the line, GH-82 will start using DSN-style connection strings instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants