Open lebalz opened 1 year ago
@Alkarex Thanks for the awesome pg-node!
I had no time to set it up local and to test it. Even i think it shall work, a carefull review seems to be needed. Thanks :)
Thanks for the PR. I am a bit hesitating. I am afraid of a number of possible regressions due to that, in particular on performance (in case of many and/or large values), or unwanted side effects (I have not checked in details whether we risk calling some functions as properties or sub-properties of some context values).
To access those context values, I would rather expose them in the msg
object upstream.
It is not possible to call functions from Mustache, is it?
I see your concerns. I think mustache can somehow call function with a special annotation and setup of the function, but their examples are not working at all in the context of NR.
Probably another approach would be to add the possibility to add custom fields/expressions within the pg node? Those are then evaluated and passed to mustache?
This feature would be nice for portability. In my case, i have the exact same flow except the db-table name. It would be nice, if i only need to set a flow variable once and then use it in the queries...
atm it is not possible to access data other than
msg
within mustache. With this change, theflow
andglobal
context is accessible aswell inside mustache templates.