pub enum Token {
Show 17 variants
Keyword(Keyword),
Identifier(String),
DelimitedIdentifier(String),
Number(String),
String(String),
Symbol(char),
Operator(MultiCharOperator),
SessionVariable(String),
UserVariable(String),
Placeholder,
NumberedPlaceholder(usize),
NamedPlaceholder(String),
Semicolon,
Comma,
LParen,
RParen,
Eof,
}Expand description
SQL Token produced by the lexer.
Variants§
Keyword(Keyword)
SQL keyword (SELECT, FROM, etc.)
Identifier(String)
Identifier (table name, column name, etc.)
DelimitedIdentifier(String)
Delimited identifier (“columnName” - case-sensitive, can use reserved words)
Number(String)
Numeric literal (42, 3.14, etc.)
String(String)
String literal (‘hello’)
Symbol(char)
Single character symbols (+, -, *, /, =, <, >, etc.)
Operator(MultiCharOperator)
Multi-character operators (<=, >=, !=, <>, ||)
SessionVariable(String)
Session variable (@@variable, @@session.variable, @@global.variable)
UserVariable(String)
User variable (@variable)
Placeholder
Parameter placeholder (?) for prepared statements The index is assigned during parsing (0-indexed, in order of appearance)
NumberedPlaceholder(usize)
Numbered parameter placeholder ($1, $2, etc.) for prepared statements PostgreSQL-style: 1-indexed as written in SQL ($1 = first parameter)
NamedPlaceholder(String)
Named parameter placeholder (:name) for prepared statements Used by many ORMs and applications for readability
Semicolon
Semicolon (statement terminator)
Comma
Comma (separator)
LParen
Left parenthesis
RParen
Right parenthesis
Eof
End of input