Files
simple-rust-tests/__database/diesel/src/models.rs
2021-02-12 23:17:00 +08:00

17 lines
276 B
Rust

use crate::schema::posts;
#[derive(Queryable)]
pub struct Post {
pub id: i32,
pub title: String,
pub body: String,
pub published: bool,
}
#[derive(Insertable)]
#[table_name = "posts"]
pub struct NewPost<'a> {
pub title: &'a str,
pub body: &'a str,
}