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:
Cameron Cordes
2020-07-07 21:48:29 -04:00
parent 1c1c8531aa
commit 2aa1b61429
13 changed files with 139 additions and 221 deletions

17
src/database/models.rs Normal file
View 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,
}