With a pre select hook you can run code before the select block. For example you can run UPDATE
or even TRUNCATE
statements. For WITH
statements, there is a specific hook.
{{ block "PRE_SELECT_HOOKS" . }}
UPDATE {{ .This }}
SET blub=14
WHERE "date2" BETWEEN '{{ .StartDate }}' and '{{ .EndDate }}'
{{end}}
{{ block "PRE_SELECT_HOOKS" . }}
TRUNCATE {{ .This }}
{{end}}