complete certificate export feature

This commit is contained in:
yggverse 2024-11-29 02:36:26 +02:00
parent 8a62ef46df
commit 3dfcbc279d
9 changed files with 182 additions and 81 deletions

View file

@ -45,6 +45,21 @@ impl Database {
}
}
/// Get single record match `id`
pub fn record(&self, id: i64) -> Result<Option<Table>, Error> {
let readable = self.connection.read().unwrap();
let tx = readable.unchecked_transaction()?;
let records = select(&tx, *self.profile_identity_id)?; // @TODO single record query
for record in records {
if record.id == id {
return Ok(Some(record));
}
}
Ok(None)
}
/// Get all records match current `profile_identity_id`
pub fn records(&self) -> Result<Vec<Table>, Error> {
let readable = self.connection.read().unwrap(); // @TODO