luncheon 0.2.11

A library to make working with SQLITE in a more typed and traited way
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use rusqlite::{params, ToSql};

use crate::{Database, Res, Table};


pub trait Delete<I: PartialEq + ToSql>
where
    Self: Table,
{
    const DELETE: &str;
    fn delete(database: &Database, id: I) -> Res<()> {
        let mut stmt = database.prepare_writer(Self::DELETE)?;
        stmt.execute(params![id])?;
        Ok(())
    }
}