Hello,
I played around with your service and really like it.
If I want to put this to work with a production service I would need to put the hasura configuration under version control.
From what I understand (and please correct me if I am wrong) I can only configure hasura via the webinterface which persists the configuration under the hasura schema directly in postgres.
I am now asking myself how it would be possible to put these configurations under version control.
Maybe it is possible to use the exported sql commands. Did you already had discussions about this?
I am very open in regard to potential solutions
Quick bullet points of what is important here
Best!
@mren Hasura supports migrations which enables a rails-like experience to version control your schema changes and Hasura specific metadata.
You can find the required documentation here: https://docs.hasura.io/1.0/graphql/manual/migrations/index.html
You can use the Hasura CLI (do hasura init) and when console is served by the CLI using hasura console command, all the changes you make on the UI are automatically created as files and stored in migrations directory as sql and yaml files on your filesystem! You can later apply these changes to any other graphql engine instance by running hasura migrate apply
Let me know if you have any questions.
Also, as feedback to our docs, was it hard to find migrations from docs? If so, any suggestions on how we can improve the visibility of migrations?
@mren In addition to what @shahidhk said, you can use your own migrations tooling (say knex) and you can just export and import the hasura metadata using the CLI. You can then stick this into your version control and make it a part of your CI/CD pipeline as well :)
https://docs.hasura.io/1.0/graphql/manual/hasura-cli/hasura_metadata.html
@mren Also, a quick note, if you'd like help in setting it up and are running into issues, please do feel free to ping us on discord and we can iterate with you: https://discord.gg/vBPpJkS
Ah wow, that is perfect. Thanks for your help. I did not see the migrations in the documentations although it is a top level element. My mistake. Thank you for pointing me in the right direction!
Yeah this sounds like what I need.
The postgres migrations are handled by the main application (although you also provide to manage this) and for my case I only need to manage the metadata.yaml.
Perfect, thanks again for the fast and friendly reply!
@shahidhk RE: Feedback over logs
I had trouble understanding how exactly deploying a configured Hasura instance worked from the documentation.
Perhaps calling out
a) Hasura configuration is itself stored in postresql and not inside the container image
b) The migration functionality is the method of automatically configuring Hasura post-deployment.
Most helpful comment
@shahidhk RE: Feedback over logs
I had trouble understanding how exactly deploying a configured Hasura instance worked from the documentation.
Perhaps calling out
a) Hasura configuration is itself stored in postresql and not inside the container image
b) The migration functionality is the method of automatically configuring Hasura post-deployment.