pub struct ScriptParser { /* private fields */ }Expand description
Parses SQL scripts into individual statements using GO as separator
Implementations§
Source§impl ScriptParser
impl ScriptParser
Sourcepub fn data_file_hint(&self) -> Option<&str>
pub fn data_file_hint(&self) -> Option<&str>
Get the data file hint if present
Sourcepub fn is_multi_statement(sql: &str) -> bool
pub fn is_multi_statement(sql: &str) -> bool
True if the text holds more than one top-level statement, i.e. it needs
the script executor even though it has no GO separator.
Without this a ;-separated file routes to the single-query path, which
parses the whole thing as one statement — historically running only the
first and silently dropping the rest (P13).
Sourcepub fn parse_script_statements(&self) -> Vec<ScriptStatement>
pub fn parse_script_statements(&self) -> Vec<ScriptStatement>
Parse the script into ScriptStatements with directives GO must be on its own line (case-insensitive)
Sourcepub fn parse_statements(&self) -> Vec<String>
pub fn parse_statements(&self) -> Vec<String>
Parse the script into individual SQL statements (legacy method) GO must be on its own line (case-insensitive) Returns a vector of SQL statements to execute
Sourcepub fn parse_and_validate(&self) -> Result<Vec<String>>
pub fn parse_and_validate(&self) -> Result<Vec<String>>
Parse and validate that all statements are valid SQL Returns the statements or an error if any are invalid
Auto Trait Implementations§
impl Freeze for ScriptParser
impl RefUnwindSafe for ScriptParser
impl Send for ScriptParser
impl Sync for ScriptParser
impl Unpin for ScriptParser
impl UnsafeUnpin for ScriptParser
impl UnwindSafe for ScriptParser
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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