小编awb*_*wbt的帖子

为什么使用diesel::insert_into时“找不到名为`execute`的方法”?

diesel::insert_into当我使用向数据库插入数据时遇到问题:

table! {
    post (id) {
        id -> Integer,
        username -> Varchar,
        postdata -> Varchar,
    }
}
Run Code Online (Sandbox Code Playgroud)
pub fn create_new_post(post: Post, conn: DbConn) {
    diesel::insert_into(post::table)
            .values(&post)
            .execute(&*conn);
}
Run Code Online (Sandbox Code Playgroud)
table! {
    post (id) {
        id -> Integer,
        username -> Varchar,
        postdata -> Varchar,
    }
}
Run Code Online (Sandbox Code Playgroud)

谁能帮我?

rust rust-diesel rust-rocket

4
推荐指数
1
解决办法
1510
查看次数

标签 统计

rust ×1

rust-diesel ×1

rust-rocket ×1