Closed tonyxiao closed 1 year ago
This will never be a feature of Graphile Migrate itself, but you could absolutely write queries into the migration folder based on some preprocessing you do elsewhere 👍
Note that the placeholders are designed to be compatible with psql and are specifically there to handle things like roles/schema names and not much else.
Is it possible hook into the compile step of graphile migrate itself? I saw there seems to be an option in gmrc
No; but at some point I'll be replacing .gmrc.js
with a graphile.config.js
using the standard Graphile config package that I've built for PostGraphile V5 et al, and this will bring with it new capabilities such as plugins and what not that would allow for you to write a plugin to do this.
I often find myself repeating statements when writing raw sql. For example creating 3 different tables with extremely similar structure & permissions. Given that graphile already has the concept of placeholders, I wonder if it makes sense to implement actual templating using something like handlebars so one could do things like loops to further reduce duplication in sql