Unless I misunderstand something, it appears to me that once you go over 15 parameters for a query, we hit a SerializeRow trait problem:
| |_____^ the trait `SerializeRow` is not implemented for `(String, &String, &String, &Vec<Contact>, &String, &String, &String, &Vec<i32>, i64, i64, &String, &String, &String, i8, &Vec<String>, &Vec<String>, &Vec<VerificationCode>)`
If I remove a parameter, any parameter, then the query works. Is my understanding correct? This is implemented using a trait that has a maximum number of options? (Full example code below).
How do we solve this? I have removed as many parameters as I can to try and get this to work, but this is the minimum set I need to create a person record.
I guess I could break this query up into two separate database calls, but two database round trips seems less than ideal?
let q = c.session.query(r#"
insert into person
(uid, first_name, last_name, email, username, password, picture, role, created,
expires, offset, location, lang, status, search_keys,
keyword, verification_code)
values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
"#, (
uid,
&person.first_name,
&person.last_name,
&person.email,
&person.username,
&person.password,
&person.picture,
&person.role,
now,
person.expired,
&person.offset,
&person.location,
&person.lang,
person_status_to_i8(Unverified),
&search_keys,
&keywords,
&person.verification_code
));
match q.await {
Ok(_) => Ok(code),
Err(e) => {
println!("insert signup failed: {:?}", e);
Err(DatabaseFailure)
}
}
}