001package gudusoft.gsqlparser.ir.semantic;
002
003/**
004 * Surface form of the row-limit metadata captured on a
005 * {@link StatementGraph}. Slices 70 and 71 cover the four single-SELECT
006 * row-limit shapes that do not change column lineage:
007 *
008 * <ul>
009 *   <li>{@link #LIMIT} — PostgreSQL / MySQL / SQLite / BigQuery /
010 *       Snowflake / Redshift {@code LIMIT N} (count on
011 *       {@code TLimitClause.getRow_count()}) and the inline-offset
012 *       variants {@code LIMIT N OFFSET M} and MySQL/Hive/Informix
013 *       {@code LIMIT M, N}. When offset is present it lands on
014 *       {@link RowLimit#getOffset()}.</li>
015 *   <li>{@link #FETCH_FIRST} — ANSI / Oracle / DB2 / SQL Server
016 *       {@code FETCH FIRST N ROWS ONLY} (and the {@code FETCH NEXT N
017 *       ROWS ONLY} synonym), PostgreSQL {@code FETCH FIRST} routed
018 *       through {@code TLimitClause.getSelectFetchFirstValue()}, and
019 *       Informix {@code FIRST n} / {@code SKIP m FIRST n} (Informix
020 *       routes FIRST through the same PG slot). When offset is present
021 *       (PG {@code OFFSET m FETCH FIRST n}, Informix {@code SKIP m
022 *       FIRST n}) it lands on {@link RowLimit#getOffset()}.</li>
023 *   <li>{@link #TOP} — SQL Server {@code SELECT TOP N}. PERCENT and
024 *       WITH TIES surfaces are rejected separately for now
025 *       ({@code ROW_LIMIT_TOP_PERCENT_NOT_SUPPORTED},
026 *       {@code ROW_LIMIT_TOP_WITH_TIES_NOT_SUPPORTED}).</li>
027 *   <li>{@link #OFFSET_FETCH} — Oracle / SQL Server
028 *       {@code OFFSET m ROWS [FETCH NEXT n ROWS ONLY]} routed through
029 *       the dedicated {@code TOffsetClause} + {@code TFetchFirstClause}
030 *       AST pair, and PG's {@code OFFSET m} offset-only shape routed
031 *       through {@code TLimitClause.getOffset()} when
032 *       {@code row_count} is null. {@link RowLimit#getCount()} may be
033 *       {@code null} for offset-only forms.</li>
034 * </ul>
035 *
036 * <p>Set-op outer row-limit (e.g. {@code UNION ALL ... LIMIT 5}) is
037 * still rejected by {@code rejectSetOpRowLimit} with
038 * {@code SET_OP_ROW_LIMIT_NOT_SUPPORTED}; slice 72 lifts it. Branch-level
039 * row-limit inside a set-op (e.g.
040 * {@code (SELECT ... LIMIT 10) UNION ALL (SELECT ... LIMIT 5)}) admits
041 * per branch — each branch's {@link StatementGraph} carries its own
042 * {@link RowLimit}.
043 */
044public enum RowLimitKind {
045    LIMIT,
046    FETCH_FIRST,
047    TOP,
048    OFFSET_FETCH
049}