【发布时间】:2021-02-04 02:38:38
【问题描述】:
我想对名为主题的表的记录进行计数。我几乎是通过book
但是当我这样做时
let count: u64 = topics.select(count_star()).first(&conn).unwrap();
我不断收到(.first 下划线为错误):
[rustc E0277] [E] the trait bound `u64: diesel::deserialize::FromSql<diesel::
sql_types::BigInt, diesel::mysql::Mysql>` is not satisfied
the trait `diesel::deserialize::FromSql<diesel::sql_types::BigInt, diesel::
mysql::Mysql>` is not implemented for `u64`
help: the following implementations were found:
<u64 as diesel::deserialize::FromSql<diesel::sql_types::
// I guess there's more information but Vim's
// Pmenu only shows up to eight lines.
所以我可能需要在这里做一些类型转换,但老实说,我不知道在什么时候。
【问题讨论】:
标签: rust rust-diesel