template_sql

Function template_sql 

Source
pub fn template_sql(
    sql: &str,
    config: &TemplateConfig,
) -> Result<String, TemplateError>
Expand description

Renders a SQL template according to the specified configuration.

This is the main entry point for template preprocessing. It dispatches to the appropriate renderer based on the configured mode.

§Arguments

  • sql - The SQL template string to render
  • config - Configuration specifying the mode and context variables

§Returns

The rendered SQL string, or an error if rendering fails.

§Errors

  • TemplateError::SyntaxError - Invalid template syntax
  • TemplateError::UndefinedVariable - Undefined variable in Jinja mode
  • TemplateError::RenderError - Other rendering failures