pub struct SqlitePaperRepository { /* private fields */ }Implementations§
Trait Implementations§
Source§impl PaperRepository for SqlitePaperRepository
impl PaperRepository for SqlitePaperRepository
fn save(&self, paper: &Paper) -> Result<(), CoreError>
Source§fn save_many(
&self,
papers: &[Paper],
) -> Result<HashMap<PaperId, PaperId>, CoreError>
fn save_many( &self, papers: &[Paper], ) -> Result<HashMap<PaperId, PaperId>, CoreError>
Save multiple papers, resolving DOI conflicts with existing records.
Returns a map of original_id → resolved_id for papers whose ID was
remapped to an existing record (callers should use this to fix up
search_results and other references).
fn get(&self, paper_id: &str) -> Result<Option<Paper>, CoreError>
fn find_by_doi(&self, doi: &str) -> Result<Option<Paper>, CoreError>
fn find_by_title(&self, title: &str) -> Result<Option<Paper>, CoreError>
fn list_all(&self, limit: i64, offset: i64) -> Result<Vec<Paper>, CoreError>
Source§fn update_full_text(&self, paper_id: &str, text: &str) -> Result<(), CoreError>
fn update_full_text(&self, paper_id: &str, text: &str) -> Result<(), CoreError>
Persist extracted full text for a paper. Used by
read_paper_tool
after the first PDF/HTML extraction so subsequent reads (TUI
reader, MCP get_annotated_paper) hit the DB instead of
re-running pdf-extract. Idempotent — overwrites the existing
full_text column.Source§fn update_download_state(
&self,
paper_id: &str,
local_path: Option<&str>,
status: DownloadStatus,
) -> Result<(), CoreError>
fn update_download_state( &self, paper_id: &str, local_path: Option<&str>, status: DownloadStatus, ) -> Result<(), CoreError>
Persist the outcome of a download attempt.
local_path is the
absolute path to the saved file on success (any non-Failed
status); pass None for Failed. last_attempt_at is set to
now() automatically. See #112.Source§fn update_bibtex_key(&self, paper_id: &str, key: &str) -> Result<(), CoreError>
fn update_bibtex_key(&self, paper_id: &str, key: &str) -> Result<(), CoreError>
Assign a stable citation key to a paper. Called once per paper
by the 0.6.0 backfill migration (and per-paper on new ingest).
Must be unique across the DB — the caller is responsible for
running the Better-BibTeX algorithm + disambiguation before
calling this. See ADR-006 +
scitadel-export::bibtex::assign_keys.Auto Trait Implementations§
impl Freeze for SqlitePaperRepository
impl !RefUnwindSafe for SqlitePaperRepository
impl Send for SqlitePaperRepository
impl Sync for SqlitePaperRepository
impl Unpin for SqlitePaperRepository
impl UnsafeUnpin for SqlitePaperRepository
impl !UnwindSafe for SqlitePaperRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more