Function sql_insight::normalizer::normalize
source · pub fn normalize(dialect: &dyn Dialect, sql: &str) -> Result<Vec<String>, Error>Expand description
Convenience function to normalize SQL with default options.
§Example
use sqlparser::dialect::GenericDialect;
let dialect = GenericDialect {};
let sql = "SELECT a FROM t1 WHERE b = 1 AND c in (2, 3) AND d LIKE '%foo'";
let result = sql_insight::normalize(&dialect, sql).unwrap();
assert_eq!(result, ["SELECT a FROM t1 WHERE b = ? AND c IN (?, ?) AND d LIKE ?"]);