`cargo sqlx prepare` for workspace member tests
Bug Description
Running, cargo sqlx prepare --workspace -- --all-targets --all-features --tests, or cargo sqlx prepare --workspace -- --all-targets --all-features, on the root of a workspace, doesn't prepare the queries in integration tests (tests directory) of the workspace members. The workspace itself is also a binary crate.
If I run the same thing inside a specific crate, it works fine.
EDIT: If the workspace root isn't also a crate, it works fine.
Minimal Reproduction
^^^^
Info
- SQLx version: sqlx-cli-sqlx 0.7.4
- SQLx features enabled: [REQUIRED]
- Database server and version: Postgres
- Operating system: Linux
-
rustc --version: 1.78.0
Running into the same issue
cargo sqlx prepare --workspace -- --all-targets --all-features --tests ignores some of my workspace crates, but doing it directly cargo sqlx prepare -- --package price-services works, but deletes all my other .json files
I'm having the same issue, yet running cargo sqlx prepare -- --package <package_name> doesn't work as well, in my integration test there is still an error "set DATABASE_URL to use query online or run cargo sqlx prepare to update the query cache", running cargo sqlx prepare -- --tests will panic on the same error.