Closed NielDuysters closed 4 years ago
Thanks for report. I'll look into it.
But could you please try to wrap params! { .. }
into vec![]
and see if it still errors?
The purpose of exec_batch
is to execute a statement repeatedly with different sets of parameters:
conn.exec_batch(query, vec![params1, params2, params3, ..]);
Turns out that the result of params!
invocation itself satisfies the bound on exec_batch
's second parameter (IntoIter<Item: Into<Params>>
). So calls like the following one are possible, yet semantically incorrect:
conn.exec_batch(query, params! { .. });
Thanks for report. I'll fix this.
Regarding your code. Since there is only one set of parameters and the query result is ignored I suggest you use exec_drop
.
Okay thanks. That solved it. Is there a way to get the insert id?
Found it.
self.conn.get_conn().unwrap().last_insert_id();
Thx
I've got the following piece of code which compiles:
I'm sure that
data.username
,data.email
,data.birthdate
,data.password
ain't empty. For some reason I get the following error at runtime;I guess this has something to do with the prepared statement failing. But I don't see how it could fail?