initial commit

This commit is contained in:
2023-11-10 17:25:16 -03:00
commit fb030ce429
15 changed files with 207 additions and 0 deletions
+20
View File
@@ -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,
}