pub struct SbolObjectRepository { /* private fields */ }Implementations§
Source§impl SbolObjectRepository
impl SbolObjectRepository
pub fn new(pool: PgPool) -> Self
Sourcepub async fn upsert(
&self,
conn: &mut PgConnection,
summary: &ObjectSummary,
graph_id: Option<GraphId>,
) -> Result<UpsertResult, DomainError>
pub async fn upsert( &self, conn: &mut PgConnection, summary: &ObjectSummary, graph_id: Option<GraphId>, ) -> Result<UpsertResult, DomainError>
Insert or update by IRI. Returns the resulting object id, the new revision number, and the previous content hash (if any) so callers can detect a no-op.
pub async fn get_iri_by_id( &self, id: ObjectId, ) -> Result<Option<String>, DomainError>
pub async fn get_by_iri( &self, iri: &str, ) -> Result<Option<SbolObjectRecord>, DomainError>
Sourcepub async fn get_by_iris(
&self,
iris: &[&str],
) -> Result<Vec<SbolObjectRecord>, DomainError>
pub async fn get_by_iris( &self, iris: &[&str], ) -> Result<Vec<SbolObjectRecord>, DomainError>
Bulk variant of [get_by_iri]. Returns matching live rows in arbitrary
order; IRIs that don’t resolve are simply absent from the result. A
single indexed scan via iri = ANY($1).
Sourcepub async fn list(
&self,
filter: &ListObjectsFilter,
) -> Result<Vec<SbolObjectRecord>, DomainError>
pub async fn list( &self, filter: &ListObjectsFilter, ) -> Result<Vec<SbolObjectRecord>, DomainError>
Paginated listing for corpus-scale export. Keyset cursor on iri
(lexicographic ascending); pass the last iri of the prior page as
after_iri to fetch the next. Filters compose: when any of
sbol_class, role, or graph_id is Some, the corresponding
predicate is added to the WHERE clause.
Sourcepub async fn search(
&self,
query: &TextSearchQuery,
) -> Result<(Vec<SbolObjectRecord>, i64), DomainError>
pub async fn search( &self, query: &TextSearchQuery, ) -> Result<(Vec<SbolObjectRecord>, i64), DomainError>
Offset-paginated substring search. Without property_uri, matches the
name/display_id/description summary fields (the first two are
trigram-indexed). With property_uri, matches the literal value of that
predicate on the object via sbol_triples. Returns the page plus the
total match count; when limit is 0 the page is empty and only the
count query runs.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SbolObjectRepository
impl !UnwindSafe for SbolObjectRepository
impl Freeze for SbolObjectRepository
impl Send for SbolObjectRepository
impl Sync for SbolObjectRepository
impl Unpin for SbolObjectRepository
impl UnsafeUnpin for SbolObjectRepository
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more