I think the main problem (don't know whether this is possible in Rust which I am not familiar with) is that untrusted input is passed around as strings at all (Java, which I am familiar with, does this). I'd prefer:
- Getting untrusted input as a separate type
- Having only a controlled way to put instances of this type into an SQL query