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

Function describe_declare

src/sql/src/plan/statement/scl.rs:181–196  ·  view source on GitHub ↗
(
    scx: &StatementContext,
    DeclareStatement { stmt, .. }: DeclareStatement<Aug>,
    param_types_in: &[Option<SqlScalarType>],
)

Source from the content-addressed store, hash-verified

179}
180
181pub fn describe_declare(
182 scx: &StatementContext,
183 DeclareStatement { stmt, .. }: DeclareStatement<Aug>,
184 param_types_in: &[Option<SqlScalarType>],
185) -> Result<StatementDesc, PlanError> {
186 let (stmt_resolved, _) = names::resolve(scx.catalog, *stmt)?;
187 // Get the desc for the inner statement, but only for its parameters. The outer DECLARE doesn't
188 // return any rows itself when executed.
189 let desc = describe(scx.pcx()?, scx.catalog, stmt_resolved, param_types_in)?;
190 // The outer describe fn calls scx.finalize_param_types, so we need to transfer the inner desc's
191 // params to this scx.
192 for (i, ty) in desc.param_types.into_iter().enumerate() {
193 scx.param_types.borrow_mut().insert(i + 1, ty);
194 }
195 Ok(StatementDesc::new(None))
196}
197
198pub fn plan_declare(
199 _: &StatementContext,

Callers 1

describeFunction · 0.85

Calls 6

resolveFunction · 0.85
enumerateMethod · 0.80
describeFunction · 0.50
pcxMethod · 0.45
into_iterMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected