mithril_aggregator/database/query/pending_certificate/
delete_pending_certificate.rsuse mithril_persistence::sqlite::{Query, WhereCondition};
use crate::database::record::CertificatePendingRecord;
pub struct DeletePendingCertificateRecordQuery {
condition: WhereCondition,
}
impl DeletePendingCertificateRecordQuery {
pub fn get() -> Self {
Self {
condition: WhereCondition::default(),
}
}
}
impl Query for DeletePendingCertificateRecordQuery {
type Entity = CertificatePendingRecord;
fn filters(&self) -> WhereCondition {
self.condition.clone()
}
fn get_definition(&self, condition: &str) -> String {
let projection = Self::Entity::expand_projection("pending_certificate");
format!("delete from pending_certificate where {condition} returning {projection}")
}
}