uhyonc / HueTemplateEvaluator

Published:

Version: 0.1+744465e updated

Summary: Evaluate the text field in Hue as a template

License: MIT; https://opensource.org/licenses/MIT

Adds a button to Hue notebook which allows you to evaluate a Handlebars template to autogenerate queries based on a template.
You can use both {{var}} or ${var} for variable replacement. The context portion is evaluated as JSON that is to be passed to the template.
It currently supports the daterange helper, which is useful for generating one query for each day. e.g.

Context:
"schema":"sevilla",
"comment":"This works!"

Template:
-- ${comment}
{{#daterange 20170320 -60}}
select * from ${../schema}.mytable where dt='${day}';
{{/daterange}}
You can use other Handlebar constructs as well.

Rating: 0