Compare commits
	
		
			No commits in common. "8e07b6387733dd6bd21c7aba0bd76d405d6e2132" and "ca5d403a3fd82ed9f767f48c68500df0f4022c42" have entirely different histories.
		
	
	
		
			8e07b63877
			...
			ca5d403a3f
		
	
		
							
								
								
									
										37
									
								
								.aiContexts/SQL_Token_Types.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								.aiContexts/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
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
@ -1,37 +0,0 @@
 | 
				
			|||||||
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