Enum DatabaseValue

Source
pub enum DatabaseValue<'a> {
    Parameterized(ParameterizedValue<'a>),
    Column(Box<Column<'a>>),
    Row(Row<'a>),
    Select(Box<Select<'a>>),
    Function(Function<'a>),
    Asterisk(Option<Box<Table<'a>>>),
    Op(Box<SqlOp<'a>>),
}
Expand description

A value we can compare and use in database queries.

Variants§

§

Parameterized(ParameterizedValue<'a>)

Anything that we must parameterize before querying

§

Column(Box<Column<'a>>)

A database column

§

Row(Row<'a>)

Data in a row form, e.g. (1, 2, 3)

§

Select(Box<Select<'a>>)

A nested SELECT statement

§

Function(Function<'a>)

A database function call

§

Asterisk(Option<Box<Table<'a>>>)

A qualified asterisk to a table

§

Op(Box<SqlOp<'a>>)

An operation: sum, sub, mul or div.

Trait Implementations§

Source§

impl<'a> Add for DatabaseValue<'a>

Source§

type Output = DatabaseValue<'a>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl<'a> Clone for DatabaseValue<'a>

Source§

fn clone(&self) -> DatabaseValue<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Comparable<'a> for DatabaseValue<'a>

Source§

fn equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if both sides are the same value. Read more
Source§

fn not_equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if both sides are not the same value. Read more
Source§

fn less_than<T>(self, comparison: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if the left side is smaller than the right side. Read more
Source§

fn less_than_or_equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if the left side is smaller than the right side or the same. Read more
Source§

fn greater_than<T>(self, comparison: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if the left side is bigger than the right side. Read more
Source§

fn greater_than_or_equals<T>(self, comparison: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if the left side is bigger than the right side or the same. Read more
Source§

fn in_selection<T>(self, selection: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if the left side is included in the right side collection. Read more
Source§

fn not_in_selection<T>(self, selection: T) -> Compare<'a>
where T: Into<DatabaseValue<'a>>,

Tests if the left side is not included in the right side collection. Read more
Source§

fn like<T>(self, pattern: T) -> Compare<'a>
where T: Into<Cow<'a, str>>,

Tests if the left side includes the right side string. Read more
Source§

fn not_like<T>(self, pattern: T) -> Compare<'a>
where T: Into<Cow<'a, str>>,

Tests if the left side does not include the right side string. Read more
Source§

fn begins_with<T>(self, pattern: T) -> Compare<'a>
where T: Into<Cow<'a, str>>,

Tests if the left side starts with the right side string. Read more
Source§

fn not_begins_with<T>(self, pattern: T) -> Compare<'a>
where T: Into<Cow<'a, str>>,

Tests if the left side doesn’t start with the right side string. Read more
Source§

fn ends_into<T>(self, pattern: T) -> Compare<'a>
where T: Into<Cow<'a, str>>,

Tests if the left side ends into the right side string. Read more
Source§

fn not_ends_into<T>(self, pattern: T) -> Compare<'a>
where T: Into<Cow<'a, str>>,

Tests if the left side does not end into the right side string. Read more
Source§

fn is_null(self) -> Compare<'a>

Tests if the left side is NULL. Read more
Source§

fn is_not_null(self) -> Compare<'a>

Tests if the left side is not NULL. Read more
Source§

fn between<T, V>(self, left: T, right: V) -> Compare<'a>
where T: Into<DatabaseValue<'a>>, V: Into<DatabaseValue<'a>>,

Tests if the value is between two given values. Read more
Source§

fn not_between<T, V>(self, left: T, right: V) -> Compare<'a>
where T: Into<DatabaseValue<'a>>, V: Into<DatabaseValue<'a>>,

Tests if the value is not between two given values. Read more
Source§

impl<'a> Debug for DatabaseValue<'a>

Source§

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

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

impl<'a> Div for DatabaseValue<'a>

Source§

type Output = DatabaseValue<'a>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
Source§

impl<'a> From<AggregateToString<'a>> for DatabaseValue<'a>

Source§

fn from(f: AggregateToString<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Column<'a>> for DatabaseValue<'a>

Source§

fn from(col: Column<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Count<'a>> for DatabaseValue<'a>

Source§

fn from(f: Count<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Function<'a>> for DatabaseValue<'a>

Source§

fn from(that: Function<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Row<'a>> for DatabaseValue<'a>

Source§

fn from(that: Row<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<RowNumber<'a>> for DatabaseValue<'a>

Source§

fn from(f: RowNumber<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Select<'a>> for DatabaseValue<'a>

Source§

fn from(sel: Select<'a>) -> DatabaseValue<'a>

Converts to this type from the input type.
Source§

impl<'a> From<SqlOp<'a>> for DatabaseValue<'a>

Source§

fn from(p: SqlOp<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<T> for DatabaseValue<'a>
where T: Into<ParameterizedValue<'a>>,

Source§

fn from(p: T) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<Vec<T>> for DatabaseValue<'a>
where T: Into<DatabaseValue<'a>>,

Source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Mul for DatabaseValue<'a>

Source§

type Output = DatabaseValue<'a>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
Source§

impl<'a> PartialEq for DatabaseValue<'a>

Source§

fn eq(&self, other: &DatabaseValue<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Rem for DatabaseValue<'a>

Source§

type Output = DatabaseValue<'a>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
Source§

impl<'a> Sub for DatabaseValue<'a>

Source§

type Output = DatabaseValue<'a>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl<'a> StructuralPartialEq for DatabaseValue<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for DatabaseValue<'a>

§

impl<'a> RefUnwindSafe for DatabaseValue<'a>

§

impl<'a> Send for DatabaseValue<'a>

§

impl<'a> Sync for DatabaseValue<'a>

§

impl<'a> Unpin for DatabaseValue<'a>

§

impl<'a> UnwindSafe for DatabaseValue<'a>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,