pub type ValueExpr = Expr;Expand description
Expr restricted to value-producing forms used by INSERT rows.
Aliased Type§
pub enum ValueExpr {
Show 24 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>,
filter: Option<Box<Expr>>,
},
Array(Vec<Expr>),
Row(Vec<Expr>),
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: WindowSpec,
},
Case {
base: Option<Box<Expr>>,
when: Vec<(Expr, Expr)>,
else_branch: Option<Box<Expr>>,
},
Cast {
expr: Box<Expr>,
ty: String,
},
ScalarSubquery(Box<SelectStmt>),
Exists {
body: Box<SelectStmt>,
negated: bool,
},
InSubquery {
expr: Box<Expr>,
body: Box<SelectStmt>,
negated: bool,
},
}Variants§
Star
QualifiedStar(String)
Relation-qualified wildcard projection (table.* or alias.*).
Default
DEFAULT in an INSERT/UPDATE assignment. This is a mutation marker,
not a scalar value, and must be 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
text_match(...), knn_match(...), etc. - dispatched through
the function registry.
Fields
binding: Option<FunctionBinding>distinct: boolfunc(DISTINCT expr) - only meaningful for aggregate
functions. Mirrors PostgreSQL’s agg_distinct.
Array(Vec<Expr>)
ARRAY[1.0, 2.0, ...] literal - currently restricted to numeric
elements (vectors).
Row(Vec<Expr>)
Anonymous SQL row constructor (ROW(...) or (a, b)).
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) OVER (PARTITION BY ... ORDER BY ...).
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.
ScalarSubquery(Box<SelectStmt>)
(SELECT ...) scalar subquery: yields a single row / single
column value at evaluation time.
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.