pub struct SqlParser { /* private fields */ }Expand description
SQL parser
Implementations§
Source§impl SqlParser
impl SqlParser
Sourcepub fn with_dialect(dialect: SqlDialect) -> Self
pub fn with_dialect(dialect: SqlDialect) -> Self
Create a parser with specific dialect
Sourcepub fn parse(&self, sql: &str) -> Result<ParsedQuery, ParseError>
pub fn parse(&self, sql: &str) -> Result<ParsedQuery, ParseError>
Parse a SQL query
Sourcepub fn normalize(&self, sql: &str) -> String
pub fn normalize(&self, sql: &str) -> String
Normalize a query (replace literals with placeholders)
Sourcepub fn to_sql(&self, parsed: &ParsedQuery) -> String
pub fn to_sql(&self, parsed: &ParsedQuery) -> String
Convert AST back to SQL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqlParser
impl RefUnwindSafe for SqlParser
impl Send for SqlParser
impl Sync for SqlParser
impl Unpin for SqlParser
impl UnsafeUnpin for SqlParser
impl UnwindSafe for SqlParser
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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