PostgREST, automatically generate a REST API from a DB

A very interesting project that automatically adds a complete REST backend to a PostgreSQL database!

Feature-rich :

  • field selection as in graphql,
  • filters,
  • tris,
  • joints,
  • pagination,
  • OpenAPI schema.

DB permissions are converted directly into API permissions, so you can do pretty much what you want with JWT and postgreSQL roles, or even ROW AUTHORITY to grant permissions on certain objects only.

Benefits

PostgREST lets you prototype a backend super-fast, with very good performance.

In particular, there's no risk of making O(N) queries by mistake.

Disadvantages

If you want to turn it into a real production application, you'll quickly reach the limits of simple, classic REST, and you'll have to get down to low-level DB administration:

  • stored procedure entry,
  • trigger,
  • view,
  • etc

It can quickly become quite a mess, taking a long time to develop and hard to debug. You'll need to be very good at SQL, but at least the performance will be there.

Bonus