-
schema.rs // @generated automatically by Diesel CLI.
diesel::table! {
user (id) {
id -> Int8,
created_at -> Timestamp,
updated_at -> Timestamp,
wx_openid -> Varchar,
editor -> Int8,
nick_name -> Varchar,
password -> Varchar,
mobile -> Varchar,
avatar -> Bytea,
desc -> Text,
}
} when I definition User Table use diesel::{prelude::*, sql_types::{Bytea, Timestamp}};
use chrono::NaiveDateTime;
#[derive(Queryable, Selectable)]
#[diesel(table_name = super::schema::user)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct User {
pub id: i64,
pub created_at: Timestamp,
// pub updated_at: Timestamp,
pub updated_at: NaiveDateTime,
pub wx_openid: String,
pub editor: i64,
pub nick_name: Bytea,
pub password: String,
pub mobile: String,
pub avatar: Vec<u8>,
pub desc: String,
} this is error
how can I do it |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is an incomplete error message, checkout the full error message emitted by the compiler. It will contain more details. That said, even this part already contains the following note:
The problem here is that
|
Beta Was this translation helpful? Give feedback.
This is an incomplete error message, checkout the full error message emitted by the compiler. It will contain more details.
That said, even this part already contains the following note:
The problem here is that
diesel::sql_types::Timestamp
cannot hold values at all as written in the crate documentation:Source