Skip to main content

ResolutionKind

Enum ResolutionKind 

Source
pub enum ResolutionKind {
    Cataloged,
    Inferred,
    Ambiguous,
    Unresolved,
}
Expand description

How a reference was resolved — “what kind of resolution backs this (table, name) placement?”.

Catalog-less mode runs as an inference mode: every real-table binding’s schema is unknown, so a single-candidate resolution is best-effort, not catalog-backed. CTE and derived bodies do carry known schemas (the resolver derives them from the body’s projection), but those refs are synthetic and dropped from the public reads / lineage by the resolver’s post-pass.

Ambiguous and Unresolved are the two failure modes. Both come with table: None on the ColumnReference; the variant tells the consumer why the resolver gave up. (Unresolved arises only for columns — a table reference always has a name present.)

§Invariants

  • Catalog-less mode → no public Cataloged: every surviving non-synthetic ref points at an unknown real table, so the strongest claim the resolver can make is Inferred. Catalog-aware analysis is therefore detectable by the presence of Cataloged.
  • Catalog-aware mode does not imply Cataloged: catalogs are often partial. Refs against tables the catalog doesn’t cover, or against a real unknown table that won a multi-candidate tiebreaker over known ones, both still come back as Inferred.

§How each variant arises

SituationResolutionKind
catalog-less, real unknown table, sole candidateInferred
catalog-less, two real unknown tables in scopeAmbiguous
catalog-less, CTE known body confirms the column(internal Cataloged; synthetic, dropped)
catalog-less, CTE known body denies the column (SELECT typo FROM cte where cte = [id])Unresolved
catalog-aware, known binding lists the columnCataloged
catalog-aware, known binding doesn’t list the columnUnresolved
catalog-aware, one known confirms + one unknown suspect (known-witness-over-unknown-suspects)Inferred
catalog-aware, two or more known schemas confirmAmbiguous
qualified t.col where t is unknownInferred
qualified t.col where t is known and lists colCataloged

§Consumer guidance

  • Strict mode validation: a fully resolved, catalog-confirmed statement satisfies op.diagnostics.is_empty() && op.reads.iter().all(|r| r.resolution == ResolutionKind::Cataloged).
  • DFD / CRUD comprehension: treat Cataloged and Inferred interchangeably as “resolved” (use the (table, name) pair); treat Ambiguous and Unresolved as “incomplete”.

Variants§

§

Cataloged

Backed by a known schema that lists the column / names the table. On the public surface this means a catalog (or registry) entry backed the reference. Internally a CTE / derived body’s known schema also yields this variant on a synthetic ref, but the post-pass drops those — so consumers only ever see Cataloged for catalog-backed real references.

§

Inferred

Resolution succeeded by assuming the reference exists where the resolver placed it: an unknown-schema binding adopted as the sole candidate, a qualified reference whose qualifier alone determined the table, or a known witness winning over unknown suspects in a multi-candidate scope. All defensible inferences in catalog-less or partial-catalog mode, but not proven.

§

Ambiguous

Multiple plausible candidates and the resolver couldn’t pick one: either two-or-more known schemas confirmed the column (genuine ambiguity), or every candidate was an unknown suspect with no tiebreaker. ColumnReference.table is None.

§

Unresolved

No in-scope binding could plausibly own the column: either every known schema in scope explicitly denied it, or the scope chain held no bindings at all. ColumnReference.table is None. Columns only.

Trait Implementations§

Source§

impl Clone for ResolutionKind

Source§

fn clone(&self) -> ResolutionKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ResolutionKind

Source§

impl Debug for ResolutionKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ResolutionKind

Source§

impl Hash for ResolutionKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ResolutionKind

Source§

fn eq(&self, other: &ResolutionKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ResolutionKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.