pub enum Token {
Show 70 variants
EOF,
Word(Word),
Number(String),
Char(char),
SingleQuotedString(String),
DollarQuotedString(DollarQuotedString),
CstyleEscapesString(CstyleEscapedString),
NationalStringLiteral(String),
HexStringLiteral(String),
Parameter(String),
Comma,
Whitespace(Whitespace),
DoubleEq,
Eq,
Neq,
Lt,
Gt,
LtEq,
GtEq,
Spaceship,
Plus,
Minus,
Mul,
Div,
Mod,
Concat,
LParen,
RParen,
Period,
Colon,
DoubleColon,
SemiColon,
Backslash,
LBracket,
RBracket,
Ampersand,
Pipe,
Caret,
Prefix,
LBrace,
RBrace,
RArrow,
Sharp,
Tilde,
TildeAsterisk,
ExclamationMarkTilde,
ExclamationMarkTildeAsterisk,
DoubleTilde,
DoubleTildeAsterisk,
ExclamationMarkDoubleTilde,
ExclamationMarkDoubleTildeAsterisk,
ShiftLeft,
ShiftRight,
ExclamationMark,
DoubleExclamationMark,
AtSign,
PGSquareRoot,
PGCubeRoot,
Arrow,
LongArrow,
HashArrow,
HashLongArrow,
HashMinus,
AtArrow,
ArrowAt,
QuestionMark,
QuestionMarkPipe,
QuestionMarkAmpersand,
AtQuestionMark,
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)
An unsigned numeric literal
Char(char)
A character that could not be tokenized
SingleQuotedString(String)
Single quoted string: i.e: ‘string’
DollarQuotedString(DollarQuotedString)
Dollar quoted string: i.e: $$string$$ or $tag_name$string$tag_name$
CstyleEscapesString(CstyleEscapedString)
Single quoted string with c-style escapes: i.e: E’string’
NationalStringLiteral(String)
“National” string literal: i.e: N’string’
HexStringLiteral(String)
Hexadecimal string literal: i.e.: X’deadbeef’
Parameter(String)
Parameter symbols: i.e: $1, $2
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 %
Concat
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 ^
Prefix
Prefix ^@
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
DoubleTilde
~~
, a case sensitive LIKE expression operator in PostgreSQL
DoubleTildeAsterisk
~~*
, a case insensitive ILIKE regular expression operator in PostgreSQL
ExclamationMarkDoubleTilde
!~~
, a case sensitive NOT LIKE regular expression operator in PostgreSQL
ExclamationMarkDoubleTildeAsterisk
!~~*
, a case insensitive NOT ILIKE 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
Arrow
->
, access JSON object field or array element in PostgreSQL
LongArrow
->>
, access JSON object field or array element as text in PostgreSQL
HashArrow
#>
, extract JSON sub-object at the specified path in PostgreSQL
HashLongArrow
#>>
, extract JSON sub-object at the specified path as text in PostgreSQL
HashMinus
#-
, delete a key from a JSON object in PostgreSQL
AtArrow
@>
, does the left JSON value contain the right JSON path/value entries at the top level
ArrowAt
<@
, does the right JSON value contain the left JSON path/value entries at the top level
QuestionMark
?
, does the string exist as a top-level key within the JSON value
QuestionMarkPipe
?|
, do any of the strings exist as top-level keys or array elements?
QuestionMarkAmpersand
?&
, do all of the strings exist as top-level keys or array elements?
AtQuestionMark
@?
, does JSON path return any item for the specified JSON value?
AtAt
@@
, returns the result of a JSON path predicate check for the specified JSON value.
Implementations§
source§impl Token
impl Token
pub fn make_keyword(keyword: &str) -> Self
pub fn make_word(word: &str, quote_style: Option<char>) -> Self
pub fn with_location(self, location: Location) -> TokenWithLocation
Trait Implementations§
source§impl<I> Parser<I, TokenWithLocation, ContextError> for Tokenwhere
I: TokenStream,
impl<I> Parser<I, TokenWithLocation, ContextError> for Tokenwhere
I: TokenStream,
source§fn parse_next(
&mut self,
input: &mut I,
) -> PResult<TokenWithLocation, ContextError>
fn parse_next( &mut self, input: &mut I, ) -> PResult<TokenWithLocation, ContextError>
Stream
], turning it into the output Read more§fn parse_peek(&mut self, input: I) -> Result<(I, O), ErrMode<E>>
fn parse_peek(&mut self, input: I) -> Result<(I, O), ErrMode<E>>
Stream
], turning it into the output Read more§fn default_value<O2>(self) -> DefaultValue<Self, I, O, O2, E>
fn default_value<O2>(self) -> DefaultValue<Self, I, O, O2, E>
§fn output_into<O2>(self) -> OutputInto<Self, I, O, O2, E>
fn output_into<O2>(self) -> OutputInto<Self, I, O, O2, E>
std::convert::From
Read more§fn recognize(self) -> Recognize<Self, I, O, E>where
Self: Sized,
I: Stream,
fn recognize(self) -> Recognize<Self, I, O, E>where
Self: Sized,
I: Stream,
§fn with_recognized(self) -> WithRecognized<Self, I, O, E>where
Self: Sized,
I: Stream,
fn with_recognized(self) -> WithRecognized<Self, I, O, E>where
Self: Sized,
I: Stream,
§fn map<G, O2>(self, map: G) -> Map<Self, G, I, O, O2, E>
fn map<G, O2>(self, map: G) -> Map<Self, G, I, O, O2, E>
§fn try_map<G, O2, E2>(self, map: G) -> TryMap<Self, G, I, O, O2, E, E2>
fn try_map<G, O2, E2>(self, map: G) -> TryMap<Self, G, I, O, O2, E, E2>
Result
over the output of a parser. Read more§fn verify_map<G, O2>(self, map: G) -> VerifyMap<Self, G, I, O, O2, E>
fn verify_map<G, O2>(self, map: G) -> VerifyMap<Self, G, I, O, O2, E>
§fn flat_map<G, H, O2>(self, map: G) -> FlatMap<Self, G, H, I, O, O2, E>
fn flat_map<G, H, O2>(self, map: G) -> FlatMap<Self, G, H, I, O, O2, E>
§fn parse_to<O2>(self) -> ParseTo<Self, I, O, O2, E>where
Self: Sized,
I: Stream,
O: ParseSlice<O2>,
E: ParserError<I>,
fn parse_to<O2>(self) -> ParseTo<Self, I, O, O2, E>where
Self: Sized,
I: Stream,
O: ParseSlice<O2>,
E: ParserError<I>,
std::str::FromStr
to the output of the parser Read more§fn verify<G, O2>(self, filter: G) -> Verify<Self, G, I, O, O2, E>
fn verify<G, O2>(self, filter: G) -> Verify<Self, G, I, O, O2, E>
§fn context<C>(self, context: C) -> Context<Self, I, O, E, C>
fn context<C>(self, context: C) -> Context<Self, I, O, E, C>
§fn complete_err(self) -> CompleteErr<Self>where
Self: Sized,
fn complete_err(self) -> CompleteErr<Self>where
Self: Sized,
Incomplete
][crate::error::ErrMode::Incomplete] into [Backtrack
][crate::error::ErrMode::Backtrack] Read more§fn err_into<E2>(self) -> ErrInto<Self, I, O, E, E2>
fn err_into<E2>(self) -> ErrInto<Self, I, O, E, E2>
std::convert::From
source§impl PartialEq<Token> for TokenWithLocation
impl PartialEq<Token> for TokenWithLocation
source§impl PartialEq<TokenWithLocation> for Token
impl PartialEq<TokenWithLocation> for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more