[−][src]Function sql_support::repeat_multi_values
pub fn repeat_multi_values(
num_values: usize,
vars_per_value: usize
) -> impl Display
Returns a value that formats as num_values
instances of (?,?,?,...)
(where there are
vars_per_value
question marks separated by commas in between the ?
s).
Panics if vars_per_value
is zero (however, num_values
is allowed to be zero).
Example
assert_eq!(format!("{}", repeat_multi_values(0, 2)), ""); assert_eq!(format!("{}", repeat_multi_values(1, 5)), "(?,?,?,?,?)"); assert_eq!(format!("{}", repeat_multi_values(2, 3)), "(?,?,?),(?,?,?)"); assert_eq!(format!("{}", repeat_multi_values(3, 1)), "(?),(?),(?)");