News for hackers. Stuff that matters.
Re:pREST – A fully RESTful API from any existing PostgreSQL ... by sriram_malhar on Saturday June 24, 2017 @03:33AM (#14624753)
Can someone explain why it is necessary or useful to have a RESTful API for a database that is never exposed to the Web? If I am going to use a library to access the database, why not just use the native driver? Why the JSON indirection?
Re:pREST – A fully RESTful API from any existing PostgreSQL ... by dasloop on Saturday June 24, 2017 @04:53AM (#14624927)
Because it is possible to call it directly from your front end app, no need for a server. And you can add logic into the DB using procedures. Ideal for simple apps and prototyping.
Re:pREST – A fully RESTful API from any existing PostgreSQL ... by icot on Saturday June 24, 2017 @04:58AM (#14624942)
It's not really necessary because as you say, there are other ways.

But it's useful if what you want to do is create a simple API to access your data. If your use case includes buildinga CRUD app, or API, you basically get that out of the box.

If you have several components/clients (in different languages) which need to access your database it allows you keep a common interface instead of having to work with different specific libraries/frameworks for each language.

(PostgREST user)

Re:pREST – A fully RESTful API from any existing PostgreSQL ... by ruslan_talpa on Saturday June 24, 2017 @05:08AM (#14624961)
The point is to allow untrusted clients (browser/mobile) to run (safe/predictable) queries against your database without the need for "backend/api" as a middle layer because nowadays most of the business logic is mostly on the frontend and it needs a way to get to the database.

It's not necessarily useful if you have trusted code running on your servers, it should just connect to the database. But if this works for you ... why not.

(At least that's how i think of it, others may use it in different ways)

Re:pREST – A fully RESTful API from any existing PostgreSQL ... by thedarkproject on Saturday June 24, 2017 @08:47AM (#14625409)
> nowadays most of the business logic is mostly on the frontend

This is a design flaw imho and should not be used as a reason to motivate the use of such projects. If your logic is in the frontend you should rather build a backend that captures the logic instead of just putting a rest layer on your DB and call it a day.

Re:pREST – A fully RESTful API from any existing PostgreSQL ... by denisw on Saturday June 24, 2017 @10:13AM (#14625633)
Unless you are writing an app that should also work offline. In this case, most of your logic _must_ be your frontend, and your backend is mostly a data repository for data backup and synchronization. In such a scenario, database-as-an-API seems to be exactly the right approach.
Re:pREST – A fully RESTful API from any existing PostgreSQL ... by ruslan_talpa on Saturday June 24, 2017 @05:10AM (#14624966)
The point is to expose it to the web. It's primary role is to be accessed by browsers/mobile apps, not code running in the backend
Re:pREST – A fully RESTful API from any existing PostgreSQL ... by avelino on Saturday June 24, 2017 @01:16PM (#14626397)
pREST is not vulnerable to SQL injection, recommend you run tests Check access level (permissions) in https://github.com/nuveo/prest#table-permissions
Re:pREST – A fully RESTful API from any existing PostgreSQL ... by FullMtlAlcoholc on Saturday June 24, 2017 @04:49AM (#14624916)
So that others may consume the service