Generating JSON Directly from Postgres
> Too often, web tiers are full of boilerplate that does nothing except convert a result set into JSON.Yeah.  This is the problem: we've abandoned the hypermedia architecture of the web for a dumb-data, RPC model.  I suppose if you are going to go that direction and things are simple enough, you can jam it in the DB and get smoking perf.But as things get more complicated, where does the business logic live?  Maybe in the database as stored procedures?  It's less crazy than it sounds.An alternative is to cut out the other middle man: JSON, ditch heavy front-end javascript and return HTML instead, going back to the hypermedia approach.  The big problem with that is a step back in UX functionality, but there are tools[1][2][3] for addressing that.[1] - https://htmx.org (my library)[2] - https://unpoly.com[3] - https://hotwired.dev