Jeff Martin<p>So, <a href="https://gladtech.social/tags/sqlx" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sqlx</span></a> for <a href="https://gladtech.social/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> <a href="https://gladtech.social/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> is pretty great actually. Compile-time checked queries are a huge win for reliability! I love being able to check my queries at compile time while I'm developing. :blobcatheart: Huge benefit there!</p><p>The trouble I've found so far with this approach is there's not a good way to turn it off when you don't need it!</p><p>Downstream consumers of my library crates must compile from source (because ... Rust), but they really don't need to double-check my queries, because I already did it before I committed the code. It's just completely unnecessary for every library consumer to re-check the queries again for the same code.</p><p>Tragically, sqlx still forces downstream consumers to check the queries anyway, and requires them to have all the query metadata necessary to do that. So as a library author, I need to do a bunch of extra work to enable that step, even tho it's reaaaaally not needed. :blobcatverysad: </p><p>Yes, sqlx has an offline mode that is supposed to make this easier. And maybe it does for the postgres types. But it's actually pretty complicated to get that working since it requires a special cli and extra build steps. But for us sqlite types, there's a much simpler way.</p><p>Luckily, in my case, the sqlite schema database is a tiny file and can easily be distributed along with the library crate sources. But then you actually have to configure sqlx to find the damn thing, which, due to their reliance on .env files, is not as easy as you'd like it to be, especially in multi-package workspace environments. But thankfully cargo lets us have per-crate environmental config by just adding some instructions to build.rs.</p><p>And presto! There you have it. Compile-time metadata that library consumers shouldn't even have to worry about, but need to anyway. Maybe this is something sqlx can improve in the future.</p>