about summary refs log tree commit diff
path: root/src/types.rs
blob: d068043f9710354ff2d013bed20024f4cfac009a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use diesel::PgConnection;
use diesel::r2d2::{ConnectionManager, Pool};
use crate::schema::links;

#[derive(Debug, Deserialize)]
pub struct UserData {
    pub url: String
}

#[derive(Debug, Serialize)]
pub struct UserResponse {
    pub hash: String,
}

#[derive(Queryable, Insertable)]
#[table_name="links"]
pub struct Entry {
    pub hash: String,
    pub url: String
}

pub type PoolState = Pool<ConnectionManager<PgConnection>>;