veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

208
active users

#sqlx

0 posts0 participants0 posts today
mmcm<p>If anyone has a working example of <a href="https://mastodon.social/tags/sqlx" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sqlx</span></a>, <a href="https://mastodon.social/tags/sqlite" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>sqlite</span></a>, and the <a href="https://mastodon.social/tags/chrono" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>chrono</span></a> DateTime (or NaiveDateTime) types working together, I'd be really glag... 🙄</p><p><a href="https://mastodon.social/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a></p>
bram dingelstad :nb_flag:<p>anyone using <a href="https://gamedev.lgbt/tags/Rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rust</span></a> ever get a random "intellijRulezz" put into their macro outputs?</p><p>mine get randomly added to my <a href="https://gamedev.lgbt/tags/SQLX" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SQLX</span></a> <a href="https://gamedev.lgbt/tags/Postgres" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Postgres</span></a> queries, really fucking weird and _definitely_ not desirable for prod</p><p>EDIT: found out why, im stupid, skip to the last post in thread to know why</p>
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>