I use some https://github.com/launchbadge/sqlx query!
macros in my tests, and I need to be able to run cargo sqlx prepare
for them so my IDE can expand the macros and provide type information (autocomplete, etc.).
But if I just run cargo sqlx prepare
, all code behind #[cfg(test)]
is ignored.
How can I tell cargo/sqlx to analyse my tests too?
cargo sqlx prepare -- --tests
does the trick
(--tests
is passed to cargo rustc
, which makes it build all tests)