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

document the need for --merged in workspaces #2322

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sqlx-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,11 @@ This is how you would turn all targets and features on.
```bash
cargo sqlx prepare -- --all-targets --all-features
```

### Building workspaces in offline mode

When you have several crates that use `query!`-like macros and some of these depend on another you may need to pass the `--merged` parameter to cargo. This typically happens when a lib crate makes use of `query!` and is used by another crate that also makes use of such macros.
```bash
cargo sqlx prepare --merged
```
The above should resolve such issues. If doing so in a workspace, it is recommended to run it on the root of the workspace and only keep the one `sqlx-data.json` or confusions may occur.