We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3388e24 commit 6fb58fcCopy full SHA for 6fb58fc
postgres_resource_derive/src/lib.rs
@@ -386,6 +386,10 @@ impl Parsed {
386
.set(model)
387
.get_result::<Self::ModelWithId>(&self.connection())?)
388
}
389
+
390
+ fn delete(&self, by: Expr<#table>) -> Result<usize, Error> {
391
+ Ok(delete(#table).filter(by).execute(&self.connection())?)
392
+ }
393
394
395
src/lib.rs
@@ -51,4 +51,5 @@ where
51
fn get_one(&self, by: Expr<Self::DBTable>) -> Result<Self::ModelWithId>;
52
fn get_all(&self, by: Expr<Self::DBTable>) -> Result<Vec<Self::ModelWithId>>;
53
fn update(&self, model: &Self::Model, by: Expr<Self::DBTable>) -> Result<Self::ModelWithId>;
54
+ fn delete(&self, by: Expr<Self::DBTable>) -> Result<usize>;
55
0 commit comments