3 ms·
Coming from a Rust perspective, I really value strong typing, so the SQLite type system leaves some things to be desired. Is there an alternative embedded data
by clarkmoody 3y ago
Coming from a Rust perspective, I really value strong typing, so the SQLite type system leaves some things to be desired.
Is there an alternative embedded database with stronger types?
- mattrighetti 3y agoI’ve used sqlx and SQLite for a lot of projects and sqlx’s macros have prevented me from inserting the wrong types in columns, but I agree that it’s not a viabile long term solution, especially if you don’t use sqlx macros in the first place which is not something you can always do. On the contrary, I think that everything should be fine with Diesel since that leverages the rust ecosystem to manage types and migrations of the sqlite database.
- jmull 3y agoA type system like what a programming languages have doesn't make sense for databases. For inserts, sure (but then, it's straightforward to use the host language for that). But once you move beyond simple cases, data changes over time, not atomically. It's also common for data to be distributed. Static type system can handle either of these things. If your database can't go down for the duration of a migration (which will need more time now, to type-check all the data), and you don't have a way to ensure all clients are updated at the same time also, then you can't use static type checking like programming languages have.
- simonw 3y agoSQLite with strict mode turned on.