@memberjunction/generic-database-provider 6.2.0-edge.4 → 6.2.0-edge.5
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.
- package/dist/GenericDatabaseProvider.d.ts +155 -13
- package/dist/GenericDatabaseProvider.d.ts.map +1 -1
- package/dist/GenericDatabaseProvider.js +452 -121
- package/dist/GenericDatabaseProvider.js.map +1 -1
- package/dist/SqlLogger.d.ts +17 -0
- package/dist/SqlLogger.d.ts.map +1 -1
- package/dist/SqlLogger.js +88 -15
- package/dist/SqlLogger.js.map +1 -1
- package/dist/clientClauseScreen.d.ts +259 -0
- package/dist/clientClauseScreen.d.ts.map +1 -0
- package/dist/clientClauseScreen.js +531 -0
- package/dist/clientClauseScreen.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/saveTypes.d.ts +41 -4
- package/dist/saveTypes.d.ts.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +14 -14
package/dist/SqlLogger.d.ts
CHANGED
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { SQLDialect } from '@memberjunction/sql-dialect';
|
|
11
11
|
import { SqlLoggingOptions, SqlLoggingSession } from './types.js';
|
|
12
|
+
/** Line written in place of a statement whose `TransformStatement` threw. */
|
|
13
|
+
export declare const TRANSFORM_FAILED_LINE = "-- Statement not logged: TransformStatement failed";
|
|
14
|
+
/** Text `ApplyStatementTransforms` returns when a transform throws. */
|
|
15
|
+
export declare const TRANSFORM_FAILED_PLACEHOLDER = "[statement hidden: TransformStatement failed]";
|
|
12
16
|
/**
|
|
13
17
|
* Internal implementation of SqlLoggingSession that handles SQL statement logging to files.
|
|
14
18
|
* This class manages file I/O, SQL formatting, and filtering based on session options.
|
|
@@ -55,6 +59,12 @@ export declare class SqlLoggingSessionImpl implements SqlLoggingSession {
|
|
|
55
59
|
* @param simpleSQLFallback - Optional simple SQL to use if logRecordChangeMetadata=false
|
|
56
60
|
*/
|
|
57
61
|
LogSqlStatement(query: string, parameters?: unknown, description?: string, isMutation?: boolean, simpleSQLFallback?: string): Promise<void>;
|
|
62
|
+
/** Builds the `-- Parameters: …` line, or undefined when there are no parameters to show. */
|
|
63
|
+
private _buildParameterComment;
|
|
64
|
+
/** Runs `TransformStatement` on each text part. Returns null when the transform throws. */
|
|
65
|
+
private _transformParts;
|
|
66
|
+
/** Writes the fixed placeholder line in place of a statement whose transform threw. */
|
|
67
|
+
private _writeTransformFailure;
|
|
58
68
|
/** @deprecated Use {@link LogSqlStatement}. */
|
|
59
69
|
logSqlStatement(query: string, parameters?: unknown, description?: string, isMutation?: boolean, simpleSQLFallback?: string): Promise<void>;
|
|
60
70
|
/**
|
|
@@ -104,4 +114,11 @@ export declare class SqlLoggingSessionImpl implements SqlLoggingSession {
|
|
|
104
114
|
*/
|
|
105
115
|
private _escapeFlywaySyntaxInStrings;
|
|
106
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Runs the `TransformStatement` of each session in turn; sessions without one leave the text as is.
|
|
119
|
+
* Returns a fixed placeholder when a transform throws.
|
|
120
|
+
*/
|
|
121
|
+
export declare function ApplyStatementTransforms(sql: string, sessions: Iterable<{
|
|
122
|
+
options: SqlLoggingOptions;
|
|
123
|
+
}>): string;
|
|
107
124
|
//# sourceMappingURL=SqlLogger.d.ts.map
|
package/dist/SqlLogger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SqlLogger.d.ts","sourceRoot":"","sources":["../src/SqlLogger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAE,UAAU,EAAoB,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,iBAAi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AAC,eAAe;IAmBvB,OAAO,CAAC,eAAe;IAavB;;OAEG;IACH,OAAO,CAAC,eAAe;IAwBvB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IA+B5B;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAwDlC;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;IAIlC;;;;;OAKG;IACH,OAAO,CAAC,4BAA4B;IAapC;;;;;OAKG;IACH,OAAO,CAAC,4BAA4B;CAIrC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;IAAE,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC,GAAG,MAAM,CAahH"}
|
package/dist/SqlLogger.js
CHANGED
|
@@ -12,6 +12,10 @@ import * as path from 'path';
|
|
|
12
12
|
import { format as formatSql } from 'sql-formatter';
|
|
13
13
|
import { ensureRegExps } from '@memberjunction/global';
|
|
14
14
|
import { SQLServerDialect } from '@memberjunction/sql-dialect';
|
|
15
|
+
/** Line written in place of a statement whose `TransformStatement` threw. */
|
|
16
|
+
export const TRANSFORM_FAILED_LINE = '-- Statement not logged: TransformStatement failed';
|
|
17
|
+
/** Text `ApplyStatementTransforms` returns when a transform throws. */
|
|
18
|
+
export const TRANSFORM_FAILED_PLACEHOLDER = '[statement hidden: TransformStatement failed]';
|
|
15
19
|
/**
|
|
16
20
|
* Internal implementation of SqlLoggingSession that handles SQL statement logging to files.
|
|
17
21
|
* This class manages file I/O, SQL formatting, and filtering based on session options.
|
|
@@ -73,6 +77,17 @@ export class SqlLoggingSessionImpl {
|
|
|
73
77
|
* @param simpleSQLFallback - Optional simple SQL to use if logRecordChangeMetadata=false
|
|
74
78
|
*/
|
|
75
79
|
async LogSqlStatement(query, parameters, description, isMutation = false, simpleSQLFallback) {
|
|
80
|
+
// The SQL that ran decides the "(core SP call only)" tag
|
|
81
|
+
const fallbackDiffersFromQuery = simpleSQLFallback !== query;
|
|
82
|
+
let paramComment = this._buildParameterComment(parameters);
|
|
83
|
+
// The session reads only the transformed text from here on
|
|
84
|
+
if (this.options.TransformStatement) {
|
|
85
|
+
const transformed = this._transformParts({ query, simpleSQLFallback, description, paramComment });
|
|
86
|
+
if (!transformed) {
|
|
87
|
+
return this._writeTransformFailure(isMutation);
|
|
88
|
+
}
|
|
89
|
+
({ query, simpleSQLFallback, description, paramComment } = transformed);
|
|
90
|
+
}
|
|
76
91
|
const verbose = this.options.verboseOutput === true;
|
|
77
92
|
if (verbose) {
|
|
78
93
|
console.log(`=== SESSION ${this.id} LOG ATTEMPT ===`);
|
|
@@ -120,7 +135,7 @@ export class SqlLoggingSessionImpl {
|
|
|
120
135
|
// Tag the description only when the logged text actually differs from what ran.
|
|
121
136
|
// A save on an entity without record-change tracking can hand over a fallback that is
|
|
122
137
|
// byte-identical to the executed SQL (a forced update), and tagging that would misreport it.
|
|
123
|
-
if (description &&
|
|
138
|
+
if (description && fallbackDiffersFromQuery && !description.includes('(core SP call only)')) {
|
|
124
139
|
logEntry = logEntry.replace(`-- ${description}\n`, `-- ${description} (core SP call only)\n`);
|
|
125
140
|
}
|
|
126
141
|
}
|
|
@@ -174,20 +189,8 @@ export class SqlLoggingSessionImpl {
|
|
|
174
189
|
// Add the SQL statement
|
|
175
190
|
logEntry += `${processedQuery};\n`;
|
|
176
191
|
// Add parameter comment if parameters exist
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
if (parameters.length > 0) {
|
|
180
|
-
logEntry += `-- Parameters: ${parameters.map((p, i) => `@p${i}='${p}'`).join(', ')}\n`;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else if (typeof parameters === 'object') {
|
|
184
|
-
const paramStr = Object.entries(parameters)
|
|
185
|
-
.map(([key, value]) => `@${key}='${value}'`)
|
|
186
|
-
.join(', ');
|
|
187
|
-
if (paramStr) {
|
|
188
|
-
logEntry += `-- Parameters: ${paramStr}\n`;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
192
|
+
if (paramComment !== undefined) {
|
|
193
|
+
logEntry += `${paramComment}\n`;
|
|
191
194
|
}
|
|
192
195
|
// Batch separator logic:
|
|
193
196
|
// - Threshold mode: emit separator when accumulated variable declarations reach the threshold,
|
|
@@ -237,6 +240,57 @@ export class SqlLoggingSessionImpl {
|
|
|
237
240
|
throw error;
|
|
238
241
|
}
|
|
239
242
|
}
|
|
243
|
+
/** Builds the `-- Parameters: …` line, or undefined when there are no parameters to show. */
|
|
244
|
+
_buildParameterComment(parameters) {
|
|
245
|
+
let paramStr = '';
|
|
246
|
+
if (Array.isArray(parameters)) {
|
|
247
|
+
paramStr = parameters.map((p, i) => `@p${i}='${p}'`).join(', ');
|
|
248
|
+
}
|
|
249
|
+
else if (parameters && typeof parameters === 'object') {
|
|
250
|
+
paramStr = Object.entries(parameters)
|
|
251
|
+
.map(([key, value]) => `@${key}='${value}'`)
|
|
252
|
+
.join(', ');
|
|
253
|
+
}
|
|
254
|
+
return paramStr ? `-- Parameters: ${paramStr}` : undefined;
|
|
255
|
+
}
|
|
256
|
+
/** Runs `TransformStatement` on each text part. Returns null when the transform throws. */
|
|
257
|
+
_transformParts(parts) {
|
|
258
|
+
const transform = this.options.TransformStatement;
|
|
259
|
+
if (!transform) {
|
|
260
|
+
return parts;
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
return {
|
|
264
|
+
query: transform(parts.query),
|
|
265
|
+
simpleSQLFallback: parts.simpleSQLFallback !== undefined ? transform(parts.simpleSQLFallback) : undefined,
|
|
266
|
+
description: parts.description !== undefined ? transform(parts.description) : undefined,
|
|
267
|
+
paramComment: parts.paramComment !== undefined ? transform(parts.paramComment) : undefined,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** Writes the fixed placeholder line in place of a statement whose transform threw. */
|
|
275
|
+
async _writeTransformFailure(isMutation) {
|
|
276
|
+
console.error(`Session ${this.id}: TransformStatement failed; the statement was not logged`);
|
|
277
|
+
if (this._disposed || !this._fileHandle) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const statementTypes = this.options.statementTypes || 'both';
|
|
281
|
+
if ((statementTypes === 'mutations' && !isMutation) || (statementTypes === 'queries' && isMutation)) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
try {
|
|
285
|
+
await this._fileHandle.writeFile(`${TRANSFORM_FAILED_LINE}\n\n`);
|
|
286
|
+
this._statementCount++;
|
|
287
|
+
this._emittedStatementCount++;
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
console.error(`Session ${this.id}: Error writing to file:`, error);
|
|
291
|
+
throw error;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
240
294
|
/** @deprecated Use {@link LogSqlStatement}. */
|
|
241
295
|
async logSqlStatement(query, parameters, description, isMutation = false, simpleSQLFallback) {
|
|
242
296
|
return this.LogSqlStatement(query, parameters, description, isMutation, simpleSQLFallback);
|
|
@@ -441,4 +495,23 @@ export class SqlLoggingSessionImpl {
|
|
|
441
495
|
return this._dialect.EscapeFlywayStringInterpolation(sql);
|
|
442
496
|
}
|
|
443
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Runs the `TransformStatement` of each session in turn; sessions without one leave the text as is.
|
|
500
|
+
* Returns a fixed placeholder when a transform throws.
|
|
501
|
+
*/
|
|
502
|
+
export function ApplyStatementTransforms(sql, sessions) {
|
|
503
|
+
let result = sql;
|
|
504
|
+
try {
|
|
505
|
+
for (const session of sessions) {
|
|
506
|
+
const transform = session.options.TransformStatement;
|
|
507
|
+
if (transform) {
|
|
508
|
+
result = transform(result);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
catch {
|
|
513
|
+
return TRANSFORM_FAILED_PLACEHOLDER;
|
|
514
|
+
}
|
|
515
|
+
return result;
|
|
516
|
+
}
|
|
444
517
|
//# sourceMappingURL=SqlLogger.js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I,SAAS,EAAE,CAAC;gBACd,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { type EntityInfo, type PlatformSQL, type UserInfo } from '@memberjunction/core';
|
|
2
|
+
import { SQLParser } from '@memberjunction/sql-parser';
|
|
3
|
+
import { type SQLParserDialect } from '@memberjunction/sql-dialect';
|
|
4
|
+
/** A client-supplied SQL fragment: plain text, or a set of per-platform variants. */
|
|
5
|
+
export type ClientClauseText = string | PlatformSQL | null | undefined;
|
|
6
|
+
/** The SQL fragments a RunView request can carry from a client. */
|
|
7
|
+
export interface ClientViewClauseSet {
|
|
8
|
+
ExtraFilter?: ClientClauseText;
|
|
9
|
+
OrderBy?: ClientClauseText;
|
|
10
|
+
OverrideExcludeFilter?: ClientClauseText;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The entity base views a client fragment may read. `Qualified` is keyed by `schema.view`, `Bare`
|
|
14
|
+
* by view name alone; a bare name that exists in more than one schema maps to `null`.
|
|
15
|
+
*/
|
|
16
|
+
export interface EntityBaseViewAllowList {
|
|
17
|
+
Qualified: Map<string, EntityInfo>;
|
|
18
|
+
Bare: Map<string, EntityInfo | null>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A provider that screens client SQL clauses with {@link ClientClauseScreen} against its own
|
|
22
|
+
* entities and dialect. `GenericDatabaseProvider` is one; server code that hands client SQL text
|
|
23
|
+
* to RunView outside the API entry points asks its provider through this.
|
|
24
|
+
*/
|
|
25
|
+
export interface ClientClauseScreeningProvider {
|
|
26
|
+
ScreenClientClause(clause: string | null | undefined, label: string, contextUser?: UserInfo, entityInfo?: EntityInfo): void;
|
|
27
|
+
}
|
|
28
|
+
/** Options for {@link ClientClauseScreen.AssertClauseUsesEntityBaseViews}. */
|
|
29
|
+
export interface ClientClauseScreenOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Leaves text the parser cannot read to the caller instead of refusing it. For a clause the
|
|
32
|
+
* provider checks again per item (an aggregate expression), that per-item check refuses it.
|
|
33
|
+
*/
|
|
34
|
+
LeaveUnparseableToProvider?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** True when `provider` can screen client SQL clauses. */
|
|
37
|
+
export declare function IsClientClauseScreeningProvider(provider: object | null | undefined): provider is ClientClauseScreeningProvider;
|
|
38
|
+
/** One FROM item a parsed statement reads: a table or view, or a table function. */
|
|
39
|
+
export interface StatementRelation {
|
|
40
|
+
/**
|
|
41
|
+
* The schema of the table or function as written, without quotes; empty when unqualified. A
|
|
42
|
+
* three-part name keeps its database (`database.schema`), so it never matches a view in this
|
|
43
|
+
* database.
|
|
44
|
+
*/
|
|
45
|
+
SchemaName: string;
|
|
46
|
+
/** The table or view name without quotes; empty when the item is not a table or view. */
|
|
47
|
+
TableName: string;
|
|
48
|
+
/** The table function's name; empty when the item is not a function call. */
|
|
49
|
+
FunctionName: string;
|
|
50
|
+
/**
|
|
51
|
+
* True when the item names a CTE that is in scope where it is read: an unqualified name that
|
|
52
|
+
* matches, by the dialect's identifier rules, a CTE declared by its own SELECT or an enclosing
|
|
53
|
+
* one. A schema, `dbo` included, always makes the item a real table or view.
|
|
54
|
+
*/
|
|
55
|
+
IsCTEReference: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** What {@link ClientClauseScreen.CollectStatementReads} found in a parse tree. */
|
|
58
|
+
export interface StatementReads {
|
|
59
|
+
/** Every FROM item, repeats included. Derived tables and VALUES lists add none of their own. */
|
|
60
|
+
Relations: StatementRelation[];
|
|
61
|
+
/** The SELECT nodes in the tree, each counted once. */
|
|
62
|
+
SelectCount: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* SECURITY — screens for SQL text that a client (or a client-saved record) supplies to RunView.
|
|
66
|
+
*
|
|
67
|
+
* {@link ClientClauseScreen.AssertClauseUsesEntityBaseViews} is the full screen: one statement,
|
|
68
|
+
* parsed as a read-only fragment, that calls no function the dialect forbids in caller SQL and
|
|
69
|
+
* whose table references are only entity base views the acting user can read unscoped (no row
|
|
70
|
+
* filter and no denied fields). Base tables and system catalogs are refused. Apply it at every
|
|
71
|
+
* point where client text enters RunView: the GraphQL and REST entry points, ad-hoc list sources,
|
|
72
|
+
* and the clauses a saved view stores (at save and when the view runs).
|
|
73
|
+
*
|
|
74
|
+
* {@link ClientClauseScreen.AssertSingleStatementFragment} is the light check the provider runs on
|
|
75
|
+
* every RunView, server-internal ones included: no statement separator and no comment outside a
|
|
76
|
+
* literal or quoted identifier. It cannot refuse a legitimate fragment, so it is safe for callers
|
|
77
|
+
* whose filters the full screen would refuse (base tables, entities the acting user cannot read).
|
|
78
|
+
*
|
|
79
|
+
* Both use dialect-aware lexing, so a quote inside a bracket identifier (`[a']`) or a PostgreSQL
|
|
80
|
+
* `E'\''` string cannot hide a statement the way it hides one from the keyword denylist.
|
|
81
|
+
*/
|
|
82
|
+
export declare class ClientClauseScreen {
|
|
83
|
+
/**
|
|
84
|
+
* Built-in table functions that read only their arguments. A subquery may use one in its FROM
|
|
85
|
+
* when the name is unqualified; a subquery inside its arguments is screened like any other.
|
|
86
|
+
*/
|
|
87
|
+
private static readonly ARGUMENT_ONLY_TABLE_FUNCTIONS;
|
|
88
|
+
private static readonly WRITE_NODE_TYPES;
|
|
89
|
+
/**
|
|
90
|
+
* The parser dialect for a provider: from its `PlatformKey` when it has one, otherwise from its
|
|
91
|
+
* class name. Defaults to SQL Server.
|
|
92
|
+
*/
|
|
93
|
+
static DialectFor(provider?: object | null): SQLParserDialect;
|
|
94
|
+
/**
|
|
95
|
+
* The full screen for one client clause fragment; throws when it refuses. The label `OrderBy`
|
|
96
|
+
* screens the text as an ORDER BY list; any other label screens it as a WHERE predicate. When
|
|
97
|
+
* `user` is given, every entity the fragment reads must be readable by that user, unscoped
|
|
98
|
+
* ({@link AssertUnscopedRead}). That includes the entity the clause filters: a subquery over
|
|
99
|
+
* its base view is outside the row filter RunView applies to the outer query.
|
|
100
|
+
*
|
|
101
|
+
* The reads come from a walk of the whole parse tree ({@link CollectStatementReads}), and the
|
|
102
|
+
* clause is refused when that walk does not account for every SELECT in the text
|
|
103
|
+
* ({@link AssertEverySelectAccountedFor}). Only the parse wrapper's own FROM item is skipped,
|
|
104
|
+
* and no CTE reference is exempt. A name reserved for the parser
|
|
105
|
+
* ({@link AssertNoIdentifierAliasNames}) and a call to a function the dialect forbids
|
|
106
|
+
* ({@link AssertNoForbiddenFunctionCalls}) are refused first.
|
|
107
|
+
*
|
|
108
|
+
* With `LeaveUnparseableToProvider`, text the parser cannot read returns without a refusal;
|
|
109
|
+
* the caller's own per-item check must refuse it instead.
|
|
110
|
+
*/
|
|
111
|
+
static AssertClauseUsesEntityBaseViews(clause: string | null | undefined, label: string, entities: readonly EntityInfo[], dialect: SQLParserDialect, user?: UserInfo, options?: ClientClauseScreenOptions): void;
|
|
112
|
+
/**
|
|
113
|
+
* Applies {@link AssertClauseUsesEntityBaseViews} to every clause of a RunView request. A
|
|
114
|
+
* platform-specific clause has every variant screened, each under its own platform's dialect.
|
|
115
|
+
*/
|
|
116
|
+
static ScreenViewClauses(clauses: ClientViewClauseSet, entities: readonly EntityInfo[], dialect: SQLParserDialect, user?: UserInfo): void;
|
|
117
|
+
/**
|
|
118
|
+
* Refuses a statement separator or a comment outside literals and quoted identifiers. A filter
|
|
119
|
+
* or sort fragment never needs either, so this cannot refuse a legitimate clause.
|
|
120
|
+
*/
|
|
121
|
+
static AssertSingleStatementFragment(clause: string | null | undefined, label: string, dialect: SQLParserDialect): void;
|
|
122
|
+
/**
|
|
123
|
+
* Refuses an identifier, quoted or bare, in the form of a name the SQL parser gives a bracket
|
|
124
|
+
* identifier it renames ({@link SQLParser.IsIdentifierAliasName}), in any case. Those names are
|
|
125
|
+
* reserved for the parser, so client SQL may not use them.
|
|
126
|
+
*/
|
|
127
|
+
static AssertNoIdentifierAliasNames(sql: string, dialect: SQLParserDialect, label: string): void;
|
|
128
|
+
/**
|
|
129
|
+
* Refuses a call to a function the dialect forbids in caller-supplied SQL
|
|
130
|
+
* ({@link SQLParserDialect.CallerSQLForbiddenFunctions}). Such a function runs SQL given as a
|
|
131
|
+
* string, reads files or other databases, acts on the server, or pauses the query, so the
|
|
132
|
+
* table check cannot see what it reads.
|
|
133
|
+
*/
|
|
134
|
+
static AssertNoForbiddenFunctionCalls(sql: string, dialect: SQLParserDialect, label: string): void;
|
|
135
|
+
/** True when a parsed AST contains a write or DDL node at any depth. */
|
|
136
|
+
static AstContainsWriteNode(node: unknown): boolean;
|
|
137
|
+
/** Removes the bracket, double-quote or backtick quoting around one identifier. */
|
|
138
|
+
static StripIdentifierQuotes(name: string | null | undefined): string;
|
|
139
|
+
/** True for a reference written with no schema. A schema, `dbo` included, is matched as written. */
|
|
140
|
+
static IsUnqualifiedSchema(schema: string): boolean;
|
|
141
|
+
/** Builds the base-view allow-list for a set of entities. */
|
|
142
|
+
static BuildEntityBaseViewAllowList(entities: readonly EntityInfo[]): EntityBaseViewAllowList;
|
|
143
|
+
/**
|
|
144
|
+
* Resolves a table reference against the allow-list and returns its entity; throws when it is
|
|
145
|
+
* not an entity base view, or when `user` is given and lacks CanRead on that entity.
|
|
146
|
+
*
|
|
147
|
+
* A schema-qualified reference, `dbo` included, must match an entity in that exact schema. An
|
|
148
|
+
* unqualified one resolves only when the view name is unique across schemas, because the
|
|
149
|
+
* database's default-schema resolution, not this screen, would pick which view runs.
|
|
150
|
+
*/
|
|
151
|
+
static AssertTableRefReadable(allowed: EntityBaseViewAllowList, schema: string, table: string, label: string, user?: UserInfo): EntityInfo;
|
|
152
|
+
/**
|
|
153
|
+
* Refuses an entity whose read `user` holds under a row filter (role row-level security or an
|
|
154
|
+
* API-key row filter) or with denied fields. SQL that reads the entity's base view directly, such
|
|
155
|
+
* as a subquery in a client clause or an ad-hoc query, applies neither; RunView on that entity
|
|
156
|
+
* does. For any other entity, a granted read covers every row and field of its base view.
|
|
157
|
+
*/
|
|
158
|
+
static AssertUnscopedRead(entity: EntityInfo, user: UserInfo, label: string): void;
|
|
159
|
+
/**
|
|
160
|
+
* Every FROM item in a parsed statement, and the number of SELECT nodes. The walk visits every
|
|
161
|
+
* property of every node, so it finds a FROM list wherever the grammar puts one: a subquery in a
|
|
162
|
+
* CASE branch, HAVING, a window's ORDER BY or PARTITION BY, a function argument, IN, EXISTS, a
|
|
163
|
+
* set operation or a CTE body. Every FROM item is kept, even when its alias repeats. Names the
|
|
164
|
+
* fallback parse renamed are read back through {@link SQLParser.IdentifierAliases}, which holds
|
|
165
|
+
* only names the parser put in the tree. `skip` is a FROM item node to leave out (the screen's
|
|
166
|
+
* parse wrapper).
|
|
167
|
+
*
|
|
168
|
+
* Each FROM item records whether it reads a CTE in scope there
|
|
169
|
+
* ({@link StatementRelation.IsCTEReference}). A WITH covers its own SELECT, everything below it,
|
|
170
|
+
* and the following set-operation branches unless its SELECT is a parenthesized branch. A CTE
|
|
171
|
+
* body sees the CTEs before it, itself on SQL Server, and every CTE of a PostgreSQL WITH
|
|
172
|
+
* RECURSIVE list. Names match by the dialect's identifier rules ({@link cteNameRules}). The walk
|
|
173
|
+
* keeps a count of the CTEs of each name in scope as it goes, so its time is linear in the tree.
|
|
174
|
+
*/
|
|
175
|
+
static CollectStatementReads(parser: SQLParser, skip?: object): StatementReads;
|
|
176
|
+
/**
|
|
177
|
+
* Refuses SQL whose SELECT keywords, outside literals, quoted identifiers and comments, differ
|
|
178
|
+
* in number from the SELECT nodes a walk of its parse tree found. A subquery the walk cannot
|
|
179
|
+
* see would otherwise go unchecked, so a mismatch fails closed.
|
|
180
|
+
*/
|
|
181
|
+
static AssertEverySelectAccountedFor(sql: string, dialect: SQLParserDialect, reads: StatementReads, label: string): void;
|
|
182
|
+
/**
|
|
183
|
+
* The entity one FROM item reads, or null for an unqualified built-in table function that
|
|
184
|
+
* reads only its arguments. Throws for any other function or row source, and when
|
|
185
|
+
* {@link AssertTableRefReadable} refuses a table name.
|
|
186
|
+
*/
|
|
187
|
+
static AssertRelationReadable(allowed: EntityBaseViewAllowList, relation: StatementRelation, label: string, user?: UserInfo): EntityInfo | null;
|
|
188
|
+
/** Visits one node of the parse tree. */
|
|
189
|
+
private static visitNode;
|
|
190
|
+
/**
|
|
191
|
+
* Visits a SELECT node: counts it, adds its FROM items, and visits its CTE bodies and every
|
|
192
|
+
* other property with the CTE names each one can see. The CTEs of its WITH are in scope from
|
|
193
|
+
* their place in the list until the walk leaves the SELECT.
|
|
194
|
+
*/
|
|
195
|
+
private static visitSelect;
|
|
196
|
+
/**
|
|
197
|
+
* Visits the bodies of one WITH list, whose CTE names are `declared`. Body `i` sees the CTEs
|
|
198
|
+
* before it, itself too on SQL Server, and every CTE of a RECURSIVE list. Each CTE comes into
|
|
199
|
+
* scope once, at its place in the list, and all of them are in scope afterwards.
|
|
200
|
+
*/
|
|
201
|
+
private static visitCTEBodies;
|
|
202
|
+
/** Adds the relation each FROM item names, marking an unqualified reference to a CTE in scope. */
|
|
203
|
+
private static addFromItems;
|
|
204
|
+
/** Brings each readable name among `names` into scope once more. */
|
|
205
|
+
private static enterScope;
|
|
206
|
+
/** Takes each readable name among `names` out of scope once. */
|
|
207
|
+
private static leaveScope;
|
|
208
|
+
/**
|
|
209
|
+
* Adds `delta` to the in-scope count of `name` when it is readable. A count that drops to zero
|
|
210
|
+
* stays in the map: in V8, each delete of a key leaves an entry that later lookups of that key
|
|
211
|
+
* step over until the map is rebuilt.
|
|
212
|
+
*/
|
|
213
|
+
private static countName;
|
|
214
|
+
/** The name node of one item of a `with` list. */
|
|
215
|
+
private static cteNameNode;
|
|
216
|
+
/** True for the item of a `with` list that carries RECURSIVE (the parser marks the first). */
|
|
217
|
+
private static isRecursiveCTE;
|
|
218
|
+
/**
|
|
219
|
+
* How the parser's dialect matches a FROM item to a CTE. SQL Server ignores case, and a CTE
|
|
220
|
+
* body reads its own CTE. PostgreSQL folds an unquoted name to lower case and matches a quoted
|
|
221
|
+
* one exactly ({@link postgresNameRules}). A dialect that quotes identifiers any other way
|
|
222
|
+
* matches no CTE.
|
|
223
|
+
*/
|
|
224
|
+
private static cteNameRules;
|
|
225
|
+
/**
|
|
226
|
+
* PostgreSQL's CTE name rules. A CTE name node says whether it was quoted. A FROM item's name
|
|
227
|
+
* does not, so its quoting comes from the SQL's tokens: a name with upper-case letters that the
|
|
228
|
+
* SQL writes only quoted is exact, one it writes only unquoted folds to lower case, and one it
|
|
229
|
+
* writes both ways, or not as a token at all, matches no CTE.
|
|
230
|
+
*/
|
|
231
|
+
private static postgresNameRules;
|
|
232
|
+
/** `text` with ASCII upper-case letters in lower case: PostgreSQL's folding of an unquoted name. */
|
|
233
|
+
private static asciiLower;
|
|
234
|
+
/**
|
|
235
|
+
* The relation one FROM item names. A derived table and a VALUES list name none; the walk
|
|
236
|
+
* reaches any subquery inside them.
|
|
237
|
+
*/
|
|
238
|
+
private static relationOf;
|
|
239
|
+
/** The relation a table function names. Leading name parts join the schema, so a qualified name never matches a built-in. */
|
|
240
|
+
private static functionRelation;
|
|
241
|
+
/**
|
|
242
|
+
* The text of an identifier node (a string, or the PostgreSQL grammar's `{ value }` node), with
|
|
243
|
+
* a name the fallback parse renamed read back from `aliases`; empty when unreadable.
|
|
244
|
+
*/
|
|
245
|
+
private static identifierText;
|
|
246
|
+
/** The FROM item of the screen's parse wrapper: the root statement's only FROM item, when it is `__mj_clause_screen`. */
|
|
247
|
+
private static wrapperFromItem;
|
|
248
|
+
/** The text variants of one clause; a platform-specific clause yields each of its variants. */
|
|
249
|
+
private static clauseVariants;
|
|
250
|
+
/**
|
|
251
|
+
* The clause with T-SQL bracket identifiers in the dialect's own quoting, for a dialect that
|
|
252
|
+
* does not quote with brackets. The PostgreSQL provider accepts `[Name]` in a client clause and
|
|
253
|
+
* converts it the same way before running it (`PostgreSQLDataProvider.quoteIdentifiersInSQL`).
|
|
254
|
+
* Only a bracket around a plain name changes; any other bracket stays as written, and the
|
|
255
|
+
* grammar refuses it.
|
|
256
|
+
*/
|
|
257
|
+
private static toDialectQuoting;
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=clientClauseScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientClauseScreen.d.ts","sourceRoot":"","sources":["../src/clientClauseScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAoE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACzH,OAAO,EAAuC,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEzG,qFAAqF;AACrF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvE,mEAAmE;AACnE,MAAM,WAAW,mBAAmB;IAChC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACnC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC,CAAC;CACxC;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC1C,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/H;AAED,8EAA8E;AAC9E,MAAM,WAAW,yBAAyB;IACtC;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CA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