pub type ValueExpr = Expr;Expand description
Expr restricted to value-producing forms used by INSERT rows.
Aliased Type§
pub enum ValueExpr {
Show 25 variants
Star,
QualifiedStar(String),
Default,
Column(String),
QualifiedColumn {
qualifier: String,
column: String,
},
Literal(Value),
Param(usize),
Func {
name: String,
binding: Option<FunctionBinding>,
args: Vec<Expr>,
distinct: bool,
order_by: Vec<OrderBy>,
order_syntax: FunctionCallSyntax,
filter: Option<Box<Expr>>,
},
Array(Vec<Expr>),
Row(Vec<Expr>),
CompositeRow {
items: Vec<Expr>,
binding: CompositeRowBinding,
},
Binary {
op: BinaryOp,
lhs: Box<Expr>,
rhs: Box<Expr>,
},
UnaryMinus(Box<Expr>),
Not(Box<Expr>),
And(Vec<Expr>),
Or(Vec<Expr>),
IsNull {
expr: Box<Expr>,
negated: bool,
},
Between {
expr: Box<Expr>,
low: Box<Expr>,
high: Box<Expr>,
},
InList {
expr: Box<Expr>,
list: Vec<Expr>,
negated: bool,
},
WindowCall {
name: String,
args: Vec<Expr>,
spec: Box<WindowSpec>,
filter: Option<Box<Expr>>,
modifiers: WindowCallModifiers,
},
Case {
base: Option<Box<Expr>>,
when: Vec<(Expr, Expr)>,
else_branch: Option<Box<Expr>>,
},
Cast {
implicit: bool,
expr: Box<Expr>,
ty: String,
},
ScalarSubquery(Box<SelectStmt>),
Exists {
body: Box<SelectStmt>,
negated: bool,
},
InSubquery {
expr: Box<Expr>,
body: Box<SelectStmt>,
negated: bool,
},
// some variants omitted
}Variants§
Star
QualifiedStar(String)
Relation-qualified wildcard projection (table.* or alias.*).
Default
DEFAULT in an INSERT/UPDATE assignment is a mutation marker resolved against the target column before expression evaluation.
Column(String)
Unqualified column reference (col).
QualifiedColumn
Qualified column reference (table.col or alias.col).
Literal(Value)
Param(usize)
A positional bind parameter ($1, $2, …).
Func
Function call dispatched through the function registry.
Fields
binding: Option<FunctionBinding>distinct: boolfunc(DISTINCT expr) - only meaningful for aggregate
functions. Mirrors PostgreSQL’s agg_distinct.
order_by: Vec<OrderBy>Ordering expressions from either func(expr ORDER BY ...) or func(expr) WITHIN GROUP (ORDER BY ...); order_syntax preserves their written location.
order_syntax: FunctionCallSyntaxArray(Vec<Expr>)
SQL array constructor.
Row(Vec<Expr>)
Anonymous SQL row constructor (ROW(...) or (a, b)).
CompositeRow
A stored typed row with creation-time attribute positions and already selected field conversions.
Binary
lhs op rhs - comparison or arithmetic.
UnaryMinus(Box<Expr>)
PostgreSQL prefix -, kept distinct from binary subtraction so the
operand’s declared numeric width and overflow behavior survive lowering.
Not(Box<Expr>)
NOT expr.
And(Vec<Expr>)
cond_1 AND cond_2 AND ... (n-ary).
Or(Vec<Expr>)
cond_1 OR cond_2 OR ... (n-ary).
IsNull
expr IS NULL / expr IS NOT NULL.
Between
expr BETWEEN low AND high.
InList
expr IN (a, b, c) literal list.
WindowCall
func(args) [FILTER (WHERE condition)] OVER (PARTITION BY ... ORDER BY ...). Only aggregates accept FILTER.
Case
CASE [base] WHEN cond THEN result ... [ELSE default] END.
base lifts simple-form CASE expr WHEN val THEN ... into an
optional comparison anchor; searched-form CASE WHEN cond ...
leaves it None.
Cast
CAST(expr AS type). The type name is preserved verbatim so
the evaluator can apply the correct coercion.
Fields
ScalarSubquery(Box<SelectStmt>)
(SELECT ...) query expression: ordinary scalar consumers select one
column; a multiple-column SET target consumes the positional result.
Exists
EXISTS (SELECT ...) – truthy when the body produces at
least one row.
InSubquery
expr [NOT] IN (SELECT ...) set membership against a
subquery. Evaluator runs the body once per top-level
expression and tests membership.