feat: insert works
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user