Skip to content
Snippets Groups Projects
Commit 9254259a authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

User guide: add sql.txt, to which the user guide refers.

Add sql.txt, describing the supported SQL grammar,
to which the user guide refers.
parent e58d165d
No related branches found
No related tags found
No related merge requests found
;
; Tarantool SQL parser is implemented entirely on the client side.
; This BNF provides a reference of the supported subset of
; the standard SQL, to which all clients are strongly encouraged
; to stick.
;
; Convention: Uppercase letters are used for terminals and literals,
; which should be typed in intact. Lowercase letters are used
; for <non-terminals>.
<sql> ::= <insert> | <update> | <delete> | <select>
<insert> ::= INSERT [INTO] <ident> VALUES <value_list>
<update> ::= UPDATE <ident> SET <update_list> <simple_where>
<delete> ::= DELETE FROM <ident> <simple_where>
; It's only possible to select all fields of a tuple (* for field list)
<select> ::= SELECT * FROM <ident> <where> <opt_limit>
<simple_where> ::= WHERE <predicate>
<where> ::= WHERE <disjunction>
<predicate> ::= <ident> = <constant>
<disjunction> ::= <predicate> [{OR <predicate>}+]
; LIMIT is optional
<opt_limit> ::= | LIMIT NUM[, NUM]
<value_list> ::= (<constant> [{, <constant>}+])
<update_list> ::= <ident> = <constant> [{, <ident> = <constant>}+]
<constant> ::= STR | NUM
<ident> ::= ID
; Only integer numbers, optionally signed, are supported
NUM ::= [+-]?[0-9]+
; Strings must be single-quoted
STR ::= '.*'
; Identifiers must be standard SQL, but end with digits.
; These digits are used to infer the namespace or index id.
ID ::= [a-z_]+[0-9]+
; vim: syntax=bnf
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