-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
feat: allow connection URI and add additional config parameters #841
Conversation
woops. |
Pull Request Test Coverage Report for Build c579f3eb8-PR-841
💛 - Coveralls |
Thank you very much for the detailed review, @gdey. I’ll read up on error handling some more and fix the issues. 🙏🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this LGTM! I think we should deprecate the old config strategy in favor of the connection URI string. We should do this over 2 releases, so we should add a warning during the parsing step now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minot comment, but LGTM! Thank you for the contribution!
feat: allow connection URI and add additional config parameters fix: dependencies fix: dont return empty objects fix: errors fix: return if both Msg and Err are empty chore: add deprecation warning, set DefaultSSLMode to prefer chore: add TODO reminder to remove BuildURI when host/port connection is deprecated docs: update with connection string docs: add a comment on top to state the context the file is used within docs: fix versions
is there an example way to connect to a local postgresql database via UNIX socket connection with the new |
I think you have to escape it or use host as Param. Never tried it myself tho. postgresql:///dbname?host=/var/lib/postgresql postgresql://%2Fvar%2Flib%2Fpostgresql/dbname |
Yeah I haven't had much luck with either of those formats: escaping it with %2F results in parse errors, and not escaping it says "missing port". Adding a "port" via something like |
Im sorry, can't help right now. Tegola is using pgx under the hood, maybe dig a little if that is an issue with pgx. |
Sure thing. After digging around a bit, it looks like the main issue is using
|
@durkie thanks for digging into this. Would be great to get some better error handling on these connection params. I would happily accept a PR if you feel so inclined. ;-) |
Hi 👋
Now with the new pgx it is easier to pass a connection string which was on the wishlist for some issues (eg. #774). If the
uri
is set in theconfig.toml
saiduri
is used without compromise as long as the basic informationuser
,password
,host
,port
anddatabase
are set. Thesslmode
is added if not specifically set.Something on my personal wish list was the addition of
"max_connection_idle_time"
and"max_connection_lifetime"
to the config that default to the pgx default if not specifically set.