Skip to main content

Module sql_formatter

Module sql_formatter 

Source
Expand description

SQL escaping formatters for minijinja templates.

This crate provides SQL-safe value formatting for different database dialects. Each dialect module implements escaping rules appropriate for that database.

§Supported Dialects

§Usage

use spawn_db::sql_formatter::{SqlDialect, get_auto_escape_callback, get_formatter};
use minijinja::Environment;

let mut env = Environment::new();
env.set_auto_escape_callback(get_auto_escape_callback(SqlDialect::Postgres));
env.set_formatter(get_formatter(SqlDialect::Postgres));

Modules§

postgres
PostgreSQL-specific SQL escaping for minijinja templates.

Enums§

SqlDialect
SQL dialect for formatting.

Functions§

get_auto_escape_callback
Returns an auto-escape callback for the given SQL dialect.
get_formatter
Returns the appropriate formatter function for the given SQL dialect.

Type Aliases§

AutoEscapeCallback
Type alias for minijinja auto-escape callback functions.
FormatterFn
Type alias for minijinja formatter functions.