pub struct QueryAnalysis {
pub original_sql: String,
pub hints: Vec<QueryOptimizationHint>,
pub complexity_score: u32,
pub detected_tables: Vec<String>,
pub has_where: bool,
pub has_limit: bool,
pub has_join: bool,
pub has_subquery: bool,
pub uses_select_star: bool,
}Expand description
查询分析结果
Fields§
§original_sql: String原始 SQL
hints: Vec<QueryOptimizationHint>所有优化建议
complexity_score: u32预估的 SQL 复杂度评分(0-100,越高越复杂)
detected_tables: Vec<String>检测到的表名列表
has_where: bool是否包含 WHERE 子句
has_limit: bool是否包含 LIMIT 子句
has_join: bool是否包含 JOIN
has_subquery: bool是否包含子查询
uses_select_star: bool是否使用了 SELECT *
Implementations§
Source§impl QueryAnalysis
impl QueryAnalysis
Sourcepub fn critical_count(&self) -> usize
pub fn critical_count(&self) -> usize
返回严重级别为 Critical 的建议数量
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
返回严重级别为 Warning 的建议数量
Trait Implementations§
Source§impl Clone for QueryAnalysis
impl Clone for QueryAnalysis
Source§fn clone(&self) -> QueryAnalysis
fn clone(&self) -> QueryAnalysis
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryAnalysis
impl RefUnwindSafe for QueryAnalysis
impl Send for QueryAnalysis
impl Sync for QueryAnalysis
impl Unpin for QueryAnalysis
impl UnsafeUnpin for QueryAnalysis
impl UnwindSafe for QueryAnalysis
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