File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,15 @@ use std::sync::Arc;
3535/// [injection]: https://en.wikipedia.org/wiki/SQL_injection
3636/// [`query()`]: crate::query::query
3737/// [`raw_sql()`]: crate::raw_sql::raw_sql
38+ #[ diagnostic:: on_unimplemented(
39+ label = "dynamic SQL string" ,
40+ message = "dynamic SQL strings should be audited for possible injections" ,
41+ note = "prefer literal SQL strings with bind parameters or `QueryBuilder` to add dynamic data to a query.
42+
43+ To bypass this error, manually audit for potential injection vulnerabilities and wrap with `AssertSqlSafe()`.
44+ For details, see the docs for `SqlSafeStr`.\n " ,
45+ note = "this trait is only implemented for `&'static str`, not all `&str` like the compiler error may suggest"
46+ ) ]
3847pub trait SqlSafeStr {
3948 /// Convert `self` to a [`SqlStr`].
4049 fn into_sql_str ( self ) -> SqlStr ;
You can’t perform that action at this time.
0 commit comments