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

Configurable DATABASE_URL environment key for SQLx macros #3494

Closed
dnlsndr opened this issue Sep 8, 2024 · 2 comments
Closed

Configurable DATABASE_URL environment key for SQLx macros #3494

dnlsndr opened this issue Sep 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@dnlsndr
Copy link

dnlsndr commented Sep 8, 2024

Is your feature request related to a problem? Please describe.
At the moment, SQLx live query checks rely on the DATABASE_URL environment variable, which is hardcoded in the macro code. This causes issues when building out more complex systems, where environment variables are automaticelly separated by underscores and parsed into configuration structs and other advanced features that may collide with this fixed env variable.

Describe the solution you'd like
I propose a way that allows us to configure how this environment variable is named,
maybe through a configuration parameter int the Cargo.toml or via a separate environment variable called something like SQLX_DATABASE_URL_ENVIRONMENT_KEY

Describe alternatives you've considered
There are no alternatives available that allow me to change the environment variable, other than forking the whole crate.

Additional context
I'd be happy to create a PR for this

@dnlsndr dnlsndr added the enhancement New feature or request label Sep 8, 2024
@abonander
Copy link
Collaborator

This is intended to be addressed by #3383

@dnlsndr
Copy link
Author

dnlsndr commented Sep 8, 2024

Ah, my bad, didn't look well enough

@dnlsndr dnlsndr closed this as completed Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants