@Override
    public Optional<Function<StatementContext, String>> parse(String sqlTemplate, ConfigRegistry config) {
        try {
            Template template = new Template(null, sqlTemplate,
                    config.get(FreemarkerConfig.class).getFreemarkerConfiguration());
            return Optional.of(ctx -> {
                try {
                    StringWriter writer = new StringWriter();
                    template.process(ctx.getAttributes(), writer);
                    return writer.toString();
                } catch (IOException | TemplateException e) {
                    throw new IllegalStateException("Failed to render template: " + sqlTemplate, e);
                }
            });
        } catch (IOException e) {
            throw new IllegalStateException("Failed to process template: " + sqlTemplate, e);
        }
    }
@deprecated use {@link #instance()} for a shared engine instead
freemarker/src/main/java/org/jdbi/v3/freemarker/FreemarkerEngine.java