MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / parse_proj

Function parse_proj

crates/sql-parser/src/parser/mod.rs:198–208  ·  view source on GitHub ↗

Parse a column projection

(expr: Expr)

Source from the content-addressed store, hash-verified

196
197/// Parse a column projection
198pub(crate) fn parse_proj(expr: Expr) -> SqlParseResult<ProjectExpr> {
199 match expr {
200 Expr::Identifier(ident) => Ok(ProjectExpr::Var(ident.into())),
201 Expr::CompoundIdentifier(mut idents) if idents.len() == 2 => {
202 let table = idents.swap_remove(0).into();
203 let field = idents.swap_remove(0).into();
204 Ok(ProjectExpr::Field(table, field))
205 }
206 _ => Err(SqlUnsupported::ProjectionExpr(expr).into()),
207 }
208}
209
210// These types determine the size of [`parse_expr`]'s stack frame on 64-bit targets.
211// Changing their sizes will require updating the recursion limit to avoid stack overflows.

Callers 1

parse_project_elemFunction · 0.85

Calls 3

OkFunction · 0.50
ErrFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…