ralsei.jinja.wrapper

Module Contents

Classes

SqlEnvironmentWrapper

Layer on top of ralsei.jinja.SqlEnvironment with extra local variables

API

class ralsei.jinja.wrapper.SqlEnvironmentWrapper(env: ralsei.jinja.environment.SqlEnvironment, locals: dict[str, Any])

Layer on top of ralsei.jinja.SqlEnvironment with extra local variables

Parameters:
env: ralsei.jinja.environment.SqlEnvironment

the base environment

locals: dict[str, Any]

local variables map

Initialization

property adapter : ralsei.jinja.adapter.SqlAdapter

Type adapter that turns values in braces (like {{value}}) into SQL strings

property dialect_info : ralsei.dialect.DialectInfo

Dialect-specific settings

from_string(source: str | jinja2.nodes.Template, globals: collections.abc.MutableMapping[str, Any] | None = None, template_class: None = None) ralsei.jinja.environment.SqlTemplate

See jinja2.Environment.from_string()

By default, the template class will be SqlTemplate

render(source: str, /, *args: Any, **kwargs: Any) str

Render template once, shorthand for self.from_string().render()

render_sql(source: str, /, *args: Any, **kwargs: Any) sqlalchemy.sql.elements.TextClause

Render and wrap with sqlalchemy.sql.expression.text()

render_split(source: str, /, *args: Any, **kwargs: Any) list[str]

Render as multiple statements, splitting on {%split%} tag

render_sql_split(source: str, /, *args: Any, **kwargs: Any) list[sqlalchemy.sql.elements.TextClause]

Render as multiple statements, splitting on {%split%} tag, wrap with sqlalchemy.sql.expression.text()

property base : ralsei.jinja.environment.SqlEnvironment

The base environment