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

Do not require db url for prepare #2675

Closed

Conversation

tamasfe
Copy link
Contributor

@tamasfe tamasfe commented Aug 2, 2023

Allow per-crate DATABASE_URL in .env files for workspaces to be used alongside cargo sqlx prepare. Closes #2667.

Instead of enforcing the database-url argument by clap, I made it optional and instead throw an error later if for some reason it has to be provided (e.g. migrations).

I also had to remove the eager db checks for the prepare commands, the queries in cargo check will fail anyway.

sqlx-cli/src/prepare.rs Show resolved Hide resolved
@abonander
Copy link
Collaborator

Closing due to inactivity, feel free to reopen but please address the review comment.

It's worth checking eagerly that the database exists because it can provide quicker feedback in the case that some dependencies need to be built.

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 this pull request may close these issues.

Do not require DATABASE_URL for prepare
2 participants