Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macros] improve handling of SQLX_OFFLINE #868

Closed
abonander opened this issue Dec 2, 2020 · 0 comments · Fixed by #874
Closed

[macros] improve handling of SQLX_OFFLINE #868

abonander opened this issue Dec 2, 2020 · 0 comments · Fixed by #874
Labels
E-easy enhancement New feature or request good first issue Good for newcomers macros

Comments

@abonander
Copy link
Collaborator

abonander commented Dec 2, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy enhancement New feature or request good first issue Good for newcomers macros
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant