1.What is PostgREST
PostgreSQL+ RESTful
2.下载解压
$ wget https://github.com/PostgREST/postgrest/releases/download/v6.0.2/postgrest-v6.0.2-centos7.tar.xz $ xz -d postgrest-v6.0.2-centos7.tar.xz $ tar -xvf postgrest-v6.0.2-centos7.tar
复制
3.编辑配置文件 db.conf
db-uri = "postgres://flylinker:123456@127.0.0.1:5555/flylinker" db-schema = "public" db-anon-role = "flylinker" server-host = "0.0.0.0" server-port = 6666
复制
4.启动postgrest服务监听6666端口
$ ./postgrest db.conf Attempting to connect to the database... Listening on port 6666 Connection successful
复制
5.创建测试表并插入数据
create table test ( id serial primary key, info text, ctime timestamptz ); insert into test (info,ctime) values ('佩奇',now()), ('乔治',now());
复制
6.使用postman测试
7.查询规则
http://192.168.99.200:6666/test?select=id,info,ctime&id=eq.2&order=id.desc&limit=2
url中包含表名?select=字段名1,字段名2&过滤条件字段=比较运算符.值&order=排序字段.正序&limit=数量
更多运算操作符 http://postgrest.org/en/latest/api.html#operators
最后修改时间:2022-10-22 13:20:23
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
文章被以下合辑收录
评论
相关阅读
外国CTO也感兴趣的开源数据库项目——openHalo
小满未满、
1316次阅读
2025-04-21 16:58:09
9.9 分高危漏洞,尽快升级到 pgAdmin 4 v9.2 进行修复
严少安
383次阅读
2025-04-11 10:43:23
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
368次阅读
2025-04-15 14:48:05
转发有奖 | PostgreSQL 16 PGCM高级认证课程直播班招生中!
墨天轮小教习
174次阅读
2025-04-14 15:58:34
中国PostgreSQL培训认证体系新增PGAI应用工程师方向
开源软件联盟PostgreSQL分会
139次阅读
2025-05-06 10:21:13
SQL 优化之 OR 子句改写
xiongcc
130次阅读
2025-04-21 00:08:06
融合Redis缓存的PostgreSQL高可用架构
梧桐
111次阅读
2025-04-08 06:35:40
告别老旧mysql_fdw,升级正当时
NickYoung
109次阅读
2025-04-29 11:15:18
PostgreSQL的dblink扩展模块使用方法
szrsu
95次阅读
2025-04-24 17:39:30
pgsql+pgpool高可用配置示例
(*´I`*)
90次阅读
2025-04-15 10:43:30