3 ms·
+1 for sqlx. Native SQL queries that are typechecked at compile time.
by echelon 4y ago
+1 for sqlx. Native SQL queries that are typechecked at compile time.
- maxbond 4y agosqlx is awesome but I'd add the small caveat that it has an annoying sharp edge with sqlite where it relies on sqlite's loose typing, but if you want to use the recent strict feature[1] (which enforces type & check constraints), you need to use the specific underlying types (eg, you need to specify INTEGER, not DATETIME). In which case, I'd recommend the excellent rusqlite. You'll also be able to use all sorts of advanced sqlite features that way, like writing functions in Rust that you can call from your queries[2]. [1] https://www.sqlite.org/stricttables.html https://www.sqlite.org/stricttables.html [2] https://docs.rs/rusqlite/latest/rusqlite/functions/index.html https://docs.rs/rusqlite/latest/rusqlite/functions/index.htm...