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

Option to use a uri like „postgres://user:password@host:port/database“ #70

Closed
dattito opened this issue Nov 3, 2021 · 2 comments
Closed
Assignees

Comments

@dattito
Copy link

dattito commented Nov 3, 2021

Your Question

Simple Question, but hard to find an answer online: Is there an option to use URIs instead of DSNs to connect to the database? This would make working with Heroku Postgres a lot easier!

The document you expected this should be explained

Expected answer

@jinzhu
Copy link
Member

jinzhu commented Nov 30, 2021

Maybe create an issue on pgx driver?

@jinzhu jinzhu closed this as completed Nov 30, 2021
@ktarplee
Copy link

ktarplee commented Dec 4, 2021

URI's already work with this driver in GORM since the underlying postgres driver already supports it. I use URI all the time for gorm/postgres. The only part that might not work is in this code base (but I have not hit an issue with it). It is this line

result := regexp.MustCompile("(time_zone|TimeZone)=(.*?)($|&| )").FindStringSubmatch(dialector.Config.DSN)

It would be nice if the documentation was updated to point out that URIs do in fact work.

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

No branches or pull requests

3 participants