MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / first_select_projection

Function first_select_projection

nodedb-sql/src/aggregate_walk.rs:221–230  ·  view source on GitHub ↗
(sql: &str)

Source from the content-addressed store, hash-verified

219 use crate::parser::statement::parse_sql;
220
221 fn first_select_projection(sql: &str) -> Vec<ast::SelectItem> {
222 let stmts = parse_sql(sql).unwrap();
223 match stmts.into_iter().next().unwrap() {
224 ast::Statement::Query(q) => match *q.body {
225 ast::SetExpr::Select(s) => s.projection,
226 _ => panic!(),
227 },
228 _ => panic!(),
229 }
230 }
231
232 fn first_expr(sql: &str) -> ast::Expr {
233 match first_select_projection(sql).into_iter().next().unwrap() {

Callers 1

first_exprFunction · 0.85

Calls 2

parse_sqlFunction · 0.50
nextMethod · 0.45

Tested by

no test coverage detected