Render functions in the Tera DuckDB extension
Function category
Render
1 functionRender Tera templates with JSON context. Single-function surface; the optional `template_path` argument lets you load templates from disk by name rather than embedding them inline.
Signature
2 overloaded forms · click to inspectArguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
template
|
Type
VARCHAR
|
Mode Positional | Description |
Argument
varargs
|
Type
ANY
|
Mode Positional | Description Varargs |
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
template
|
Type
VARCHAR
|
Mode Positional | Description |
Argument
context
|
Type
JSON
|
Mode Positional | Description |
Argument
varargs
|
Type
ANY
|
Mode Positional | Description Varargs |
Description
Render a Tera template with JSON context. Supports the full Tera vocabulary: variables, filters, conditionals, for loops, autoescape, and inclusion. Optional named arguments tune behavior — autoescape := false for non-HTML output, template_path := './templates/*.html' to load templates from disk by name.
1
Inline variable
SELECT tera_render('{{ foo }}', '{"foo":"bar"}');
2
Nested context
SELECT tera_render('Hello {{ user.name }}', '{"user":{"name":"Alice"}}');
3
Disable autoescape
SELECT tera_render('{{ v }}', '{"v":"B&O"}', autoescape := false);
4
Render a named template file
SELECT tera_render('email.html', '{"name":"Alice"}', template_path := './templates/*.html');