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
Whenever I try to run cargo sqlx prepare -- --bin mybin against a postgres database, it works only if I first do a cargo clean. Any other time it writes a mostly empty file (attached) and reports
warning: no queries found; please ensure that the `offline` feature is enabled in sqlx
query data written to `sqlx-data.json` in the current directory; please check this into version control
Is this something wrong in the code or something wrong with how I'm doing it?
It sounds like you have all your query!() macros in the library portion of your crate. If Cargo doesn't need to rebuild that part then it won't execute the macros when you do cargo sqlx prepare -- --bin mybin.
This will be fixed by #570 which should be part of 0.6.0.
It seems that's not possible after some research. The args after -- apparently go to cargo rustc and it will not accept multiple targets, so I'll just make sure all queries live in the lib. Thanks a ton for your help @abonander.
Whenever I try to run
cargo sqlx prepare -- --bin mybin
against a postgres database, it works only if I first do acargo clean
. Any other time it writes a mostly empty file (attached) and reportsIs this something wrong in the code or something wrong with how I'm doing it?
sqlx-data.txt
The text was updated successfully, but these errors were encountered: