2 ms·
I recently implemented something like this in Go, basically just a tiny bit of glue between encoding/json and pgx (for JSONB columns). With generics, it's trivi
by pphysch 5y ago
I recently implemented something like this in Go, basically just a tiny bit of glue between encoding/json and pgx (for JSONB columns). With generics, it's trivial to wrap any Go struct into an ACID record.
Quite nice for rapid development without getting buried by ORMs or NoSQL, and it becomes easy to migrate the "soft" JSONB columns to "hard" DDL schemas as performance requires it.
- unclebucknasty 5y ago>migrate the "soft" JSONB columns to "hard" DDL schemas as performance requires Are there cases wherein GIN indexes on the JSONB columns aren't sufficient for performance requirements?
- pphysch 5y agoI assume so but not sure. I'm also keeping the ACID wrapper as simple as possible and not trying to implement e.g. joins, with the idea that highly relational data should be "hardened" anyways into proper (de)normalized DDL. It is really easy to implement indexes and multi-column unique constraints generically over JSONB (in the Go wrapper), which is nice.