I would prefer relational databases just have a compound hierarchal data type that can contain all the types it supports. Json is so anemic on types.
This way it can efficiently store numbers , dates, uuids or raw binary etc. and should really have some sort of key interning to efficiently store repeating key names.
Then just have functions to convert to/from json if thats what you want
I do wish that SQLite3 could get a CREATE TYPE command so that one could get a measure of static typing. Under the covers there would still be only the types that SQLite3 has now, so a CREATE TYPE would have to specify which one of those types underlies the user-defined type. I think this should be doable.
This way it can efficiently store numbers , dates, uuids or raw binary etc. and should really have some sort of key interning to efficiently store repeating key names.
Then just have functions to convert to/from json if thats what you want