pub enum Method {
Show 88 variants
Equal,
NotEqual,
LessThan,
LessThanEqual,
GreaterThan,
GreaterThanEqual,
Contains,
ContainsAny,
NotContains,
Search,
NotSearch,
IsNull,
IsNotNull,
Between,
NotBetween,
StartsWith,
NotStartsWith,
EndsWith,
NotEndsWith,
Regex,
Exists,
NotExists,
Crosses,
NotCrosses,
DistanceEqual,
DistanceNotEqual,
DistanceGreaterThan,
DistanceLessThan,
Intersects,
NotIntersects,
Overlaps,
NotOverlaps,
Touches,
NotTouches,
VectorDot,
VectorCosine,
VectorEuclidean,
Select,
OrderDesc,
OrderAsc,
OrderRandom,
Limit,
Offset,
CursorAfter,
CursorBefore,
And,
Or,
ContainsAll,
ElemMatch,
Relationship,
Count,
CountDistinct,
Sum,
Avg,
Min,
Max,
Stddev,
StddevPop,
StddevSamp,
Variance,
VarPop,
VarSamp,
BitAnd,
BitOr,
BitXor,
GroupBy,
GroupByTimeBucket,
Having,
Distinct,
Join,
LeftJoin,
RightJoin,
CrossJoin,
FullOuterJoin,
NaturalJoin,
On,
Union,
UnionAll,
JsonContains,
JsonNotContains,
JsonOverlaps,
JsonPath,
OrderVectorDistance,
Covers,
NotCovers,
SpatialEquals,
NotSpatialEquals,
Raw,
}Expand description
What a Query does: filter, order, paginate, select,
aggregate, join, combine, or carry raw SQL.
PHP: Utopia\Query\Method.
Variants§
Equal
equal: the attribute is one of the values.
NotEqual
notEqual: the attribute is none of the values.
LessThan
lessThan.
LessThanEqual
lessThanEqual.
GreaterThan
greaterThan.
GreaterThanEqual
greaterThanEqual.
Contains
contains: substring (or array element) match.
ContainsAny
containsAny: any of the values.
NotContains
notContains.
Search
search: full-text search.
NotSearch
notSearch.
IsNull
isNull.
IsNotNull
isNotNull.
Between
between.
NotBetween
notBetween.
StartsWith
startsWith.
NotStartsWith
notStartsWith.
EndsWith
endsWith.
NotEndsWith
notEndsWith.
Regex
regex.
Exists
exists: the attributes are present.
NotExists
notExists.
Crosses
crosses (spatial).
NotCrosses
notCrosses (spatial).
DistanceEqual
distanceEqual (spatial).
DistanceNotEqual
distanceNotEqual (spatial).
DistanceGreaterThan
distanceGreaterThan (spatial).
DistanceLessThan
distanceLessThan (spatial).
Intersects
intersects (spatial).
NotIntersects
notIntersects (spatial).
Overlaps
overlaps (spatial).
NotOverlaps
notOverlaps (spatial).
Touches
touches (spatial).
NotTouches
notTouches (spatial).
VectorDot
vectorDot (vector similarity).
VectorCosine
vectorCosine (vector similarity).
VectorEuclidean
vectorEuclidean (vector similarity).
Select
select: the columns to return.
OrderDesc
orderDesc.
OrderAsc
orderAsc.
OrderRandom
orderRandom.
Limit
limit.
Offset
offset.
CursorAfter
cursorAfter: page after a row.
CursorBefore
cursorBefore: page before a row.
And
and.
Or
or.
ContainsAll
containsAll.
ElemMatch
elemMatch: an array element matches every nested query.
Relationship
relationship: queries, written against the related collection,
that shape the documents populated for a relationship attribute.
Count
count.
CountDistinct
countDistinct.
Sum
sum.
Avg
avg.
Min
min.
Max
max.
Stddev
stddev.
StddevPop
stddevPop.
StddevSamp
stddevSamp.
Variance
variance.
VarPop
varPop.
VarSamp
varSamp.
BitAnd
bitAnd.
BitOr
bitOr.
BitXor
bitXor.
GroupBy
groupBy.
GroupByTimeBucket
groupByTimeBucket.
Having
having.
Distinct
distinct.
Join
join (inner).
LeftJoin
leftJoin.
RightJoin
rightJoin.
CrossJoin
crossJoin.
FullOuterJoin
fullOuterJoin.
NaturalJoin
naturalJoin.
On
on: a column-to-column join condition.
Union
union.
UnionAll
unionAll.
JsonContains
jsonContains.
JsonNotContains
jsonNotContains.
JsonOverlaps
jsonOverlaps.
JsonPath
jsonPath.
OrderVectorDistance
orderVectorDistance.
Covers
covers (spatial).
NotCovers
notCovers (spatial).
SpatialEquals
spatialEquals (spatial).
NotSpatialEquals
notSpatialEquals (spatial).
Raw
raw: SQL used as given.
Implementations§
Source§impl Method
impl Method
Sourcepub fn try_from_value(value: &str) -> Option<Self>
pub fn try_from_value(value: &str) -> Option<Self>
The case with backing value value, if any.
PHP: tryFrom().
Sourcepub fn from_value(value: &str) -> Result<Self, Error>
pub fn from_value(value: &str) -> Result<Self, Error>
The case with backing value value.
PHP: from(), which throws ValueError (Error::InvalidValue) with the same message.
Source§impl Method
impl Method
Sourcepub fn is_filter(self) -> bool
pub fn is_filter(self) -> bool
Whether this is a comparison filter (equal through notExists).
PHP: isFilter().
Sourcepub fn is_spatial(self) -> bool
pub fn is_spatial(self) -> bool
Whether this is a spatial predicate.
PHP: isSpatial().
Sourcepub fn is_nested(self) -> bool
pub fn is_nested(self) -> bool
Whether queries of this method hold other queries.
PHP: isNested().
Sourcepub fn is_aggregate(self) -> bool
pub fn is_aggregate(self) -> bool
Whether this is an aggregate.
PHP: isAggregate().
Sourcepub fn is_join_condition(self) -> bool
pub fn is_join_condition(self) -> bool
Whether a join’s ON list may hold this method: on column
comparisons, the filters every builder compiles inside ON, and
and/or of those.
PHP: isJoinCondition().
Sourcepub fn sql_function(self) -> Option<&'static str>
pub fn sql_function(self) -> Option<&'static str>
The standard SQL function of an aggregate (SUM, COUNT, …), or
None when the method has no direct mapping.
PHP: sqlFunction().
use utopia_query::Method;
assert_eq!(Method::StddevPop.sql_function(), Some("STDDEV_POP"));
assert_eq!(Method::Equal.sql_function(), None);use Utopia\Query\Method;
echo Method::StddevPop->sqlFunction(), "\n"; // STDDEV_POP
var_dump(Method::Equal->sqlFunction()); // NULLTrait Implementations§
impl Copy for Method
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Forget for Method
impl Freeze for Method
impl Move for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnsafeUnpin for Method
impl UnwindSafe for Method
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.