Hacker News new | ask | show | jobs
by elnygren 1887 days 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.

3 comments

It's not really dynamically typed in the sense that there isn't a schema.
However 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...

AFAIK 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

Take a look at https://cgsql.dev/. It's supposed to be a lightweight and strict type-checked data layer on top of sqlite.
For JSON support, there seems to be an extension:

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.