3 ms·
Json columns are really useful. When prototyping applications in sqlite or postgres you can just dump everything into a json column, and as things begin to cool
by eddd-ddde 2y ago
Json columns are really useful. When prototyping applications in sqlite or postgres you can just dump everything into a json column, and as things begin to cool down and stabilise, you can migrate them into their own column.
Postgres goes even further than sqlite in terms of json functionality like aggregates.
And if you wanna go /even/ further you can add schemas to the json itself [1]
1: https://supabase.com/blog/pg-jsonschema-a-postgres-extension-for-json-validation https://supabase.com/blog/pg-jsonschema-a-postgres-extension...
- chipdart 2y ago> Json columns are really useful. When prototyping applications in sqlite or postgres you can just dump everything into a json column, and as things begin to cool down and stabilise, you can migrate them into their own column. I agree. That's precisely how I've been managing my proof of concept projects, and it's a treat. Previously I used ORMs for the same reason, but they ended up requiring too much extra work to setup and manage. With JSON columns, it's a matter of getting the JSON payload and store it directly, and fetch the payload and massage it in any way. If we're already getting JSON inputs and sending JSON outputs, spending time adding and managing a whole new component to map to/from an intermediate format is something that's very hard to justify.