You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not a big deal since I usually have DATABASE_URL in .env anyways, but I just noticed in a new project before creating .env that sqlx mig add init failed with
error: The DATABASE_URL environment variable must be set
It'd just be a bit annoying to have to do this for every command.
The error message that Clap generates if you omit DATABASE_URL isn't really helpful though as it defaults to suggesting it as --database-url=... and doesn't mention environment variables at all except in the output of --help.
Activity
abonander commentedon Aug 20, 2021
Yeah, it's purely because we're requiring it unconditionally: https://github.com/launchbadge/sqlx/blob/master/sqlx-cli/src/lib.rs#L18-L22
claphas support for getting values from the environment, so we could move this to theOptdefinitions, e.g.:It'd just be a bit annoying to have to do this for every command.
The error message that Clap generates if you omit
DATABASE_URLisn't really helpful though as it defaults to suggesting it as--database-url=...and doesn't mention environment variables at all except in the output of--help.fix(cli) move database_url transact-rs#1391
fix(cli) move database_url #1391 (#1400)
xpe commentedon Sep 7, 2021
The commit made in this issue (0e51272) led to a regression (#1431) where a
.envfile isn't read in time for clap argument parsing.Merge launchbadge/sqlx master into JetASAP/sqlx master (#12)
Update ws-support (#15)