4 ms·
Some feedback: I need to see some kind of "big picture" usage highlights. I find it hard to picture what endpoints are generated based on the tables: does each
by theprotocol 10y ago
Some feedback: I need to see some kind of "big picture" usage highlights. I find it hard to picture what endpoints are generated based on the tables: does each table/row become a resource with its own url? How are relational queries and joins handled?
I looked at the docs and they seem to discuss various concepts and other minutiae but there is no real overview that cuts through the fat.
It's not immediately obvious to me how it fulfills its stated claim:
> PostgREST is a standalone web server that turns your PostgreSQL database directly into a RESTful API. The structural constraints and permissions in the database determine the API endpoints and operations.
> Using PostgREST is an alternative to manual CRUD programming. Custom API servers suffer problems. Writing business logic often duplicates, ignores or hobbles database structure. Object-relational mapping is a leaky abstraction leading to slow imperative code. The PostgREST philosophy establishes a single declarative source of truth: the data itself.
The second paragraph in particular is a pretty bold claim, so I find it strange that there is very little elaboration on how this project can eliminate the need for custom APIs.
- ruslan_talpa 10y agoYou are right in saying that the docs lack "the big picture", but that will be fixed soon(ish). The big picture is that it's not PostgREST alone that accomplishes this "big claim" of eliminating the need for custom APIs. It's the combination of using openresty(nginx)/postgrest/postgres/rabbitmq together that gives you the possibility of "defining" apis rather then "manually coding" apis.
- theprotocol 10y agoSounds like an interesting tightrope walk. I feel a bit of concern about the number of moving parts being part of a single solution, having configured similar selections of software myself, but I'll wait and see. Best of luck.
- ruslan_talpa 10y agohttps://lobste.rs/s/g6cu5r/rest_api_haskell/comments/ecggfa#c_ecggfa https://lobste.rs/s/g6cu5r/rest_api_haskell/comments/ecggfa#...
- ruslan_talpa 10y agothose moving parts are all there already in every project (nginx/db/rabbitmq), people are just not using their full power.
- theprotocol 10y agoFair point. I can't really judge until I see some kind of overview that deals with the pragmatic aspects of working with it, or trying it myself (which I may do some time).
- andreareina 10y agoSome usage examples here[1]. I do wish they were available in the README though. [1]https://postgrest.com/en/v0.4/api.html https://postgrest.com/en/v0.4/api.html
- ryanar 10y agoLooks like to define richer endpoints you create views in the database and stored procedures. It can follow foreign key and m2m through a select url param select=id,foreignkey(name)