cargo sqlx prepare produces stub file -- even with 'offline' feature enabled

Viewed 298

I am using some sqlx::query! and sqlx::query_as! and my project compiles fine. But when I run cargo sqlx prepare I get first and error:

$ 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

Then when I run it with "-- --lib" I get:

$ 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

I get similar output with --bin.

What am I doing wrong here?

0 Answers
Related