Struct query_structure::filter::ScalarFilter
source · pub struct ScalarFilter {
pub projection: ScalarProjection,
pub condition: ScalarCondition,
pub mode: QueryMode,
}
Expand description
Filtering with a scalar value. From a GraphQL point of view this is in the head of the query:
findManyUser(where: { id: 5 })
This translates to a projection of one column id
with a condition where
the column value equals 5
.
Fields§
§projection: ScalarProjection
§condition: ScalarCondition
§mode: QueryMode
Implementations§
source§impl ScalarFilter
impl ScalarFilter
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The number of values in the filter. IN
and NOT IN
may contain more
than one.
sourcepub fn should_batch(&self, chunk_size: usize) -> bool
pub fn should_batch(&self, chunk_size: usize) -> bool
If true
, the filter should be split into smaller filters executed in
separate queries.
pub fn can_batch(&self) -> bool
sourcepub fn batched(self, chunk_size: usize) -> Vec<ScalarFilter>
pub fn batched(self, chunk_size: usize) -> Vec<ScalarFilter>
If possible, converts the filter into multiple smaller filters.
sourcepub fn as_field_ref(&self) -> Option<&ScalarFieldRef>
pub fn as_field_ref(&self) -> Option<&ScalarFieldRef>
Returns the referenced scalar field if there is one.
sourcepub fn scalar_fields(&self) -> Vec<&ScalarFieldRef>
pub fn scalar_fields(&self) -> Vec<&ScalarFieldRef>
Returns all the scalar fields related to a scalar filter. It also includes the referenced field if there is one.
pub fn is_unique(&self) -> bool
pub fn scalar_ref(&self) -> Option<&ScalarFieldRef>
Trait Implementations§
source§impl Clone for ScalarFilter
impl Clone for ScalarFilter
source§fn clone(&self) -> ScalarFilter
fn clone(&self) -> ScalarFilter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ScalarFilter
impl Debug for ScalarFilter
source§impl From<ScalarFilter> for Filter
impl From<ScalarFilter> for Filter
source§fn from(sf: ScalarFilter) -> Self
fn from(sf: ScalarFilter) -> Self
Converts to this type from the input type.
source§impl Hash for ScalarFilter
impl Hash for ScalarFilter
source§impl PartialEq for ScalarFilter
impl PartialEq for ScalarFilter
source§fn eq(&self, other: &ScalarFilter) -> bool
fn eq(&self, other: &ScalarFilter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ScalarFilter
impl StructuralEq for ScalarFilter
impl StructuralPartialEq for ScalarFilter
Auto Trait Implementations§
impl !RefUnwindSafe for ScalarFilter
impl Send for ScalarFilter
impl Sync for ScalarFilter
impl Unpin for ScalarFilter
impl !UnwindSafe for ScalarFilter
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
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.