Struct CommonParser

Source
pub struct CommonParser;
Expand description

collection of common used parsers

Implementations§

Source§

impl CommonParser

Source

pub fn sql_keyword(i: &str) -> IResult<&str, &str, ParseSQLError<&str>>

Source

pub fn opt_index_name( i: &str, ) -> IResult<&str, Option<String>, ParseSQLError<&str>>

[index_name]

Source

pub fn index_col_name( i: &str, ) -> IResult<&str, (Column, Option<u16>, Option<OrderType>), ParseSQLError<&str>>

Source

pub fn opt_delimited<I: Clone, O1, O2, O3, E: ParseError<I>, F, G, H>( first: F, second: G, third: H, ) -> impl FnMut(I) -> IResult<I, O2, E>
where F: Parser<I, O1, E>, G: Parser<I, O2, E>, H: Parser<I, O3, E>,

first and third are opt

Source

pub fn precision( i: &str, ) -> IResult<&str, (u8, Option<u8>), ParseSQLError<&str>>

Source

pub fn delim_digit(i: &str) -> IResult<&str, &str, ParseSQLError<&str>>

Source

pub fn sql_identifier(i: &str) -> IResult<&str, &str, ParseSQLError<&str>>

Source

pub fn unsigned_number(i: &str) -> IResult<&str, u64, ParseSQLError<&str>>

Source

pub fn eof<I: Copy + InputLength, E: ParseError<I>>( input: I, ) -> IResult<I, I, E>

Source

pub fn statement_terminator(i: &str) -> IResult<&str, (), ParseSQLError<&str>>

Source

pub fn as_alias(i: &str) -> IResult<&str, &str, ParseSQLError<&str>>

Source

pub fn ws_sep_comma(i: &str) -> IResult<&str, &str, ParseSQLError<&str>>

Source

pub fn parse_comment(i: &str) -> IResult<&str, String, ParseSQLError<&str>>

Parse rule for a comment part. COMMENT ‘comment content’ or COMMENT “comment content”

Source

pub fn parse_if_exists( i: &str, ) -> IResult<&str, Option<&str>, ParseSQLError<&str>>

IF EXISTS

Source

pub fn parse_quoted_string( i: &str, ) -> IResult<&str, String, ParseSQLError<&str>>

extract String quoted by ' or "

Source

pub fn parse_quoted_string_value_with_key( i: &str, key: String, ) -> IResult<&str, String, ParseSQLError<&str>>

extract value from key [=] 'value' or key [=] "value"

Source

pub fn parse_string_value_with_key( i: &str, key: String, ) -> IResult<&str, String, ParseSQLError<&str>>

extract value from key [=] value

Source

pub fn parse_digit_value_with_key( i: &str, key: String, ) -> IResult<&str, String, ParseSQLError<&str>>

extract value from key [=] value

Source

pub fn parse_default_value_with_key( i: &str, key: String, ) -> IResult<&str, DefaultOrZeroOrOne, ParseSQLError<&str>>

extract value from key [=] {DEFAULT | 0 | 1}

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.