Skip to main content

Flavor

Struct Flavor 

Source
pub struct Flavor {
    pub search_terms: bool,
    pub contains_all_patterns: bool,
    pub compiles_aggregates: bool,
    pub object_path: Option<ObjectPathCheck>,
    pub indexed_distance: Option<i64>,
    pub sqlite: Option<SqliteFlavor>,
    pub ids: Option<IdCollation>,
}
Expand description

How a builder compiles some filters, as utopia-php/database’s builder subclasses do. The default compiles as this library does.

Fields§

§search_terms: bool

Prepares full-text search terms as 7.x did: every character other than a letter, a number, an underscore or whitespace separates words, and a term wrapped in double quotes stays an exact search (MySQL, MariaDB, PostgreSQL).

PHP: Utopia\Database\Builder\PreparesSearchTerms.

§contains_all_patterns: bool

containsAll() on an attribute that is not an array matches as 7.x did: each value is a LIKE pattern on the whole value, and a row matching any one of them is returned (MySQL, MariaDB, PostgreSQL).

PHP: Utopia\Database\Builder\MatchesContainsAllPatterns.

§compiles_aggregates: bool

Compiles the aggregates MySQL and MariaDB answer differently from the other engines. Each floating aggregate (sum, avg, the variances and, through SQRT() of a variance, the deviations) compiles through the engine’s float range check, + 0, which raises an error for a value that is not finite: both send a DOUBLE aggregate that overflowed as 0 over the text protocol, and turn an infinite or undefined variance into DBL_MAX or NULL under STDDEV. Each bitwise aggregate is cast to SIGNED: both answer BIT_AND, BIT_OR and BIT_XOR as BIGINT UNSIGNED, and the cast reads the same 64 bits as the two’s complement integer PostgreSQL answers. An unaliased aggregate keeps the name the engine gave it.

PHP: Utopia\Database\Builder\CompilesAggregates (8.3.4; until then RaisesFloatOverflow, without the bitwise cast).

§object_path: Option<ObjectPathCheck>

Checks the path of a filter into an object attribute (attribute.key.key) before it compiles (PostgreSQL); its error is the filter’s.

PHP: Utopia\Database\Builder\Postgres::compileFilter().

§indexed_distance: Option<i64>

distanceLessThan() leads with a predicate the spatial index serves, in this SRID (PostgreSQL).

PHP: Utopia\Database\Builder\Postgres::compileSpatialFilter().

§sqlite: Option<SqliteFlavor>

SQLite’s overrides.

§ids: Option<IdCollation>

Compares document ids in the collation of their unique indexes (SQLite, PostgreSQL).

PHP: Utopia\Database\Builder\CollatesDocumentIds.

Trait Implementations§

Source§

impl Clone for Flavor

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Flavor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Flavor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Flavor

§

impl !UnwindSafe for Flavor

§

impl Forget for Flavor

§

impl Freeze for Flavor
where *const ArcInner<dyn Fn(&str) -> Result<(), Error> + Sync + Send> is !null: Freeze, PhantomData<ArcInner<dyn Fn(&str) -> Result<(), Error> + Sync + Send>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze,

§

impl Move for Flavor

§

impl Send for Flavor
where Arc<dyn Fn(&str) -> Result<(), Error> + Sync + Send>: Send, RawVecInner: Send,

§

impl Sync for Flavor
where Arc<dyn Fn(&str) -> Result<(), Error> + Sync + Send>: Sync, RawVecInner: Sync,

§

impl Unpin for Flavor
where Arc<dyn Fn(&str) -> Result<(), Error> + Sync + Send>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Flavor
where *const ArcInner<dyn Fn(&str) -> Result<(), Error> + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(&str) -> Result<(), Error> + Sync + Send>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.