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() -> Self
pub fn new() -> Self
Create a new SqlParserRouter.
Trait Implementations§
Source§impl Default for SqlParserRouter
impl Default for SqlParserRouter
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