Skip to content

[email protected] broke .env default resolution mechanism #3823

Closed
@vegardgs-ksat

Description

@vegardgs-ksat

I have found these related issues/pull requests

No related issues.

Description

Running sqlx-cli with version 0.8.4 version doesn't respect .env files (for DATABASE_URL) as expected.

In the changelog for 0.8.4, this PR adds a --no-dotenv flag, but that does indeed seem to set the default value to false, e.g., resolve .env files.

Reproduction steps

mkdir scratch && cd scratch
cargo install sqlx-cli --version 0.8.3 --root 0.8.3
cargo install sqlx-cli --version 0.8.4 --root 0.8.4
echo "DATABASE_URL=sqlite:tmp.db" >> .env
./0.8.3/bin/sqlx database create
./0.8.4/bin/sqlx database create

Observe that the 0.8.3 command succeeds, whilst the 0.8.4 command complains about no DATABASE_URL.

SQLx version

0.8.4

Enabled SQLx features

default

Database server and version

any

Operating system

macOS

Rust version

1.86

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugregressionSomething worked before but doesn't now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions