Skip to main content

Parser

Struct Parser 

Source
pub struct Parser { /* private fields */ }
Expand description

SQL Parser using Pratt parsing algorithm

Implementations§

Source§

impl Parser

Source

pub fn new(input: &str) -> Self

Create a new parser for the given input

Source

pub fn parse_program(&mut self) -> Result<Program, ParseErrors>

Parse the input and return a Program

Source

pub fn errors(&self) -> &[ParseError]

Get collected errors

Source§

impl Parser

Source

pub fn parse_expression(&mut self, precedence: Precedence) -> Option<Expression>

Parse an expression with the given precedence

Source

pub fn parse_expression_list(&mut self) -> Vec<Expression>

Parse an expression list (comma-separated)

Source

pub fn parse_group_by_clause(&mut self) -> GroupByClause

Parse a GROUP BY clause with optional ROLLUP/CUBE/GROUPING SETS modifier

Source

pub fn parse_window_definitions(&mut self) -> Vec<WindowDefinition>

Parse WINDOW clause definitions (WINDOW w AS (…), w2 AS (…))

Source

pub fn parse_order_by_expression(&mut self) -> Option<OrderByExpression>

Parse an ORDER BY expression

Source

pub fn parse_order_by_expressions(&mut self) -> Vec<OrderByExpression>

Parse ORDER BY expressions (comma-separated)

Source§

impl Parser

Source

pub fn parse_identifier_list(&mut self) -> Vec<Identifier>

Parse an identifier list (allows keywords as identifiers for CTE column aliases)

Source§

impl Parser

Source

pub fn parse_statement(&mut self) -> Option<Statement>

Parse a statement

Source§

impl Parser

Source

pub fn parse_select_statement(&mut self) -> Option<SelectStatement>

Parse a SELECT statement

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CompactArcDrop for T

Source§

unsafe fn drop_and_dealloc(ptr: *mut u8)

Drop the contained data and deallocate the header+data allocation. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V