Enum sql::plan::expr::CoercibleScalarExpr[][src]

pub enum CoercibleScalarExpr {
    Coerced(HirScalarExpr),
    Parameter(usize),
    LiteralNull,
    LiteralString(String),
    LiteralRecord(Vec<CoercibleScalarExpr>),
}
Expand description

A CoercibleScalarExpr is a HirScalarExpr whose type is not fully determined. Several SQL expressions can be freely coerced based upon where in the expression tree they appear. For example, the string literal ‘42’ will be automatically coerced to the integer 42 if used in a numeric context:

SELECT '42' + 42

This separate type gives the code that needs to interact with coercions very fine-grained control over what coercions happen and when.

The primary driver of coercion is function and operator selection, as choosing the correct function or operator implementation depends on the type of the provided arguments. Coercion also occurs at the very root of the scalar expression tree. For example in

SELECT ... WHERE $1

the WHERE clause will coerce the contained unconstrained type parameter $1 to have type bool.

Variants

Coerced(HirScalarExpr)

Tuple Fields

Parameter(usize)

Tuple Fields

0: usize

LiteralNull

LiteralString(String)

Tuple Fields

0: String

LiteralRecord(Vec<CoercibleScalarExpr>)

Tuple Fields

Implementations

Trait Implementations

Computes the type of the expression.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Upcasts this ProgressEventTimestamp to Any. Read more

Returns the name of the concrete type of this object. Read more

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more