Skip to main content

Module parameterize

Module parameterize 

Source
Expand description

SQL literal parameterization: replace all literal values with ?.

The parameterize function is a lexical (not AST-level) transformation that replaces numeric literals, string literals, NULL, TRUE, and FALSE with positional ? placeholders. Quoted identifiers ("name") are deliberately left untouched.

The resulting ParameterizedSql::template can be used as a stable cache key that is independent of the concrete literal values.

Structs§

ParameterizedSql
The result of parameterize(sql).

Functions§

parameterize
Replace all SQL literals in sql with ? placeholders.