PostgREST: Auto-Generated API
Deploy PostgREST with Pigsty Compose templates and auto-generate REST APIs from PostgreSQL schema.
PostgREST exposes PostgreSQL schemas directly as REST APIs.
Pigsty provides the app/postgrest template, with default port 8884.
Quick Start
Default endpoints:
http://<IP>:8884http://api.pigsty(if ingress domain is configured)
Key Settings
Common .env parameters:
POSTGREST_DB_URI: database connection stringPOSTGREST_DB_SCHEMA: exposed schema (defaultpigsty)POSTGREST_DB_ANON_ROLE: anonymous rolePOSTGREST_JWT_SECRET: JWT secret
Swagger UI (Optional)
You can run Swagger UI separately to preview APIs:
Then open http://<IP>:8882.
Common Commands
References
- PostgREST docs: https://postgrest.org/en/stable/
- Pigsty template: https://github.com/pgsty/pigsty/tree/main/app/postgrest
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)