Re:PostgREST – A fully RESTful API from any existing Postgre...
by andreareina on Sunday March 26, 2017 @05:00AM
(#13959855)
Some usage examples here[1]. I do wish they were available in the README though.
Re:PostgREST – A fully RESTful API from any existing Postgre...
by ruslan_talpa on Sunday March 26, 2017 @04:23AM
(#13959773)
You 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.
Re:PostgREST – A fully RESTful API from any existing Postgre...
by theprotocol on Sunday March 26, 2017 @04:45AM
(#13959826)
Sounds 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.
Re:PostgREST – A fully RESTful API from any existing Postgre...
by ruslan_talpa on Sunday March 26, 2017 @05:05AM
(#13959870)
those moving parts are all there already in every project (nginx/db/rabbitmq), people are just not using their full power.
Re:PostgREST – A fully RESTful API from any existing Postgre...
by theprotocol on Sunday March 26, 2017 @06:15AM
(#13960023)
Fair 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).
Re:PostgREST – A fully RESTful API from any existing Postgre...
by ruslan_talpa on Sunday March 26, 2017 @05:04AM
(#13959867)
Re:PostgREST – A fully RESTful API from any existing Postgre...
by ryanar on Sunday March 26, 2017 @08:28AM
(#13960425)
Looks 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)
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.