英文:
How to connect Docker Hasura to more multiple Postgre database?
问题
我有一个运行在容器中的Hasura(在Kubernetes内部),我希望这个容器的Hasura能够连接到三个不同的PostgreSQL数据库。是否有办法进行配置,而不使用Hasura控制台网页,因为这与以后的扩展有关。
英文:
Says that I have a Hasura running in Container (inside a Kubernetes) and I want this container hasura to connect to 3 different Postgre databases.
Is there a way to configure this without using Hasura console web page, since this has thing to do with scaling later on.
答案1
得分: 2
你可以使用 pg_add_source API 动态添加新的数据库源到 Hasura。
相反,你可以使用 pg_drop_source 来移除它们。
上述方法适用于动态环境,其中数据库会定期添加和移除。如果它们更加静态,你可能需要考虑通过程序化方式操作元数据文件,然后使用 metadata apply
应用更改。
英文:
You can use the pg_add_source API to dynamically add new Database sources to Hasura.
Conversely, you can use pg_drop_source to remove them.
The above approaches would work in a dynamic environment where Databases are being added and removed reguarly. If they're more static, you might want to consider programatically manipulating the Metadata files and then applying the changes using metadata apply
instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论