mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-27 12:17:24 +01:00
Use access time in some selectors
For now, only persons, instruments and ensembles will be ordered by access time.
This commit is contained in:
parent
3064f18323
commit
3a27113bda
9 changed files with 34 additions and 7 deletions
|
|
@ -77,4 +77,13 @@ impl Database {
|
|||
|
||||
Ok(persons)
|
||||
}
|
||||
|
||||
/// Get recently used persons.
|
||||
pub fn get_recent_persons(&self) -> Result<Vec<Person>> {
|
||||
let persons = persons::table
|
||||
.order(persons::last_used.desc())
|
||||
.load::<Person>(&self.connection)?;
|
||||
|
||||
Ok(persons)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue