pub enum Token {
Show 63 variants
EOF,
Word(Word),
Number(String, bool),
Char(char),
SingleQuotedString(String),
DoubleQuotedString(String),
DollarQuotedString(DollarQuotedString),
NationalStringLiteral(String),
EscapedStringLiteral(String),
HexStringLiteral(String),
Comma,
Whitespace(Whitespace),
DoubleEq,
Eq,
Neq,
Lt,
Gt,
LtEq,
GtEq,
Spaceship,
Plus,
Minus,
Mul,
Div,
Mod,
StringConcat,
LParen,
RParen,
Period,
Colon,
DoubleColon,
SemiColon,
Backslash,
LBracket,
RBracket,
Ampersand,
Pipe,
Caret,
LBrace,
RBrace,
RArrow,
Sharp,
Tilde,
TildeAsterisk,
ExclamationMarkTilde,
ExclamationMarkTildeAsterisk,
ShiftLeft,
ShiftRight,
ExclamationMark,
DoubleExclamationMark,
AtSign,
PGSquareRoot,
PGCubeRoot,
Placeholder(String),
Arrow,
LongArrow,
HashArrow,
HashLongArrow,
AtArrow,
ArrowAt,
HashMinus,
AtQuestion,
AtAt,
}
Expand description
SQL Token enumeration
Variants§
EOF
An end-of-file marker, not a real token
Word(Word)
A keyword (like SELECT) or an optionally quoted SQL identifier
Number(String, bool)
An unsigned numeric literal
Char(char)
A character that could not be tokenized
SingleQuotedString(String)
Single quoted string: i.e: ‘string’
DoubleQuotedString(String)
Double quoted string: i.e: “string”
DollarQuotedString(DollarQuotedString)
Dollar quoted string: i.e: $$string$$ or $tag_name$string$tag_name$
NationalStringLiteral(String)
“National” string literal: i.e: N’string’
EscapedStringLiteral(String)
“escaped” string literal, which are an extension to the SQL standard: i.e: e’first \n second’ or E ‘first \n second’
HexStringLiteral(String)
Hexadecimal string literal: i.e.: X’deadbeef’
Comma
Comma
Whitespace(Whitespace)
Whitespace (space, tab, etc)
DoubleEq
Double equals sign ==
Eq
Equality operator =
Neq
Not Equals operator <>
(or !=
in some dialects)
Lt
Less Than operator <
Gt
Greater Than operator >
LtEq
Less Than Or Equals operator <=
GtEq
Greater Than Or Equals operator >=
Spaceship
Spaceship operator <=>
Plus
Plus operator +
Minus
Minus operator -
Mul
Multiplication operator *
Div
Division operator /
Mod
Modulo Operator %
StringConcat
String concatenation ||
LParen
Left parenthesis (
RParen
Right parenthesis )
Period
Period (used for compound identifiers or projections into nested types)
Colon
Colon :
DoubleColon
DoubleColon ::
(used for casting in postgresql)
SemiColon
SemiColon ;
used as separator for COPY and payload
Backslash
Backslash \
used in terminating the COPY payload with \.
LBracket
Left bracket [
RBracket
Right bracket ]
Ampersand
Ampersand &
Pipe
Pipe |
Caret
Caret ^
LBrace
Left brace {
RBrace
Right brace }
RArrow
Right Arrow =>
Sharp
Sharp #
used for PostgreSQL Bitwise XOR operator
Tilde
Tilde ~
used for PostgreSQL Bitwise NOT operator or case sensitive match regular expression operator
TildeAsterisk
~*
, a case insensitive match regular expression operator in PostgreSQL
ExclamationMarkTilde
!~
, a case sensitive not match regular expression operator in PostgreSQL
ExclamationMarkTildeAsterisk
!~*
, a case insensitive not match regular expression operator in PostgreSQL
ShiftLeft
<<
, a bitwise shift left operator in PostgreSQL
ShiftRight
>>
, a bitwise shift right operator in PostgreSQL
ExclamationMark
Exclamation Mark !
used for PostgreSQL factorial operator
DoubleExclamationMark
Double Exclamation Mark !!
used for PostgreSQL prefix factorial operator
AtSign
AtSign @
used for PostgreSQL abs operator
PGSquareRoot
|/
, a square root math operator in PostgreSQL
PGCubeRoot
||/
, a cube root math operator in PostgreSQL
Placeholder(String)
?
or $
, a prepared statement arg placeholder
Arrow
->, used as a operator to extract json field in PostgreSQL
LongArrow
->>, used as a operator to extract json field as text in PostgreSQL
HashArrow
#> Extracts JSON sub-object at the specified path
HashLongArrow
#>> Extracts JSON sub-object at the specified path as text
AtArrow
jsonb @> jsonb -> boolean: Test whether left json contains the right json
ArrowAt
jsonb <@ jsonb -> boolean: Test whether right json contains the left json
HashMinus
jsonb #- text[] -> jsonb: Deletes the field or array element at the specified path, where path elements can be either field keys or array indexes.
AtQuestion
jsonb @? jsonpath -> boolean: Does JSON path return any item for the specified JSON value?
AtAt
jsonb @@ jsonpath → boolean: Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is not Boolean, then NULL is returned.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Token
impl<'de> Deserialize<'de> for Token
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Ord for Token
impl Ord for Token
source§impl PartialEq<Token> for Token
impl PartialEq<Token> for Token
source§impl PartialEq<Token> for TokenWithLocation
impl PartialEq<Token> for TokenWithLocation
source§impl PartialEq<TokenWithLocation> for Token
impl PartialEq<TokenWithLocation> for Token
source§fn eq(&self, other: &TokenWithLocation) -> bool
fn eq(&self, other: &TokenWithLocation) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Token> for Token
impl PartialOrd<Token> for Token
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more