Function normalize_with_options

Source
pub fn normalize_with_options(
    dialect: &dyn Dialect,
    sql: &str,
    options: NormalizerOptions,
) -> Result<Vec<String>, Error>
Expand description

Convenience function to normalize SQL with options.

ยงExample

use sql_insight::sqlparser::dialect::GenericDialect;
use sql_insight::NormalizerOptions;

let dialect = GenericDialect {};
let sql = "SELECT a FROM t1 WHERE b = 1 AND c in (2, 3, 4)";
let result = sql_insight::normalize_with_options(&dialect, sql, NormalizerOptions::new().with_unify_in_list(true)).unwrap();
assert_eq!(result, ["SELECT a FROM t1 WHERE b = ? AND c IN (...)"]);