Add DbExecute and DbQuery traits
This commit is contained in:
parent
f3d7708290
commit
cb74e7abf8
2 changed files with 11 additions and 0 deletions
|
|
@ -4,3 +4,4 @@ version = "0.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
rusqlite = "0.28.0"
|
||||||
|
|
|
||||||
10
src/lib.rs
10
src/lib.rs
|
|
@ -0,0 +1,10 @@
|
||||||
|
use rusqlite::Connection;
|
||||||
|
|
||||||
|
pub trait DbExecute {
|
||||||
|
fn run(self, conn: &mut Connection) -> rusqlite::Result<()>;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait DbQuery {
|
||||||
|
type Result;
|
||||||
|
fn run(self, conn: &mut Connection) -> rusqlite::Result<Self::Result>;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue