5 ms·
Ugh a dynamically typed SQL database, no thanks. I always find I have to build quite a bit of a "data layer" on top of SQLite for example when using it in mobil
by elnygren 5y ago
Ugh a dynamically typed SQL database, no thanks. I always find I have to build quite a bit of a "data layer" on top of SQLite for example when using it in mobile apps.
Also you have to build some basic stuff yourself like Enum or JSON support. It's not hard but honestly I would feel much better using PostgreSQL in those situations.
- klysm 5y agoIt's not really dynamically typed in the sense that there isn't a schema.
- elnygren 5y agoHowever the schema does look like type schema = { field1: any, field2: any, ... } AFAIK the column types are not really enforced and you can even leave them out. https://stackoverflow.com/questions/2489936/sqlite3s-dynamic-typing https://stackoverflow.com/questions/2489936/sqlite3s-dynamic...
- CodesInChaos 5y agoAFAIK it's even worse than that. The field types can trigger lossy transformation of the input data, but aren't enforced. https://www.sqlite.org/datatype3.html#type_affinity https://www.sqlite.org/datatype3.html#type_affinity
- rplnt 5y agoFor JSON support, there seems to be an extension: https://www.sqlite.org/json1.html https://www.sqlite.org/json1.html Haven't used it, was just wondering if there's something as I found myself quite happy with JSON support in mysql/aurora.
- shakkhar 5y agoTake a look at https://cgsql.dev/ https://cgsql.dev/. It's supposed to be a lightweight and strict type-checked data layer on top of sqlite.