Features: REST, GraphQL and realtime from PostgreSQL

Postrust provides a complete solution for exposing your PostgreSQL database as a secure, high-performance REST and GraphQL API.

REST API

PostgREST-compatible REST API with advanced querying capabilities

CRUD Operations

Full create, read, update, delete support on tables and views

Advanced Filtering

eq, neq, gt, lt, gte, lte, like, ilike, in, is, not operators

Full-Text Search

fts, plfts, phfts, wfts operators with language support

Resource Embedding

Automatic JOINs via foreign keys with nested resources

Pagination

Limit, offset, and Range header support

Column Selection

Select specific columns with aliasing and computed fields

Dynamic Schema

GraphQL schema automatically generated from your database

Hasura Dialect

A client generated against Hasura points at /v1/graphql unchanged

Queries & Mutations

author, author_by_pk, author_aggregate, insert_author_one, update_author_many, on_conflict upserts and nested writes

Permissions

A schema per role, row filters, separate read and write columns, presets and backend_only

Real-time Subscriptions

Live queries over WebSocket, mirroring the query root

Apollo Federation

Opt-in Federation v2 subgraph: _service, _entities and @key from the primary key, checked by Apollo's compatibility suite in CI

Introspection

Full schema introspection for tooling support

GraphQL Playground

Built-in interactive IDE at /v1/graphql

Same RLS

Same Row-Level Security enforcement as REST

Real-time & pgvector Search

Live data synchronization powered by PostgreSQL LISTEN/NOTIFY and vector similarity search via pgvector

GraphQL Subscriptions

Subscribe to any table changes via WebSocket

PostgreSQL LISTEN/NOTIFY

Native PostgreSQL pub/sub for efficient updates

Automatic Triggers

Changes broadcast automatically on INSERT/UPDATE/DELETE

WebSocket Protocol

Uses graphql-transport-ws and graphql-ws standard protocols

pgvector Similarity Search

Cosine, L2, and inner-product distance queries on pgvector embedding columns over REST and RPC

Push, Not Poll

Delivered on PostgreSQL's LISTEN/NOTIFY, not a polling loop

Security

Enterprise-grade security with PostgreSQL Row-Level Security, asymmetric JWTs, and auto-rotating JWKS

Asymmetric & Symmetric JWTs

HS256, HS384, HS512, RS256, RS384, RS512, PS256, PS384, PS512, ES256, ES384, and EdDSA signature verification

JWKS Auto-Rotation

Auto-rotating JWKS key sets via PGRST_JWT_JWKS_URL for Auth0, Clerk, Supabase Auth, AWS Cognito, and Keycloak

Row-Level Security

PostgreSQL RLS policies enforced on every REST, GraphQL, and custom route request

Role-Based Access

Map JWT claims to PostgreSQL roles with NOINHERIT authenticator support

Custom Claims

Access verified JWT claims in SQL policies via request.jwt.claims

Audience & Issuer Validation

Configurable JWT aud and iss claim verification and anonymous role fallback

Developer Experience

Built-in tools for development, configuration, and observability

Admin Dashboard

Central hub with links to all dev tools

Swagger UI

Interactive API documentation and testing

Scalar Docs

Modern, beautiful API documentation

OpenAPI Spec

Auto-generated OpenAPI 3.0 specification

OpenTelemetry & Logging

Structured JSON logs and OpenTelemetry OTLP trace export

Health Checks

/_/health and /_/ready endpoints

Deployment

A server, a container, Kubernetes, AWS Lambda, Cloudflare Workers, or multi-tenant SaaS proxy

Docker

Official container image ready to use

AWS Lambda

The server's REST and GraphQL router behind the Lambda runtime

Cloudflare Workers

The REST API in a Worker, over Hyperdrive, with the schema cache in KV

Kubernetes

Production-ready with health checks

Single Binary

2.93 MiB binary (4.98 MiB with Admin UI) that needs only libc

SaaS Custom Domains

Multi-tenant reverse proxy with automatic Let's Encrypt TLS certificates

Extensibility

Extend Postrust with custom Rust code under the same RLS transaction

Custom Routes

Add your own endpoints in Rust with RlsConn enforcing the caller's JWT role

Webhook Handlers

Process Stripe, GitHub, and other webhooks

RPC Functions

Call PostgreSQL stored procedures

Middleware

Add custom request/response processing

Type Safety

Compile-time guarantees with Rust

Async Runtime

Built on Tokio for high concurrency

Ready to get started?

Set up your PostgreSQL API in under 5 minutes.

Read the Documentation