Is there an easy way to share functions between queries and transformers? More specifically, my application uses MySQL with many columns that are datetime and whenever queries are done it needs to be formatted with moment. The end result is moment.utc(date).format("YYYY-MM-DD HH:mm:ss") is littered all over the queries. It would be much easier if I could move this into a function (ie formatDate(date)).
It looks like this could be done by triggering js queries, but needing to add the addtionalScope parameter is a little messy.
Also, I have noticed that it can take a page reload or two to get the function to be recognized.
Additionally, if there is a syntax error in the function it will not be created and thus not available. This last one has gotten me more times than I care to count. Let Chrome (or equivalent) Dev Tools check that for you - though sometimes it fails to notify of an error when there is one - but stepping through the code reveals this. Ain't programming fun!