Skip to content

dotenv not working for sqlx database ... CLI commands #1431

@xpe

Description

@xpe

Currently dotenv isn't working for sqlx database ... commands. This is a regression caused by commit 0e51272. (That commit was created as a response to #1391.)

For example, testing on the master branch that includes 0e51272 :

% sqlx database drop
error: The following required arguments were not provided:
    --database-url <database-url>

USAGE:
    sqlx database drop [FLAGS] --database-url <database-url>

For more information try --help

Testing on a similar branch that excludes the 0e51272 commit:

% sqlx database drop                   
Drop database at postgres://foo_dev@localhost/foo_dev? (y/n): y

The .env file for both is:

DATABASE_URL=postgres://foo_dev@localhost/foo_dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions