pub struct SqlComplexityScore {
pub score: u32,
pub join_count: u32,
pub subquery_count: u32,
pub where_condition_count: u32,
pub set_operation_count: u32,
pub group_by_count: u32,
pub has_having: bool,
pub has_window_function: bool,
pub has_cte: bool,
pub token_count: u32,
}Expand description
SQL 复杂度评分结果。
Fields§
§score: u32总分(0-100,越高越复杂)
join_count: u32JOIN 数量
subquery_count: u32子查询数量(括号内的 SELECT)
where_condition_count: u32WHERE 条件数量(AND/OR 数 + 1)
set_operation_count: u32UNION/INTERSECT/EXCEPT 数量
group_by_count: u32GROUP BY 列数
has_having: bool是否包含 HAVING
has_window_function: bool是否包含窗口函数
has_cte: bool是否包含 CTE
token_count: u32令牌总数
Implementations§
Source§impl SqlComplexityScore
impl SqlComplexityScore
Sourcepub fn level(&self) -> ComplexityLevel
pub fn level(&self) -> ComplexityLevel
复杂度等级。
Trait Implementations§
Source§impl Clone for SqlComplexityScore
impl Clone for SqlComplexityScore
Source§fn clone(&self) -> SqlComplexityScore
fn clone(&self) -> SqlComplexityScore
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 SqlComplexityScore
impl RefUnwindSafe for SqlComplexityScore
impl Send for SqlComplexityScore
impl Sync for SqlComplexityScore
impl Unpin for SqlComplexityScore
impl UnsafeUnpin for SqlComplexityScore
impl UnwindSafe for SqlComplexityScore
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