MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / plan_default_expr

Function plan_default_expr

src/sql/src/plan/query.rs:1251–1269  ·  view source on GitHub ↗
(
    scx: &StatementContext,
    expr: &Expr<Aug>,
    target_ty: &SqlScalarType,
)

Source from the content-addressed store, hash-verified

1249}
1250
1251pub fn plan_default_expr(
1252 scx: &StatementContext,
1253 expr: &Expr<Aug>,
1254 target_ty: &SqlScalarType,
1255) -> Result<HirScalarExpr, PlanError> {
1256 let qcx = QueryContext::root(scx, QueryLifetime::OneShot);
1257 let ecx = &ExprContext {
1258 qcx: &qcx,
1259 name: "DEFAULT expression",
1260 scope: &Scope::empty(),
1261 relation_type: &SqlRelationType::empty(),
1262 allow_aggregates: false,
1263 allow_subqueries: false,
1264 allow_parameters: false,
1265 allow_windows: false,
1266 };
1267 let hir = plan_expr(ecx, expr)?.cast_to(ecx, CastContext::Assignment, target_ty)?;
1268 Ok(hir)
1269}
1270
1271pub fn plan_params<'a>(
1272 scx: &'a StatementContext,

Callers 4

plan_insert_queryFunction · 0.85
plan_copy_itemFunction · 0.85
plan_copy_from_rowsFunction · 0.85
plan_create_tableFunction · 0.85

Calls 2

plan_exprFunction · 0.85
cast_toMethod · 0.80

Tested by

no test coverage detected