pub struct QailUsage {Show 14 fields
pub file: String,
pub line: usize,
pub column: usize,
pub table: String,
pub is_dynamic_table: bool,
pub columns: Vec<String>,
pub action: String,
pub related_tables: Vec<String>,
pub is_cte_ref: bool,
pub has_rls: bool,
pub rls_policy_delegated: bool,
pub has_explicit_tenant_scope: bool,
pub file_uses_super_admin: bool,
pub scope_errors: Vec<String>,
}Expand description
Extracted QAIL usage from source code
Fields§
§file: StringSource file path.
line: usizeLine number (1-indexed).
column: usizeColumn number (1-indexed) where Qail::... constructor starts.
table: StringTable name referenced.
is_dynamic_table: boolTrue when table name came from a dynamic expression instead of a compile-time string literal.
columns: Vec<String>Column names referenced.
action: StringCRUD action (GET, SET, ADD, DEL, PUT).
Additional static tables referenced by the chain.
This is used for secondary relation slots such as MERGE USING table.
is_cte_ref: boolWhether this references a CTE rather than a real table.
has_rls: boolWhether this query chain includes .with_rls( call
rls_policy_delegated: boolWhether the chain delegates isolation to DB policies via
.with_rls_policy(. Distinct from has_rls: delegation is an
explicit declaration that no AST predicate is expected, so the
“scopes nothing” audit must not fire on it.
has_explicit_tenant_scope: boolWhether this query chain has explicit tenant scope condition
(e.g. .eq("tenant_id", ...) or .is_null("tenant_id")).
file_uses_super_admin: boolWhether the containing file uses SuperAdminToken::for_system_process().
When true AND the queried table is tenant-scoped, the build emits a
warning: the query may bypass tenant isolation.
scope_errors: Vec<String>Qualifier-scope violations found at scan time: GROUP BY / DISTINCT ON
entries whose table. qualifier is neither the FROM table, a joined
table, a declared alias, nor a visible CTE. These compile and pass
schema-existence validation but fail at runtime (42P01-class), so the
build must fail instead.