by hk__2 · 9y ago · 0 comments
Of course, SQLite can also emulate a key-value store quite well, with a table with 'key' and 'value' columns.
(thought it was a typo, now I’m not sure)
Then you can "SELECT person.name, array_agg(hobbies.name) FROM person JOIN hobbies ON (person.id = hobbies.person_id)" to get your json representation back (at least with postgresql, "array_agg" isn't in standard SQL)
That's a pretty simple join, any real database layout I've seen goes much more complicated and much deeper than that.