Skip to main content

get_formatter

Function get_formatter 

Source
pub fn get_formatter(dialect: SqlDialect) -> FormatterFn
Expand description

Returns the appropriate formatter function for the given SQL dialect.

The returned function can be passed directly to Environment::set_formatter().

ยงExample

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

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