Open onx2 opened 3 years ago
@onx2 Did you ever sort this out? I'm in the same boat.
@mike-lloyd03 I didn't put any effort into resolving this issue because I was just playing around with some personal projects. For my professional work I've been using Diesel. You could also check out sqlx which would be a closer comparison to this package than diesel.
If you want to stick with this package you might be able to submit a PR but it looks like it isn't maintained anymore (last commit). Your best bet is probably forking and maybe modifying arg.rs to support UUID.
Believe it or not, I'm actually using this to generate the sql that I pass into sqlx. The and_when
function saves a lot of redundancy. But I didn't realize isn't been over 2 years since last it was updated. I might just go back to writing my own queries.
But also uuid.to_string()
seems to work fine.
Is there now (or in the future) UUID support or should I just convert to a string?
Also, would you recommend using
.and_where("id = $1".bind(&SqlName::new(id).safe()))
to prevent sql injection since theid
is passed from the client or is my understanding ofSqlName
incorrect?