Skip to content

Does string interpolation in raw queries affect prepared statements and query caching? #4081

Answered by weiznich
Datron asked this question in Q&A
Discussion options

You must be logged in to vote

Prepared statements for queries issued via sql_query are not cached as described here: https://docs.diesel.rs/2.2.x/diesel/connection/statement_cache/index.html#a-primer-on-prepared-statement-caching-in-diesel

That written: By using format! to construct your SQL queries you open the possibility for sql injections.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Datron
Comment options

Answer selected by Datron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants