Skip to content

Alternative to environment variable for setting SQLX_OFFLINE=true #3077

@blazzy

Description

@blazzy

Is your feature request related to a problem? Please describe.
I want the default way to work in my project to be with SQLX_OFFLINE=true while still having a DATABASE_URL set for convenince. I don't want to specify this setting in a .env file, because I would have to check that .env file into the project to make it the default workflow. I don't want to check in a default .env file to the project as a .env file is meant for local overrides that developers/users can tweak to set custom DB and other variables. This is the kind of thing that will accidentally be committed with local settings by contributors when they run commands like a git commit -a

Describe the solution you'd like
I would like an alternate mechanism to set SQLX_OFFLINE=true by default while also specifying a DATABASE_URL for convenience. Maybe by bringing back a feature flag for offline would work.

Describe alternatives you've considered
At the moment I am committing a .env.example file and asking contributors to copy that file. I'd like to eliminate that step. If not a feature flag, perhaps an alternate config file to force SQLX_OFFLINE might be nice. An annotation in the project's source code might be even better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions