Skip to content

sqlx-cli prepare command requires a database URL in offline mode #4297

@tosti007

Description

@tosti007

I have found these related issues/pull requests

None

Description

It seems with the release of sqlx-cli 0.9.0 the prepare subcommand always requires a database url to be set, even when SQLX_OFFLINE=true is set.

Reproduction steps

  1. Create a new rust project
  2. Run
$ env SQLX_OFFLINE=true cargo sqlx prepare --check                                                                     Found `sqlx.toml` in current directory; reading...
error: `--database-url` or `DATABASE_URL` must be set

SQLx 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions