Show HN: Solving SQL's schema rigidity
raijindb.com5 pointsby b0ti2 comments
{"foo":"bar"}
{"foo":"bar2","intfield":42}
Note that when you select the full record with the star it does not return null values: select * from tbl;
--
{"_id":1,"eventtime":"2016-07-20 10:37:12","foo":"bar","whatever":"xx"}
{"_id":2,"eventtime":"2016-07-20 10:38:22","foo":"bar2","intfield":42}
The undef/exists thing can get a bit confusing when you are mapping this into SQL. CREATE TABLE tbl(eventtime datetime);
INSERT INTO tbl {"eventtime":"2016-07-20 10:37:12","foo":"bar","whatever":"xx"};
INSERT INTO tbl {"eventtime":"2016-07-20 10:38:22","foo":"bar2","intfield":42};
SELECT foo, intfield FROM tbl;
--
{"foo":"bar","intfield":null}
{"foo":"bar2","intfield":42}
It won't complain about the missing 'columns'.