initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
use diesel::{prelude::{Queryable, Insertable}, Selectable};
|
||||
|
||||
use crate::schema::posts;
|
||||
|
||||
#[derive(Queryable, Selectable)]
|
||||
#[diesel(table_name = crate::schema::posts)]
|
||||
#[diesel(check_for_backend(diesel::pg::Pg))]
|
||||
pub struct Post {
|
||||
pub id: i32,
|
||||
pub title: String,
|
||||
pub body: String,
|
||||
pub published: bool,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[diesel(table_name = posts)]
|
||||
pub struct NuevoPost<'a> {
|
||||
pub title: &'a str,
|
||||
pub body: &'a str,
|
||||
}
|
||||
Reference in New Issue
Block a user