Function mentat_db::repeat_values [] [src]

pub fn repeat_values(values_per_tuple: usize, tuples: usize) -> String

Prepare an SQL VALUES block, like (?, ?, ?), (?, ?, ?).

The number of values per tuple determines (?, ?, ?). The number of tuples determines (...), (...).

Examples

assert_eq!(repeat_values(1, 3), "(?), (?), (?)".to_string());
assert_eq!(repeat_values(3, 1), "(?, ?, ?)".to_string());
assert_eq!(repeat_values(2, 2), "(?, ?), (?, ?)".to_string());