Skip to content
Extraits de code Groupes Projets
Vérifiée Valider c0709481 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

DB: Impl load_all and clear history

parent 6cd8cc2a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -186,12 +186,19 @@ impl LktDatabaseConnection {
/// Returns the queue history.
pub fn history(&mut self) -> LktDatabaseResult<Vec<i64>> {
todo!()
Ok(with_dsl!(history => history
.select(id)
.order_by(epoch.desc())
.load::<i64>(&mut self.sqlite)?
))
}
/// Clears the history.
pub fn clear_history(&mut self) -> LktDatabaseResult<()> {
todo!()
with_dsl! { history => {
diesel::delete(history).execute(&mut self.sqlite)?;
Ok(())
}}
}
/// Search the history by URIs. We return the local ids.
......
//! Types exported by the database crate.
//! TODO: Use [bumpalo](https://docs.rs/bumpalo/3.12.0/bumpalo/) to reduce
//! allocation counts?
use hashbrown::HashMap;
pub struct KaraInfo {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter