News for hackers. Stuff that matters.
Re:Generating JSON Directly from Postgres by taffer on Friday July 16, 2021 @06:14AM (#27854690)
The way you are supposed to use Postgrest or Postgraphile is to provide only views and stored procedures as the API. These views and stored procedures are layered over your data schema and should be the only way to query or change the data. This way you can make API changes without requiring migrations.

The point is that instead of having queries that return tables that you then map to DTOs for serialization, you have queries that return JSON directly.

Another way to accomplish the same thing, if you don't want views or stored procedures, is to use a library like jOOQ that does much the same thing in your Java middleware.

There are no comments on this comment yet.