@dbcube/query-builder 3.0.27 → 3.0.28
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/bun.lockb +0 -0
- package/dist/index.cjs +128 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +128 -136
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -175,30 +175,33 @@ var Table = class _Table {
|
|
|
175
175
|
* console.log(users); // [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }]
|
|
176
176
|
*/
|
|
177
177
|
select(fields = []) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
const clone = this.clone();
|
|
179
|
+
clone.dml.type = "select";
|
|
180
|
+
clone.dml.columns = fields.length > 0 ? fields : ["*"];
|
|
181
|
+
return clone;
|
|
181
182
|
}
|
|
182
183
|
where(column, operator, value) {
|
|
183
|
-
this.
|
|
184
|
+
const clone = this.clone();
|
|
185
|
+
clone.dml.where.push({
|
|
184
186
|
column,
|
|
185
187
|
operator,
|
|
186
188
|
value,
|
|
187
|
-
type:
|
|
189
|
+
type: clone.nextType,
|
|
188
190
|
isGroup: false
|
|
189
191
|
});
|
|
190
|
-
|
|
191
|
-
return
|
|
192
|
+
clone.nextType = "AND";
|
|
193
|
+
return clone;
|
|
192
194
|
}
|
|
193
195
|
orWhere(column, operator, value) {
|
|
194
|
-
this.
|
|
196
|
+
const clone = this.clone();
|
|
197
|
+
clone.dml.where.push({
|
|
195
198
|
column,
|
|
196
199
|
operator,
|
|
197
200
|
value,
|
|
198
201
|
type: "OR",
|
|
199
202
|
isGroup: false
|
|
200
203
|
});
|
|
201
|
-
return
|
|
204
|
+
return clone;
|
|
202
205
|
}
|
|
203
206
|
/**
|
|
204
207
|
* Adds a grouped WHERE condition to the query.
|
|
@@ -213,23 +216,26 @@ var Table = class _Table {
|
|
|
213
216
|
* console.log(users); // [{ id: 1, name: 'John', age: 30 }, { id: 2, name: 'Jane', age: 25 }]
|
|
214
217
|
*/
|
|
215
218
|
whereGroup(callback) {
|
|
216
|
-
const
|
|
219
|
+
const clone = this.clone();
|
|
220
|
+
const groupQuery = new _Table(clone.dml.database, clone.dml.table, clone.engine);
|
|
217
221
|
callback(groupQuery);
|
|
218
|
-
|
|
219
|
-
type:
|
|
222
|
+
clone.dml.where.push({
|
|
223
|
+
type: clone.nextType,
|
|
220
224
|
isGroup: true,
|
|
221
225
|
conditions: groupQuery.dml.where
|
|
222
226
|
});
|
|
223
|
-
|
|
224
|
-
return
|
|
227
|
+
clone.nextType = "AND";
|
|
228
|
+
return clone;
|
|
225
229
|
}
|
|
226
230
|
or() {
|
|
227
|
-
|
|
228
|
-
|
|
231
|
+
const clone = this.clone();
|
|
232
|
+
clone.nextType = "OR";
|
|
233
|
+
return clone;
|
|
229
234
|
}
|
|
230
235
|
and() {
|
|
231
|
-
|
|
232
|
-
|
|
236
|
+
const clone = this.clone();
|
|
237
|
+
clone.nextType = "AND";
|
|
238
|
+
return clone;
|
|
233
239
|
}
|
|
234
240
|
/**
|
|
235
241
|
* Adds a WHERE BETWEEN condition to the query.
|
|
@@ -243,18 +249,19 @@ var Table = class _Table {
|
|
|
243
249
|
* console.log(users); // [{ id: 1, name: 'John', age: 30 }, { id: 2, name: 'Jane', age: 25 }]
|
|
244
250
|
*/
|
|
245
251
|
whereBetween(column, values) {
|
|
252
|
+
const clone = this.clone();
|
|
246
253
|
const [value1, value2] = values;
|
|
247
254
|
if (value1 !== void 0 && value2 !== void 0) {
|
|
248
|
-
|
|
255
|
+
clone.dml.where.push({
|
|
249
256
|
column,
|
|
250
257
|
operator: "BETWEEN",
|
|
251
258
|
value: [value1, value2],
|
|
252
|
-
type:
|
|
259
|
+
type: clone.nextType,
|
|
253
260
|
isGroup: false
|
|
254
261
|
});
|
|
255
|
-
|
|
262
|
+
clone.nextType = "AND";
|
|
256
263
|
}
|
|
257
|
-
return
|
|
264
|
+
return clone;
|
|
258
265
|
}
|
|
259
266
|
/**
|
|
260
267
|
* Adds a WHERE IN condition to the query.
|
|
@@ -268,17 +275,18 @@ var Table = class _Table {
|
|
|
268
275
|
* console.log(users); // [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }]
|
|
269
276
|
*/
|
|
270
277
|
whereIn(column, values) {
|
|
278
|
+
const clone = this.clone();
|
|
271
279
|
if (Array.isArray(values) && values.length > 0) {
|
|
272
|
-
|
|
280
|
+
clone.dml.where.push({
|
|
273
281
|
column,
|
|
274
282
|
operator: "IN",
|
|
275
283
|
value: values,
|
|
276
|
-
type:
|
|
284
|
+
type: clone.nextType,
|
|
277
285
|
isGroup: false
|
|
278
286
|
});
|
|
279
|
-
|
|
287
|
+
clone.nextType = "AND";
|
|
280
288
|
}
|
|
281
|
-
return
|
|
289
|
+
return clone;
|
|
282
290
|
}
|
|
283
291
|
/**
|
|
284
292
|
* Adds a WHERE IS NULL condition to the query.
|
|
@@ -291,14 +299,15 @@ var Table = class _Table {
|
|
|
291
299
|
* console.log(users); // [{ id: 3, name: 'Alice', email: null }]
|
|
292
300
|
*/
|
|
293
301
|
whereNull(column) {
|
|
294
|
-
this.
|
|
302
|
+
const clone = this.clone();
|
|
303
|
+
clone.dml.where.push({
|
|
295
304
|
column,
|
|
296
305
|
operator: "IS NULL",
|
|
297
|
-
type:
|
|
306
|
+
type: clone.nextType,
|
|
298
307
|
isGroup: false
|
|
299
308
|
});
|
|
300
|
-
|
|
301
|
-
return
|
|
309
|
+
clone.nextType = "AND";
|
|
310
|
+
return clone;
|
|
302
311
|
}
|
|
303
312
|
/**
|
|
304
313
|
* Adds a WHERE IS NOT NULL condition to the query.
|
|
@@ -311,14 +320,15 @@ var Table = class _Table {
|
|
|
311
320
|
* console.log(users); // [{ id: 1, name: 'John', email: 'john@example.com' }]
|
|
312
321
|
*/
|
|
313
322
|
whereNotNull(column) {
|
|
314
|
-
this.
|
|
323
|
+
const clone = this.clone();
|
|
324
|
+
clone.dml.where.push({
|
|
315
325
|
column,
|
|
316
326
|
operator: "IS NOT NULL",
|
|
317
|
-
type:
|
|
327
|
+
type: clone.nextType,
|
|
318
328
|
isGroup: false
|
|
319
329
|
});
|
|
320
|
-
|
|
321
|
-
return
|
|
330
|
+
clone.nextType = "AND";
|
|
331
|
+
return clone;
|
|
322
332
|
}
|
|
323
333
|
/**
|
|
324
334
|
* Adds a JOIN clause to the query.
|
|
@@ -334,7 +344,8 @@ var Table = class _Table {
|
|
|
334
344
|
* console.log(users); // [{ id: 1, name: 'John', order_id: 101 }]
|
|
335
345
|
*/
|
|
336
346
|
join(table, column1, operator, column2) {
|
|
337
|
-
this.
|
|
347
|
+
const clone = this.clone();
|
|
348
|
+
clone.dml.joins.push({
|
|
338
349
|
type: "INNER",
|
|
339
350
|
table,
|
|
340
351
|
on: {
|
|
@@ -343,7 +354,7 @@ var Table = class _Table {
|
|
|
343
354
|
column2
|
|
344
355
|
}
|
|
345
356
|
});
|
|
346
|
-
return
|
|
357
|
+
return clone;
|
|
347
358
|
}
|
|
348
359
|
/**
|
|
349
360
|
* Adds a LEFT JOIN clause to the query.
|
|
@@ -359,7 +370,8 @@ var Table = class _Table {
|
|
|
359
370
|
* console.log(users); // [{ id: 1, name: 'John', order_id: 101 }, { id: 2, name: 'Jane', order_id: null }]
|
|
360
371
|
*/
|
|
361
372
|
leftJoin(table, column1, operator, column2) {
|
|
362
|
-
this.
|
|
373
|
+
const clone = this.clone();
|
|
374
|
+
clone.dml.joins.push({
|
|
363
375
|
type: "LEFT",
|
|
364
376
|
table,
|
|
365
377
|
on: {
|
|
@@ -368,7 +380,7 @@ var Table = class _Table {
|
|
|
368
380
|
column2
|
|
369
381
|
}
|
|
370
382
|
});
|
|
371
|
-
return
|
|
383
|
+
return clone;
|
|
372
384
|
}
|
|
373
385
|
/**
|
|
374
386
|
* Adds a RIGHT JOIN clause to the query.
|
|
@@ -384,7 +396,8 @@ var Table = class _Table {
|
|
|
384
396
|
* console.log(users); // [{ id: 1, name: 'John', order_id: 101 }, { id: null, name: null, order_id: 102 }]
|
|
385
397
|
*/
|
|
386
398
|
rightJoin(table, column1, operator, column2) {
|
|
387
|
-
this.
|
|
399
|
+
const clone = this.clone();
|
|
400
|
+
clone.dml.joins.push({
|
|
388
401
|
type: "RIGHT",
|
|
389
402
|
table,
|
|
390
403
|
on: {
|
|
@@ -393,7 +406,7 @@ var Table = class _Table {
|
|
|
393
406
|
column2
|
|
394
407
|
}
|
|
395
408
|
});
|
|
396
|
-
return
|
|
409
|
+
return clone;
|
|
397
410
|
}
|
|
398
411
|
/**
|
|
399
412
|
* Adds an ORDER BY clause to the query.
|
|
@@ -407,16 +420,17 @@ var Table = class _Table {
|
|
|
407
420
|
* console.log(users); // [{ id: 2, name: 'Jane' }, { id: 1, name: 'John' }]
|
|
408
421
|
*/
|
|
409
422
|
orderBy(column, direction = "ASC") {
|
|
423
|
+
const clone = this.clone();
|
|
410
424
|
const validDirections = ["ASC", "DESC"];
|
|
411
425
|
if (validDirections.includes(direction.toUpperCase())) {
|
|
412
|
-
|
|
426
|
+
clone.dml.orderBy.push({
|
|
413
427
|
column,
|
|
414
428
|
direction: direction.toUpperCase()
|
|
415
429
|
});
|
|
416
430
|
} else {
|
|
417
431
|
throw new Error(`Invalid direction: ${direction}. Use 'ASC' or 'DESC'.`);
|
|
418
432
|
}
|
|
419
|
-
return
|
|
433
|
+
return clone;
|
|
420
434
|
}
|
|
421
435
|
/**
|
|
422
436
|
* Adds a GROUP BY clause to the query.
|
|
@@ -429,8 +443,9 @@ var Table = class _Table {
|
|
|
429
443
|
* console.log(users); // [{ age: 30, count: 1 }, { age: 25, count: 1 }]
|
|
430
444
|
*/
|
|
431
445
|
groupBy(column) {
|
|
432
|
-
this.
|
|
433
|
-
|
|
446
|
+
const clone = this.clone();
|
|
447
|
+
clone.dml.groupBy.push(column);
|
|
448
|
+
return clone;
|
|
434
449
|
}
|
|
435
450
|
/**
|
|
436
451
|
* Adds a DISTINCT clause to the query.
|
|
@@ -442,8 +457,9 @@ var Table = class _Table {
|
|
|
442
457
|
* console.log(users); // [{ name: 'John' }, { name: 'Jane' }]
|
|
443
458
|
*/
|
|
444
459
|
distinct() {
|
|
445
|
-
|
|
446
|
-
|
|
460
|
+
const clone = this.clone();
|
|
461
|
+
clone.dml.distinct = true;
|
|
462
|
+
return clone;
|
|
447
463
|
}
|
|
448
464
|
/**
|
|
449
465
|
* Adds a COUNT clause to the query.
|
|
@@ -456,18 +472,17 @@ var Table = class _Table {
|
|
|
456
472
|
* console.log(count); // { count: 2 }
|
|
457
473
|
*/
|
|
458
474
|
async count(column = "*") {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
clonedDML.aggregation = {
|
|
475
|
+
this.dml.type = "select";
|
|
476
|
+
this.dml.aggregation = {
|
|
462
477
|
type: "COUNT",
|
|
463
478
|
column,
|
|
464
479
|
alias: "count"
|
|
465
480
|
};
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
481
|
+
this.dml.columns = [`COUNT(${column}) AS count`];
|
|
482
|
+
this.dml.data = null;
|
|
483
|
+
this.dml.limit = 1;
|
|
469
484
|
try {
|
|
470
|
-
const result = await this.getResponse(
|
|
485
|
+
const result = await this.getResponse();
|
|
471
486
|
const res = result[0] || null;
|
|
472
487
|
if (res) {
|
|
473
488
|
return res.count;
|
|
@@ -488,18 +503,17 @@ var Table = class _Table {
|
|
|
488
503
|
* console.log(totalAge); // { sum: 55 }
|
|
489
504
|
*/
|
|
490
505
|
async sum(column) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
clonedDML.aggregation = {
|
|
506
|
+
this.dml.type = "select";
|
|
507
|
+
this.dml.aggregation = {
|
|
494
508
|
type: "SUM",
|
|
495
509
|
column,
|
|
496
510
|
alias: "sum"
|
|
497
511
|
};
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
512
|
+
this.dml.columns = [`SUM(${column}) AS sum`];
|
|
513
|
+
this.dml.data = null;
|
|
514
|
+
this.dml.limit = 1;
|
|
501
515
|
try {
|
|
502
|
-
const result = await this.getResponse(
|
|
516
|
+
const result = await this.getResponse();
|
|
503
517
|
const res = result[0] || null;
|
|
504
518
|
if (res) {
|
|
505
519
|
return res.sum;
|
|
@@ -520,18 +534,17 @@ var Table = class _Table {
|
|
|
520
534
|
* console.log(avgAge); // { avg: 27.5 }
|
|
521
535
|
*/
|
|
522
536
|
async avg(column) {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
clonedDML.aggregation = {
|
|
537
|
+
this.dml.type = "select";
|
|
538
|
+
this.dml.aggregation = {
|
|
526
539
|
type: "AVG",
|
|
527
540
|
column,
|
|
528
541
|
alias: "avg"
|
|
529
542
|
};
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
543
|
+
this.dml.columns = [`AVG(${column}) AS avg`];
|
|
544
|
+
this.dml.data = null;
|
|
545
|
+
this.dml.limit = 1;
|
|
533
546
|
try {
|
|
534
|
-
const result = await this.getResponse(
|
|
547
|
+
const result = await this.getResponse();
|
|
535
548
|
const res = result[0] || null;
|
|
536
549
|
if (res) {
|
|
537
550
|
return res.avg;
|
|
@@ -552,18 +565,17 @@ var Table = class _Table {
|
|
|
552
565
|
* console.log(maxAge); // { max: 30 }
|
|
553
566
|
*/
|
|
554
567
|
async max(column) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
clonedDML.aggregation = {
|
|
568
|
+
this.dml.type = "select";
|
|
569
|
+
this.dml.aggregation = {
|
|
558
570
|
type: "MAX",
|
|
559
571
|
column,
|
|
560
572
|
alias: "max"
|
|
561
573
|
};
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
574
|
+
this.dml.columns = [`MAX(${column}) AS max`];
|
|
575
|
+
this.dml.data = null;
|
|
576
|
+
this.dml.limit = 1;
|
|
565
577
|
try {
|
|
566
|
-
const result = await this.getResponse(
|
|
578
|
+
const result = await this.getResponse();
|
|
567
579
|
const res = result[0] || null;
|
|
568
580
|
if (res) {
|
|
569
581
|
return res.max;
|
|
@@ -584,18 +596,17 @@ var Table = class _Table {
|
|
|
584
596
|
* console.log(minAge); // { min: 25 }
|
|
585
597
|
*/
|
|
586
598
|
async min(column) {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
clonedDML.aggregation = {
|
|
599
|
+
this.dml.type = "select";
|
|
600
|
+
this.dml.aggregation = {
|
|
590
601
|
type: "MIN",
|
|
591
602
|
column,
|
|
592
603
|
alias: "min"
|
|
593
604
|
};
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
605
|
+
this.dml.columns = [`MIN(${column}) AS min`];
|
|
606
|
+
this.dml.data = null;
|
|
607
|
+
this.dml.limit = 1;
|
|
597
608
|
try {
|
|
598
|
-
const result = await this.getResponse(
|
|
609
|
+
const result = await this.getResponse();
|
|
599
610
|
const res = result[0] || null;
|
|
600
611
|
if (res) {
|
|
601
612
|
return res.min;
|
|
@@ -616,8 +627,9 @@ var Table = class _Table {
|
|
|
616
627
|
* console.log(users); // [{ id: 1, name: 'John', age: 30 }]
|
|
617
628
|
*/
|
|
618
629
|
limit(number) {
|
|
619
|
-
|
|
620
|
-
|
|
630
|
+
const clone = this.clone();
|
|
631
|
+
clone.dml.limit = number;
|
|
632
|
+
return clone;
|
|
621
633
|
}
|
|
622
634
|
/**
|
|
623
635
|
* Adds pagination to the query using LIMIT and OFFSET.
|
|
@@ -630,10 +642,11 @@ var Table = class _Table {
|
|
|
630
642
|
* console.log(users); // [{ id: 2, name: 'Jane', age: 25 }]
|
|
631
643
|
*/
|
|
632
644
|
page(number) {
|
|
633
|
-
|
|
634
|
-
|
|
645
|
+
const clone = this.clone();
|
|
646
|
+
if (clone.dml.limit) {
|
|
647
|
+
clone.dml.offset = (number - 1) * clone.dml.limit;
|
|
635
648
|
}
|
|
636
|
-
return
|
|
649
|
+
return clone;
|
|
637
650
|
}
|
|
638
651
|
/**
|
|
639
652
|
* Executes the query and returns all matching rows.
|
|
@@ -646,10 +659,9 @@ var Table = class _Table {
|
|
|
646
659
|
*/
|
|
647
660
|
async get() {
|
|
648
661
|
try {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
const result = await this.getResponse(clonedDML);
|
|
662
|
+
this.dml.type = "select";
|
|
663
|
+
this.dml.data = null;
|
|
664
|
+
const result = await this.getResponse();
|
|
653
665
|
return result;
|
|
654
666
|
} catch (error) {
|
|
655
667
|
throw error;
|
|
@@ -665,12 +677,11 @@ var Table = class _Table {
|
|
|
665
677
|
* console.log(user); // { id: 1, name: 'John' }
|
|
666
678
|
*/
|
|
667
679
|
async first() {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
clonedDML.limit = 1;
|
|
680
|
+
this.dml.type = "select";
|
|
681
|
+
this.dml.data = null;
|
|
682
|
+
this.dml.limit = 1;
|
|
672
683
|
try {
|
|
673
|
-
const result = await this.getResponse(
|
|
684
|
+
const result = await this.getResponse();
|
|
674
685
|
return result[0] || null;
|
|
675
686
|
} catch (error) {
|
|
676
687
|
throw error;
|
|
@@ -688,19 +699,12 @@ var Table = class _Table {
|
|
|
688
699
|
* console.log(user); // { id: 1, name: 'John' }
|
|
689
700
|
*/
|
|
690
701
|
async find(value, column = "id") {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
column,
|
|
696
|
-
operator: "=",
|
|
697
|
-
value,
|
|
698
|
-
type: "AND",
|
|
699
|
-
isGroup: false
|
|
700
|
-
});
|
|
701
|
-
clonedDML.limit = 1;
|
|
702
|
+
this.dml.type = "select";
|
|
703
|
+
this.dml.data = null;
|
|
704
|
+
this.where(column, "=", value);
|
|
705
|
+
this.dml.limit = 1;
|
|
702
706
|
try {
|
|
703
|
-
const result = await this.getResponse(
|
|
707
|
+
const result = await this.getResponse();
|
|
704
708
|
return result[0] || null;
|
|
705
709
|
} catch (error) {
|
|
706
710
|
throw error;
|
|
@@ -726,10 +730,9 @@ var Table = class _Table {
|
|
|
726
730
|
if (!data.every((item) => typeof item === "object" && item !== null)) {
|
|
727
731
|
throw new Error("The array must contain only valid objects.");
|
|
728
732
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
await this.getResponse(clonedDML, "Add");
|
|
733
|
+
this.dml.type = "insert";
|
|
734
|
+
this.dml.data = data;
|
|
735
|
+
await this.getResponse(this.dml, "Add");
|
|
733
736
|
return data;
|
|
734
737
|
}
|
|
735
738
|
/**
|
|
@@ -751,10 +754,9 @@ var Table = class _Table {
|
|
|
751
754
|
if (this.dml.where.length === 0) {
|
|
752
755
|
throw new Error("You must specify at least one WHERE condition to perform an update.");
|
|
753
756
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
await this.getResponse(clonedDML, "Update");
|
|
757
|
+
this.dml.type = "update";
|
|
758
|
+
this.dml.data = data;
|
|
759
|
+
await this.getResponse(this.dml, "Update");
|
|
758
760
|
return data;
|
|
759
761
|
}
|
|
760
762
|
/**
|
|
@@ -770,9 +772,8 @@ var Table = class _Table {
|
|
|
770
772
|
if (this.dml.where.length === 0) {
|
|
771
773
|
throw new Error("You must specify at least one WHERE condition to perform a delete.");
|
|
772
774
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
const deleteData = await this.getResponse(clonedDML, "Delete");
|
|
775
|
+
this.dml.type = "delete";
|
|
776
|
+
const deleteData = await this.getResponse(this.dml, "Delete");
|
|
776
777
|
return deleteData;
|
|
777
778
|
}
|
|
778
779
|
async getResponse(dml = null, type = null) {
|
|
@@ -866,8 +867,14 @@ var Table = class _Table {
|
|
|
866
867
|
}
|
|
867
868
|
return arrayResult;
|
|
868
869
|
}
|
|
869
|
-
|
|
870
|
-
|
|
870
|
+
clone() {
|
|
871
|
+
const cloned = Object.create(Object.getPrototypeOf(this));
|
|
872
|
+
cloned.engine = this.engine;
|
|
873
|
+
cloned.nextType = this.nextType;
|
|
874
|
+
cloned.computedFields = this.computedFields;
|
|
875
|
+
cloned.trigger = this.trigger;
|
|
876
|
+
cloned.triggers = this.triggers;
|
|
877
|
+
cloned.dml = {
|
|
871
878
|
...this.dml,
|
|
872
879
|
columns: [...this.dml.columns],
|
|
873
880
|
joins: [...this.dml.joins],
|
|
@@ -875,22 +882,7 @@ var Table = class _Table {
|
|
|
875
882
|
orderBy: [...this.dml.orderBy],
|
|
876
883
|
groupBy: [...this.dml.groupBy]
|
|
877
884
|
};
|
|
878
|
-
|
|
879
|
-
reset() {
|
|
880
|
-
this.dml = {
|
|
881
|
-
...this.dml,
|
|
882
|
-
type: "select",
|
|
883
|
-
columns: ["*"],
|
|
884
|
-
distinct: false,
|
|
885
|
-
joins: [],
|
|
886
|
-
where: [],
|
|
887
|
-
orderBy: [],
|
|
888
|
-
groupBy: [],
|
|
889
|
-
limit: null,
|
|
890
|
-
offset: null,
|
|
891
|
-
data: null,
|
|
892
|
-
aggregation: null
|
|
893
|
-
};
|
|
885
|
+
return cloned;
|
|
894
886
|
}
|
|
895
887
|
};
|
|
896
888
|
function returnFormattedError(status, message) {
|