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
{{ message }}
Repository navigation
cargo sqlx prepare picks up queries from another crate #2049
When I run cargo sqlx prepare -- --lib inside a crate, it seems to sometimes pick up queries from outside the crate (in another crate, inside the same workspace). This seems to be intermittent -- I see it happening while running prepare in a terminal in a VS Code window, while I also have Rust Analyzer enabled which might be rebuilding other parts of the workspace in the background.
That's certainly possible. The macros output to the same folder under target/ regardless of source crate and cargo sqlx prepare just bundles up what it finds in there, so if multiple runs are happening at the same time they could be getting mixed together.
Would you be open to a PR that adds the source crate name to the path, and if so, could you give me some pointers into the source code where this change would need to be made?
Activity
abonander commentedon Aug 16, 2022
That's certainly possible. The macros output to the same folder under
target/regardless of source crate andcargo sqlx preparejust bundles up what it finds in there, so if multiple runs are happening at the same time they could be getting mixed together.djc commentedon Aug 16, 2022
Would you be open to a PR that adds the source crate name to the path, and if so, could you give me some pointers into the source code where this change would need to be made?
abonander commentedon Aug 16, 2022
Sure, it would be these two places: