From 663a6f2d1fea54c8d325d5cba9fdc5a495bc9a40 Mon Sep 17 00:00:00 2001 From: Pleto Date: Thu, 3 Dec 2020 17:17:10 +0200 Subject: [PATCH] add 1 as true for SQLX_OFFLINE env variable --- sqlx-macros/src/query/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlx-macros/src/query/mod.rs b/sqlx-macros/src/query/mod.rs index 3ccab3139a..59ddbee917 100644 --- a/sqlx-macros/src/query/mod.rs +++ b/sqlx-macros/src/query/mod.rs @@ -37,7 +37,7 @@ pub fn expand_input(input: QueryMacroInput) -> crate::Result { // if `dotenv` wasn't initialized by the above we make sure to do it here match ( dotenv::var("SQLX_OFFLINE") - .map(|s| s.to_lowercase() == "true") + .map(|s| s.eq_ignore_ascii_case("true") || s == "1") .unwrap_or(false), dotenv::var("DATABASE_URL"), ) {