PostgREST API

Auto-generated REST API from your PostgreSQL tables

Enable PostgREST on any PostgreSQL database server and get instant CRUD endpoints. No backend code, no ORM, no boilerplate. Your schema is your API.

Query your API with standard HTTP

# List users with filtering
curl https://myapp-api.sh0.app/users?select=name,email&role=eq.admin
# Insert a record
curl -X POST https://myapp-api.sh0.app/todos \
-H "Content-Type: application/json" \
-d '[object Object]'
# Joins via resource embedding
curl https://myapp-api.sh0.app/orders?select=id,total,customer(name,email)

Everything you need from a REST API

PostgREST turns your database into a fully-featured API server with zero configuration.

Auto-Generated from Schema

PostgREST introspects your PostgreSQL tables, views, and functions to generate a full REST API automatically. No code generation step required.

Filtering, Pagination & Joins

Built-in query operators: eq, gt, lt, like, in, is, and more. Resource embedding for foreign-key joins. Offset and cursor pagination out of the box.

OpenAPI Specification

Every PostgREST instance exposes a live OpenAPI spec at its root. Import it into Postman, generate client SDKs, or feed it to your documentation system.

One-Click Enable

Select any PostgreSQL database server in your sh0 dashboard and enable PostgREST with a single toggle. Automatic configuration, automatic SSL.

Row-Level Security

Leverage PostgreSQL RLS policies to control access at the row level. PostgREST passes JWT claims as role context so your policies just work.

Auto-SSL Domain

Each PostgREST instance gets its own subdomain with automatic HTTPS via Caddy. Connect from any frontend or mobile app securely.

How It Works

01

Create a PostgreSQL Server

Provision a PostgreSQL database server from the sh0 dashboard. Any version from 14 to 17.

02

Design Your Schema

Create tables, views, and functions in your database. Use the built-in terminal or any PostgreSQL client.

03

Enable PostgREST

Toggle PostgREST on for your database server. sh0 deploys a managed PostgREST instance and connects it automatically.

04

Query via REST

Your API is live. Use standard HTTP methods (GET, POST, PATCH, DELETE) with powerful query parameters.

Request Flow

HTTP Request
Caddy (SSL)
PostgREST
PostgreSQL
JSON Response

PostgREST connects directly to PostgreSQL. No application server in between.

Without PostgREST

  • x Write CRUD routes for every table
  • x Maintain ORM models and migrations
  • x Implement filtering, sorting, pagination
  • x Write API documentation manually
  • x Deploy and scale a separate API server
  • x Keep schema and API in sync

With sh0 + PostgREST

  • API auto-generated from your schema
  • Schema is the single source of truth
  • Filtering, sorting, pagination built-in
  • OpenAPI spec generated automatically
  • One-click deploy with auto-SSL
  • Row-level security via PostgreSQL RLS

Frequently Asked Questions

Do I need to write any backend code? +
No. PostgREST generates the API directly from your PostgreSQL schema. You define tables, views, and RLS policies -- PostgREST handles the HTTP layer.
Can I use PostgREST with an existing database? +
Yes. Enable PostgREST on any PostgreSQL database server managed by sh0. It introspects your existing schema and exposes it immediately.
How is authentication handled? +
PostgREST uses JWT tokens. You can pair it with the sh0 Auth service (Logto) for complete auth, or use any JWT issuer. The token claims are passed as PostgreSQL role context for RLS.
What about performance? +
PostgREST is written in Haskell and is extremely fast. It connects directly to PostgreSQL via a connection pool and adds minimal overhead to your queries.
Can I expose only certain tables? +
Yes. PostgREST exposes only the schemas you configure (default: public). Use PostgreSQL roles and GRANT statements to control exactly which tables and operations are available.
Is this a Supabase alternative? +
PostgREST is the same core technology that powers Supabase's auto-generated API. Combined with sh0's Auth, Realtime, Functions, and Storage, you get a full self-hosted BaaS.

Turn your database into an API

Stop writing boilerplate CRUD. Enable PostgREST and ship your frontend faster.