3 ms·
Yep, I'm the one. And the question stands. What is the point of an auto-generated HTTP API to the database, if not to let clients formulate queries? And why wo
by DidYaWipe 1y ago
Yep, I'm the one. And the question stands.
What is the point of an auto-generated HTTP API to the database, if not to let clients formulate queries? And why would you do that?
- whstl 1y agoPostgREST creates the same type of CRUD endpoint that one would create when writing a traditional backend with an (eg) MVC framework, and it does this without requiring a developer and with complete consistency. If "letting the client formulate queries" you mean "filter posts by DidYaWipe, sorting by date", this is also what traditional CRUD backends do.
- DidYaWipe 1y agoI wouldn't write a back end with an MVC framework, since it's not doing any presentation whatsoever. If PostgREST auto-generates three-table joins automatically to resolve many-to-many relationships and presents an appropriate endpoint, that's interesting.
- steve-chavez 1y agoYes, it does many-to-many joins automatically: https://docs.postgrest.org/en/v12/references/api/resource_embedding.html#many-to-many-relationships https://docs.postgrest.org/en/v12/references/api/resource_em....
- DidYaWipe 1y agoThanks for the reference. I'll check it out!