pub struct Parser { /* private fields */ }Expand description
A recursive-descent SQL parser.
Supports CTEs (WITH), subqueries, UNION/INTERSECT/EXCEPT, CAST, window functions (OVER), EXISTS, EXTRACT, INTERVAL, and more.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn new_with_comments(sql: &str) -> Result<Self>
pub fn new_with_comments(sql: &str) -> Result<Self>
Create a new parser that preserves SQL comments in the AST.
Sourcepub fn parse_statement(&mut self) -> Result<Statement>
pub fn parse_statement(&mut self) -> Result<Statement>
Parse a single SQL statement.
Sourcepub fn parse_statements(&mut self) -> Result<Vec<Statement>>
pub fn parse_statements(&mut self) -> Result<Vec<Statement>>
Parse multiple statements separated by semicolons.
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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
Mutably borrows from an owned value. Read more