This commit is contained in:
2026-05-31 20:24:10 +02:00
parent 49cd648d5b
commit a1e8d34210
27 changed files with 426 additions and 23 deletions

View File

@@ -0,0 +1,24 @@
use anyhow::Error;
use super::Repository;
use crate::database::Queryer;
use crate::domain::typ::{entity, model};
impl Repository {
pub async fn typ_loeschen<'c, C: Queryer<'c>>(
&self,
db: C,
typ: &entity::Typ,
) -> Result<model::Typ, Error> {
const QUERY: &str = r#"
DELETE FROM typen WHERE id=$1 RETURNING id, erstellt_am, geaendert_am, typname;
"#;
let typ = sqlx::query_as::<_, model::Typ>(QUERY)
.bind(typ.id)
.fetch_one(db)
.await?;
Ok(typ)
}
}