Postgrest

REST API for any Postgres database
Alternatives To Postgrest
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Metabase31,825
9 hours ago1June 08, 20222,781otherClojure
The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum:
Dbeaver31,165
10 hours ago1,745apache-2.0Java
Free universal database tool and SQL client
Typeorm30,8241,9942,16413 hours ago650September 20, 20221,918mitTypeScript
ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
Prisma29,9704429 hours ago4,993September 24, 20222,798apache-2.0TypeScript
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Directus20,715509 hours ago55September 22, 2022348gpl-3.0TypeScript
The Modern Data Stack 🐰 — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database.
Postgrest20,239
42 days ago37July 12, 2022201mitHaskell
REST API for any Postgres database
Shardingsphere18,135810 hours ago7June 04, 2020567apache-2.0Java
Ecosystem to transform any database into a distributed database system, and enhance it with sharding, elastic scaling, encryption features & more
Timescaledb14,711
11 hours ago520otherC
An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
Mindsdb14,4873110 hours ago42March 19, 2019445gpl-3.0Python
A low-code Machine Learning platform to help developers build #AI solutions
Beekeeper Studio12,671
14 hours ago488gpl-3.0Vue
Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows.
Alternatives To Postgrest
Select To Compare


Alternative Project Comparisons
Readme

Logo

Donate Donate Join the chat at https://gitter.im/begriffs/postgrest Docs Docker Stars Build Status Coverage Status Hackage docs

PostgREST serves a fully RESTful API from any existing PostgreSQL database. It provides a cleaner, more standards-compliant, faster API than you are likely to write from scratch.

Sponsors

Big thanks to our sponsors! You can join them by supporting PostgREST on Patreon.

Usage

  1. Download the binary (latest release) for your platform.

  2. Invoke for help:

    postgrest --help
    

Documentation

Latest documentation is at postgrest.org. You can contribute to the docs in PostgREST/postgrest-docs.

Performance

TLDR; subsecond response times for up to 2000 requests/sec on Heroku free tier. If you're used to servers written in interpreted languages, prepare to be pleasantly surprised by PostgREST performance.

Three factors contribute to the speed. First the server is written in Haskell using the Warp HTTP server (aka a compiled language with lightweight threads). Next it delegates as much calculation as possible to the database including

  • Serializing JSON responses directly in SQL
  • Data validation
  • Authorization
  • Combined row counting and retrieval
  • Data post in single command (returning *)

Finally it uses the database efficiently with the Hasql library by

  • Keeping a pool of db connections
  • Using the PostgreSQL binary protocol
  • Being stateless to allow horizontal scaling

Security

PostgREST handles authentication (via JSON Web Tokens) and delegates authorization to the role information defined in the database. This ensures there is a single declarative source of truth for security. When dealing with the database the server assumes the identity of the currently authenticated user, and for the duration of the connection cannot do anything the user themselves couldn't. Other forms of authentication can be built on top of the JWT primitive. See the docs for more information.

Versioning

A robust long-lived API needs the freedom to exist in multiple versions. PostgREST does versioning through database schemas. This allows you to expose tables and views without making the app brittle. Underlying tables can be superseded and hidden behind public facing views.

Self-documentation

PostgREST uses the OpenAPI standard to generate up-to-date documentation for APIs. You can use a tool like Swagger-UI to render interactive documentation for demo requests against the live API server.

This project uses HTTP to communicate other metadata as well. For instance the number of rows returned by an endpoint is reported by - and limited with - range headers. More about that.

Data Integrity

Rather than relying on an Object Relational Mapper and custom imperative coding, this system requires you put declarative constraints directly into your database. Hence no application can corrupt your data (including your API server).

The PostgREST exposes HTTP interface with safeguards to prevent surprises, such as enforcing idempotent PUT requests.

See examples of PostgreSQL constraints and the API guide.

Supporting development

You can help PostgREST ongoing maintenance and development by:

Every donation will be spent on making PostgREST better for the whole community.

Thanks

The PostgREST organization is grateful to:

  • The project sponsors and backers who support PostgREST's development.
  • The project contributors who have improved PostgREST immensely with their code and good judgement. See more details in the changelog.

The cool logo came from Mikey Casalaina.

Popular Database Projects
Popular Postgresql Projects
Popular Data Storage Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Database
Server
Security
Http
Rest
Postgresql
Postgres
Sql
Haskell
Api Server
Pgsql
Automatic Api