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

Support for a DATABASE_URL style config #26

Closed
mattrobenolt opened this issue Aug 10, 2022 · 1 comment · Fixed by #27
Closed

Support for a DATABASE_URL style config #26

mattrobenolt opened this issue Aug 10, 2022 · 1 comment · Fixed by #27
Assignees

Comments

@mattrobenolt
Copy link
Member

mattrobenolt commented Aug 10, 2022

I think either providing a helper such as configFromEnv('DATABASE_URL') or something along these lines to parse a config in a traditional mysql://user:pass@host would be nice for configuration, we can even be a bit more planetscale specific with our URI such as pscale://user:pass@aws.connect.psdb.cloud. I don't personally have an opinion if this is it's own thing like:

connect(configFromEnv())

Or built into the config such as:

connect({uri: env['DATABASE_URL']})

Up to whatever you think is most common or would be most desirable to adopt.

This would allow simplifying an application config with one variable instead of 3 different ones, and we can leverage the already standard DATABASE_URL that's established.

@dgraham dgraham self-assigned this Aug 10, 2022
dgraham added a commit that referenced this issue Aug 10, 2022
Parse a database URL into host, username, and password configuration
values. This allows the app to configure a single environment variable
rather than three.

Closes #26.
@steven-tey
Copy link

Potentially related: planetscale/f1-championship-stats#18

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 a pull request may close this issue.

3 participants