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
SqlDialect::Postgres- PostgreSQL escaping (works for psql CLI and native drivers)
§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§
- Auto
Escape Callback - Type alias for minijinja auto-escape callback functions.
- Formatter
Fn - Type alias for minijinja formatter functions.