feat: add quick reference to SQL token types
This commit is contained in:
parent
642a272a83
commit
8e07b63877
37
docs/SQL_Token_Types.md
Normal file
37
docs/SQL_Token_Types.md
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
These are the SQL Token Types that will serve as the foundation on how we interpret SQL strings
|
||||||
|
and create our `Query` structs
|
||||||
|
|
||||||
|
```go
|
||||||
|
type TokenType int
|
||||||
|
|
||||||
|
const (
|
||||||
|
ERROR TokenType = iota // 0
|
||||||
|
EOF // 1
|
||||||
|
SPACE // 2 space or newline
|
||||||
|
STRING // 3 string literal
|
||||||
|
INCOMPLETE_STRING // 4 incomplete string literal so that we can obfuscate it, e.g. 'abc
|
||||||
|
NUMBER // 5 number literal
|
||||||
|
IDENT // 6 identifier column name
|
||||||
|
QUOTED_IDENT // 7 quoted identifier
|
||||||
|
OPERATOR // 8 operator like = > < >= <=
|
||||||
|
WILDCARD // 9 wildcard *
|
||||||
|
COMMENT // 10 comment
|
||||||
|
MULTILINE_COMMENT // 11 multiline comment
|
||||||
|
PUNCTUATION // 12 punctuation such as a comma
|
||||||
|
DOLLAR_QUOTED_FUNCTION // 13 dollar quoted function
|
||||||
|
DOLLAR_QUOTED_STRING // 14 dollar quoted string
|
||||||
|
POSITIONAL_PARAMETER // 15 numbered parameter
|
||||||
|
BIND_PARAMETER // 16 bind parameter
|
||||||
|
FUNCTION // 17 function
|
||||||
|
SYSTEM_VARIABLE // 18 system variable
|
||||||
|
UNKNOWN // 19 unknown token
|
||||||
|
COMMAND // 20 SQL commands like SELECT INSERT UPDATE DELETE
|
||||||
|
KEYWORD // 21 Other SQL keywords like FROM, WHERE, NOT, IS, LIKE
|
||||||
|
JSON_OP // 22 JSON operators
|
||||||
|
BOOLEAN // 23 boolean literal
|
||||||
|
NULL // 24 null literal
|
||||||
|
PROC_INDICATOR // 25 procedure indicator
|
||||||
|
CTE_INDICATOR // 26 CTE indicator
|
||||||
|
ALIAS_INDICATOR // 27 alias indicator
|
||||||
|
)
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user