@memberjunction/generic-database-provider 6.2.0-edge.2 → 6.2.0-edge.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,22 +13,54 @@ export interface PagingWrappedSQL {
13
13
  /** The page size (same as maxRows input) */
14
14
  PageSize: number;
15
15
  }
16
+ /**
17
+ * How a requested row cap was applied.
18
+ *
19
+ * - `top` / `limit` / `fetch`: a `TOP n`, `LIMIT n`, or `OFFSET 0 ROWS FETCH NEXT n ROWS ONLY`
20
+ * clause in the statement itself.
21
+ * - `own-cap`: the statement's own cap was already as tight or tighter, so it was left as is.
22
+ * - `derived-table`: the statement was capped as a derived table.
23
+ * - `none`: no cap was applied; {@link RowCapOutcome.Reason} says why.
24
+ */
25
+ export type RowCapMethod = 'top' | 'limit' | 'fetch' | 'own-cap' | 'derived-table' | 'none';
26
+ /** Whether a requested row cap holds for the rendered SQL, and how. */
27
+ export interface RowCapOutcome {
28
+ /** True when the rendered SQL returns at most the requested number of rows. */
29
+ Applied: boolean;
30
+ Method: RowCapMethod;
31
+ /** Why no cap was applied; `null` when one was. */
32
+ Reason: string | null;
33
+ }
34
+ /** The capped SQL and the outcome, from {@link QueryPagingEngine.ApplyMaxRows}. */
35
+ export interface RowCapResult {
36
+ SQL: string;
37
+ Outcome: RowCapOutcome;
38
+ }
16
39
  /**
17
40
  * Handles server-side pagination for query SQL by applying platform-specific
18
41
  * paging clauses.
19
42
  *
20
- * **Data SQL** — appends OFFSET/FETCH (SQL Server) or LIMIT/OFFSET (PostgreSQL)
21
- * directly to the original SQL. The query is not wrapped in a CTE, so all column
22
- * scopes, ORDER BY references, and table aliases remain valid. TOP is stripped on
23
- * SQL Server since it conflicts with OFFSET.
43
+ * The statement is read from tokens ({@link AnalyzePagingShape}), so paging works the same way
44
+ * on SQL the AST parser cannot read, and the query's own text is kept as written: nothing is
45
+ * re-emitted from a syntax tree.
46
+ *
47
+ * **The query's own row cap is part of what it means.** `StartRow` and `MaxRows` page within the
48
+ * capped result, so the smaller of the query's cap and `MaxRows` wins, and the total row count is
49
+ * the size of the capped result. A numeric cap (`TOP n`, `LIMIT n [OFFSET k]`, `OFFSET k … FETCH
50
+ * NEXT n`) is replaced by the page's own clause with the arithmetic folded in; a page past the
51
+ * cap is an empty result. Any other cap (`TOP … PERCENT`, `WITH TIES`, an expression) is kept, and
52
+ * the query is paged as a derived table.
24
53
  *
25
- * **Count SQL** — wraps the original SQL (minus ORDER BY) in a CTE and produces
26
- * `SELECT COUNT(*) AS TotalRowCount FROM [__count]`. ORDER BY is irrelevant for
27
- * counting and must be removed since SQL Server forbids it in CTEs without TOP.
54
+ * **Data SQL** — appends OFFSET/FETCH (SQL Server) or LIMIT/OFFSET (PostgreSQL) to the
55
+ * statement, after its ORDER BY (a default one is added when it has none) and before any clause
56
+ * that must stay last (`OPTION (…)`, `FOR UPDATE`). Column scopes, ORDER BY references and table
57
+ * aliases stay valid because the query is not wrapped.
28
58
  *
29
- * This approach eliminates the need for ORDER BY remapping (mapping column
30
- * references from the inner query scope to the outer CTE scope), which was the
31
- * primary source of paging bugs.
59
+ * **Count SQL** — puts the query (without its ORDER BY, unless its own cap needs it) in a
60
+ * `[__count]` CTE beside the query's own CTEs and selects `COUNT(*) AS TotalRowCount`.
61
+ *
62
+ * A query that ends in `FOR JSON` / `FOR XML` returns a document, not rows, and cannot be paged;
63
+ * asking to page one is an error.
32
64
  */
33
65
  export declare class QueryPagingEngine {
34
66
  /**
@@ -42,80 +74,78 @@ export declare class QueryPagingEngine {
42
74
  */
43
75
  static WrapWithPaging(resolvedSQL: string, startRow: number, maxRows: number, platform: DatabasePlatform): PagingWrappedSQL;
44
76
  /**
45
- * Applies a row cap to the outermost SELECT.
77
+ * Applies a row cap to the outermost SELECT: the result returns at most `maxRows` rows.
46
78
  *
47
- * `maxRows` is treated as a hard ceiling: the result is guaranteed to
48
- * return at most `maxRows` rows whenever the SQL shape can be capped
49
- * without corrupting the query.
79
+ * The statement is edited in place, from tokens, so the caller's SQL is kept exactly as
80
+ * written apart from the cap, and SQL the AST parser cannot read is capped the same way:
81
+ * - No cap of its own: `TOP n` goes after `SELECT [ALL | DISTINCT]` on SQL Server, and
82
+ * `LIMIT n` at the end on PostgreSQL. A SQL Server set operation (which has no single
83
+ * SELECT to put TOP on) gets `OFFSET 0 ROWS FETCH NEXT n ROWS ONLY` after its ORDER BY.
84
+ * - A numeric cap of its own: the tighter of the two wins.
85
+ * - Any other cap of its own (`TOP … PERCENT`, `WITH TIES`, an expression, caps on more than
86
+ * one branch): the statement is capped as a derived table.
87
+ * Clauses that must stay last (`OPTION (…)`, `FOR UPDATE`) stay last.
50
88
  *
51
- * Strategy:
52
- * 1. Parse via AST. If the outermost SELECT has no existing cap,
53
- * inject `TOP N` (SQL Server) or `LIMIT N` (PostgreSQL).
54
- * 2. If an existing numeric `TOP`/`LIMIT` is present, reduce it to
55
- * `min(existing, maxRows)`. The tighter cap wins.
56
- * 3. If the AST recognizes the shape but can't inject (`TOP PERCENT`,
57
- * non-numeric `TOP`, `UNION`, `WITH TIES`, etc.), wrap with an
58
- * outer `SELECT TOP N * FROM (…) AS _mj_capped` (or LIMIT on PG).
59
- * 4. If the parser can't handle the input but the SQL is CTE-headed,
60
- * append `OFFSET 0 ROWS FETCH NEXT N ROWS ONLY` via {@link buildDataSQL}.
61
- * 5. Shapes that can't legally appear inside a derived table
62
- * (`FOR JSON`, `FOR XML`, `OPTION (...)`, `SELECT INTO`,
63
- * mutations) are returned unchanged — the cap is moot
64
- * (FOR JSON/XML return one row) or the validator should have
65
- * rejected them earlier (mutations, SELECT INTO).
89
+ * A statement that ends in `FOR JSON` / `FOR XML` returns one document built from its rows;
90
+ * it is capped in place (bounding the rows the document is built from) and left unchanged
91
+ * where only a derived table or a set-operation clause could cap it. Anything that is not a
92
+ * single read query (a write, `SELECT … INTO`) is left unchanged; the render pipeline refuses
93
+ * those before this point anyway.
66
94
  *
67
- * Non-positive, non-finite, or fractional `maxRows` are sanitized
68
- * (`<= 0` and non-finite are no-ops; fractional values are floored).
95
+ * Non-positive, non-finite, or fractional `maxRows` are sanitized (`<= 0` and non-finite are
96
+ * no-ops; fractional values are floored).
69
97
  */
70
98
  static WrapWithMaxRows(resolvedSQL: string, maxRows: number, platform: DatabasePlatform): string;
71
99
  /**
72
- * Wraps `sql` in an outer SELECT that enforces the row cap.
73
- * Used when the AST recognises the shape but cannot inject the cap
74
- * cleanly, or when the AST can't parse the input but the SQL is known
75
- * to be wrap-safe (no FOR JSON/FOR XML/OPTION at top level).
100
+ * Applies a row cap exactly as {@link WrapWithMaxRows} does, and also reports whether the cap
101
+ * holds and how, so a caller that asked for a cap can tell whether it got one.
102
+ */
103
+ static ApplyMaxRows(resolvedSQL: string, maxRows: number, platform: DatabasePlatform): RowCapResult;
104
+ /** Caps a statement that has no cap of its own. */
105
+ private static addCap;
106
+ /** Lowers a numeric cap of the query's own to `cap`, or leaves it when it is already tighter. */
107
+ private static tightenCap;
108
+ /** How a row-limit suffix from the dialect's `LimitClause` caps rows: `FETCH` or `LIMIT`. */
109
+ private static suffixMethod;
110
+ /**
111
+ * Caps the statement as a derived table, for shapes that cannot be capped in place. The
112
+ * query's CTEs stay in front and its trailing clause stays last. Its ORDER BY stays inside,
113
+ * where SQL Server allows it beside the query's own TOP; a set operation's ORDER BY is
114
+ * repeated outside (see {@link derivedTableParts}).
115
+ */
116
+ private static capAsDerivedTable;
117
+ /**
118
+ * Splits the main statement into the body of a derived table and the ORDER BY to put outside it.
76
119
  *
77
- * Strips any top-level ORDER BY before wrapping: ORDER BY is illegal
78
- * inside a derived table on SQL Server (unless TOP/OFFSET/FOR XML is
79
- * present), and the outer SELECT doesn't preserve inner ordering anyway.
80
- * The ORDER BY is moved to the outer SELECT so the final result retains
81
- * the intended sort order.
82
- */
83
- private static outerWrap;
84
- /**
85
- * AST-based row-cap injection.
86
- * `capped` — `sql` contains the input with TOP/LIMIT injected
87
- * or reduced to `min(existing, cap)`.
88
- * `wrap` — AST recognized the shape but the cap can't be
89
- * safely injected inline (`TOP PERCENT`, non-numeric
90
- * `TOP`/`LIMIT`); caller should outer-wrap.
91
- * `pass-through` — shape can't be capped at all without corrupting
92
- * the query (SELECT INTO, mutation).
93
- * `unparseable` — parser could not handle the input; caller may
94
- * attempt a CTE-fallback or outer wrap.
120
+ * Only a set operation's ORDER BY goes outside: it orders the combined result, which a derived
121
+ * table does not preserve. Outside, the set operation's table aliases are out of scope, so its
122
+ * column references lose their qualifiers (`a.Name` → `Name`) and name the derived table's
123
+ * output columns instead.
95
124
  *
96
- * All AST shape inspection is delegated to {@link SQLParser} primitives —
97
- * this method contains no `node-sql-parser` field knowledge.
125
+ * The ORDER BY is cut from the inside, where SQL Server rejects it. When the set operation also
126
+ * has its own `OFFSET … FETCH` / `LIMIT` after that ORDER BY, that cap still has to pick the
127
+ * rows, so the inside becomes a second derived table that applies it with the same, unqualified,
128
+ * ORDER BY. Keeping the set operation's own text there instead would put its branches' `TOP`
129
+ * and its `OFFSET` in one subquery, which SQL Server refuses even though it accepts them as a
130
+ * whole statement.
98
131
  */
99
- private static applyMaxRowsViaAST;
132
+ private static derivedTableParts;
100
133
  /**
101
- * Clauses that must come AFTER `LIMIT` in PostgreSQL, so a bare append would be illegal.
102
- *
103
- * Matched loosely and deliberately: a false positive (the word inside a string literal, a
104
- * column alias, or a nested subquery) costs only a fall-through to the AST path, which is
105
- * the behaviour that shipped before. A false negative would emit invalid SQL, so the test
106
- * errs heavily toward abstaining.
134
+ * Drops the table or schema qualifier from every dotted column name in `sql`, keeping its last
135
+ * part: `a.Name` → `Name`, `[dbo].[A].[Name]` → `[Name]`. A dotted name followed by `(` is a
136
+ * function call such as `dbo.fnLen(Name)`, whose schema SQL Server requires, so it is kept.
137
+ * Whitespace, comments and every other token are kept as written.
107
138
  */
108
- private static readonly CLAUSES_THAT_FOLLOW_LIMIT;
139
+ private static unqualifyColumnReferences;
109
140
  /**
110
- * Returns `sql` with the row cap appended as a trailing clause, or `null` when that is not
111
- * provably safe and the caller should fall back to AST injection.
112
- *
113
- * Applies only to dialects whose cap is a suffix (`LIMIT N`). SQL Server caps with a `TOP N`
114
- * prefix that has to go between `SELECT` and the select list — a position no append can
115
- * reach — so it is left to the AST path, where the round-trip is harmless anyway because
116
- * T-SQL is not case-sensitive about the identifiers involved.
141
+ * The index just past the dotted name (`part.part[.part…]`) that starts at `start`, or `start`
142
+ * when no name of two or more parts starts there.
117
143
  */
118
- private static appendTrailingCap;
144
+ private static dottedNameEnd;
145
+ /** Whether the next token at or after `index`, other than whitespace and comments, opens a parenthesis. */
146
+ private static isFollowedByOpenParen;
147
+ /** Whether a token can be one part of a dotted name: a bare word or a quoted identifier. */
148
+ private static isNamePart;
119
149
  /**
120
150
  * Determines whether the given params indicate paging should be applied.
121
151
  *
@@ -138,33 +168,60 @@ export declare class QueryPagingEngine {
138
168
  * `ShouldPage` needs a concrete offset, and `StartRow` is not guaranteed to be set.
139
169
  */
140
170
  static ResolveStartRow(startRow: number | undefined): number;
171
+ /** Removes trailing semicolons and whitespace; a statement-ending `;` cannot precede a paging clause. */
172
+ private static stripTrailingSemicolons;
173
+ /**
174
+ * Builds the SQL for one page. A query without a cap of its own gets the paging clause
175
+ * appended; a single numeric cap is replaced by the page's clause with the arithmetic folded
176
+ * in; anything else is paged as a derived table.
177
+ */
141
178
  private static buildDataSQL;
179
+ /** The statement up to the clause that must stay last. */
180
+ private static head;
181
+ /** The clause that must stay last (`OPTION (…)`, `FOR UPDATE`), with its leading newline, or ''. */
182
+ private static tail;
183
+ /** Appends ORDER BY (when the statement has none), the paging clause and the trailing clause. */
184
+ private static appendPage;
185
+ /**
186
+ * The ORDER BY to page by when the statement has none: the dialect's
187
+ * {@link SQLDialect.SelectListPagingOrderBy} for a set operation or SELECT DISTINCT when it
188
+ * has one (a platform that only accepts select-list items there), otherwise its
189
+ * {@link SQLDialect.DefaultPagingOrderBy}.
190
+ */
191
+ private static defaultOrderBy;
142
192
  /**
143
- * Strips a TOP clause from the outermost SELECT statement.
144
- * Handles `TOP N` and `TOP (N)`, with or without DISTINCT.
145
- * Does not affect TOP in subqueries or CTEs.
193
+ * Pages within a numeric cap of the query's own: the page starts `startRow` rows into the
194
+ * capped result and stops at the cap. A page that starts at or past the cap is empty.
146
195
  */
147
- private static stripTopFromMainSelect;
196
+ private static pageWithinCap;
148
197
  /**
149
- * Builds count SQL that wraps the (cap-free, ORDER-BY-free) query in a
150
- * `[__count]` CTE and selects `COUNT(*)`. A single instance-API path:
151
- * 1. `ExtractCTEs` hoists any user CTEs as siblings (a CTE body can't
152
- * contain its own WITH) — AST parse first, paren-depth regex fallback.
153
- * 2. `stripCountBody` removes the top-level ORDER BY (irrelevant for a
154
- * count, and illegal in a SQL Server CTE without TOP) and any outer
155
- * TOP / LIMIT (so the count reflects the full set, consistent with the
156
- * paged data query).
198
+ * Pages a query whose own cap cannot be reasoned about as a row count (`TOP … PERCENT`, `WITH
199
+ * TIES`, an expression, or a cap on more than one branch of a set operation) by selecting the
200
+ * page from it as a derived table. Its CTEs stay in front, its trailing clause stays last, and
201
+ * the ORDER BY of a set operation is repeated outside (see {@link derivedTableParts}).
202
+ */
203
+ private static wrapAndPage;
204
+ /** A statement that returns no rows, for a page that starts past the query's own cap. */
205
+ private static emptyResultSQL;
206
+ /**
207
+ * Builds the count query: the main statement in a `[__count]` CTE placed after the query's
208
+ * own CTEs (a CTE body cannot contain its own WITH), and `SELECT COUNT(*) AS TotalRowCount`.
209
+ * The ORDER BY is removed — it does not change a count, and SQL Server forbids it in a CTE —
210
+ * unless the query's own cap needs it to choose its rows. A trailing `OPTION (…)` stays last.
157
211
  */
158
212
  private static buildCountSQL;
159
213
  /**
160
- * Strips the ORDER BY and any outer row cap (TOP on SQL Server, LIMIT on
161
- * PostgreSQL) from the statement being counted, via a single parser
162
- * round-trip — so the count reflects the full set rather than the capped
163
- * subset. Falls back to a string-based ORDER BY strip when the statement
164
- * can't be parsed (e.g. TRY_CAST, unresolved templates); the cap can't be
165
- * reliably removed without a parse, matching the prior regex behavior.
214
+ * The main statement as the count query sees it. With a cap of its own the statement is kept
215
+ * whole (its ORDER BY picks the capped rows, and is legal in a CTE beside TOP or OFFSET),
216
+ * except that a set operation's trailing ORDER BY is dropped; otherwise the ORDER BY is cut.
217
+ *
218
+ * A set operation with both branch `TOP`s and its own `OFFSET` / `LIMIT` cannot be kept whole:
219
+ * SQL Server refuses the two in one CTE. It is counted through the same second derived table
220
+ * the data query uses (see {@link derivedTableParts}).
166
221
  */
167
- private static stripCountBody;
222
+ private static countBody;
223
+ /** Whether a set operation ordered by its own ORDER BY caps both its branches (`TOP`) and itself (`OFFSET` / `LIMIT`). */
224
+ private static hasBranchTopAndOwnClauseCap;
168
225
  /**
169
226
  * Extracts the top-level ORDER BY clause from SQL, ignoring ORDER BY
170
227
  * inside subqueries, block comments, line comments, single-quoted strings,
@@ -193,11 +250,6 @@ export declare class QueryPagingEngine {
193
250
  sql: string;
194
251
  topRemoved: boolean;
195
252
  };
196
- /**
197
- * ExtractCTEs returns CTE definitions with unquoted names (e.g. `myName AS (...)`).
198
- * Apply dialect-specific identifier quoting to the CTE name.
199
- */
200
- private static quoteCteName;
201
253
  private static getDialect;
202
254
  }
203
255
  //# sourceMappingURL=queryPagingEngine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryPagingEngine.d.ts","sourceRoot":"","sources":["../src/queryPagingEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE5F;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;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