pub struct AssetRefSelect<'conn> { /* private fields */ }Implementations§
Source§impl<'conn> AssetRefSelect<'conn>
impl<'conn> AssetRefSelect<'conn>
pub const Id: SelectField<AssetRef, HashId, HashId>
pub const Uri: SelectField<AssetRef, String, String>
pub const FileType: SelectField<AssetRef, String, String>
pub const Checksum: SelectField<AssetRef, Option<Sha256Hash>, Sha256Hash>
pub const Size: SelectField<AssetRef, Option<i64>, i64>
pub const Role: SelectField<AssetRef, AssetRole, AssetRole>
pub const LogicalPath: SelectField<AssetRef, Option<String>, String>
pub const Name: SelectField<AssetRef, Option<String>, String>
pub const CreatedOn: SelectField<AssetRef, i64, i64>
pub const UpstreamAssetRefId: SelectField<AssetRef, Option<HashId>, HashId>
pub fn new(conn: &'conn Connection) -> Self
pub fn with_ref<R, K>(self, history_ref: R) -> Selfwhere
R: IntoHistoryRef<K>,
pub fn id(self, value: HashId) -> Self
pub fn id_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = HashId>,
pub fn uri(self, value: impl Into<String>) -> Self
pub fn uri_in<I, V>(self, values: I) -> Self
pub fn uri_contains(self, value: impl Into<String>) -> Self
Sourcepub fn uri_like(self, pattern: impl Into<String>) -> Self
pub fn uri_like(self, pattern: impl Into<String>) -> Self
Matches a bound SQL LIKE pattern, preserving % and _ wildcards.
Case sensitivity follows the database connection’s LIKE settings.
pub fn uri_case_insensitive(self, value: impl Into<String>) -> Self
pub fn file_type(self, value: impl Into<String>) -> Self
pub fn file_type_in<I, V>(self, values: I) -> Self
pub fn file_type_contains(self, value: impl Into<String>) -> Self
Sourcepub fn file_type_like(self, pattern: impl Into<String>) -> Self
pub fn file_type_like(self, pattern: impl Into<String>) -> Self
Matches a bound SQL LIKE pattern, preserving % and _ wildcards.
Case sensitivity follows the database connection’s LIKE settings.
pub fn file_type_case_insensitive(self, value: impl Into<String>) -> Self
pub fn checksum(self, value: Sha256Hash) -> Self
pub fn checksum_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = Sha256Hash>,
pub fn checksum_is_null(self) -> Self
pub fn size(self, value: i64) -> Self
pub fn size_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = i64>,
pub fn size_is_null(self) -> Self
pub fn role(self, value: AssetRole) -> Self
pub fn role_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = AssetRole>,
pub fn logical_path(self, value: impl Into<String>) -> Self
pub fn logical_path_in<I, V>(self, values: I) -> Self
pub fn logical_path_contains(self, value: impl Into<String>) -> Self
Sourcepub fn logical_path_like(self, pattern: impl Into<String>) -> Self
pub fn logical_path_like(self, pattern: impl Into<String>) -> Self
Matches a bound SQL LIKE pattern, preserving % and _ wildcards.
Case sensitivity follows the database connection’s LIKE settings.
pub fn logical_path_case_insensitive(self, value: impl Into<String>) -> Self
pub fn logical_path_is_null(self) -> Self
pub fn name(self, value: impl Into<String>) -> Self
pub fn name_in<I, V>(self, values: I) -> Self
pub fn name_contains(self, value: impl Into<String>) -> Self
Sourcepub fn name_like(self, pattern: impl Into<String>) -> Self
pub fn name_like(self, pattern: impl Into<String>) -> Self
Matches a bound SQL LIKE pattern, preserving % and _ wildcards.
Case sensitivity follows the database connection’s LIKE settings.
pub fn name_case_insensitive(self, value: impl Into<String>) -> Self
pub fn name_is_null(self) -> Self
pub fn created_on(self, value: i64) -> Self
pub fn created_on_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = i64>,
pub fn upstream_asset_ref_id(self, value: HashId) -> Self
pub fn upstream_asset_ref_id_in<I>(self, values: I) -> Selfwhere
I: IntoIterator<Item = HashId>,
pub fn upstream_asset_ref_id_is_null(self) -> Self
pub fn order_by<T, JoinType>( self, field: SelectField<AssetRef, T, JoinType>, direction: Direction, ) -> Self
Sourcepub fn order_by_relevance<T>(
self,
field: SelectField<AssetRef, T, String>,
search: impl Into<String>,
) -> Self
pub fn order_by_relevance<T>( self, field: SelectField<AssetRef, T, String>, search: impl Into<String>, ) -> Self
Orders by exact match, case-insensitive exact match, LIKE prefix, then LIKE contains.
Search values are bound parameters; % and _ retain LIKE wildcard semantics.
Case-insensitive equality uses SQL lower (ASCII by default); LIKE follows the
connection’s settings. Case-sensitive equality has the highest priority.
Unmatched rows, including NULL, rank last. Add a _like filter to exclude them,
and chain order_by for deterministic ties. Ordering runs before pagination.
pub fn join_on<SourceType, JoinedModel, JoinedType, JoinType>(
self,
source_field: SelectField<AssetRef, SourceType, JoinType>,
joined_field: SelectField<JoinedModel, JoinedType, JoinType>,
) -> Selfwhere
JoinedModel: ModelSelectSource,
pub fn join_filtered_on<SourceType, JoinedModel, JoinedType, JoinType>(
self,
source_field: SelectField<AssetRef, SourceType, JoinType>,
joined_field: SelectField<JoinedModel, JoinedType, JoinType>,
joined: <JoinedModel as ModelSelectSource>::Selector<'conn>,
) -> Selfwhere
JoinedModel: ModelSelectSource,
pub fn only<P>(self, projection: P) -> SelectedFields<Self, P>where
P: SelectProjection,
pub fn models<P>(self) -> SelectedModels<Self, P>where
P: ModelProjection,
pub fn limit(self, limit: u32) -> Self
pub fn offset(self, offset: u32) -> Self
pub fn load(self) -> Result<Vec<AssetRef>, ModelSelectError>
pub fn get(self) -> Result<Option<AssetRef>, ModelSelectError>
pub fn get_by_id(self, id: HashId) -> Result<Option<AssetRef>, ModelSelectError>
pub fn query_by_ids<I>(self, ids: I) -> Result<Vec<AssetRef>, ModelSelectError>where
I: IntoIterator<Item = HashId>,
pub fn delete_by_ids<I>(self, ids: I) -> Result<usize, ModelSelectError>where
I: IntoIterator<Item = HashId>,
Trait Implementations§
Source§impl<'conn> Clone for AssetRefSelect<'conn>
impl<'conn> Clone for AssetRefSelect<'conn>
Auto Trait Implementations§
impl<'conn> !RefUnwindSafe for AssetRefSelect<'conn>
impl<'conn> !Send for AssetRefSelect<'conn>
impl<'conn> !Sync for AssetRefSelect<'conn>
impl<'conn> !UnwindSafe for AssetRefSelect<'conn>
impl<'conn> Freeze for AssetRefSelect<'conn>
impl<'conn> Unpin for AssetRefSelect<'conn>
impl<'conn> UnsafeUnpin for AssetRefSelect<'conn>
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