mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-30 03:32:59 +03:00
a1a89ee9dd
* sakila: initial test data * sakila: more test data * sakila: yet more test data setup * whitespace cols: now working for sqlite * grammar cleanup * whitespace cols: now working inside count() func for sqlite * whitespace cols: tests mostly passing; begining refactoring * grammar: refactor handle * grammar: more refactoring * grammar: rename selElement to selector * wip * all tests passing * all tests passing * linting * driver: implement CurrentSchema for all driver.SQLDriver impls * driver: tests for AlterTableRename and AlterTableRenameColumn * undo reformat of SQL * undo reformat of SQL * undo reformat of SQL * undo reformat of SQL
131 lines
7.3 KiB
Plaintext
131 lines
7.3 KiB
Plaintext
token literal names:
|
|
null
|
|
';'
|
|
'*'
|
|
'join'
|
|
'JOIN'
|
|
'j'
|
|
'group'
|
|
'GROUP'
|
|
'g'
|
|
'.['
|
|
'sum'
|
|
'SUM'
|
|
'avg'
|
|
'AVG'
|
|
'count'
|
|
'COUNT'
|
|
'where'
|
|
'WHERE'
|
|
'||'
|
|
'/'
|
|
'%'
|
|
'+'
|
|
'-'
|
|
'<<'
|
|
'>>'
|
|
'&'
|
|
'&&'
|
|
'~'
|
|
'!'
|
|
null
|
|
null
|
|
'('
|
|
')'
|
|
'['
|
|
']'
|
|
','
|
|
'|'
|
|
':'
|
|
null
|
|
null
|
|
null
|
|
'<='
|
|
'<'
|
|
'>='
|
|
'>'
|
|
'!='
|
|
'=='
|
|
null
|
|
null
|
|
null
|
|
null
|
|
|
|
token symbolic names:
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
null
|
|
ID
|
|
WS
|
|
LPAR
|
|
RPAR
|
|
LBRA
|
|
RBRA
|
|
COMMA
|
|
PIPE
|
|
COLON
|
|
NULL
|
|
NN
|
|
NUMBER
|
|
LT_EQ
|
|
LT
|
|
GT_EQ
|
|
GT
|
|
NEQ
|
|
EQ
|
|
NAME
|
|
HANDLE
|
|
STRING
|
|
LINECOMMENT
|
|
|
|
rule names:
|
|
stmtList
|
|
query
|
|
segment
|
|
element
|
|
cmpr
|
|
fn
|
|
fnElement
|
|
join
|
|
joinConstraint
|
|
group
|
|
selector
|
|
selectorElement
|
|
alias
|
|
handleTable
|
|
handle
|
|
rowRange
|
|
fnName
|
|
expr
|
|
literal
|
|
unaryOperator
|
|
|
|
|
|
atn:
|
|
[4, 1, 50, 210, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 1, 0, 5, 0, 42, 8, 0, 10, 0, 12, 0, 45, 9, 0, 1, 0, 1, 0, 4, 0, 49, 8, 0, 11, 0, 12, 0, 50, 1, 0, 5, 0, 54, 8, 0, 10, 0, 12, 0, 57, 9, 0, 1, 0, 5, 0, 60, 8, 0, 10, 0, 12, 0, 63, 9, 0, 1, 1, 1, 1, 1, 1, 5, 1, 68, 8, 1, 10, 1, 12, 1, 71, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 76, 8, 2, 10, 2, 12, 2, 79, 9, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 89, 8, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 98, 8, 5, 10, 5, 12, 5, 101, 9, 5, 1, 5, 3, 5, 104, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 3, 6, 110, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 122, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 5, 9, 129, 8, 9, 10, 9, 12, 9, 132, 9, 9, 1, 9, 1, 9, 1, 10, 1, 10, 3, 10, 138, 8, 10, 1, 11, 1, 11, 3, 11, 142, 8, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 161, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 174, 8, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 195, 8, 17, 1, 17, 1, 17, 1, 17, 1, 17, 5, 17, 201, 8, 17, 10, 17, 12, 17, 204, 9, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 0, 1, 34, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 10, 1, 0, 41, 46, 1, 0, 3, 5, 1, 0, 6, 8, 1, 0, 10, 17, 2, 0, 2, 2, 19, 20, 1, 0, 21, 22, 1, 0, 23, 25, 1, 0, 41, 44, 2, 0, 38, 40, 49, 49, 2, 0, 21, 22, 27, 28, 226, 0, 43, 1, 0, 0, 0, 2, 64, 1, 0, 0, 0, 4, 72, 1, 0, 0, 0, 6, 88, 1, 0, 0, 0, 8, 90, 1, 0, 0, 0, 10, 92, 1, 0, 0, 0, 12, 107, 1, 0, 0, 0, 14, 111, 1, 0, 0, 0, 16, 121, 1, 0, 0, 0, 18, 123, 1, 0, 0, 0, 20, 135, 1, 0, 0, 0, 22, 139, 1, 0, 0, 0, 24, 143, 1, 0, 0, 0, 26, 146, 1, 0, 0, 0, 28, 149, 1, 0, 0, 0, 30, 151, 1, 0, 0, 0, 32, 164, 1, 0, 0, 0, 34, 173, 1, 0, 0, 0, 36, 205, 1, 0, 0, 0, 38, 207, 1, 0, 0, 0, 40, 42, 5, 1, 0, 0, 41, 40, 1, 0, 0, 0, 42, 45, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 46, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 46, 55, 3, 2, 1, 0, 47, 49, 5, 1, 0, 0, 48, 47, 1, 0, 0, 0, 49, 50, 1, 0, 0, 0, 50, 48, 1, 0, 0, 0, 50, 51, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 54, 3, 2, 1, 0, 53, 48, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 61, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 60, 5, 1, 0, 0, 59, 58, 1, 0, 0, 0, 60, 63, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 1, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 64, 69, 3, 4, 2, 0, 65, 66, 5, 36, 0, 0, 66, 68, 3, 4, 2, 0, 67, 65, 1, 0, 0, 0, 68, 71, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 3, 1, 0, 0, 0, 71, 69, 1, 0, 0, 0, 72, 77, 3, 6, 3, 0, 73, 74, 5, 35, 0, 0, 74, 76, 3, 6, 3, 0, 75, 73, 1, 0, 0, 0, 76, 79, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 5, 1, 0, 0, 0, 79, 77, 1, 0, 0, 0, 80, 89, 3, 26, 13, 0, 81, 89, 3, 28, 14, 0, 82, 89, 3, 22, 11, 0, 83, 89, 3, 14, 7, 0, 84, 89, 3, 18, 9, 0, 85, 89, 3, 30, 15, 0, 86, 89, 3, 12, 6, 0, 87, 89, 3, 34, 17, 0, 88, 80, 1, 0, 0, 0, 88, 81, 1, 0, 0, 0, 88, 82, 1, 0, 0, 0, 88, 83, 1, 0, 0, 0, 88, 84, 1, 0, 0, 0, 88, 85, 1, 0, 0, 0, 88, 86, 1, 0, 0, 0, 88, 87, 1, 0, 0, 0, 89, 7, 1, 0, 0, 0, 90, 91, 7, 0, 0, 0, 91, 9, 1, 0, 0, 0, 92, 93, 3, 32, 16, 0, 93, 103, 5, 31, 0, 0, 94, 99, 3, 34, 17, 0, 95, 96, 5, 35, 0, 0, 96, 98, 3, 34, 17, 0, 97, 95, 1, 0, 0, 0, 98, 101, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 104, 1, 0, 0, 0, 101, 99, 1, 0, 0, 0, 102, 104, 5, 2, 0, 0, 103, 94, 1, 0, 0, 0, 103, 102, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 106, 5, 32, 0, 0, 106, 11, 1, 0, 0, 0, 107, 109, 3, 10, 5, 0, 108, 110, 3, 24, 12, 0, 109, 108, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 13, 1, 0, 0, 0, 111, 112, 7, 1, 0, 0, 112, 113, 5, 31, 0, 0, 113, 114, 3, 16, 8, 0, 114, 115, 5, 32, 0, 0, 115, 15, 1, 0, 0, 0, 116, 117, 3, 20, 10, 0, 117, 118, 3, 8, 4, 0, 118, 119, 3, 20, 10, 0, 119, 122, 1, 0, 0, 0, 120, 122, 3, 20, 10, 0, 121, 116, 1, 0, 0, 0, 121, 120, 1, 0, 0, 0, 122, 17, 1, 0, 0, 0, 123, 124, 7, 2, 0, 0, 124, 125, 5, 31, 0, 0, 125, 130, 3, 20, 10, 0, 126, 127, 5, 35, 0, 0, 127, 129, 3, 20, 10, 0, 128, 126, 1, 0, 0, 0, 129, 132, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 133, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 134, 5, 32, 0, 0, 134, 19, 1, 0, 0, 0, 135, 137, 5, 47, 0, 0, 136, 138, 5, 47, 0, 0, 137, 136, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 21, 1, 0, 0, 0, 139, 141, 3, 20, 10, 0, 140, 142, 3, 24, 12, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 23, 1, 0, 0, 0, 143, 144, 5, 37, 0, 0, 144, 145, 5, 29, 0, 0, 145, 25, 1, 0, 0, 0, 146, 147, 5, 48, 0, 0, 147, 148, 5, 47, 0, 0, 148, 27, 1, 0, 0, 0, 149, 150, 5, 48, 0, 0, 150, 29, 1, 0, 0, 0, 151, 160, 5, 9, 0, 0, 152, 153, 5, 39, 0, 0, 153, 154, 5, 37, 0, 0, 154, 161, 5, 39, 0, 0, 155, 156, 5, 39, 0, 0, 156, 161, 5, 37, 0, 0, 157, 158, 5, 37, 0, 0, 158, 161, 5, 39, 0, 0, 159, 161, 5, 39, 0, 0, 160, 152, 1, 0, 0, 0, 160, 155, 1, 0, 0, 0, 160, 157, 1, 0, 0, 0, 160, 159, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 5, 34, 0, 0, 163, 31, 1, 0, 0, 0, 164, 165, 7, 3, 0, 0, 165, 33, 1, 0, 0, 0, 166, 167, 6, 17, -1, 0, 167, 174, 3, 20, 10, 0, 168, 174, 3, 36, 18, 0, 169, 170, 3, 38, 19, 0, 170, 171, 3, 34, 17, 9, 171, 174, 1, 0, 0, 0, 172, 174, 3, 10, 5, 0, 173, 166, 1, 0, 0, 0, 173, 168, 1, 0, 0, 0, 173, 169, 1, 0, 0, 0, 173, 172, 1, 0, 0, 0, 174, 202, 1, 0, 0, 0, 175, 176, 10, 8, 0, 0, 176, 177, 5, 18, 0, 0, 177, 201, 3, 34, 17, 9, 178, 179, 10, 7, 0, 0, 179, 180, 7, 4, 0, 0, 180, 201, 3, 34, 17, 8, 181, 182, 10, 6, 0, 0, 182, 183, 7, 5, 0, 0, 183, 201, 3, 34, 17, 7, 184, 185, 10, 5, 0, 0, 185, 186, 7, 6, 0, 0, 186, 201, 3, 34, 17, 6, 187, 188, 10, 4, 0, 0, 188, 189, 7, 7, 0, 0, 189, 201, 3, 34, 17, 5, 190, 194, 10, 3, 0, 0, 191, 195, 5, 46, 0, 0, 192, 195, 5, 45, 0, 0, 193, 195, 1, 0, 0, 0, 194, 191, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 201, 3, 34, 17, 4, 197, 198, 10, 2, 0, 0, 198, 199, 5, 26, 0, 0, 199, 201, 3, 34, 17, 3, 200, 175, 1, 0, 0, 0, 200, 178, 1, 0, 0, 0, 200, 181, 1, 0, 0, 0, 200, 184, 1, 0, 0, 0, 200, 187, 1, 0, 0, 0, 200, 190, 1, 0, 0, 0, 200, 197, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 202, 203, 1, 0, 0, 0, 203, 35, 1, 0, 0, 0, 204, 202, 1, 0, 0, 0, 205, 206, 7, 8, 0, 0, 206, 37, 1, 0, 0, 0, 207, 208, 7, 9, 0, 0, 208, 39, 1, 0, 0, 0, 19, 43, 50, 55, 61, 69, 77, 88, 99, 103, 109, 121, 130, 137, 141, 160, 173, 194, 200, 202] |