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

cargo sqlx prepare picks up queries from another crate #2049

Closed
djc opened this issue Aug 15, 2022 · 3 comments · Fixed by #2069
Closed

cargo sqlx prepare picks up queries from another crate #2049

djc opened this issue Aug 15, 2022 · 3 comments · Fixed by #2069

Comments

@djc
Copy link
Contributor

djc commented Aug 15, 2022

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.

@abonander
Copy link
Collaborator

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.

@djc
Copy link
Contributor Author

djc commented 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
Copy link
Collaborator

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 a pull request may close this issue.

2 participants