sql_support

Function repeat_sql_values

source
pub fn repeat_sql_values(count: usize) -> impl Display
Expand description

Returns a value that formats as count instances of (?) separated by commas.

ยงExample

assert_eq!(format!("{}", repeat_sql_values(0)), "");
assert_eq!(format!("{}", repeat_sql_values(1)), "(?)");
assert_eq!(format!("{}", repeat_sql_values(2)), "(?),(?)");
assert_eq!(format!("{}", repeat_sql_values(3)), "(?),(?),(?)");