From a46d7f8fdf562edbf152f0538c7c41263965b853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20Tam=C3=A1s?= Date: Tue, 13 Oct 2020 18:37:36 +0200 Subject: [PATCH] fix(macro): offline env --- sqlx-macros/src/query/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlx-macros/src/query/mod.rs b/sqlx-macros/src/query/mod.rs index de5b8164..7a324b7f 100644 --- a/sqlx-macros/src/query/mod.rs +++ b/sqlx-macros/src/query/mod.rs @@ -36,7 +36,9 @@ 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").is_ok(), + dotenv::var("SQLX_OFFLINE") + .map(|s| s.to_lowercase() == "true") + .unwrap_or(false), dotenv::var("DATABASE_URL"), ) { (false, Ok(db_url)) => expand_from_db(input, &db_url),