001package gudusoft.gsqlparser.resolver2.namespace;
002
003/**
004 * Tri-value describing whether a namespace's column metadata is authoritative.
005 *
006 * <p>Slice S4 (plan §5.5) introduces this enum so the binding post-pass can
007 * distinguish "catalog says column missing" (authoritative) from "metadata is
008 * unavailable" (silent). Without this distinction strict-mode
009 * {@code UNKNOWN_COLUMN} would fire on every unbacked table — the largest
010 * false-positive risk for the binding feature.</p>
011 *
012 * <p>Returned by {@link INamespace#getMetadataState()}.</p>
013 *
014 * <ul>
015 *   <li>{@link #FOUND} — namespace has authoritative column metadata. A column
016 *       absent from this namespace is genuinely missing and may emit
017 *       {@code UNKNOWN_COLUMN} (see plan §5.4 frozen codes).</li>
018 *   <li>{@link #NOT_FOUND_IN_CATALOG} — namespace consulted a real catalog and
019 *       the table itself is absent. Drives strict-mode {@code UNKNOWN_TABLE}
020 *       (S6); never causes {@code UNKNOWN_COLUMN}.</li>
021 *   <li>{@link #METADATA_UNAVAILABLE} — no authoritative source: no
022 *       {@code TSQLEnv}, an empty env, a table found but with no expanded
023 *       columns (Q8 view-without-columns), or a derived namespace whose inner
024 *       projection is unknown. Strict mode may emit
025 *       {@code CATALOG_METADATA_UNAVAILABLE} (WARNING); non-strict is silent.
026 *       Never causes {@code UNKNOWN_COLUMN}.</li>
027 * </ul>
028 */
029public enum MetadataState {
030
031    /** Authoritative metadata is present; absent columns are genuinely missing. */
032    FOUND,
033
034    /**
035     * The catalog consulted does not contain the table. Drives strict-mode
036     * {@code UNKNOWN_TABLE} but never {@code UNKNOWN_COLUMN}.
037     */
038    NOT_FOUND_IN_CATALOG,
039
040    /**
041     * No authoritative metadata is available. Strict mode may emit
042     * {@code CATALOG_METADATA_UNAVAILABLE}; non-strict is silent.
043     */
044    METADATA_UNAVAILABLE
045}