ood_persistence/examples/web/src/db/list/mod.rs

22 lines
336 B
Rust

use crate::app::list::List;
pub mod storage;
pub type DbListId = i32;
#[derive(Debug, FromSql)]
#[postgres(name = "lists")]
struct DbList {
pub id: DbListId,
pub name: String,
}
impl From<DbList> for List {
fn from(db: DbList) -> Self {
Self {
id: db.id,
name: db.name,
}
}
}