@docstack/client 0.0.1 → 0.0.3
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/lib/core/attribute.d.ts +4 -4
- package/lib/core/class.d.ts +13 -12
- package/lib/core/crypto-engine/index.d.ts +5 -5
- package/lib/core/query-engine/executor.d.ts +1 -1
- package/lib/core/query-engine/index.d.ts +3 -3
- package/lib/core/stack.d.ts +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7530 -7536
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +8256 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +11 -4
- package/lib/core/attribute.js +0 -296
- package/lib/core/attribute.js.map +0 -1
- package/lib/core/class.js +0 -540
- package/lib/core/class.js.map +0 -1
- package/lib/core/crypto-engine/index.js +0 -130
- package/lib/core/crypto-engine/index.js.map +0 -1
- package/lib/core/crypto-engine/utils.js +0 -76
- package/lib/core/crypto-engine/utils.js.map +0 -1
- package/lib/core/datamodel/index.js +0 -1186
- package/lib/core/datamodel/index.js.map +0 -1
- package/lib/core/domain.js +0 -285
- package/lib/core/domain.js.map +0 -1
- package/lib/core/index.js +0 -379
- package/lib/core/index.js.map +0 -1
- package/lib/core/job-engine/index.js +0 -116
- package/lib/core/job-engine/index.js.map +0 -1
- package/lib/core/policy-engine/index.js +0 -150
- package/lib/core/policy-engine/index.js.map +0 -1
- package/lib/core/query-engine/accumulators.js +0 -258
- package/lib/core/query-engine/accumulators.js.map +0 -1
- package/lib/core/query-engine/evaluator.js +0 -179
- package/lib/core/query-engine/evaluator.js.map +0 -1
- package/lib/core/query-engine/executor.js +0 -405
- package/lib/core/query-engine/executor.js.map +0 -1
- package/lib/core/query-engine/index.js +0 -4
- package/lib/core/query-engine/index.js.map +0 -1
- package/lib/core/query-engine/parser.js +0 -515
- package/lib/core/query-engine/parser.js.map +0 -1
- package/lib/core/query-engine/planner.js +0 -330
- package/lib/core/query-engine/planner.js.map +0 -1
- package/lib/core/stack.js +0 -1507
- package/lib/core/stack.js.map +0 -1
- package/lib/core/test-utils/docstack.js +0 -222
- package/lib/core/test-utils/docstack.js.map +0 -1
- package/lib/core/trigger/index.js +0 -81
- package/lib/core/trigger/index.js.map +0 -1
- package/lib/plugins/pouchdb.js +0 -403
- package/lib/plugins/pouchdb.js.map +0 -1
- package/lib/utils/crypto/index.js +0 -34
- package/lib/utils/crypto/index.js.map +0 -1
- package/lib/utils/index.js +0 -58
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/logger/index.js +0 -20
- package/lib/utils/logger/index.js.map +0 -1
- package/lib/utils/logger/transport.js +0 -28
- package/lib/utils/logger/transport.js.map +0 -1
- package/lib/workers/dataModel.js +0 -48
- package/lib/workers/dataModel.js.map +0 -1
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
// A SQL parser built with a scanner and a registry of pluggable clause handlers.
|
|
3
|
-
// This approach is more robust and extensible than regex-based string splitting.
|
|
4
|
-
// ---------- Scanner (cursor) ----------
|
|
5
|
-
class Scanner {
|
|
6
|
-
constructor(text, pos = 0) {
|
|
7
|
-
this.text = text;
|
|
8
|
-
this.pos = pos;
|
|
9
|
-
}
|
|
10
|
-
eof() { return this.pos >= this.text.length; }
|
|
11
|
-
rest() { return this.text.slice(this.pos); }
|
|
12
|
-
skipWSAndComments() {
|
|
13
|
-
while (!this.eof()) {
|
|
14
|
-
const char = this.peekChar();
|
|
15
|
-
if (/\s/.test(char)) {
|
|
16
|
-
this.pos++;
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
if (char === '-' && this.peekChar(1) === '-') {
|
|
20
|
-
while (!this.eof() && this.peekChar() !== '\n')
|
|
21
|
-
this.pos++;
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
peekChar(offset = 0) {
|
|
28
|
-
const i = this.pos + offset;
|
|
29
|
-
return i < this.text.length ? this.text[i] : '';
|
|
30
|
-
}
|
|
31
|
-
peekKW(kw) {
|
|
32
|
-
this.skipWSAndComments();
|
|
33
|
-
const len = kw.length;
|
|
34
|
-
if (this.text.substr(this.pos, len).toUpperCase() !== kw.toUpperCase())
|
|
35
|
-
return false;
|
|
36
|
-
const next = this.text[this.pos + len] || '';
|
|
37
|
-
// Keyword boundary rule: next char must not be part of an identifier
|
|
38
|
-
if (/[A-Za-z0-9_]/.test(next))
|
|
39
|
-
return false;
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
tryKW(kw) {
|
|
43
|
-
if (!this.peekKW(kw))
|
|
44
|
-
return false;
|
|
45
|
-
this.pos += kw.length;
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
expectKW(kw, msg = `Expected '${kw}'`) {
|
|
49
|
-
if (!this.tryKW(kw))
|
|
50
|
-
throw new Error(msg + ` at position ${this.pos}`);
|
|
51
|
-
}
|
|
52
|
-
matchRe(re) {
|
|
53
|
-
this.skipWSAndComments();
|
|
54
|
-
const m = this.rest().match(re);
|
|
55
|
-
if (!m || m.index !== 0)
|
|
56
|
-
return null;
|
|
57
|
-
return m;
|
|
58
|
-
}
|
|
59
|
-
consumeRe(re, msg) {
|
|
60
|
-
const m = this.matchRe(re);
|
|
61
|
-
if (!m)
|
|
62
|
-
throw new Error(msg + ` at position ${this.pos}`);
|
|
63
|
-
this.pos += m[0].length;
|
|
64
|
-
return m;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// ---------- Helper parsers ----------
|
|
68
|
-
function parseIdentifier(scan) {
|
|
69
|
-
scan.skipWSAndComments();
|
|
70
|
-
if (scan.peekChar() === '"') {
|
|
71
|
-
scan.pos++;
|
|
72
|
-
let value = '';
|
|
73
|
-
while (!scan.eof()) {
|
|
74
|
-
const char = scan.peekChar();
|
|
75
|
-
scan.pos++;
|
|
76
|
-
if (char === '"') {
|
|
77
|
-
// Support escaped double quotes by doubling them: "".
|
|
78
|
-
if (scan.peekChar() === '"') {
|
|
79
|
-
value += '"';
|
|
80
|
-
scan.pos++;
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
return value;
|
|
84
|
-
}
|
|
85
|
-
value += char;
|
|
86
|
-
}
|
|
87
|
-
throw new Error('Unterminated quoted identifier');
|
|
88
|
-
}
|
|
89
|
-
const match = scan.consumeRe(/^[a-zA-Z_][a-zA-Z0-9_]*/, 'Expected identifier');
|
|
90
|
-
return match[0];
|
|
91
|
-
}
|
|
92
|
-
function parseColumnExpr(scan) {
|
|
93
|
-
scan.skipWSAndComments();
|
|
94
|
-
const char = scan.peekChar();
|
|
95
|
-
if (char === '*') {
|
|
96
|
-
scan.pos++;
|
|
97
|
-
return { type: 'star' };
|
|
98
|
-
}
|
|
99
|
-
if (char === '1') { // Hack for `SELECT 1` in EXISTS
|
|
100
|
-
scan.pos++;
|
|
101
|
-
return { type: 'literal', value: 1 };
|
|
102
|
-
}
|
|
103
|
-
const part1 = parseIdentifier(scan);
|
|
104
|
-
scan.skipWSAndComments();
|
|
105
|
-
if (scan.peekChar() === '.') {
|
|
106
|
-
scan.pos++;
|
|
107
|
-
const part2 = parseIdentifier(scan);
|
|
108
|
-
return { type: 'column_ref', table: part1, column: part2 };
|
|
109
|
-
}
|
|
110
|
-
return { type: 'column_ref', table: null, column: part1 };
|
|
111
|
-
}
|
|
112
|
-
function parseExpression(scan) {
|
|
113
|
-
scan.skipWSAndComments();
|
|
114
|
-
const startPos = scan.pos;
|
|
115
|
-
// Check for scalar subquery `(SELECT ...)`
|
|
116
|
-
if (scan.peekChar() === '(') {
|
|
117
|
-
const tempScan = new Scanner(scan.text, scan.pos + 1);
|
|
118
|
-
if (tempScan.peekKW('SELECT')) {
|
|
119
|
-
scan.consumeRe(/^\s*\(/, 'Expected (');
|
|
120
|
-
const subqueryAst = parseSingleSelect(scan);
|
|
121
|
-
scan.consumeRe(/^\s*\)/, 'Expected )');
|
|
122
|
-
return { type: 'scalar_subquery', ast: subqueryAst };
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
const identMatch = scan.matchRe(/^[a-zA-Z_][a-zA-Z0-9_]*/);
|
|
126
|
-
if (identMatch) {
|
|
127
|
-
const afterIdentPos = scan.pos + identMatch[0].length;
|
|
128
|
-
const tempScanner = new Scanner(scan.text, afterIdentPos);
|
|
129
|
-
tempScanner.skipWSAndComments();
|
|
130
|
-
if (tempScanner.peekChar() === '(') {
|
|
131
|
-
// Confirmed function call
|
|
132
|
-
const name = identMatch[0].toUpperCase();
|
|
133
|
-
scan.pos = afterIdentPos;
|
|
134
|
-
scan.consumeRe(/^\s*\(/, 'Expected (');
|
|
135
|
-
const distinct = scan.tryKW('DISTINCT');
|
|
136
|
-
const argExpr = parseColumnExpr(scan);
|
|
137
|
-
scan.consumeRe(/^\s*\)/, 'Expected )');
|
|
138
|
-
return {
|
|
139
|
-
type: 'aggr_func',
|
|
140
|
-
name,
|
|
141
|
-
args: { expr: argExpr, distinct }
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
scan.pos = startPos;
|
|
146
|
-
return parseColumnExpr(scan);
|
|
147
|
-
}
|
|
148
|
-
function parsePredicate(scan) {
|
|
149
|
-
scan.skipWSAndComments();
|
|
150
|
-
let not = false;
|
|
151
|
-
if (scan.tryKW('NOT')) {
|
|
152
|
-
not = true;
|
|
153
|
-
}
|
|
154
|
-
if (scan.tryKW('EXISTS')) {
|
|
155
|
-
scan.consumeRe(/^\s*\(/, 'Expected (');
|
|
156
|
-
const subqueryAst = parseSingleSelect(scan);
|
|
157
|
-
scan.consumeRe(/^\s*\)/, 'Expected )');
|
|
158
|
-
return { type: 'exists_expr', subquery: subqueryAst, not };
|
|
159
|
-
}
|
|
160
|
-
if (not) {
|
|
161
|
-
// "NOT" was consumed but it wasn't "NOT EXISTS". This could be "NOT IN" or a syntax error.
|
|
162
|
-
// We put it back and let the binary expression parser handle it.
|
|
163
|
-
scan.pos -= 3;
|
|
164
|
-
}
|
|
165
|
-
const left = parseExpression(scan);
|
|
166
|
-
scan.skipWSAndComments();
|
|
167
|
-
const opMatch = scan.matchRe(/^(>=|<=|>|<|=|IN|NOT\s+IN)/i);
|
|
168
|
-
if (!opMatch)
|
|
169
|
-
throw new Error(`Expected binary operator at position ${scan.pos}`);
|
|
170
|
-
const operator = opMatch[0].trim().toUpperCase();
|
|
171
|
-
scan.pos += opMatch[0].length;
|
|
172
|
-
scan.skipWSAndComments();
|
|
173
|
-
let right;
|
|
174
|
-
if (operator === 'IN' || operator === 'NOT IN') {
|
|
175
|
-
if (scan.peekChar() === '(') {
|
|
176
|
-
scan.consumeRe(/^\s*\(/, 'Expected (');
|
|
177
|
-
scan.skipWSAndComments();
|
|
178
|
-
if (scan.peekKW('SELECT')) {
|
|
179
|
-
right = { type: 'subquery', ast: parseSingleSelect(scan) };
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
throw new Error('Value lists for IN are not supported. Use subquery or array column ref.');
|
|
183
|
-
}
|
|
184
|
-
scan.consumeRe(/^\s*\)/, 'Expected )');
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
// This handles the `a._id IN m.actors` case where actors is a column ref to an array
|
|
188
|
-
right = parseColumnExpr(scan);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
const valMatch = scan.matchRe(/^[0-9]+(\.[0-9]+)?/);
|
|
193
|
-
if (valMatch) {
|
|
194
|
-
scan.pos += valMatch[0].length;
|
|
195
|
-
right = { type: 'param', value: valMatch[0] };
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// Handle right side being a column expression
|
|
199
|
-
right = parseExpression(scan);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
// A real parser would build a proper expression tree for multiple AND/ORs.
|
|
203
|
-
// For now, we assume a single predicate or predicates joined by AND, which we'll handle by pushing to a list.
|
|
204
|
-
const predicate = { type: 'binary_expr', operator, left, right };
|
|
205
|
-
if (scan.tryKW('AND')) {
|
|
206
|
-
return { type: 'and', left: predicate, right: parsePredicate(scan) };
|
|
207
|
-
}
|
|
208
|
-
return predicate;
|
|
209
|
-
}
|
|
210
|
-
function parseSelectItem(scan) {
|
|
211
|
-
const expr = parseExpression(scan);
|
|
212
|
-
let alias = null;
|
|
213
|
-
if (scan.tryKW('AS')) {
|
|
214
|
-
alias = parseIdentifier(scan);
|
|
215
|
-
}
|
|
216
|
-
return { expr, as: alias };
|
|
217
|
-
}
|
|
218
|
-
function parseSingleFrom(scan) {
|
|
219
|
-
const table = parseIdentifier(scan);
|
|
220
|
-
scan.skipWSAndComments();
|
|
221
|
-
let alias = null;
|
|
222
|
-
if (scan.tryKW('AS')) {
|
|
223
|
-
alias = parseIdentifier(scan);
|
|
224
|
-
}
|
|
225
|
-
else if (scan.peekChar() === '"') {
|
|
226
|
-
alias = parseIdentifier(scan);
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
const aliasMatch = scan.matchRe(/^[a-zA-Z_][a-zA-Z0-9_]*/);
|
|
230
|
-
if (aliasMatch) {
|
|
231
|
-
const tempScanner = new Scanner(scan.text, scan.pos + aliasMatch[0].length);
|
|
232
|
-
const isReservedWord = ['JOIN', 'WHERE', 'GROUP', 'ORDER', 'LIMIT', 'HAVING', 'ON', 'AS'].some(kw => tempScanner.peekKW(kw));
|
|
233
|
-
if (!isReservedWord) {
|
|
234
|
-
scan.pos += aliasMatch[0].length;
|
|
235
|
-
alias = aliasMatch[0];
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return { table, as: alias || table };
|
|
240
|
-
}
|
|
241
|
-
function parseSingleSelect(scan) {
|
|
242
|
-
const ast = {
|
|
243
|
-
type: 'select', distinct: false, columns: [], from: [], joins: [],
|
|
244
|
-
where: null, groupBy: null, having: null, orderBy: null, limit: null
|
|
245
|
-
};
|
|
246
|
-
const ctx = { scan, ast };
|
|
247
|
-
if (!SelectHandler.canStart(ctx))
|
|
248
|
-
throw new Error('Expected SELECT in subquery');
|
|
249
|
-
SelectHandler.parse(ctx);
|
|
250
|
-
if (FromHandler.canStart(ctx))
|
|
251
|
-
FromHandler.parse(ctx);
|
|
252
|
-
else
|
|
253
|
-
throw new Error('Subquery must have a FROM clause.');
|
|
254
|
-
while (JoinHandler.canStart(ctx))
|
|
255
|
-
JoinHandler.parse(ctx);
|
|
256
|
-
if (WhereHandler.canStart(ctx))
|
|
257
|
-
WhereHandler.parse(ctx);
|
|
258
|
-
if (GroupByHandler.canStart(ctx))
|
|
259
|
-
GroupByHandler.parse(ctx);
|
|
260
|
-
if (HavingHandler.canStart(ctx))
|
|
261
|
-
HavingHandler.parse(ctx);
|
|
262
|
-
if (OrderByHandler.canStart(ctx))
|
|
263
|
-
OrderByHandler.parse(ctx);
|
|
264
|
-
if (LimitHandler.canStart(ctx))
|
|
265
|
-
LimitHandler.parse(ctx);
|
|
266
|
-
return ast;
|
|
267
|
-
}
|
|
268
|
-
// ---------- Registry ----------
|
|
269
|
-
class ClauseRegistry {
|
|
270
|
-
constructor() {
|
|
271
|
-
this.handlers = [];
|
|
272
|
-
}
|
|
273
|
-
register(h) { this.handlers.push(h); }
|
|
274
|
-
get(id) { return this.handlers.find(h => h.id === id); }
|
|
275
|
-
}
|
|
276
|
-
// ---------- Concrete handlers ----------
|
|
277
|
-
const SelectHandler = {
|
|
278
|
-
id: 'SELECT',
|
|
279
|
-
canStart: ({ scan }) => scan.peekKW('SELECT'),
|
|
280
|
-
parse: ({ scan, ast }) => {
|
|
281
|
-
scan.expectKW('SELECT');
|
|
282
|
-
if (scan.tryKW('DISTINCT')) {
|
|
283
|
-
ast.distinct = true;
|
|
284
|
-
if (scan.tryKW('ON')) {
|
|
285
|
-
scan.consumeRe(/^\s*\(/, 'Expected ( after DISTINCT ON');
|
|
286
|
-
const distinctExprs = [];
|
|
287
|
-
while (!scan.eof()) {
|
|
288
|
-
distinctExprs.push(parseColumnExpr(scan));
|
|
289
|
-
if (!scan.tryKW(','))
|
|
290
|
-
break;
|
|
291
|
-
}
|
|
292
|
-
scan.consumeRe(/^\s*\)/, 'Expected ) after DISTINCT ON expressions');
|
|
293
|
-
ast.distinctOn = distinctExprs;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
const cols = [];
|
|
297
|
-
while (!scan.eof()) {
|
|
298
|
-
scan.skipWSAndComments();
|
|
299
|
-
if (scan.peekKW('FROM'))
|
|
300
|
-
break;
|
|
301
|
-
cols.push(parseSelectItem(scan));
|
|
302
|
-
if (!scan.tryKW(','))
|
|
303
|
-
break;
|
|
304
|
-
}
|
|
305
|
-
ast.columns = cols;
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
const FromHandler = {
|
|
309
|
-
id: 'FROM',
|
|
310
|
-
canStart: ({ scan }) => scan.peekKW('FROM'),
|
|
311
|
-
parse: ({ scan, ast }) => {
|
|
312
|
-
scan.expectKW('FROM');
|
|
313
|
-
ast.from = [parseSingleFrom(scan)];
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
const JoinHandler = {
|
|
317
|
-
id: 'JOIN',
|
|
318
|
-
repeatable: true,
|
|
319
|
-
canStart: ({ scan }) => {
|
|
320
|
-
const save = scan.pos;
|
|
321
|
-
scan.skipWSAndComments();
|
|
322
|
-
scan.tryKW('LEFT') || scan.tryKW('RIGHT') || scan.tryKW('INNER');
|
|
323
|
-
const ok = scan.peekKW('JOIN');
|
|
324
|
-
scan.pos = save;
|
|
325
|
-
return ok;
|
|
326
|
-
},
|
|
327
|
-
parse: ({ scan, ast }) => {
|
|
328
|
-
let joinType = 'INNER';
|
|
329
|
-
if (scan.tryKW('LEFT'))
|
|
330
|
-
joinType = 'LEFT';
|
|
331
|
-
else if (scan.tryKW('RIGHT'))
|
|
332
|
-
joinType = 'RIGHT';
|
|
333
|
-
else
|
|
334
|
-
scan.tryKW('INNER');
|
|
335
|
-
scan.expectKW('JOIN');
|
|
336
|
-
const fromPart = parseSingleFrom(scan);
|
|
337
|
-
scan.expectKW('ON');
|
|
338
|
-
const onCondition = parsePredicate(scan);
|
|
339
|
-
ast.joins.push({ type: joinType, table: fromPart.table, as: fromPart.as, on: onCondition });
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
const WhereHandler = {
|
|
343
|
-
id: 'WHERE',
|
|
344
|
-
canStart: ({ scan }) => scan.peekKW('WHERE'),
|
|
345
|
-
parse: ({ scan, ast }) => {
|
|
346
|
-
scan.expectKW('WHERE');
|
|
347
|
-
ast.where = parsePredicate(scan);
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
const GroupByHandler = {
|
|
351
|
-
id: 'GROUP BY',
|
|
352
|
-
canStart: ({ scan }) => scan.peekKW('GROUP'),
|
|
353
|
-
parse: ({ scan, ast }) => {
|
|
354
|
-
scan.expectKW('GROUP');
|
|
355
|
-
scan.expectKW('BY');
|
|
356
|
-
const cols = [];
|
|
357
|
-
while (true) {
|
|
358
|
-
cols.push(parseColumnExpr(scan));
|
|
359
|
-
if (!scan.tryKW(','))
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
ast.groupBy = { type: 'group_by', columns: cols };
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
const HavingHandler = {
|
|
366
|
-
id: 'HAVING',
|
|
367
|
-
canStart: ({ scan }) => scan.peekKW('HAVING'),
|
|
368
|
-
parse: ({ scan, ast }) => {
|
|
369
|
-
scan.expectKW('HAVING');
|
|
370
|
-
ast.having = parsePredicate(scan);
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
const OrderByHandler = {
|
|
374
|
-
id: 'ORDER BY',
|
|
375
|
-
canStart: ({ scan }) => scan.peekKW('ORDER'),
|
|
376
|
-
parse: ({ scan, ast }) => {
|
|
377
|
-
scan.expectKW('ORDER');
|
|
378
|
-
scan.expectKW('BY');
|
|
379
|
-
const items = [];
|
|
380
|
-
while (true) {
|
|
381
|
-
const expr = parseColumnExpr(scan);
|
|
382
|
-
let order = 'ASC';
|
|
383
|
-
if (scan.tryKW('DESC'))
|
|
384
|
-
order = 'DESC';
|
|
385
|
-
else
|
|
386
|
-
scan.tryKW('ASC');
|
|
387
|
-
items.push({ expr, order });
|
|
388
|
-
if (!scan.tryKW(','))
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
ast.orderBy = items;
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
const LimitHandler = {
|
|
395
|
-
id: 'LIMIT',
|
|
396
|
-
canStart: ({ scan }) => scan.peekKW('LIMIT'),
|
|
397
|
-
parse: ({ scan, ast }) => {
|
|
398
|
-
scan.expectKW('LIMIT');
|
|
399
|
-
const m = scan.consumeRe(/^\s*\d+/, 'Expected integer after LIMIT');
|
|
400
|
-
ast.limit = parseInt(m[0], 10);
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
const UnionHandler = {
|
|
404
|
-
id: 'UNION',
|
|
405
|
-
canStart: ({ scan }) => scan.peekKW('UNION'),
|
|
406
|
-
parse: ({ scan, astList, setAST }) => {
|
|
407
|
-
scan.expectKW('UNION');
|
|
408
|
-
const isAll = scan.tryKW('ALL');
|
|
409
|
-
const topIndex = astList.length - 1;
|
|
410
|
-
// The union AST will be at astList.length.
|
|
411
|
-
// The next select AST will be at astList.length + 1.
|
|
412
|
-
const bottomIndex = astList.length + 1;
|
|
413
|
-
astList.push({
|
|
414
|
-
type: 'union',
|
|
415
|
-
distinct: !isAll,
|
|
416
|
-
top: topIndex,
|
|
417
|
-
bottom: bottomIndex,
|
|
418
|
-
});
|
|
419
|
-
// As requested, reset the main AST object to prepare for the next SELECT statement.
|
|
420
|
-
setAST({
|
|
421
|
-
type: 'select', distinct: false, columns: [], from: [], joins: [],
|
|
422
|
-
where: null, groupBy: null, having: null, orderBy: null, limit: null
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
// ---------- Driver ----------
|
|
427
|
-
const registry = new ClauseRegistry();
|
|
428
|
-
registry.register(SelectHandler);
|
|
429
|
-
registry.register(FromHandler);
|
|
430
|
-
registry.register(JoinHandler);
|
|
431
|
-
registry.register(WhereHandler);
|
|
432
|
-
registry.register(GroupByHandler);
|
|
433
|
-
registry.register(HavingHandler);
|
|
434
|
-
registry.register(OrderByHandler);
|
|
435
|
-
registry.register(LimitHandler);
|
|
436
|
-
registry.register(UnionHandler); // Register the union handler
|
|
437
|
-
const SEQUENCE = [
|
|
438
|
-
'SELECT', 'FROM', 'JOIN*',
|
|
439
|
-
'WHERE', 'GROUP BY', 'HAVING', 'ORDER BY',
|
|
440
|
-
'LIMIT',
|
|
441
|
-
];
|
|
442
|
-
/**
|
|
443
|
-
* Parses a SQL SELECT statement into an Abstract Syntax Tree (AST).
|
|
444
|
-
* This parser uses a scanner and a sequence of clause handlers to build the AST
|
|
445
|
-
* in a structured and extensible way. It supports UNION and UNION ALL.
|
|
446
|
-
* @param {string} sql The SQL query string to parse.
|
|
447
|
-
* @returns {(SelectAST | UnionAST)[]} List of ASTs representing the query.
|
|
448
|
-
* @throws {Error} If the SQL syntax is invalid or contains unexpected tokens.
|
|
449
|
-
*/
|
|
450
|
-
export function parse(sql) {
|
|
451
|
-
let text = sql.replace(/[\r\n]+/g, ' ').replace(/\s+/g, ' ').trim();
|
|
452
|
-
if (text.endsWith(';'))
|
|
453
|
-
text = text.slice(0, -1);
|
|
454
|
-
const astList = [];
|
|
455
|
-
const scan = new Scanner(text);
|
|
456
|
-
let ast = {
|
|
457
|
-
type: 'select', distinct: false, columns: [], from: [], joins: [],
|
|
458
|
-
where: null, groupBy: null, having: null, orderBy: null, limit: null
|
|
459
|
-
};
|
|
460
|
-
const ctx = {
|
|
461
|
-
scan,
|
|
462
|
-
get ast() { return ast; },
|
|
463
|
-
setAST: (newAst) => { ast = newAst; },
|
|
464
|
-
astList
|
|
465
|
-
};
|
|
466
|
-
// The main driver loop. It repeatedly parses a full SELECT statement
|
|
467
|
-
// and then checks for a UNION operator to continue.
|
|
468
|
-
while (!scan.eof()) {
|
|
469
|
-
scan.skipWSAndComments();
|
|
470
|
-
if (scan.eof())
|
|
471
|
-
break;
|
|
472
|
-
// Parse one full SELECT statement using the defined sequence of handlers.
|
|
473
|
-
for (const step of SEQUENCE) {
|
|
474
|
-
const repeatable = step.endsWith('*');
|
|
475
|
-
const id = repeatable ? step.slice(0, -1) : step;
|
|
476
|
-
const handler = registry.get(id);
|
|
477
|
-
if (repeatable) {
|
|
478
|
-
while (handler.canStart(ctx))
|
|
479
|
-
handler.parse(ctx);
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
if (handler.canStart(ctx))
|
|
483
|
-
handler.parse(ctx);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
// Validate and store the parsed SELECT AST.
|
|
487
|
-
if (ast.columns.length === 0) {
|
|
488
|
-
if (astList.length > 0) { // After a UNION, a SELECT is mandatory.
|
|
489
|
-
throw new Error('Expected SELECT statement after UNION.');
|
|
490
|
-
}
|
|
491
|
-
// If it's the first statement and it's empty, it might be an empty query string.
|
|
492
|
-
break;
|
|
493
|
-
}
|
|
494
|
-
if (ast.from.length === 0)
|
|
495
|
-
throw new Error('Invalid SQL: Missing FROM clause.');
|
|
496
|
-
astList.push(ast);
|
|
497
|
-
// After a full SELECT statement, check if a UNION follows.
|
|
498
|
-
scan.skipWSAndComments();
|
|
499
|
-
const unionHandler = registry.get('UNION');
|
|
500
|
-
if (unionHandler.canStart(ctx)) {
|
|
501
|
-
// The handler adds the UnionAST and resets the `ast` variable via `setAST`.
|
|
502
|
-
unionHandler.parse(ctx);
|
|
503
|
-
}
|
|
504
|
-
else {
|
|
505
|
-
// No UNION operator, so the query should be complete.
|
|
506
|
-
break;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
scan.skipWSAndComments();
|
|
510
|
-
if (!scan.eof()) {
|
|
511
|
-
throw new Error(`Unexpected token near: "${scan.rest().slice(0, 40)}"`);
|
|
512
|
-
}
|
|
513
|
-
return astList;
|
|
514
|
-
}
|
|
515
|
-
//# sourceMapping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