Skip to main content

rewrite_placeholders

Function rewrite_placeholders 

Source
pub fn rewrite_placeholders(stmt: &mut Statement) -> usize
Expand description

Walks every expression in stmt and rewrites bare ? placeholders to ?N (1-indexed source order). Returns the total parameter count.

Idempotent for already-numbered placeholders: ?1, ?2, … pass through unchanged. We deliberately don’t try to renumber already- numbered placeholders — that’s a foot-gun (the user might use the same index twice on purpose to bind once and reference twice), and Statement::new runs this exactly once on a freshly-parsed AST.