Skip to content
Snippets Groups Projects
Commit 093ddb52 authored by Alexander Tolstoy's avatar Alexander Tolstoy Committed by Denis Smirnov
Browse files

docs: add railroad diagrams (eBNF) for Sbroad queries

parent ca630799
No related branches found
No related tags found
1 merge request!1414sbroad import
Query ::= Select | Select 'union all' Select | Select ('except' | 'except distinct') Select | Values | Insert
Select ::= 'select' (Column (',' Column)*) 'from' (Table | Select) ('as' Alias)? ( ('inner')? 'join' (Table | Select) ('as' Alias)? 'on' Expression )? ( 'group by' GroupBy )? ( 'where' Expression )?
Column ::= '*' | Table '.' '*' | Expression | Expression 'as' Alias
Expression ::= Expression 'or' Expression
| Expression 'and' Expression
| Expression '*' Expression
| Expression '/' Expression
| Expression '+' Expression
| Expression '-' Expression
| Expression '=' Expression
| Expression '>' Expression
| Expression '>=' Expression
| Expression '<' Expression
| Expression '<=' Expression
| Expression ('<>' | '!=') Expression
| Expression 'is null'
| Expression 'is not null'
| Expression 'between' Expression 'and' Expression
| Reference
| Select
| Value
GroupBy ::= Concat | Cast | Function | Reference
Reference ::= ((Table | '"' Table '"') '.')? (Alias | '"' Alias '"')
Value ::= 'true'
| 'false'
| 'null'
| '?'
| Integer
| Unsigned
| Double
| Decimal
| String
| Row
Cast ::= 'cast' '(' Expression 'as' Type ')'
Type ::= 'any'
| 'bool'
| 'boolean'
| 'decimal'
| 'double'
| 'int'
| 'integer'
| 'number'
| 'scalar'
| 'string'
| 'text'
| 'unsigned'
| 'varchar' ('(' Length ')')?
Insert ::= 'insert into' Table ('(' Reference (',' Reference)* ')')? (Select | Values)
Values ::= 'values' '(' (Value (',' Value)*) ')' (',' '(' (Value (',' Value)*) ')')*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment