sqlx-cli `prepare --check` command requires a database URL in offline mode
Author: tosti007Created Jun 4, 2026Updated Sep 25, 2026
Labelsbug
I have found these related issues/pull requests
None
Description
It seems with the release of sqlx-cli 0.9.0 the prepare subcommand with the --check flag always requires a database url to be set, even when SQLX_OFFLINE=true is set.
Reproduction steps
- Create a new rust project
- Run
$ env SQLX_OFFLINE=true cargo sqlx prepare --check Found `sqlx.toml` in current directory; reading...
error: `--database-url` or `DATABASE_URL` must be setSQLx version
0.9.0
Enabled SQLx features
default
Database server and version
any
Operating system
linux
Rust version
rustc 1.96.0 (ac68faa20 2026-05-25)
Source: transact-rs/sqlx