$name. Bind them with execute_with_named, passing
(name, value) pairs. Binding is by name, so the order of the pairs is irrelevant.
execute_with_named
execute_with_named(sql, binds: &mut [(&str, &mut dyn AppendAble)]) -> Result<DuckResult>.
&mut dyn AppendAble used by
positional binding — every DuckValue and
the primitive Rust types qualify.
Give the name without the leading
$: use "id" to bind $id.Unknown names are reported
A name that is not a parameter of the SQL is not silently ignored:Error::InvalidParameterName. An interior NUL in a name is caught as
Error::NulError.
See also
- Positional parameters —
$1/?binding andparams!. - Prepared statements —
bind_namedon a reusableCachedStatement.