fix(macros): smarter .env loading, caching, and invalidation (#4053)

* fix(macros): smarter `.env` loading, caching, and invalidation

* feat(mysql): test `.env` loading in CI

* feat(postgres): test `.env` loading in CI

* feat(macros): allow `DATABASE_URL` to be empty

* fix(examples/postgres): make `cargo-sqlx` executable

* fix(examples/postgres): `cargo sqlx` invocation

* feat(examples/postgres): check offline prepare on more examples

* fix(examples/postgres): the name of this step

* fix(cli): don't suppress error from `dotenv()`

* fix(ci/examples/postgres): don't use heredoc in this step

* fix(ci/examples/postgres): multi-tenant

* fix(ci/examples/sqlite): test `.env` loading

* chore: add CHANGELOG entry
This commit is contained in:
Austin Bonander
2025-10-14 17:31:12 -07:00
committed by GitHub
parent 064d649abd
commit 388c424f48
18 changed files with 622 additions and 297 deletions

View File

@@ -49,7 +49,11 @@ pub fn maybe_apply_dotenv() {
return;
}
dotenvy::dotenv().ok();
if let Err(e) = dotenvy::dotenv() {
if !e.not_found() {
eprintln!("Warning: error loading `.env` file: {e:?}");
}
}
}
pub async fn run(opt: Opt) -> anyhow::Result<()> {