Release of PostgREST 9.0.0, add-ons for turning a database into a RESTful API

PostgREST 9.0.0 has been released, a standalone web server with a lightweight add-on to the PostgreSQL DBMS that translates objects from an existing database into a RESTful API. Instead of mapping relational data to objects (ORM), PostgREST creates views directly in the database. On the DB side, JSON response serialization, data validation, and authorization are also performed. System performance is sufficient to process up to 2000 requests per second on a typical server. The project code is written in Haskell and distributed under the MIT license.

For example, using only the privilege mechanism in the database, you can grant access to data (tables, views, and stored procedures) over HTTP. In this case, there is no need to encode such a translation, and usually one GRANT command is enough to make the table available via the REST API. It is possible to configure access by token (JWT) and organize “multitenancy” through the use of dynamic row-level security (Row Level Security).

Architecturally, PostgREST is pushing towards a data-oriented architecture (Data-Oriented Architecture), where microservices do not save state themselves, but use a single data access layer (Data Access Layer) for this.

Release of PostgREST 9.0.0, add-ons for turning a database into a RESTful API

Among the changes in the new version:

  • Partitioned (partitioned) tables have been added to the storage scheme cache, which made it possible for such tables to embed UPSERT and INSERT operations in the Location response, execute OPTIONS queries and implement OpenAPI support.
  • Through RPC POST it is allowed to call functions with one unnamed parameter.
  • It is allowed to call functions with a single JSON parameter without the "Prefer: params=single-object" header.
  • It is allowed to load data with type bytea in a function using requests with "Content-Type: application/octet-stream".
  • It is allowed to load text in functions using requests with "Content-Type: text/plain".
  • Added support for escaping characters inside double brackets, e.g. "?col=in.("Double\"Quote"), ?col=in.("Back\\slash")".
  • Added the ability to filter first-level resources based on built-in filters ("/projects?select=*,clients!inner(*)&clients.id=eq.12".
  • In the "is" operator, the use of the value "unknown" is allowed.
  • Support for PostgreSQL 14 has been added and support for PostgreSQL 9.5 has been dropped.

Source: opennet.ru

Add a comment