我是 PostgreSQL 新手,想知道是否可以创建一个 http 链接来从表中选择特定数据。
我尝试使用 Postgres,但不能真正遵循文档。docker 和 postgREST 容器正在运行,但仍然可以通过 HTTP 链接访问数据库。
有什么解决办法吗?
主要目标是使用http://......../select() From () where time...
某种结构从数据库中获取数据。
图像显示 postgrest 的设置正在运行
谢谢问候。
我是 PostgreSQL 新手,想知道是否可以创建一个 http 链接来从表中选择特定数据。
我尝试使用 Postgres,但不能真正遵循文档。docker 和 postgREST 容器正在运行,但仍然可以通过 HTTP 链接访问数据库。
有什么解决办法吗?
主要目标是使用http://......../select() From () where time...
某种结构从数据库中获取数据。
图像显示 postgrest 的设置正在运行
谢谢问候。
您可以粘贴您阅读和使用命令的参考吗?粘贴的日志显示权限问题(root 用户不存在。)。关于你想要什么的文件可能是这个。
参考。https://postgrest.org/en/latest/api.html
为了确认,您可以使用 psql 访问 postgres 吗?如果你能做到,我认为是配置带来的麻烦。你用过这样的执行命令吗?请阅读 postgres-user.conf。
$ ./postgrest postgres-user.conf
在配置中,我们可以设置 db-uri 指定 postgrest 的角色,db-anon-role 是 HTTP API 服务器在 postgres 中的非授权用户角色。
db-uri = "postgres://authenticator:mysecretpassword@localhost:5433/postgres
db-anon-role = "web_anon"
阅读本教程后,我尝试使用 postgrest 并成功通过 postgrest 获取表数据
参考。