< 返回版块

tokyohuang123 发表于 2021-10-28 10:44

Tags:web

 src/routers/kfjl.rs:67:10
   |
67 |         .first::<Kfjl>(&db_connection) {
   |          ^^^^^ the trait `LimitDsl` is not implemented for `diesel::query_builder::SelectStatement<schema::kfjl::table, diesel::query_builder::select_clause::DefaultSelectClause, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::operators::Eq<schema::kfjl::columns::kfjlname, diesel::expression::bound::Bound<diesel::sql_types::Text, &std::string::String>>>>`
   |
   = help: the following implementations were found:
             <diesel::query_builder::SelectStatement<F, S, D, W, O, L, Of, G, LC> as LimitDsl>


非常奇怪的 问题当我的表字段在30个的时候 编译没有问题 当我增加到31个的时候就开始报错 开始我以为是我字段语法问题 结果我发现。只要把随意注释i个字段 然后前面加了就报错的字段可以正常边缘 也就是只要30个字段 你怎么加都不回报错。一旦超过30个 你加什么都错 ###我不知道这是我个人问提还是库的问题

评论区

写评论
作者 tokyohuang123 2021-10-28 15:03

谢谢 果然是feature的问题 谢谢

--
👇
Freddie Mercury: 看了下Github,似乎也有人遇到了类似的问题,但报错信息不一样。可能须要激活某个feature。有完整点的代码贴出来看看不?

https://github.com/diesel-rs/diesel/issues/2435

https://docs.rs/crate/diesel/1.4.5/source/Cargo.toml

作者 tokyohuang123 2021-10-28 15:03

成了 谢谢 开启128就好了

--
👇
苦瓜小仔: 【猜测】开启 huge-tables 或者 64-column-tables 或者 128-column-tables feature 试试

作者 tokyohuang123 2021-10-28 14:25

谢谢 我先试试别的方案。不行再发出来

--
👇
Freddie Mercury: 看了下Github,似乎也有人遇到了类似的问题,但报错信息不一样。可能须要激活某个feature。有完整点的代码贴出来看看不?

https://github.com/diesel-rs/diesel/issues/2435

https://docs.rs/crate/diesel/1.4.5/source/Cargo.toml

作者 tokyohuang123 2021-10-28 14:23

谢谢 我试试

--
👇
苦瓜小仔: 【猜测】开启 huge-tables 或者 64-column-tables 或者 128-column-tables feature 试试

苦瓜小仔 2021-10-28 12:48

【猜测】开启 huge-tables 或者 64-column-tables 或者 128-column-tables feature 试试

Mercury 2021-10-28 11:46

看了下Github,似乎也有人遇到了类似的问题,但报错信息不一样。可能须要激活某个feature。有完整点的代码贴出来看看不?

https://github.com/diesel-rs/diesel/issues/2435

https://docs.rs/crate/diesel/1.4.5/source/Cargo.toml

1 共 6 条评论, 1 页