Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
547b549c
Commit
547b549c
authored
1 year ago
by
Alexander Tolstoy
Committed by
Denis Smirnov
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
ebnf: convert keywords to uppercase and references to the snake-case
parent
1435b222
No related branches found
No related tags found
1 merge request
!1414
sbroad import
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/sql/query.ebnf
+40
-41
40 additions, 41 deletions
doc/sql/query.ebnf
with
40 additions
and
41 deletions
doc/sql/query.ebnf
+
40
−
41
View file @
547b549c
STATEMENT ::= EXPLAIN | DDL | DML | DQL | ACL
EXPLAIN
::= 'EXPLAIN' (
DML | DQL
)
DQL
::= (
SELECT | SELECT UNION ALL SELECT | SELECT (EXCEPT
'DISTINCT'? )
SELECT
)
O
ptions?
DML
::= (
DELETE | INSERT | UPDATE
)
O
ptions?
DDL
::=
C
reate
T
able |
D
rop
T
able
ACL
::=
D
rop
R
ole |
D
rop
U
ser |
C
reate
R
ole |
C
reate
U
ser |
A
lter
U
ser |
G
rant
P
rivilege |
R
evoke
P
rivilege
R
evoke
P
rivilege ::= '
revoke
'
P
rivilege '
from
' (role | user) ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
G
rant
P
rivilege ::= '
grant
'
P
rivilege '
to
' (role | user) ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
P
rivilege ::= (('
create' | 'alter' | 'drop') 'user
')
| (('
alter
' | '
drop
') '
on
' '
user
' (role | user))
| (('
create' | 'drop') 'role
')
| ('
drop
' '
on
' '
role
' (role | user))
| (('
read
' | '
write' | 'create' | 'alter' | 'drop') 'table
')
| (('
alter
' | '
drop
' | '
read
' | '
write
') '
on
' '
table
'? table)
statement ::= explain | ddl | dml | dql | acl
explain
::= 'EXPLAIN' (
dml | dql
)
dql
::= (
select | select union all select | select (except
'DISTINCT'? )
select
)
o
ptions?
dml
::= (
delete | insert | update
)
o
ptions?
ddl
::=
c
reate
_t
able |
d
rop
_t
able
acl
::=
d
rop
_r
ole |
d
rop
_u
ser |
c
reate
_r
ole |
c
reate
_u
ser |
a
lter
_u
ser |
g
rant
_p
rivilege |
r
evoke
_p
rivilege
r
evoke
_p
rivilege ::= '
REVOKE
'
p
rivilege '
FROM
' (role | user) ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
g
rant
_p
rivilege ::= '
GRANT
'
p
rivilege '
TO
' (role | user) ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
p
rivilege ::= (('
CREATE' | 'ALTER' | 'DROP') 'USER
')
| (('
ALTER
' | '
DROP
') '
ON
' '
USER
' (role | user))
| (('
CREATE' | 'DROP') 'ROLE
')
| ('
DROP
' '
ON
' '
ROLE
' (role | user))
| (('
READ
' | '
WRITE' | 'CREATE' | 'ALTER' | 'DROP') 'TABLE
')
| (('
ALTER
' | '
DROP
' | '
READ
' | '
WRITE
') '
ON
' '
TABLE
'? table)
| role
C
reate
R
ole ::= '
create role
' role ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
C
reate
T
able ::= '
create table
' table '('
C
olumn (','
C
olumn)* ','
P
rimary
K
ey ')' ('
using' ('memtx' | 'vinyl
'))?
D
istribution ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
C
reate
U
ser ::= '
create user' user 'with'? 'password
' "'" password "'" ('
using' ('chap-sha
1' | '
ldap
' | '
md
5'))? ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
A
lter
U
ser ::= '
alter user
' user '
with
'? ('
login' | 'nologin' | 'password
' "'" password "'" ('
using' ('chap-sha
1' | '
ldap
' | '
md
5'))?) ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
C
olumn ::= name ('B
ool
' | 'D
ecimal
' | 'D
ouble
' | 'I
nt
' | 'N
umber
' | 'S
calar
' | 'S
tring
' | 'T
ext
' | 'U
nsigned' | 'Varchar
') (('
not
'?) '
null
')?
P
rimary
K
ey ::= '
primary key
' '(' name (',' name)* ')'
D
istribution ::= '
global' | ('distributed by
' '(' name (',' name)* ')')
D
rop
T
able ::= '
drop table
' table ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
D
rop
R
ole ::= '
drop role
' role ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
D
rop
U
ser ::= '
drop user
' user ('
option
' '(' ('
timeout' '=' DOUBLE
)')')?
O
ptions ::= '
option
' '(' ('
vtable_max_rows' '=' UNSIGNED)? (',' 'sql_vdbe_max_steps' '=' UNSIGNED
)? ')'
SELECT
::= 'SELECT' ((alias (',' alias)*) ) 'FROM' (table ('AS' name)? | '(' (
SELECT | VALUES
) ')' ('AS' name)?) ( ('INNER')? 'JOIN' (table ('AS' name)? | ('(' (
SELECT | VALUES
) ')' ('AS' name)?)) 'ON' expression )? ( 'WHERE' expression )? ( 'GROUP BY' expression(',' expression)* )?
VALUES
::= 'VALUES' '(' row (',' row)* ')'
SUBQUERY
::= '(' (
SELECT | VALUES
) ')'
c
reate
_r
ole ::= '
CREATE ROLE
' role ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
c
reate
_t
able ::= '
CREATE TABLE
' table '('
c
olumn (','
c
olumn)* ','
p
rimary
_k
ey ')' ('
USING' ('MEMTX' | 'VINYL
'))?
d
istribution ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
c
reate
_u
ser ::= '
CREATE USER' user 'WITH'? 'PASSWORD
' "'" password "'" ('
USING' ('CHAP-SHA
1' | '
LDAP
' | '
MD
5'))? ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
a
lter
_u
ser ::= '
ALTER USER
' user '
WITH
'? ('
LOGIN' | 'NOLOGIN' | 'PASSWORD
' "'" password "'" ('
USING' ('CHAP-SHA
1' | '
LDAP
' | '
MD
5'))?) ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
c
olumn
::= name ('B
OOL
' | 'D
ECIMAL
' | 'D
OUBLE
' | 'I
NT
' | 'N
UMBER
' | 'S
CALAR
' | 'S
TRING
' | 'T
EXT
' | 'U
NSIGNED' | 'VARCHAR
') (('
NOT
'?) '
NULL
')?
p
rimary
_k
ey ::= '
PRIMARY KEY
' '(' name (',' name)* ')'
d
istribution ::= '
GLOBAL' | ('DISTRIBUTED BY
' '(' name (',' name)* ')')
d
rop
_t
able ::= '
DROP TABLE
' table ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
d
rop
_r
ole ::= '
DROP ROLE
' role ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
d
rop
_u
ser ::= '
DROP USER
' user ('
OPTION
' '(' ('
TIMEOUT' '=' double
)')')?
o
ptions ::= '
OPTION
' '(' ('
VTABLE_MAX_ROWS' '=' unsigned)? (',' 'SQL_VDBE_MAX_STEPS' '=' unsigned
)? ')'
select
::= 'SELECT' ((alias (',' alias)*) ) 'FROM' (table ('AS' name)? | '(' (
select | values
) ')' ('AS' name)?) ( ('INNER')? 'JOIN' (table ('AS' name)? | ('(' (
select | values
) ')' ('AS' name)?)) 'ON' expression )? ( 'WHERE' expression )? ( 'GROUP BY' expression(',' expression)* )?
values
::= 'VALUES' '(' row (',' row)* ')'
subquery
::= '(' (
select | values
) ')'
row ::= '(' (value (',' value)*) ')'
alias ::= '*' | (table '.')? name ('AS' name)? | table '.' '*' | expression ('AS' name)?
alias
::= '*' | (table '.')? name ('AS' name)? | table '.' '*' | expression ('AS' name)?
expression ::= column_name
| 'CAST' '(' expression 'AS' type ')'
| expression ('IS' ('NOT')? 'NULL')
| expression ('OR' | 'AND' | '*' | '/' | '+' | '-' | '=' | '>' | '<' | '>=' | '<=' | ('<>' | '!=')) expression
| expression ('NOT')? 'BETWEEN' expression 'AND' expression
| ('NOT')? 'EXISTS'
SUBQUERY
| expression ('NOT')? 'IN'
SUBQUERY
| ('NOT')? 'EXISTS'
subquery
| expression ('NOT')? 'IN'
subquery
| reference
|
SUBQUERY
|
subquery
| value
| 'NOT' expression
reference ::= (table '.')? name
...
...
@@ -45,11 +45,11 @@ value ::= 'TRUE'
| 'FALSE'
| 'NULL'
| '?'
|
INTEGER
|
UNSIGNED
|
DOUBLE
|
DECIMAL
|
STRING
|
integer
|
unsigned
|
double
|
decimal
|
string
| row
type ::= 'ANY'
| 'BOOL'
...
...
@@ -64,7 +64,6 @@ type ::= 'ANY'
| 'TEXT'
| 'UNSIGNED'
| 'VARCHAR' ('(' length ')')?
DELETE ::= 'DELETE' 'FROM' table ('WHERE' expression)?
INSERT ::= 'INSERT' 'INTO' table ('(' name (',' name)* ')')? (VALUES row | SELECT ) ('on conflict' 'do' ('nothing' | 'replace' | 'fail'))?
UPDATE ::= 'UPDATE' table 'set' ( name '=' ((table '.')? name) (',' name '=' (table '.')? name)* ) ( 'FROM' '(' SELECT ')' ( 'AS' name )? )? ( 'WHERE' expression )?
delete ::= 'DELETE' 'FROM' table ('WHERE' expression)?
insert ::= 'INSERT' 'INTO' table ('(' name (',' name)* ')')? (values row | select ) ('ON CONFLICT' 'DO' ('NOTHING' | 'REPLACE' | 'FAIL'))?
update ::= 'UPDATE' table 'SET' ( name '=' ((table '.')? name) (',' name '=' (table '.')? name)* ) ( 'FROM' '(' select ')' ( 'AS' name )? )? ( 'WHERE' expression )?
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment