Sync query stored in code/version control with Retool

Hello,
We are looking to use Retools in my company for a back office (with business or enterprise plan if necessary). However we have some questions that we need answers to before moving forward.

Our main problematic is how to handle versioning for our queries.
Right now, our objective is to deliver fast so we are using SQL queries directly inside modules. However our data model is changing as well and we can't really make sure the queries in retools are always up to date with our data model.
How can we make sure we keep sync between the two?

The easier for us would be to be able, in any PR that edit the datamodel, to also edit the query in retools at the same time. Is that possible?

  • I saw the version control features available, but it seems any change needs to be done in retools anyway.
  • Also, can it be integrated in a monorepo or does it need to be in a separate repository?
  • Could it also be done via API? We keep queries in our version control in our repo, and we have a CI that pushes any change to retools.

What are the best practices ?

Thanks in advance for these clarification!

Hey @Khaaz, if you are going to be changing the backend data model and want to update the queries to reflect that change, I'd recommend using the Query Library. You can write you sql there and update it as necessary. In the individual apps, you can import the query and set it to pull in the latest version so that it will be up to date when you make the changes in the QL.

We are also expanding a bit more to have some integrations with VSCode etc. You can check out this Beta feature for editing queries there as well.