pub enum ColumnLevelDiagnosticKind {
UnsupportedStatement,
WildcardSuppressed,
TooManyTableQualifiers,
InsertColumnsUnresolved,
InsertColumnsArityMismatch,
AnonymousColumnsSuppressed,
}Expand description
Why a column-level extraction is incomplete.
Every variant is a tool-side coverage gap: sql-insight chose not to
(or couldn’t) fully analyze the construct, and a more capable analyzer
could do more. Per-reference resolution outcomes (ambiguous /
unresolved columns) are not diagnostics — they surface on each
ColumnRead::resolution instead, so the consumer
reads them off the reference rather than cross-referencing a parallel
diagnostic stream.
Variants§
UnsupportedStatement
Statement variant the resolver / extractor does not understand
well enough to extract operations from. message names the
statement.
WildcardSuppressed
SELECT * / t.* left unexpanded — the extractor does not
perform wildcard expansion (see crate docs), so column lineage
is incomplete for projections that include a wildcard.
TooManyTableQualifiers
A table reference with more identifiers than catalog.schema.name
(e.g. a SQL Server server.db.schema.table) that can’t be
represented as a TableReference, so the
relation — and any column read / write through it — is dropped.
message names the offending identifier.
InsertColumnsUnresolved
A column-list-less INSERT / MERGE … WHEN … INSERT whose target
column list couldn’t be determined without a catalog, so the source
columns can’t be paired with target columns: column-level writes
and lineage are dropped (the table itself still surfaces in
table_writes). Supply a Catalog to
resolve it. message names the target.
InsertColumnsArityMismatch
An explicit target column list whose count differs from the source
query’s projected column count — an INSERT INTO t (a, b, c) <source>,
or a CREATE TABLE t (a, b, c) AS / CREATE VIEW / ALTER VIEW with a
column list. The positional pairing zips to the shorter side, so the
surplus target columns get no lineage edge (their writes still
surface) — a silent truncation this flags. message states both counts.
AnonymousColumnsSuppressed
A CREATE TABLE … AS / CREATE VIEW … (without an explicit column
list) whose source projects one or more outputs with no derivable name —
unaliased expressions like SELECT a + 1. The created relation does
get those columns, but their names are engine-specific and not
recoverable from the SQL text (e.g. PostgreSQL ?column?), so they can’t
be named writes / lineage targets and are dropped. Alias the
expressions to surface them. message names the relation and the count.
Trait Implementations§
Source§impl Clone for ColumnLevelDiagnosticKind
impl Clone for ColumnLevelDiagnosticKind
Source§fn clone(&self) -> ColumnLevelDiagnosticKind
fn clone(&self) -> ColumnLevelDiagnosticKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ColumnLevelDiagnosticKind
impl Debug for ColumnLevelDiagnosticKind
impl Eq for ColumnLevelDiagnosticKind
Source§impl PartialEq for ColumnLevelDiagnosticKind
impl PartialEq for ColumnLevelDiagnosticKind
Source§fn eq(&self, other: &ColumnLevelDiagnosticKind) -> bool
fn eq(&self, other: &ColumnLevelDiagnosticKind) -> bool
self and other values to be equal, and is used by ==.