Documentation
¶
Overview ¶
Package sqllex is the SQL lexer shared by the plugin sandbox's table scope check and the organisation query scoper. It splits a statement into words, quoted identifiers, string literals and punctuation; it is not a parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AliasStop = map[string]bool{ "WHERE": true, "ON": true, "USING": true, "JOIN": true, "INNER": true, "LEFT": true, "RIGHT": true, "FULL": true, "CROSS": true, "OUTER": true, "NATURAL": true, "STRAIGHT_JOIN": true, "GROUP": true, "ORDER": true, "LIMIT": true, "OFFSET": true, "HAVING": true, "UNION": true, "EXCEPT": true, "INTERSECT": true, "SET": true, "VALUES": true, "FOR": true, "WINDOW": true, "RETURNING": true, "INTO": true, "SELECT": true, "WHEN": true, "THEN": true, "ELSE": true, "END": true, "AND": true, "OR": true, "FETCH": true, "LOCK": true, "PARTITION": true, "TABLESAMPLE": true, "USE": true, "FORCE": true, "IGNORE": true, "DEFAULT": true, "TO": true, "ADD": true, "DROP": true, "MODIFY": true, "CHANGE": true, "ALTER": true, "RENAME": true, }
AliasStop lists the words that end a table reference, so they are never taken for an alias.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct {
Kind byte // 'w' word, 'q' quoted identifier, 's' string literal, 'p' punctuation
Text string // word: upper case; punctuation: the character
Name string // identifier, lower case, schema-qualified as "schema.table"
Start int // byte offset of the token in the source
End int // byte offset one past the token
}
Token is one lexical token of a SQL statement.
Click to show internal directories.
Click to hide internal directories.