baja-lite 1.5.18 → 1.5.20

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/sql.js CHANGED
@@ -21,7 +21,6 @@ import tslib from 'tslib';
21
21
  import { convert } from './convert-xml.js';
22
22
  import { Throw } from './error.js';
23
23
  import { excuteSplit, ExcuteSplitMode, sleep } from './fn.js';
24
- import { ArrayList } from './list.js';
25
24
  import { add, calc, ten2Any } from './math.js';
26
25
  import { C2P, C2P2, P2C } from './object.js';
27
26
  import { emptyString } from './string.js';
@@ -179,10 +178,8 @@ export var TemplateResult;
179
178
  TemplateResult[TemplateResult["NotSureOne"] = 1] = "NotSureOne";
180
179
  /** 返回多条记录 */
181
180
  TemplateResult[TemplateResult["Many"] = 2] = "Many";
182
- /** 返回多条记录并封装ArrayList */
183
- TemplateResult[TemplateResult["ManyList"] = 3] = "ManyList";
184
181
  /** 仅查询记录数量 */
185
- TemplateResult[TemplateResult["Count"] = 4] = "Count";
182
+ TemplateResult[TemplateResult["Count"] = 3] = "Count";
186
183
  })(TemplateResult || (TemplateResult = {}));
187
184
  export var SelectResult;
188
185
  (function (SelectResult) {
@@ -196,12 +193,8 @@ export var SelectResult;
196
193
  SelectResult[SelectResult["R_CS_NotSure"] = 3] = "R_CS_NotSure";
197
194
  /** 多行一列 */
198
195
  SelectResult[SelectResult["RS_C"] = 4] = "RS_C";
199
- /** 多行一列并封装ArrayList */
200
- SelectResult[SelectResult["RS_C_List"] = 5] = "RS_C_List";
201
196
  /** 多行多列 */
202
- SelectResult[SelectResult["RS_CS"] = 6] = "RS_CS";
203
- /** 多行多列并封装ArrayList */
204
- SelectResult[SelectResult["RS_CS_List"] = 7] = "RS_CS_List";
197
+ SelectResult[SelectResult["RS_CS"] = 5] = "RS_CS";
205
198
  })(SelectResult || (SelectResult = {}));
206
199
  export var ColumnMode;
207
200
  (function (ColumnMode) {
@@ -2649,9 +2642,6 @@ export class SqlService {
2649
2642
  case TemplateResult.Count: {
2650
2643
  return result[0].ct;
2651
2644
  }
2652
- case TemplateResult.ManyList: {
2653
- return new ArrayList(result[0]);
2654
- }
2655
2645
  }
2656
2646
  }
2657
2647
  template(option) {
@@ -2823,39 +2813,6 @@ export class SqlService {
2823
2813
  }
2824
2814
  }
2825
2815
  }
2826
- case SelectResult.RS_C_List: {
2827
- try {
2828
- if (dataConvert) {
2829
- const key = Object.keys(result[0])[0];
2830
- if (key && dataConvert[key] && globalThis[_DataConvert][dataConvert[key]]) {
2831
- return new ArrayList(result.map((r) => globalThis[_DataConvert][dataConvert[key]](Object.values(r)[0])));
2832
- }
2833
- }
2834
- return new ArrayList(result.map((r) => Object.values(r)[0]));
2835
- }
2836
- catch (error) {
2837
- return new ArrayList();
2838
- }
2839
- }
2840
- case SelectResult.RS_CS_List: {
2841
- if (mapper) {
2842
- return new ArrayList(iterate(result).map((data) => flatData({
2843
- data,
2844
- mapper,
2845
- mapperIfUndefined
2846
- })).toArray());
2847
- }
2848
- else {
2849
- hump = hump === true || (hump === undefined && globalThis[_Hump] === true);
2850
- const __dataConvert = dataConvert ? Object.fromEntries(Object.entries(dataConvert).map(([k, v]) => [k, globalThis[_DataConvert][v]])) : undefined;
2851
- if (hump || __dataConvert) {
2852
- return new ArrayList(iterate(result).map((r) => C2P2(r, hump, __dataConvert)).toArray());
2853
- }
2854
- else {
2855
- return new ArrayList();
2856
- }
2857
- }
2858
- }
2859
2816
  }
2860
2817
  }
2861
2818
  select(option) {
@@ -2884,8 +2841,9 @@ export class SqlService {
2884
2841
  });
2885
2842
  }
2886
2843
  }
2887
- selectMuit(option) {
2844
+ selectBatch(option) {
2888
2845
  Throw.if(!option.sqlId && !option.sql, 'not found sql!');
2846
+ option.selectResult ?? (option.selectResult = SelectResult.RS_CS);
2889
2847
  if (option.sqlId && globalThis[_resultMap_SQLID][option.sqlId] && !option.mapper) {
2890
2848
  option.mapper = globalThis[_resultMap_SQLID][option.sqlId];
2891
2849
  }
@@ -2894,13 +2852,13 @@ export class SqlService {
2894
2852
  const { sql, params } = this._generSql(option.dbType, option.sql, _params);
2895
2853
  if (option.sync === SyncMode.Sync) {
2896
2854
  const result = option.conn.query(SyncMode.Sync, sql, params);
2897
- return result.map(item => this._select(SelectResult.RS_CS, result, null, undefined, option.hump, option.mapper, option.mapperIfUndefined, option.dataConvert));
2855
+ return result.map(item => this._select(option.selectResult, result, null, undefined, option.hump, option.mapper, option.mapperIfUndefined, option.dataConvert));
2898
2856
  }
2899
2857
  else {
2900
2858
  return new Promise(async (resolve, reject) => {
2901
2859
  try {
2902
2860
  const result = await option.conn.query(SyncMode.Async, sql, params);
2903
- resolve(result.map(item => this._select(SelectResult.RS_CS, result, null, undefined, option.hump, option.mapper, option.mapperIfUndefined, option.dataConvert)));
2861
+ resolve(result.map(item => this._select(option.selectResult, result, null, undefined, option.hump, option.mapper, option.mapperIfUndefined, option.dataConvert)));
2904
2862
  }
2905
2863
  catch (error) {
2906
2864
  reject(error);
@@ -3405,7 +3363,7 @@ __decorate([
3405
3363
  __metadata("design:type", Function),
3406
3364
  __metadata("design:paramtypes", [Object]),
3407
3365
  __metadata("design:returntype", Object)
3408
- ], SqlService.prototype, "selectMuit", null);
3366
+ ], SqlService.prototype, "selectBatch", null);
3409
3367
  __decorate([
3410
3368
  P(),
3411
3369
  __metadata("design:type", Function),
@@ -3539,7 +3497,7 @@ class StreamQuery {
3539
3497
  const paramKeys = {};
3540
3498
  for (const [key, value] of Object.entries(t)) {
3541
3499
  const pkey = `p${this._prefix}${this._index++}`;
3542
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} = :${pkey} `);
3500
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} = :${pkey} `);
3543
3501
  this._param[pkey] = value;
3544
3502
  if (paramName) {
3545
3503
  paramKeys[key] = pkey;
@@ -3563,14 +3521,6 @@ class StreamQuery {
3563
3521
  eqWith(key1, key2) { return this._key(key1, key2, '='); }
3564
3522
  /** AND key1 <> key2 */
3565
3523
  notEqWith(key1, key2) { return this._key(key1, key2, '<>'); }
3566
- /** AND key REGEXP :regexp */
3567
- regexp(key, regexp, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._(key, regexp, 'REGEXP', { paramName, skipEmptyString: true, breakExcuteIfEmpty }); }
3568
- /** AND key NOT REGEXP :regexp */
3569
- notRegexp(key, regexp, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._(key, regexp, 'REGEXP', { paramName, skipEmptyString: true, not: 'NOT', breakExcuteIfEmpty }); }
3570
- /** AND (key1 << 8) + key2 = value */
3571
- shiftEq(key1, key2, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._shift(key1, key2, value, '=', { paramName, breakExcuteIfEmpty }); }
3572
- /** AND (key1 << 8) + key2 <> value */
3573
- shiftNotEq(key1, key2, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._shift(key1, key2, value, '<>', { paramName, breakExcuteIfEmpty }); }
3574
3524
  /** AND key > :value */
3575
3525
  grate(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._(key, value, '>', { paramName, skipEmptyString: true, breakExcuteIfEmpty }); }
3576
3526
  /** AND key >= :value */
@@ -3587,6 +3537,18 @@ class StreamQuery {
3587
3537
  lessWith(key1, key2) { return this._key(key1, key2, '<'); }
3588
3538
  /** AND key1 <= key2 */
3589
3539
  lessEqWith(key1, key2) { return this._key(key1, key2, '<='); }
3540
+ /** AND key REGEXP :regexp */
3541
+ regexp(key, regexp, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._(key, regexp, 'REGEXP', { paramName, skipEmptyString: true, breakExcuteIfEmpty }); }
3542
+ /** AND key NOT REGEXP :regexp */
3543
+ notRegexp(key, regexp, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._(key, regexp, 'REGEXP', { paramName, skipEmptyString: true, not: 'NOT', breakExcuteIfEmpty }); }
3544
+ /** AND :regexp REGEXP key */
3545
+ regexp2(key, regexp, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._2(key, regexp, 'REGEXP', { paramName, skipEmptyString: true, breakExcuteIfEmpty }); }
3546
+ /** AND :regexp NOT REGEXP key */
3547
+ notRegexp2(key, regexp, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._2(key, regexp, 'REGEXP', { paramName, skipEmptyString: true, not: 'NOT', breakExcuteIfEmpty }); }
3548
+ /** AND (key1 << 8) + key2 = value */
3549
+ shiftEq(key1, key2, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._shift(key1, key2, value, '=', { paramName, breakExcuteIfEmpty }); }
3550
+ /** AND (key1 << 8) + key2 <> value */
3551
+ shiftNotEq(key1, key2, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._shift(key1, key2, value, '<>', { paramName, breakExcuteIfEmpty }); }
3590
3552
  /** AND key LIKE CONCAT('%', :value, '%') */
3591
3553
  like(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, left: '%', right: '%', breakExcuteIfEmpty }); }
3592
3554
  /** AND key NOT LIKE CONCAT('%', :value, '%') */
@@ -3599,29 +3561,61 @@ class StreamQuery {
3599
3561
  rightLike(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, right: '%', breakExcuteIfEmpty }); }
3600
3562
  /** AND key NOT LIKE CONCAT(:value, '%') */
3601
3563
  notRightLike(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, right: '%', not: 'NOT', breakExcuteIfEmpty }); }
3602
- /** AND key NOT LIKE :value */
3564
+ /** AND key LIKE :value 注意:不会拼接% */
3603
3565
  PreciseLike(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty }); }
3604
- /** AND key LIKE :value */
3566
+ /** AND key NOT LIKE :value 注意:不会拼接%*/
3605
3567
  notPreciseLike(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty }); }
3606
- /** AND key GLOB CONCAT('%', :value, '%') */
3568
+ /** AND key GLOB CONCAT('%', :value, '%') 注意:GLOB是大小写敏感like */
3607
3569
  glob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, left: '%', right: '%', breakExcuteIfEmpty, op: 'GLOB' }); }
3608
- /** AND key NOT GLOB CONCAT('%', :value, '%') */
3570
+ /** AND key NOT GLOB CONCAT('%', :value, '%') 注意:GLOB是大小写敏感like*/
3609
3571
  notGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, left: '%', right: '%', not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3610
- /** AND key GLOB CONCAT('%', :value) */
3572
+ /** AND key GLOB CONCAT('%', :value) 注意:GLOB是大小写敏感like*/
3611
3573
  leftGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, left: '%', breakExcuteIfEmpty, op: 'GLOB' }); }
3612
- /** AND key NOT GLOB CONCAT('%', :value) */
3574
+ /** AND key NOT GLOB CONCAT('%', :value) 注意:GLOB是大小写敏感like*/
3613
3575
  notLeftGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, left: '%', not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3614
- /** AND key GLOB CONCAT(:value, '%') */
3576
+ /** AND key GLOB CONCAT(:value, '%') 注意:GLOB是大小写敏感like*/
3615
3577
  rightGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, right: '%', breakExcuteIfEmpty, op: 'GLOB' }); }
3616
- /** AND key NOT GLOB CONCAT(:value, '%') */
3578
+ /** AND key NOT GLOB CONCAT(:value, '%') 注意:GLOB是大小写敏感like*/
3617
3579
  notRightGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, right: '%', not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3618
- /** AND key GLOB :value */
3619
- PreciseGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty, op: 'GLOB' }); }
3620
- /** AND key NOT GLOB :value */
3580
+ /** AND key GLOB :value 注意:GLOB是大小写敏感like,这里不拼接%*/
3581
+ preciseGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty, op: 'GLOB' }); }
3582
+ /** AND key NOT GLOB :value 注意:GLOB是大小写敏感like,这里不拼接%*/
3621
3583
  notPreciseGlob(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3622
- /** AND key IN :value */
3584
+ /** AND :value LIKE CONCAT('%', key, '%') */
3585
+ like2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', right: '%', breakExcuteIfEmpty }); }
3586
+ /** AND :value NOT LIKE CONCAT('%', key, '%') */
3587
+ notLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', right: '%', not: 'NOT', breakExcuteIfEmpty }); }
3588
+ /** AND :value NOT LIKE CONCAT('%', key) */
3589
+ leftLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', breakExcuteIfEmpty }); }
3590
+ /** AND :value LIKE CONCAT('%', key) */
3591
+ notLeftLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', not: 'NOT', breakExcuteIfEmpty }); }
3592
+ /** AND :value LIKE CONCAT(key, '%') */
3593
+ rightLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, right: '%', breakExcuteIfEmpty }); }
3594
+ /** AND :value NOT LIKE CONCAT(key, '%') */
3595
+ notRightLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, right: '%', not: 'NOT', breakExcuteIfEmpty }); }
3596
+ /** AND :value LIKE key 注意:不会拼接% */
3597
+ PreciseLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty }); }
3598
+ /** AND :value NOT LIKE key 注意:不会拼接%*/
3599
+ notPreciseLike2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty }); }
3600
+ /** AND :value GLOB CONCAT('%', key, '%') 注意:GLOB是大小写敏感like */
3601
+ glob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', right: '%', breakExcuteIfEmpty, op: 'GLOB' }); }
3602
+ /** AND :value NOT GLOB CONCAT('%', key, '%') 注意:GLOB是大小写敏感like*/
3603
+ notGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', right: '%', not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3604
+ /** AND :value GLOB CONCAT('%', key) 注意:GLOB是大小写敏感like*/
3605
+ leftGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', breakExcuteIfEmpty, op: 'GLOB' }); }
3606
+ /** AND :value NOT GLOB CONCAT('%', key) 注意:GLOB是大小写敏感like*/
3607
+ notLeftGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, left: '%', not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3608
+ /** AND :value GLOB CONCAT(key, '%') 注意:GLOB是大小写敏感like*/
3609
+ rightGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, right: '%', breakExcuteIfEmpty, op: 'GLOB' }); }
3610
+ /** AND :value NOT GLOB CONCAT(key, '%') 注意:GLOB是大小写敏感like*/
3611
+ notRightGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, right: '%', not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3612
+ /** AND :value GLOB key 注意:GLOB是大小写敏感like,这里不拼接%*/
3613
+ preciseGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty, op: 'GLOB' }); }
3614
+ /** AND :value NOT GLOB key 注意:GLOB是大小写敏感like,这里不拼接%*/
3615
+ notPreciseGlob2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._like2(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty, op: 'GLOB' }); }
3616
+ /** AND key IN (:value) */
3623
3617
  in(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._in(key, value, { paramName, breakExcuteIfEmpty }); }
3624
- /** AND key NOT IN :value */
3618
+ /** AND key NOT IN (:value) */
3625
3619
  notIn(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._in(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty }); }
3626
3620
  /** AND :value IN (key1, key2, ...) */
3627
3621
  in2(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._in2(key, value, { paramName, breakExcuteIfEmpty }); }
@@ -3633,12 +3627,12 @@ class StreamQuery {
3633
3627
  isNotNULL(key) { return this._null(key, 'NOT'); }
3634
3628
  /** AND (key IS NULL OR key = '') */
3635
3629
  isEmpty(key) {
3636
- this._wheres.push(`AND (${this[_fields][String(key)]?.C2()} IS NULL OR ${this[_fields][String(key)]?.C2()} = '')`);
3630
+ this._wheres.push(`AND (t.${this[_fields][String(key)]?.C2()} IS NULL OR t.${this[_fields][String(key)]?.C2()} = '')`);
3637
3631
  return this;
3638
3632
  }
3639
3633
  /** AND key IS NOT NULL AND key <> ''*/
3640
3634
  isNotEmpty(key) {
3641
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} IS NOT NULL AND ${this[_fields][String(key)]?.C2()} <> ''`);
3635
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} IS NOT NULL AND t.${this[_fields][String(key)]?.C2()} <> ''`);
3642
3636
  return this;
3643
3637
  }
3644
3638
  /** AND key BETWEEN :value1 AND :value2 */
@@ -3649,26 +3643,34 @@ class StreamQuery {
3649
3643
  pow(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._pow(key, value, { paramName, breakExcuteIfEmpty }); }
3650
3644
  /** AND NOT POW(2, key) & :value */
3651
3645
  notPow(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._pow(key, value, { paramName, not: 'NOT', breakExcuteIfEmpty }); }
3646
+ /** AND POW(2, :value) & key */
3647
+ pow2(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._pow2(key, value, { paramName, breakExcuteIfEmpty }); }
3648
+ /** AND NOT POW(2, :value) & key */
3649
+ notPow2(key, value, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._pow2(key, value, { paramName, not: 'NOT', breakExcuteIfEmpty }); }
3652
3650
  /** AND POW(2, key1) & key2 */
3653
3651
  powWith(key, values, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._pow(key, add(...values.map(value => Math.pow(2, +value))), { paramName, breakExcuteIfEmpty }); }
3654
3652
  /** AND NOT POW(2, key1) & key2 */
3655
3653
  notPowWith(key, values, { paramName = '', breakExcuteIfEmpty = true } = {}) { return this._pow(key, add(...values.map(value => Math.pow(2, +value))), { paramName, not: 'NOT', breakExcuteIfEmpty }); }
3656
- /** AND MATCH(key1, key2, key3) AGAINST (:value) */
3654
+ /** AND MATCH(key1, key2, key3...) AGAINST (:value) */
3657
3655
  match(value, keys, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._match(value, keys, { paramName, skipEmptyString, breakExcuteIfEmpty }); }
3658
- /** AND NOT MATCH(key1, key2, key3) AGAINST (:value) */
3656
+ /** AND NOT MATCH(key1, key2, key3...) AGAINST (:value) */
3659
3657
  notMatch(value, keys, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._match(value, keys, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty }); }
3660
- /** AND MATCH(key1, key2, key3) AGAINST (:value) IN BOOLEAN MODE*/
3658
+ /** AND MATCH(key1, key2, key3...) AGAINST (:value) IN BOOLEAN MODE*/
3661
3659
  matchBoolean(value, keys, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._match(value, keys, { paramName, skipEmptyString, breakExcuteIfEmpty, append: 'IN BOOLEAN MODE' }); }
3662
- /** AND NOT MATCH(key1, key2, key3) AGAINST (:value) IN BOOLEAN MODE */
3660
+ /** AND NOT MATCH(key1, key2, key3...) AGAINST (:value) IN BOOLEAN MODE */
3663
3661
  notMatchBoolean(value, keys, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._match(value, keys, { paramName, skipEmptyString, breakExcuteIfEmpty, not: 'NOT', append: 'IN BOOLEAN MODE' }); }
3664
- /** AND MATCH(key1, key2, key3) AGAINST (:value) WITH QUERY EXPANSION*/
3662
+ /** AND MATCH(key1, key2, key3...) AGAINST (:value) WITH QUERY EXPANSION*/
3665
3663
  matchQuery(value, keys, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._match(value, keys, { paramName, skipEmptyString, breakExcuteIfEmpty, append: 'WITH QUERY EXPANSION' }); }
3666
- /** AND NOT MATCH(key1, key2, key3) AGAINST (:value) WITH QUERY EXPANSION*/
3664
+ /** AND NOT MATCH(key1, key2, key3...) AGAINST (:value) WITH QUERY EXPANSION*/
3667
3665
  notMatchQuery(value, keys, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._match(value, keys, { paramName, skipEmptyString, breakExcuteIfEmpty, not: 'NOT', append: 'WITH QUERY EXPANSION' }); }
3668
- /** AND NOT LOCATE(key, :value) > 0 */
3666
+ /** AND LOCATE(key, :value) > 0 */
3669
3667
  includes(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._includes(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty }); }
3670
3668
  /** AND NOT LOCATE(key, :value) = 0 */
3671
3669
  notIncludes(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._includes(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty }); }
3670
+ /** AND LOCATE(:value, key) > 0 */
3671
+ includes2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._includes2(key, value, { paramName, skipEmptyString, breakExcuteIfEmpty }); }
3672
+ /** AND NOT LOCATE(:value, key) = 0 */
3673
+ notIncludes2(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) { return this._includes2(key, value, { paramName, skipEmptyString, not: 'NOT', breakExcuteIfEmpty }); }
3672
3674
  /** AND FIND_IN_SET(:value, key) */
3673
3675
  findInSet(key, value, { paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) {
3674
3676
  if (value === null
@@ -3684,7 +3686,7 @@ class StreamQuery {
3684
3686
  }
3685
3687
  else {
3686
3688
  const pkey = `p${this._prefix}${this._index++}`;
3687
- this._wheres.push(`AND FIND_IN_SET(:${pkey}, ${this[_fields][String(key)]?.C2()})`);
3689
+ this._wheres.push(`AND FIND_IN_SET(:${pkey}, t.${this[_fields][String(key)]?.C2()})`);
3688
3690
  this._param[pkey] = value;
3689
3691
  if (paramName) {
3690
3692
  this._paramKeys[paramName] = pkey;
@@ -3707,7 +3709,7 @@ class StreamQuery {
3707
3709
  }
3708
3710
  else {
3709
3711
  const pkey = `p${this._prefix}${this._index++}`;
3710
- this._wheres.push(`AND FIND_IN_SET(${this[_fields][String(key)]?.C2()}, :${pkey})`);
3712
+ this._wheres.push(`AND FIND_IN_SET(t.${this[_fields][String(key)]?.C2()}, :${pkey})`);
3711
3713
  this._param[pkey] = value;
3712
3714
  if (paramName) {
3713
3715
  this._paramKeys[paramName] = pkey;
@@ -3741,51 +3743,73 @@ class StreamQuery {
3741
3743
  }
3742
3744
  return this;
3743
3745
  }
3746
+ /**
3747
+ * sql WHERE 查询语句拼接:注意若有JOIN,需要写明别名。本表别名为t.例如:
3748
+ * ```
3749
+ * where('t.name > :name', {name: 1});
3750
+ * where('(t.name > :name OR t.name <> :name)', {name: 1});
3751
+ * ```
3752
+ */
3753
+ where(sql, param) {
3754
+ this._wheres.push(`AND ${sql}`);
3755
+ if (param) {
3756
+ Object.assign(this._param, param);
3757
+ }
3758
+ return this;
3759
+ }
3744
3760
  /** SET key = IFNULL(key, 0) + :value */
3745
3761
  incr(key, value = 1) {
3746
3762
  const pkey = `p${this._prefix}${this._index++}`;
3747
3763
  const keyName = this[_fields][String(key)]?.C2();
3748
- this._updateColumns.push(`${keyName} = IFNULL(${keyName}, 0) + :${pkey}`);
3764
+ this._updateColumns.push(`t.${keyName} = IFNULL(t.${keyName}, 0) + :${pkey}`);
3749
3765
  this._param[pkey] = value;
3750
3766
  return this;
3751
3767
  }
3752
3768
  /** GROUP BY key1, key2, ... */
3753
- groupBy(...keys) { this._groups.push(...keys.map(key => `${this[_fields][String(key)]?.C2()}`)); return this; }
3769
+ groupBy(...keys) { this._groups.push(...keys.map(key => `t.${this[_fields][String(key)]?.C2()}`)); return this; }
3754
3770
  /** GROUP BY key1, key2, ... */
3755
- groupBy2(...keys) { this._groups.push(...keys.map(key => `${this[_fields][String(key)]?.C2()}`)); return this; }
3771
+ groupBy2(...keys) { this._groups.push(...keys.map(key => `t.${this[_fields][String(key)]?.C2()}`)); return this; }
3756
3772
  /** ORDER BY key1 ASC, key2 ASC, ... */
3757
- asc(...keys) { this._orders.push(...keys.map(key => `${this[_fields][String(key)]?.C2()} ASC`)); return this; }
3773
+ asc(...keys) { this._orders.push(...keys.map(key => `t.${this[_fields][String(key)]?.C2()} ASC`)); return this; }
3758
3774
  /** ORDER BY key1 ASC, key2 ASC, ... */
3759
- asc2(...keys) { this._orders.push(...keys.map(key => `${this[_fields][String(key)]?.C2()} ASC`)); return this; }
3775
+ asc2(...keys) { this._orders.push(...keys.map(key => `t.${this[_fields][String(key)]?.C2()} ASC`)); return this; }
3760
3776
  /** ORDER BY key1 DESC, key2 DESC, ... */
3761
- desc(...keys) { this._orders.push(...keys.map(key => `${this[_fields][String(key)]?.C2()} DESC`)); return this; }
3777
+ desc(...keys) { this._orders.push(...keys.map(key => `t.${this[_fields][String(key)]?.C2()} DESC`)); return this; }
3762
3778
  /** ORDER BY key1 DESC, key2 DESC, ... */
3763
- desc2(...keys) { this._orders.push(...keys.map(key => `${this[_fields][String(key)]?.C2()} ASC`)); return this; }
3779
+ desc2(...keys) { this._orders.push(...keys.map(key => `t.${this[_fields][String(key)]?.C2()} ASC`)); return this; }
3764
3780
  /** LIMIT :startRow, :pageSize */
3765
3781
  limit(startRow, pageSize) { this._startRow = startRow; this._pageSize = pageSize; return this; }
3766
3782
  /** LIMIT ((:pageNumber || 1) - 1) * :pageSize, :pageSize */
3767
3783
  page(pageNumber, pageSize) { this._startRow = ((pageNumber || 1) - 1) * pageSize; this._pageSize = pageSize; return this; }
3768
3784
  distinct(on = true) { this._distinct = on; return this; }
3769
3785
  /** COUNT(DISTINCT key) */
3770
- countDistinct(key, countName) { this._columns.push(`COUNT(DISTINCT ${this[_fields][String(key)]?.C2()}) ${countName || `${this[_fields][String(key)]?.C2()}`}`); return this; }
3786
+ countDistinct(key, countName) { this._columns.push(`COUNT(DISTINCT t.${this[_fields][String(key)]?.C2()}) ${countName || `t.${this[_fields][String(key)]?.C2()}`}`); return this; }
3771
3787
  count(countName) { this._columns.push(`COUNT(1) ${countName ?? 'ct'}`); return this; }
3772
- sum(key, legName, distinct) { this._columns.push(`SUM(${distinct ? 'DISTINCT' : ''} ${this[_fields][String(key)]?.C2()}) ${legName || `${this[_fields][String(key)]?.C2()}`}`); return this; }
3773
- avg(key, legName, distinct) { this._columns.push(`AVG(${distinct ? 'DISTINCT' : ''} ${this[_fields][String(key)]?.C2()}) ${legName || `${this[_fields][String(key)]?.C2()}`}`); return this; }
3774
- max(key, legName, distinct) { this._columns.push(`MAX(${distinct ? 'DISTINCT' : ''} ${this[_fields][String(key)]?.C2()}) ${legName || `${this[_fields][String(key)]?.C2()}`}`); return this; }
3775
- min(key, legName, distinct) { this._columns.push(`MIN(${distinct ? 'DISTINCT' : ''} ${this[_fields][String(key)]?.C2()}) ${legName || `${this[_fields][String(key)]?.C2()}`}`); return this; }
3788
+ sum(key, legName, distinct) { this._columns.push(`SUM(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName || `t.${this[_fields][String(key)]?.C2()}`}`); return this; }
3789
+ avg(key, legName, distinct) { this._columns.push(`AVG(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName || `t.${this[_fields][String(key)]?.C2()}`}`); return this; }
3790
+ max(key, legName, distinct) { this._columns.push(`MAX(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName || `t.${this[_fields][String(key)]?.C2()}`}`); return this; }
3791
+ min(key, legName, distinct) { this._columns.push(`MIN(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName || `t.${this[_fields][String(key)]?.C2()}`}`); return this; }
3776
3792
  /** GROUP_CONCAT([DISTINCT] key [ORDER BY :asc ASC] [ORDER BY :asc DESC] [SEPARATOR :separator]) */
3777
3793
  groupConcat(key, param) {
3778
3794
  this._columns.push(`GROUP_CONCAT(
3779
- ${param && param.distinct ? 'DISTINCT' : ''} ${this[_fields][String(key)]?.C2()}
3780
- ${param && param.asc && param.asc.length > 0 ? `ORDER BY ${param.asc.map(i => `${this[_fields][String(i)]?.C2()} ASC`)} ` : ''}
3781
- ${param && param.desc && param.desc.length > 0 ? `${param && param.asc && param.asc.length > 0 ? '' : 'ORDER BY'} ${param.desc.map(i => `${this[_fields][String(i)]?.C2()} DESC`)} ` : ''}
3795
+ ${param && param.distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}
3796
+ ${param && param.asc && param.asc.length > 0 ? `ORDER BY ${param.asc.map(i => `t.${this[_fields][String(i)]?.C2()} ASC`)} ` : ''}
3797
+ ${param && param.desc && param.desc.length > 0 ? `${param && param.asc && param.asc.length > 0 ? '' : 'ORDER BY'} ${param.desc.map(i => `t.${this[_fields][String(i)]?.C2()} DESC`)} ` : ''}
3782
3798
  SEPARATOR '${param && param.separator || ','}'
3783
- ) ${param && param.groupName || `${this[_fields][String(key)]?.C2()}`}`);
3799
+ ) ${param && param.groupName || `t.${this[_fields][String(key)]?.C2()}`}`);
3784
3800
  return this;
3785
3801
  }
3786
- select(...key) { this._columns.push(...(key.map(k => this[_fields][String(k)].C3()))); return this; }
3802
+ select(...key) { this._columns.push(...(key.map(k => `t.${this[_fields][String(k)].C3()}`))); return this; }
3803
+ /**
3804
+ * sql查询语句拼接:注意若有JOIN,需要写明别名。本表别名为t.例如:
3805
+ * ```
3806
+ * select2('t.name, t.age, ISNULL(t.type, :type)', {type: 1});
3807
+ * select2('MAX(t.age) MAXAge');
3808
+ * ```
3809
+ */
3787
3810
  select2(sql, param) { this._columns.push(`${sql}`); Object.assign(this._param, param); return this; }
3788
3811
  update(key, value) { this._updates ?? (this._updates = {}); this._updates[this[_fields][String(key)]?.C2()] = value; return this; }
3812
+ /** update语句拼接:注意若有JOIN,需要写明别名。本表别名为t */
3789
3813
  update2(sql, param) { this._updateColumns.push(sql); Object.assign(this._param, param); return this; }
3790
3814
  updateT(t) {
3791
3815
  this._updates ?? (this._updates = {});
@@ -3798,7 +3822,7 @@ class StreamQuery {
3798
3822
  /** SET key = REPLACE(key, :valueToFind, :valueToReplace) */
3799
3823
  replace(key, valueToFind, valueToReplace) {
3800
3824
  const [pkey1, pkey2] = [`p${this._prefix}${this._index++}`, `p${this._prefix}${this._index++}`];
3801
- this._updateColumns.push(` ${this[_fields][String(key)]?.C2()} = REPLACE(${this[_fields][String(key)]?.C2()}, :${pkey1}, :${pkey2}) `);
3825
+ this._updateColumns.push(` t.${this[_fields][String(key)]?.C2()} = REPLACE(t.${this[_fields][String(key)]?.C2()}, :${pkey1}, :${pkey2}) `);
3802
3826
  this._param[pkey1] = valueToFind;
3803
3827
  this._param[pkey2] = valueToReplace;
3804
3828
  return this;
@@ -3810,8 +3834,8 @@ class StreamQuery {
3810
3834
  const { where, params } = this._where();
3811
3835
  let sql = `
3812
3836
  SELECT
3813
- ${this._distinct ? 'DISTINCT' : ''} ${this._columns && this._columns.length > 0 ? this._columns.join(',') : this[_columns].map(key => this[_fields][String(key)]?.C3()).join(',')}
3814
- FROM ${option.tableName ?? this._service[_tableName]}
3837
+ ${this._distinct ? 'DISTINCT' : ''} ${this._columns && this._columns.length > 0 ? this._columns.join(',') : this[_columns].map(key => `t.${this[_fields][String(key)]?.C3()}`).join(',')}
3838
+ FROM ${option.tableName ?? this._service[_tableName]} t
3815
3839
  ${where ? ' WHERE ' : ''}
3816
3840
  ${where}
3817
3841
  ${this._groups.length > 0 ? `GROUP BY ${this._groups.join(',')} ` : ''}
@@ -3827,8 +3851,6 @@ class StreamQuery {
3827
3851
  switch (option.selectResult) {
3828
3852
  case SelectResult.RS_CS: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.RS_CS, sql, params });
3829
3853
  case SelectResult.RS_C: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.RS_C, sql, params });
3830
- case SelectResult.RS_CS_List: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.RS_CS_List, sql, params });
3831
- case SelectResult.RS_C_List: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.RS_C_List, sql, params });
3832
3854
  case SelectResult.R_CS_Assert: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.R_CS_Assert, sql, params });
3833
3855
  case SelectResult.R_C_Assert: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.R_C_Assert, sql, params });
3834
3856
  case SelectResult.R_CS_NotSure: return this._service.select({ ...option, sync: SyncMode.Async, selectResult: SelectResult.R_CS_NotSure, sql, params });
@@ -3839,8 +3861,6 @@ class StreamQuery {
3839
3861
  switch (option.selectResult) {
3840
3862
  case SelectResult.RS_CS: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.RS_CS, sql, params });
3841
3863
  case SelectResult.RS_C: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.RS_C, sql, params });
3842
- case SelectResult.RS_CS_List: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.RS_CS_List, sql, params });
3843
- case SelectResult.RS_C_List: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.RS_C_List, sql, params });
3844
3864
  case SelectResult.R_CS_Assert: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.R_CS_Assert, sql, params });
3845
3865
  case SelectResult.R_C_Assert: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.R_C_Assert, sql, params });
3846
3866
  case SelectResult.R_CS_NotSure: return this._service.select({ ...option, sync: SyncMode.Sync, selectResult: SelectResult.R_CS_NotSure, sql, params });
@@ -3859,8 +3879,8 @@ class StreamQuery {
3859
3879
  };
3860
3880
  let sql = `
3861
3881
  SELECT
3862
- ${this._distinct ? 'DISTINCT' : ''} ${this._columns && this._columns.length > 0 ? this._columns.join(',') : this[_columns].map(key => this[_fields][String(key)]?.C3()).join(',')}
3863
- FROM ${option.tableName ?? this._service[_tableName]}
3882
+ ${this._distinct ? 'DISTINCT' : ''} ${this._columns && this._columns.length > 0 ? this._columns.join(',') : this[_columns].map(key => `t.${this[_fields][String(key)]?.C3()}`).join(',')}
3883
+ FROM ${option.tableName ?? this._service[_tableName]} t
3864
3884
  ${where ? ' WHERE ' : ''}
3865
3885
  ${where}
3866
3886
  ${this._groups.length > 0 ? `GROUP BY ${this._groups.join(',')} ` : ''}
@@ -3874,7 +3894,7 @@ class StreamQuery {
3874
3894
  }
3875
3895
  const sqlCount = `
3876
3896
  SELECT COUNT(1)
3877
- FROM ${option.tableName ?? this._service[_tableName]}
3897
+ FROM ${option.tableName ?? this._service[_tableName]} t
3878
3898
  ${where ? ' WHERE ' : ''}
3879
3899
  ${where}
3880
3900
  ${this._groups.length > 0 ? `GROUP BY ${this._groups.join(',')} ` : ''}
@@ -3940,12 +3960,12 @@ class StreamQuery {
3940
3960
  if (this._updates) {
3941
3961
  for (const [K, V] of Object.entries(this._updates)) {
3942
3962
  const pkey = `p${this._prefix}${this._index++}`;
3943
- sets.push(` ${K} = :${pkey} `);
3963
+ sets.push(` t.${K} = :${pkey} `);
3944
3964
  params[pkey] = V;
3945
3965
  }
3946
3966
  }
3947
3967
  if (sets.length > 0) {
3948
- const sql = `UPDATE ${option.tableName ?? this._service[_tableName]} SET ${sets.join(',')}
3968
+ const sql = `UPDATE ${option.tableName ?? this._service[_tableName]} t SET ${sets.join(',')}
3949
3969
  ${where ? ' WHERE ' : ''}
3950
3970
  ${where}
3951
3971
  `;
@@ -3964,15 +3984,20 @@ class StreamQuery {
3964
3984
  option ?? (option = {});
3965
3985
  option.sync ?? (option.sync = SyncMode.Async);
3966
3986
  const { where, params } = this._where();
3967
- // const sql = `DELETE FROM ${option.tableName ?? this._service[_tableName]}
3968
- // ${where ? ' WHERE ' : ''}
3969
- // ${where}
3970
- // `;
3987
+ const sql = `DELETE FROM ${option.tableName ?? this._service[_tableName]} t
3988
+ ${where ? ' WHERE ' : ''}
3989
+ ${where}
3990
+ `;
3991
+ // if (option.sync === SyncMode.Async) {
3992
+ // return this._service.delete({ ...option, sync: SyncMode.Async, whereSql: where, whereParams: params });
3993
+ // } else {
3994
+ // return this._service.delete({ ...option, sync: SyncMode.Sync, whereSql: where, whereParams: params });
3995
+ // }
3971
3996
  if (option.sync === SyncMode.Async) {
3972
- return this._service.delete({ ...option, sync: SyncMode.Async, whereSql: where, whereParams: params });
3997
+ return this._service.excute({ ...option, sync: SyncMode.Async, sql, params });
3973
3998
  }
3974
3999
  else {
3975
- return this._service.delete({ ...option, sync: SyncMode.Sync, whereSql: where, whereParams: params });
4000
+ return this._service.excute({ ...option, sync: SyncMode.Sync, sql, params });
3976
4001
  }
3977
4002
  }
3978
4003
  _where() {
@@ -4015,7 +4040,29 @@ class StreamQuery {
4015
4040
  }
4016
4041
  else {
4017
4042
  const pkey = `p${this._prefix}${this._index++}`;
4018
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} ${not} ${op} :${pkey} `);
4043
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} ${not} ${op} :${pkey} `);
4044
+ this._param[pkey] = value;
4045
+ if (paramName) {
4046
+ this._paramKeys[paramName] = pkey;
4047
+ }
4048
+ }
4049
+ return this;
4050
+ }
4051
+ _2(key, value, op, { not = '', paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) {
4052
+ if (value === null
4053
+ || value === undefined
4054
+ || (emptyString(`${value ?? ''}`) && skipEmptyString)) {
4055
+ if (breakExcuteIfEmpty) {
4056
+ this.if_exec = false;
4057
+ }
4058
+ return this;
4059
+ }
4060
+ if (paramName !== undefined && this._paramKeys.hasOwnProperty(paramName)) {
4061
+ this._param[this._paramKeys[paramName]] = value;
4062
+ }
4063
+ else {
4064
+ const pkey = `p${this._prefix}${this._index++}`;
4065
+ this._wheres.push(`AND :${pkey} ${not} ${op} t.${this[_fields][String(key)]?.C2()}`);
4019
4066
  this._param[pkey] = value;
4020
4067
  if (paramName) {
4021
4068
  this._paramKeys[paramName] = pkey;
@@ -4037,7 +4084,7 @@ class StreamQuery {
4037
4084
  }
4038
4085
  else {
4039
4086
  const pkey = `p${this._prefix}${this._index++}`;
4040
- this._wheres.push(`AND (${keys.map(key => `${this[_fields][String(key)]?.C2()} ${not} ${op} :${pkey} `).join(' OR ')})`);
4087
+ this._wheres.push(`AND (${keys.map(key => `t.${this[_fields][String(key)]?.C2()} ${not} ${op} :${pkey} `).join(' OR ')})`);
4041
4088
  this._param[pkey] = value;
4042
4089
  if (paramName) {
4043
4090
  this._paramKeys[paramName] = pkey;
@@ -4046,11 +4093,11 @@ class StreamQuery {
4046
4093
  return this;
4047
4094
  }
4048
4095
  _null(key, not = '') {
4049
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} IS ${not} NULL`);
4096
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} IS ${not} NULL`);
4050
4097
  return this;
4051
4098
  }
4052
4099
  _key(key1, key2, op, not = '') {
4053
- this._wheres.push(`AND ${this[_fields][String(key1)]?.C2()} ${not} ${op} ${this[_fields][String(key2)]?.C2()} `);
4100
+ this._wheres.push(`AND t.${this[_fields][String(key1)]?.C2()} ${not} ${op} t.${this[_fields][String(key2)]?.C2()} `);
4054
4101
  return this;
4055
4102
  }
4056
4103
  _between(key, value1, value2, { not = '', paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) {
@@ -4071,7 +4118,7 @@ class StreamQuery {
4071
4118
  }
4072
4119
  else {
4073
4120
  const [pkey1, pkey2] = [`p${this._prefix}${this._index++}`, `p${this._prefix}${this._index++}`];
4074
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} ${not} BETWEEN :${pkey1} AND :${pkey2}`);
4121
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} ${not} BETWEEN :${pkey1} AND :${pkey2}`);
4075
4122
  this._param[pkey1] = value1;
4076
4123
  this._param[pkey2] = value2;
4077
4124
  if (paramName) {
@@ -4090,7 +4137,7 @@ class StreamQuery {
4090
4137
  }
4091
4138
  else {
4092
4139
  const pkey = `p${this._prefix}${this._index++}`;
4093
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} ${not} IN (:${pkey}) `);
4140
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} ${not} IN (:${pkey}) `);
4094
4141
  this._param[pkey] = value;
4095
4142
  if (paramName) {
4096
4143
  this._paramKeys[paramName] = pkey;
@@ -4110,7 +4157,7 @@ class StreamQuery {
4110
4157
  }
4111
4158
  else {
4112
4159
  const pkey = `p${this._prefix}${this._index++}`;
4113
- this._wheres.push(`AND :${pkey} ${not} IN (${key.map(k => this[_fields][String(k)]?.C2()).join(',')}) `);
4160
+ this._wheres.push(`AND :${pkey} ${not} IN (${key.map(k => `t.${this[_fields][String(k)]?.C2()}`).join(',')}) `);
4114
4161
  this._param[pkey] = value;
4115
4162
  if (paramName) {
4116
4163
  this._paramKeys[paramName] = pkey;
@@ -4136,7 +4183,7 @@ class StreamQuery {
4136
4183
  }
4137
4184
  else {
4138
4185
  const pkey = `p${this._prefix}${this._index++}`;
4139
- this._wheres.push(`AND (${this[_fields][String(key1)]?.C2()} << 8) + ${this[_fields][String(key2)]?.C2()} ${not} ${op} :${pkey} `);
4186
+ this._wheres.push(`AND (t.${this[_fields][String(key1)]?.C2()} << 8) + t.${this[_fields][String(key2)]?.C2()} ${not} ${op} :${pkey} `);
4140
4187
  this._param[pkey] = value;
4141
4188
  if (paramName) {
4142
4189
  this._paramKeys[paramName] = pkey;
@@ -4158,7 +4205,7 @@ class StreamQuery {
4158
4205
  }
4159
4206
  else {
4160
4207
  const pkey = `p${this._prefix}${this._index++}`;
4161
- this._wheres.push(`AND ${not} MATCH(${keys.map(key => this[_fields][String(key)]?.C2()).join(',')}) AGAINST (:${pkey} ${append ?? ''})`);
4208
+ this._wheres.push(`AND ${not} MATCH(${keys.map(key => `t.${this[_fields][String(key)]?.C2()}`).join(',')}) AGAINST (:${pkey} ${append ?? ''})`);
4162
4209
  this._param[pkey] = value;
4163
4210
  if (paramName) {
4164
4211
  this._paramKeys[paramName] = pkey;
@@ -4180,7 +4227,29 @@ class StreamQuery {
4180
4227
  }
4181
4228
  else {
4182
4229
  const pkey = `p${this._prefix}${this._index++}`;
4183
- this._wheres.push(`AND ${not} POW(2, ${this[_fields][String(key)]?.C2()}) & :${pkey}`);
4230
+ this._wheres.push(`AND ${not} POW(2, t.${this[_fields][String(key)]?.C2()}) & :${pkey}`);
4231
+ this._param[pkey] = value;
4232
+ if (paramName) {
4233
+ this._paramKeys[paramName] = pkey;
4234
+ }
4235
+ }
4236
+ return this;
4237
+ }
4238
+ _pow2(key, value, { not = '', paramName = '', breakExcuteIfEmpty = true } = {}) {
4239
+ if (value === null
4240
+ || value === undefined
4241
+ || emptyString(`${value ?? ''}`)) {
4242
+ if (breakExcuteIfEmpty) {
4243
+ this.if_exec = false;
4244
+ }
4245
+ return this;
4246
+ }
4247
+ if (paramName !== undefined && this._paramKeys.hasOwnProperty(paramName)) {
4248
+ this._param[this._paramKeys[paramName]] = value;
4249
+ }
4250
+ else {
4251
+ const pkey = `p${this._prefix}${this._index++}`;
4252
+ this._wheres.push(`AND ${not} POW(2, :${pkey}) & t.${this[_fields][String(key)]?.C2()}`);
4184
4253
  this._param[pkey] = value;
4185
4254
  if (paramName) {
4186
4255
  this._paramKeys[paramName] = pkey;
@@ -4202,7 +4271,29 @@ class StreamQuery {
4202
4271
  }
4203
4272
  else {
4204
4273
  const pkey = `p${this._prefix}${this._index++}`;
4205
- this._wheres.push(`AND ${this[_fields][String(key)]?.C2()} ${not} ${op} CONCAT('${left}', :${pkey}, '${right}') `);
4274
+ this._wheres.push(`AND t.${this[_fields][String(key)]?.C2()} ${not} ${op} CONCAT('${left}', :${pkey}, '${right}') `);
4275
+ this._param[pkey] = value;
4276
+ if (paramName) {
4277
+ this._paramKeys[paramName] = pkey;
4278
+ }
4279
+ }
4280
+ return this;
4281
+ }
4282
+ _like2(key, value, { not = '', left = '', right = '', paramName = '', op = 'LIKE', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) {
4283
+ if (value === null
4284
+ || value === undefined
4285
+ || (emptyString(`${value ?? ''}`) && skipEmptyString)) {
4286
+ if (breakExcuteIfEmpty) {
4287
+ this.if_exec = false;
4288
+ }
4289
+ return this;
4290
+ }
4291
+ if (paramName !== undefined && this._paramKeys.hasOwnProperty(paramName)) {
4292
+ this._param[this._paramKeys[paramName]] = value;
4293
+ }
4294
+ else {
4295
+ const pkey = `p${this._prefix}${this._index++}`;
4296
+ this._wheres.push(`AND :${pkey} ${not} ${op} CONCAT('${left}',t.${this[_fields][String(key)]?.C2()}, '${right}') `);
4206
4297
  this._param[pkey] = value;
4207
4298
  if (paramName) {
4208
4299
  this._paramKeys[paramName] = pkey;
@@ -4224,7 +4315,29 @@ class StreamQuery {
4224
4315
  }
4225
4316
  else {
4226
4317
  const pkey = `p${this._prefix}${this._index++}`;
4227
- this._wheres.push(`AND LOCATE(${this[_fields][String(key)]?.C2()}, :${pkey}) ${not ? '=' : '>'} 0`);
4318
+ this._wheres.push(`AND LOCATE(t.${this[_fields][String(key)]?.C2()}, :${pkey}) ${not ? '=' : '>'} 0`);
4319
+ this._param[pkey] = value;
4320
+ if (paramName) {
4321
+ this._paramKeys[paramName] = pkey;
4322
+ }
4323
+ }
4324
+ return this;
4325
+ }
4326
+ _includes2(key, value, { not = '', paramName = '', skipEmptyString = true, breakExcuteIfEmpty = true } = {}) {
4327
+ if (value === null
4328
+ || value === undefined
4329
+ || (emptyString(`${value ?? ''}`) && skipEmptyString)) {
4330
+ if (breakExcuteIfEmpty) {
4331
+ this.if_exec = false;
4332
+ }
4333
+ return this;
4334
+ }
4335
+ if (paramName !== undefined && this._paramKeys.hasOwnProperty(paramName)) {
4336
+ this._param[this._paramKeys[paramName]] = value;
4337
+ }
4338
+ else {
4339
+ const pkey = `p${this._prefix}${this._index++}`;
4340
+ this._wheres.push(`AND LOCATE(:${pkey}, t.${this[_fields][String(key)]?.C2()}) ${not ? '=' : '>'} 0`);
4228
4341
  this._param[pkey] = value;
4229
4342
  if (paramName) {
4230
4343
  this._paramKeys[paramName] = pkey;
@@ -4278,75 +4391,87 @@ __decorate([
4278
4391
  __decorate([
4279
4392
  IF_PROCEED(),
4280
4393
  __metadata("design:type", Function),
4281
- __metadata("design:paramtypes", [Object, String, Object]),
4394
+ __metadata("design:paramtypes", [Object, Object, Object]),
4282
4395
  __metadata("design:returntype", void 0)
4283
- ], StreamQuery.prototype, "regexp", null);
4396
+ ], StreamQuery.prototype, "grate", null);
4284
4397
  __decorate([
4285
4398
  IF_PROCEED(),
4286
4399
  __metadata("design:type", Function),
4287
- __metadata("design:paramtypes", [Object, String, Object]),
4400
+ __metadata("design:paramtypes", [Object, Object, Object]),
4288
4401
  __metadata("design:returntype", void 0)
4289
- ], StreamQuery.prototype, "notRegexp", null);
4402
+ ], StreamQuery.prototype, "grateEq", null);
4290
4403
  __decorate([
4291
4404
  IF_PROCEED(),
4292
4405
  __metadata("design:type", Function),
4293
- __metadata("design:paramtypes", [Object, Object, Number, Object]),
4406
+ __metadata("design:paramtypes", [Object, Object]),
4294
4407
  __metadata("design:returntype", void 0)
4295
- ], StreamQuery.prototype, "shiftEq", null);
4408
+ ], StreamQuery.prototype, "grateWith", null);
4296
4409
  __decorate([
4297
4410
  IF_PROCEED(),
4298
4411
  __metadata("design:type", Function),
4299
- __metadata("design:paramtypes", [Object, Object, Number, Object]),
4412
+ __metadata("design:paramtypes", [Object, Object]),
4300
4413
  __metadata("design:returntype", void 0)
4301
- ], StreamQuery.prototype, "shiftNotEq", null);
4414
+ ], StreamQuery.prototype, "grateEqWith", null);
4302
4415
  __decorate([
4303
4416
  IF_PROCEED(),
4304
4417
  __metadata("design:type", Function),
4305
4418
  __metadata("design:paramtypes", [Object, Object, Object]),
4306
4419
  __metadata("design:returntype", void 0)
4307
- ], StreamQuery.prototype, "grate", null);
4420
+ ], StreamQuery.prototype, "less", null);
4308
4421
  __decorate([
4309
4422
  IF_PROCEED(),
4310
4423
  __metadata("design:type", Function),
4311
4424
  __metadata("design:paramtypes", [Object, Object, Object]),
4312
4425
  __metadata("design:returntype", void 0)
4313
- ], StreamQuery.prototype, "grateEq", null);
4426
+ ], StreamQuery.prototype, "lessEq", null);
4314
4427
  __decorate([
4315
4428
  IF_PROCEED(),
4316
4429
  __metadata("design:type", Function),
4317
4430
  __metadata("design:paramtypes", [Object, Object]),
4318
4431
  __metadata("design:returntype", void 0)
4319
- ], StreamQuery.prototype, "grateWith", null);
4432
+ ], StreamQuery.prototype, "lessWith", null);
4320
4433
  __decorate([
4321
4434
  IF_PROCEED(),
4322
4435
  __metadata("design:type", Function),
4323
4436
  __metadata("design:paramtypes", [Object, Object]),
4324
4437
  __metadata("design:returntype", void 0)
4325
- ], StreamQuery.prototype, "grateEqWith", null);
4438
+ ], StreamQuery.prototype, "lessEqWith", null);
4326
4439
  __decorate([
4327
4440
  IF_PROCEED(),
4328
4441
  __metadata("design:type", Function),
4329
- __metadata("design:paramtypes", [Object, Object, Object]),
4442
+ __metadata("design:paramtypes", [Object, String, Object]),
4330
4443
  __metadata("design:returntype", void 0)
4331
- ], StreamQuery.prototype, "less", null);
4444
+ ], StreamQuery.prototype, "regexp", null);
4332
4445
  __decorate([
4333
4446
  IF_PROCEED(),
4334
4447
  __metadata("design:type", Function),
4335
- __metadata("design:paramtypes", [Object, Object, Object]),
4448
+ __metadata("design:paramtypes", [Object, String, Object]),
4336
4449
  __metadata("design:returntype", void 0)
4337
- ], StreamQuery.prototype, "lessEq", null);
4450
+ ], StreamQuery.prototype, "notRegexp", null);
4338
4451
  __decorate([
4339
4452
  IF_PROCEED(),
4340
4453
  __metadata("design:type", Function),
4341
- __metadata("design:paramtypes", [Object, Object]),
4454
+ __metadata("design:paramtypes", [Object, String, Object]),
4342
4455
  __metadata("design:returntype", void 0)
4343
- ], StreamQuery.prototype, "lessWith", null);
4456
+ ], StreamQuery.prototype, "regexp2", null);
4344
4457
  __decorate([
4345
4458
  IF_PROCEED(),
4346
4459
  __metadata("design:type", Function),
4347
- __metadata("design:paramtypes", [Object, Object]),
4460
+ __metadata("design:paramtypes", [Object, String, Object]),
4348
4461
  __metadata("design:returntype", void 0)
4349
- ], StreamQuery.prototype, "lessEqWith", null);
4462
+ ], StreamQuery.prototype, "notRegexp2", null);
4463
+ __decorate([
4464
+ IF_PROCEED(),
4465
+ __metadata("design:type", Function),
4466
+ __metadata("design:paramtypes", [Object, Object, Number, Object]),
4467
+ __metadata("design:returntype", void 0)
4468
+ ], StreamQuery.prototype, "shiftEq", null);
4469
+ __decorate([
4470
+ IF_PROCEED(),
4471
+ __metadata("design:type", Function),
4472
+ __metadata("design:paramtypes", [Object, Object, Number, Object]),
4473
+ __metadata("design:returntype", void 0)
4474
+ ], StreamQuery.prototype, "shiftNotEq", null);
4350
4475
  __decorate([
4351
4476
  IF_PROCEED(),
4352
4477
  __metadata("design:type", Function),
@@ -4436,13 +4561,109 @@ __decorate([
4436
4561
  __metadata("design:type", Function),
4437
4562
  __metadata("design:paramtypes", [Object, Object, Object]),
4438
4563
  __metadata("design:returntype", void 0)
4439
- ], StreamQuery.prototype, "PreciseGlob", null);
4564
+ ], StreamQuery.prototype, "preciseGlob", null);
4440
4565
  __decorate([
4441
4566
  IF_PROCEED(),
4442
4567
  __metadata("design:type", Function),
4443
4568
  __metadata("design:paramtypes", [Object, Object, Object]),
4444
4569
  __metadata("design:returntype", void 0)
4445
4570
  ], StreamQuery.prototype, "notPreciseGlob", null);
4571
+ __decorate([
4572
+ IF_PROCEED(),
4573
+ __metadata("design:type", Function),
4574
+ __metadata("design:paramtypes", [Object, Object, Object]),
4575
+ __metadata("design:returntype", void 0)
4576
+ ], StreamQuery.prototype, "like2", null);
4577
+ __decorate([
4578
+ IF_PROCEED(),
4579
+ __metadata("design:type", Function),
4580
+ __metadata("design:paramtypes", [Object, Object, Object]),
4581
+ __metadata("design:returntype", void 0)
4582
+ ], StreamQuery.prototype, "notLike2", null);
4583
+ __decorate([
4584
+ IF_PROCEED(),
4585
+ __metadata("design:type", Function),
4586
+ __metadata("design:paramtypes", [Object, Object, Object]),
4587
+ __metadata("design:returntype", void 0)
4588
+ ], StreamQuery.prototype, "leftLike2", null);
4589
+ __decorate([
4590
+ IF_PROCEED(),
4591
+ __metadata("design:type", Function),
4592
+ __metadata("design:paramtypes", [Object, Object, Object]),
4593
+ __metadata("design:returntype", void 0)
4594
+ ], StreamQuery.prototype, "notLeftLike2", null);
4595
+ __decorate([
4596
+ IF_PROCEED(),
4597
+ __metadata("design:type", Function),
4598
+ __metadata("design:paramtypes", [Object, Object, Object]),
4599
+ __metadata("design:returntype", void 0)
4600
+ ], StreamQuery.prototype, "rightLike2", null);
4601
+ __decorate([
4602
+ IF_PROCEED(),
4603
+ __metadata("design:type", Function),
4604
+ __metadata("design:paramtypes", [Object, Object, Object]),
4605
+ __metadata("design:returntype", void 0)
4606
+ ], StreamQuery.prototype, "notRightLike2", null);
4607
+ __decorate([
4608
+ IF_PROCEED(),
4609
+ __metadata("design:type", Function),
4610
+ __metadata("design:paramtypes", [Object, Object, Object]),
4611
+ __metadata("design:returntype", void 0)
4612
+ ], StreamQuery.prototype, "PreciseLike2", null);
4613
+ __decorate([
4614
+ IF_PROCEED(),
4615
+ __metadata("design:type", Function),
4616
+ __metadata("design:paramtypes", [Object, Object, Object]),
4617
+ __metadata("design:returntype", void 0)
4618
+ ], StreamQuery.prototype, "notPreciseLike2", null);
4619
+ __decorate([
4620
+ IF_PROCEED(),
4621
+ __metadata("design:type", Function),
4622
+ __metadata("design:paramtypes", [Object, Object, Object]),
4623
+ __metadata("design:returntype", void 0)
4624
+ ], StreamQuery.prototype, "glob2", null);
4625
+ __decorate([
4626
+ IF_PROCEED(),
4627
+ __metadata("design:type", Function),
4628
+ __metadata("design:paramtypes", [Object, Object, Object]),
4629
+ __metadata("design:returntype", void 0)
4630
+ ], StreamQuery.prototype, "notGlob2", null);
4631
+ __decorate([
4632
+ IF_PROCEED(),
4633
+ __metadata("design:type", Function),
4634
+ __metadata("design:paramtypes", [Object, Object, Object]),
4635
+ __metadata("design:returntype", void 0)
4636
+ ], StreamQuery.prototype, "leftGlob2", null);
4637
+ __decorate([
4638
+ IF_PROCEED(),
4639
+ __metadata("design:type", Function),
4640
+ __metadata("design:paramtypes", [Object, Object, Object]),
4641
+ __metadata("design:returntype", void 0)
4642
+ ], StreamQuery.prototype, "notLeftGlob2", null);
4643
+ __decorate([
4644
+ IF_PROCEED(),
4645
+ __metadata("design:type", Function),
4646
+ __metadata("design:paramtypes", [Object, Object, Object]),
4647
+ __metadata("design:returntype", void 0)
4648
+ ], StreamQuery.prototype, "rightGlob2", null);
4649
+ __decorate([
4650
+ IF_PROCEED(),
4651
+ __metadata("design:type", Function),
4652
+ __metadata("design:paramtypes", [Object, Object, Object]),
4653
+ __metadata("design:returntype", void 0)
4654
+ ], StreamQuery.prototype, "notRightGlob2", null);
4655
+ __decorate([
4656
+ IF_PROCEED(),
4657
+ __metadata("design:type", Function),
4658
+ __metadata("design:paramtypes", [Object, Object, Object]),
4659
+ __metadata("design:returntype", void 0)
4660
+ ], StreamQuery.prototype, "preciseGlob2", null);
4661
+ __decorate([
4662
+ IF_PROCEED(),
4663
+ __metadata("design:type", Function),
4664
+ __metadata("design:paramtypes", [Object, Object, Object]),
4665
+ __metadata("design:returntype", void 0)
4666
+ ], StreamQuery.prototype, "notPreciseGlob2", null);
4446
4667
  __decorate([
4447
4668
  IF_PROCEED(),
4448
4669
  __metadata("design:type", Function),
@@ -4515,6 +4736,18 @@ __decorate([
4515
4736
  __metadata("design:paramtypes", [Object, Number, Object]),
4516
4737
  __metadata("design:returntype", void 0)
4517
4738
  ], StreamQuery.prototype, "notPow", null);
4739
+ __decorate([
4740
+ IF_PROCEED(),
4741
+ __metadata("design:type", Function),
4742
+ __metadata("design:paramtypes", [Object, Number, Object]),
4743
+ __metadata("design:returntype", void 0)
4744
+ ], StreamQuery.prototype, "pow2", null);
4745
+ __decorate([
4746
+ IF_PROCEED(),
4747
+ __metadata("design:type", Function),
4748
+ __metadata("design:paramtypes", [Object, Number, Object]),
4749
+ __metadata("design:returntype", void 0)
4750
+ ], StreamQuery.prototype, "notPow2", null);
4518
4751
  __decorate([
4519
4752
  IF_PROCEED(),
4520
4753
  __metadata("design:type", Function),
@@ -4575,6 +4808,18 @@ __decorate([
4575
4808
  __metadata("design:paramtypes", [Object, Object, Object]),
4576
4809
  __metadata("design:returntype", void 0)
4577
4810
  ], StreamQuery.prototype, "notIncludes", null);
4811
+ __decorate([
4812
+ IF_PROCEED(),
4813
+ __metadata("design:type", Function),
4814
+ __metadata("design:paramtypes", [Object, Object, Object]),
4815
+ __metadata("design:returntype", void 0)
4816
+ ], StreamQuery.prototype, "includes2", null);
4817
+ __decorate([
4818
+ IF_PROCEED(),
4819
+ __metadata("design:type", Function),
4820
+ __metadata("design:paramtypes", [Object, Object, Object]),
4821
+ __metadata("design:returntype", void 0)
4822
+ ], StreamQuery.prototype, "notIncludes2", null);
4578
4823
  __decorate([
4579
4824
  IF_PROCEED(),
4580
4825
  __metadata("design:type", Function),
@@ -4599,6 +4844,12 @@ __decorate([
4599
4844
  __metadata("design:paramtypes", [Object]),
4600
4845
  __metadata("design:returntype", void 0)
4601
4846
  ], StreamQuery.prototype, "or", null);
4847
+ __decorate([
4848
+ IF_PROCEED(),
4849
+ __metadata("design:type", Function),
4850
+ __metadata("design:paramtypes", [String, Object]),
4851
+ __metadata("design:returntype", void 0)
4852
+ ], StreamQuery.prototype, "where", null);
4602
4853
  __decorate([
4603
4854
  IF_PROCEED(),
4604
4855
  __metadata("design:type", Function),