001package gudusoft.gsqlparser.ir.semantic;
002
003/**
004 * Classification of a relation source in {@link RelationSource}.
005 *
006 * <p>Slice 1 only emits {@link #TABLE}. CTE / SUBQUERY / UNION are
007 * reserved for later slices and exist here so the JSON shape does not
008 * change when those cases land.
009 *
010 * <p>Slice 14 added {@link #OUTER_REFERENCE}: a synthesised relation
011 * an inner statement carries to model an alias actually owned by an
012 * enclosing scope. Slice 15 extends OUTER_REFERENCE so the binding's
013 * {@code outerKind} (set via the 3-arg
014 * {@link gudusoft.gsqlparser.ir.semantic.binding.RelationBinding}
015 * constructor) records what the outer relation is really bound to:
016 * one of {@code {TABLE, CTE, SUBQUERY}}. Canonical-edge emission
017 * dispatches through that resolved kind so CTE / SUBQUERY outer
018 * correlations BFS the outer body to base columns just like
019 * non-correlated CTE / SUBQUERY relations do.
020 */
021public enum RelationKind {
022    TABLE,
023    CTE,
024    SUBQUERY,
025    UNION,
026    UNKNOWN,
027    OUTER_REFERENCE
028}