我正在使用一些 sqlx::query!和 sqlx::query_as!我的项目编译得很好。但是当我运行 cargo sqlx prepare 时,我首先得到错误:
$ cargo sqlx prepare
error: extra arguments to `rustc` can only be passed to one target, consider filtering
the package by passing, e.g., `--lib` or `--bin NAME` to specify a single target
error: `cargo check` failed with status: exit status: 101
然后当我用“---lib”运行它时,我得到:
$ cargo sqlx prepare -- --lib
Compiling crate v0.1.0 (/Users/ryan/Documents/crate)
Finished dev [unoptimized + debuginfo] target(s) in 5.78s
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
我用--bin 得到了类似的输出。
我在这里做错了什么?