【发布时间】:2021-11-19 17:34:34
【问题描述】:
注意:这是与How to use sqlx to query mysql IN a slice? 类似但不重复的问题。我要the Rust one。
这是我尝试做的。
let v = vec![..];
sqlx::query("SELECT something FROM table WHERE column IN (?)").bind(v)
...
然后我得到以下错误
the trait bound `std::vec::Vec<u64>: sqlx::Encode<'_, _>` is not satisfied
【问题讨论】:
-
你目前不能。
-
也欢迎任何解决方法(手动进行 SQL 查询?如果我这样做有任何防止注入的提示吗?)。
-
根据docs,看来只有PostgreSQL后端才有可能。