PostgREST 9.0.0 Release: A Layer to Turn Databases into RESTful APIs

The release of PostgREST 9.0.0 has taken place, featuring a standalone web server that implements a lightweight layer for PostgreSQL databases, translating objects from an existing database into a RESTful API. Instead of reflecting relational data into objects (ORM), PostgREST views are created directly in the database. JSON response serialization, data validation, and authorization are also performed on the database side. The system's performance is sufficient to handle up to 2000 requests per second under typical loads. serverThe project code is written in Haskell and is distributed under the MIT license.

For example, using only the privilege mechanism in the database, access to data (tables, views, and stored procedures) can be provided via HTTP. There is no need for coding such translation; usually, a single GRANT command is enough to make the table available through the REST API. It is also possible to configure access via a token (JWT) and implement multitenancy through dynamic row-level security.

Architecturally, PostgREST encourages a Data-Oriented Architecture, where microservices do not maintain their state but use a single point of access to the data (Data Access Layer).

PostgREST 9.0.0 Release: A Layer to Turn Databases into RESTful APIs

Among the changes in the new version:

  • Partitioned tables have been added to the storage scheme cache, allowing for operations like UPSERT and INSERT to be embedded in the Location response, executing OPTIONS requests and supporting OpenAPI.
  • Through RPC POST, functions can be invoked with a single unnamed parameter.
  • Functions can also be invoked with a single JSON parameter without the header 'Prefer: params=single-object'.
  • It is now allowed to upload data of type bytea to functions using requests with 'Content-Type: application/octet-stream'.
  • Text can be uploaded to functions using requests with 'Content-Type: text/plain'.
  • Support for escaping characters within double brackets has been added, for example, '?col=in.("Double\"Quote"), ?col=in.("Back\\slash").
  • The ability to filter first-level resources based on embedded filters has been provided ('/projects?select=*,clients!inner(*);clients.id=eq.12').
  • In the 'is' operator, the value 'unknown' is allowed.
  • Compatibility with PostgreSQL 14 has been ensured, and support for PostgreSQL 9.5 has been discontinued.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster