pub struct Converter { /* private fields */ }Expand description
Main converter that dispatches to specific dialect converters
Implementations§
Source§impl Converter
impl Converter
pub fn new(from: SqlDialect, to: SqlDialect) -> Self
pub fn with_strict(self, strict: bool) -> Self
Sourcepub fn has_pending_copy(&self) -> bool
pub fn has_pending_copy(&self) -> bool
Check if we have a pending COPY header (waiting for data block)
Sourcepub fn process_copy_data(
&mut self,
data: &[u8],
) -> Result<Vec<Vec<u8>>, ConvertWarning>
pub fn process_copy_data( &mut self, data: &[u8], ) -> Result<Vec<Vec<u8>>, ConvertWarning>
Process a COPY data block using the pending header
Sourcepub fn convert_statement(
&mut self,
stmt: &[u8],
) -> Result<Vec<u8>, ConvertWarning>
pub fn convert_statement( &mut self, stmt: &[u8], ) -> Result<Vec<u8>, ConvertWarning>
Convert a single statement
Sourcepub fn backticks_to_double_quotes(&self, stmt: &str) -> String
pub fn backticks_to_double_quotes(&self, stmt: &str) -> String
Convert backticks to double quotes
Sourcepub fn double_quotes_to_backticks(&self, stmt: &str) -> String
pub fn double_quotes_to_backticks(&self, stmt: &str) -> String
Convert double quotes to backticks
Sourcepub fn backticks_to_square_brackets(&self, stmt: &str) -> String
pub fn backticks_to_square_brackets(&self, stmt: &str) -> String
Convert backticks to square brackets (for MSSQL)
Sourcepub fn double_quotes_to_square_brackets(&self, stmt: &str) -> String
pub fn double_quotes_to_square_brackets(&self, stmt: &str) -> String
Convert double quotes to square brackets (for MSSQL)
Sourcepub fn square_brackets_to_backticks(&self, stmt: &str) -> String
pub fn square_brackets_to_backticks(&self, stmt: &str) -> String
Convert square brackets to backticks (from MSSQL to MySQL)
Sourcepub fn square_brackets_to_double_quotes(&self, stmt: &str) -> String
pub fn square_brackets_to_double_quotes(&self, stmt: &str) -> String
Convert square brackets to double quotes (from MSSQL to PostgreSQL/SQLite)
Sourcepub fn warnings(&self) -> &[ConvertWarning]
pub fn warnings(&self) -> &[ConvertWarning]
Get collected warnings
Auto Trait Implementations§
impl Freeze for Converter
impl RefUnwindSafe for Converter
impl Send for Converter
impl Sync for Converter
impl Unpin for Converter
impl UnwindSafe for Converter
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> 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