89 字
1 分钟
postgrest
2025-05-29
无标签
version: '3'
services:
  server:
    image: postgrest/postgrest
    ports:
      - "3000:3000"
    environment:
      PGRST_DB_URI: postgres://user:password@db:5432/database
      PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
      PGRST_DB_ANON_ROLE: anon
      PGRST_DB_SCHEMA: public
      PGRST_JWT_SECRET: `openssl rand -base64 32`

然后创建Role

create user anon;
grant usage on schema public to anon;
grant select on all tables in schema public to anon;
create user admin;
grant usage on schema public to admin;
grant select, insert, update, delete on all tables in schema public to admin;

jwt

bangwu20250529191815.jpg

然后Auth BearToken

注意postgrest特定的操作符eq

后面待补

postgrest
https://bangwu.top/posts/postgrest/
作者
棒无
发布于
2025-05-29
许可协议
CC BY-NC-SA 4.0