prettify
This commit is contained in:
parent
ead3672570
commit
6d949bb21e
10 changed files with 74 additions and 18 deletions
|
@ -90,6 +90,11 @@ impl Calibre {
|
|||
let conn = self.pool.get()?;
|
||||
Author::has_more_authors(&conn, author_sort)
|
||||
}
|
||||
|
||||
pub fn scalar_author(&self, id: u64) -> Result<Author, DataStoreError> {
|
||||
let conn = self.pool.get()?;
|
||||
Author::scalar_author(&conn, id)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -47,6 +47,12 @@ impl Author {
|
|||
Ok(stmt.query_row(params, Self::from_row)?)
|
||||
}
|
||||
|
||||
pub fn scalar_author(conn: &Connection, id: u64) -> Result<Self, DataStoreError> {
|
||||
let mut stmt = conn.prepare("SELECT id, name, sort FROM authors WHERE id = (:id)")?;
|
||||
let params = named_params! { ":id": id };
|
||||
Ok(stmt.query_row(params, Self::from_row)?)
|
||||
}
|
||||
|
||||
pub fn has_previous_authors(
|
||||
conn: &Connection,
|
||||
sort_name: &str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue