Move database into the main app
I was having issues including the lib as a crate, its fine just being a module for now.
This commit is contained in:
17
src/database/models.rs
Normal file
17
src/database/models.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::database::schema::users;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[table_name = "users"]
|
||||
pub struct InsertUser<'a> {
|
||||
pub username: &'a str,
|
||||
pub password: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Queryable, Clone, Debug)]
|
||||
pub struct User {
|
||||
pub id: i32,
|
||||
pub username: String,
|
||||
#[serde(skip_serializing)]
|
||||
pub password: String,
|
||||
}
|
||||
Reference in New Issue
Block a user