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

Function parse_sql

nodedb-sql/src/parser/statement.rs:12–21  ·  view source on GitHub ↗

Parse a SQL string into one or more statements.

(sql: &str)

Source from the content-addressed store, hash-verified

10
11/// Parse a SQL string into one or more statements.
12pub fn parse_sql(sql: &str) -> Result<Vec<Statement>> {
13 let dialect = PostgreSqlDialect {};
14 let statements = Parser::parse_sql(&dialect, sql)?;
15 if statements.is_empty() {
16 return Err(SqlError::Parse {
17 detail: "empty SQL statement".into(),
18 });
19 }
20 Ok(statements)
21}
22
23/// Classify a parsed statement for routing.
24#[derive(Debug)]

Callers 15

parse_object_nameFunction · 0.70
plan_sqlFunction · 0.50
plan_sql_with_paramsFunction · 0.50
first_select_projectionFunction · 0.50
bind_and_formatFunction · 0.50
parse_group_byFunction · 0.50
parse_selectFunction · 0.50
select_ofFunction · 0.50
plan_oneFunction · 0.50
planFunction · 0.50
planFunction · 0.50

Calls 1

is_emptyMethod · 0.45

Tested by 7

plan_oneFunction · 0.40
plan_select_sqlFunction · 0.40
first_select_exprFunction · 0.40
where_sql_exprFunction · 0.40
select_expr_loweredFunction · 0.40