我使用的是sqlx::query!还有sqlx::query_as!我的项目编写得很好。但是,当我运行货运sqlx准备时,我得到了第一个错误:
$ 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
然后当我用
$ 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
我得到了类似的输出-宾。
我在这里做错什么了?
发布于 2022-10-03 10:40:25
同样的案例也有过,但可以在他们的文档中找到有用的信息。与其只运行cargo sqlx prepare -- --lib
,不如首先重新安装sqlx,如下所示:
cargo install sqlx-cli && cargo sqlx prepare -- --lib
https://stackoverflow.com/questions/69167367
复制相似问题