pub struct SqlitePaperAliasRepository { /* private fields */ }Implementations§
Source§impl SqlitePaperAliasRepository
impl SqlitePaperAliasRepository
pub fn new(db: Database) -> Self
Sourcepub fn record(
&self,
paper_id: &str,
alias: &str,
source: &str,
) -> Result<bool, DbError>
pub fn record( &self, paper_id: &str, alias: &str, source: &str, ) -> Result<bool, DbError>
Record an alias. Idempotent on (paper_id, alias) — re-running
an import that already added the alias is a no-op. Returns
true if a new row was inserted, false if it already existed.
Sourcepub fn record_in_tx(
tx: &Transaction<'_>,
paper_id: &str,
alias: &str,
source: &str,
) -> Result<bool, DbError>
pub fn record_in_tx( tx: &Transaction<'_>, paper_id: &str, alias: &str, source: &str, ) -> Result<bool, DbError>
Transactional sibling of Self::record (#157). Used by the
bib-import orchestrator so paper-save + alias-record + annotation-
create commit (or roll back) as a single unit per row.
Sourcepub fn lookup(&self, alias: &str) -> Result<Option<String>, DbError>
pub fn lookup(&self, alias: &str) -> Result<Option<String>, DbError>
Look up a paper by alias. When two papers share an alias (legal —
two different imports may collide on citekey) this returns the
earliest-created row so the lookup is deterministic. Secondary
paper_id ASC tiebreak covers same-microsecond inserts during
batch imports where created_at ties are realistic.
For the match pipeline, prefer Self::lookup_all so you can
explicitly detect ambiguity and fall through to other match
strategies rather than silently picking the first row.
Trait Implementations§
Source§impl Clone for SqlitePaperAliasRepository
impl Clone for SqlitePaperAliasRepository
Source§fn clone(&self) -> SqlitePaperAliasRepository
fn clone(&self) -> SqlitePaperAliasRepository
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more