Skip to content

[macros] improve handling of SQLX_OFFLINE #868

@abonander

Description

@abonander

Currently, the macros expect SQLX_OFFLINE to equal "true" (case insensitive) to force offline mode. This is fine, but environment variables that can switch something on or off typically also accept 0 as false and 1 as true.

This should be a relatively easy fix, the code is here: https://github.com/launchbadge/sqlx/blob/master/sqlx-macros/src/query/mod.rs#L40

I would also prefer to use str::eq_ascii_ignore_case here to save an allocation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions