3 ms·
> Surely they're not meaning let front-end code hit the database directly? In this case they mean "let Postgres generate the JSON for API responses" instead of
by CharlesW 4y ago
> Surely they're not meaning let front-end code hit the database directly?
In this case they mean "let Postgres generate the JSON for API responses" instead of having the API interface do it. The "Generating JSON in Postgres" section in the linked article shows how this is done.
- mgkimsal 4y ago"let Postgres generate the JSON for API responses" would have been a far less confusing way of expressing that idea. I had read the linked stuff and none of it looked like front-end code hitting a PostgreSQL db directly. yes, if you can create some JSON without having to transform in an intermediate code layer, that's handy/useful. I often don't run in to too many scenarios where things are trivial enough to allow for that - there's usually some app-level logic that comes in to play with respect to visibility/permissions/etc.