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

Method parse_query

crates/sql-parser/src/parser/sql.rs:328–350  ·  view source on GitHub ↗
(query: Query)

Source from the content-addressed store, hash-verified

326 type Ast = SqlSelect;
327
328 fn parse_query(query: Query) -> SqlParseResult<Self::Ast> {
329 match query {
330 Query {
331 with: None,
332 body,
333 order_by,
334 limit: None,
335 offset: None,
336 fetch: None,
337 locks,
338 } if order_by.is_empty() && locks.is_empty() => parse_set_op(*body, None),
339 Query {
340 with: None,
341 body,
342 order_by,
343 limit: Some(Expr::Value(Value::Number(n, _))),
344 offset: None,
345 fetch: None,
346 locks,
347 } if order_by.is_empty() && locks.is_empty() => parse_set_op(*body, Some(n.into_boxed_str())),
348 _ => Err(SqlUnsupported::feature(query).into()),
349 }
350 }
351}
352
353/// Parse a set operation

Callers

nothing calls this directly

Calls 3

parse_set_opFunction · 0.70
ErrFunction · 0.50
is_emptyMethod · 0.45

Tested by

no test coverage detected