I really like using sqlx in rust. But wow I get many errors from rust-analyser when my database is offline. It always happens while doing some change, so I briefly think I've broken something mayor.

#rustlang #sqlx

@borup have you tried persisting the query metadata? Should help with your issue: https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md#enable-building-in-offline-mode-with-query
sqlx/sqlx-cli/README.md at main · launchbadge/sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite. - launchbadge/sqlx

GitHub
@Rovellat yeah the schema is in fact persisted (our build host doesn't have a database).
But the persisted schema doesn't seem to be used when there is a DATABASE_URL available (which makes sense, I guess).
@borup if you use compile time checks with query!() macro it will require db to be online at compile time. You can use offline mode (check docs) or use query() macro (no compile time checks).
@fishingdev I love the compile-time checks. I just need to remember to start the database.