pub struct SqlParserRouter;Expand description
SQL parser-based query router that classifies SQL using a real AST.
Uses sqlparser-rs to parse the SQL into an AST, then inspects the
statement type and structure to determine whether it should go to OLTP
or OLAP. Falls back to keyword-based heuristic routing if parsing fails, and
defaults to OLTP for unrecognised constructs (safety-first).
See the module-level documentation for the full routing table.
Implementations§
Source§impl SqlParserRouter
impl SqlParserRouter
Sourcepub fn new() -> SqlParserRouter
pub fn new() -> SqlParserRouter
Create a new SqlParserRouter.
Trait Implementations§
Source§impl Default for SqlParserRouter
impl Default for SqlParserRouter
Source§fn default() -> SqlParserRouter
fn default() -> SqlParserRouter
Returns the “default value” for a type. Read more
Source§impl QueryRouter for SqlParserRouter
impl QueryRouter for SqlParserRouter
Source§fn route(&self, sql: &str) -> QueryTarget
fn route(&self, sql: &str) -> QueryTarget
Classify
sql and return the engine that should execute it.Auto Trait Implementations§
impl Freeze for SqlParserRouter
impl RefUnwindSafe for SqlParserRouter
impl Send for SqlParserRouter
impl Sync for SqlParserRouter
impl Unpin for SqlParserRouter
impl UnsafeUnpin for SqlParserRouter
impl UnwindSafe for SqlParserRouter
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