PostgREST
约 1 分钟阅读
- postgrest/postgrestGitHubpostgrest/postgrestpostgrest/postgrest · MIT, Haskell · 功能: 将现有的 PostgreSQL 数据库直接转换为 RESTful API。 · 特点: 高性能,无依懒,基于数据库 Schema 自动生成 API。 · Configuration ():笔记:PostgREST
- MIT, Haskell
- 功能: 将现有的 PostgreSQL 数据库直接转换为 RESTful API。
- 特点: 高性能,无依懒,基于数据库 Schema 自动生成 API。
Quick Start (Docker)
# 1. Start PostgREST
docker run --rm --net=host \
-e PGRST_DB_URI="postgres://postgres:password@localhost/postgres" \
-e PGRST_DB_ANON_ROLE="postgres" \
postgrest/postgrest
# 2. Config via file
docker run --rm -v $PWD/postgrest.conf:/etc/postgrest.conf \
postgrest/postgrest /etc/postgrest.confConfiguration (postgrest.conf):
db-uri = "postgres://postgres:password@localhost/postgres"
db-schema = "public"
db-anon-role = "web_anon"
db-pool = 10Tools
- Swagger UI
bash docker run --rm -p 8081:8080 -e API_URL=http://localhost:3000 swaggerapi/swagger-ui
Alternatives
- graphile/postgraphileGitHubgraphile/postgraphile
- PostgreSQL to GraphQL
docker run -p 5000:5000 graphile/postgraphile --connection postgres://user:pass@host:5432/db
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub2 条
- graphile/postgraphilegithub.com/graphile/postgraphile
- postgrest/postgrestgithub.com/postgrest/postgrest