mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-01 03:37:21 +00:00
Add implementation for parsing SQL COPY
This commit is contained in:
parent
719df789e4
commit
199ec67da7
4 changed files with 123 additions and 0 deletions
|
@ -70,6 +70,10 @@ pub enum Token {
|
|||
Colon,
|
||||
/// DoubleColon `::` (used for casting in postgresql)
|
||||
DoubleColon,
|
||||
/// SemiColon `;` used as separator for COPY and payload
|
||||
SemiColon,
|
||||
/// Backslash `\` used in terminating the COPY payload with `\.`
|
||||
Backslash,
|
||||
/// Left bracket `[`
|
||||
LBracket,
|
||||
/// Right bracket `]`
|
||||
|
@ -265,6 +269,8 @@ impl<'a> Tokenizer<'a> {
|
|||
None => Ok(Some(Token::Colon)),
|
||||
}
|
||||
}
|
||||
';' => self.consume_and_return(chars, Token::SemiColon),
|
||||
'\\' => self.consume_and_return(chars, Token::Backslash),
|
||||
// brakets
|
||||
'[' => self.consume_and_return(chars, Token::LBracket),
|
||||
']' => self.consume_and_return(chars, Token::RBracket),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue