Skip to main content

template

Function template 

Source
pub fn template(
    sql: impl Into<Cow<'static, str>>,
    args: impl IntoIterator<Item = RawArg>,
) -> Expr
Expand description

Raw SQL with ? placeholders, rewritten into the dialect’s own syntax with args interleaved. Write \? for a literal question mark.

A ? may be filled by a value or by a whole expression, so IN (?) can expand to IN ($3, $4, $5). The counts must match; a mismatch is Error::RawArgCount.