baja-lite 1.5.21 → 1.5.22

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sql.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baja-lite",
3
- "version": "1.5.21",
3
+ "version": "1.5.22",
4
4
  "description": "some util for self",
5
5
  "homepage": "https://github.com/void-soul/baja-lite",
6
6
  "repository": {
package/sql.js CHANGED
@@ -3783,12 +3783,12 @@ class StreamQuery {
3783
3783
  page(pageNumber, pageSize) { this._startRow = ((pageNumber || 1) - 1) * pageSize; this._pageSize = pageSize; return this; }
3784
3784
  distinct(on = true) { this._distinct = on; return this; }
3785
3785
  /** COUNT(DISTINCT key) */
3786
- countDistinct(key, countName) { this._columns.push(`COUNT(DISTINCT t.${this[_fields][String(key)]?.C2()}) ${countName || `t.${this[_fields][String(key)]?.C2()}`}`); return this; }
3786
+ countDistinct(key, countName) { this._columns.push(`COUNT(DISTINCT t.${this[_fields][String(key)]?.C2()}) ${countName || this[_fields][String(key)]?.C2()}`); return this; }
3787
3787
  count(countName) { this._columns.push(`COUNT(1) ${countName ?? 'ct'}`); 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; }
3788
+ sum(key, legName, distinct) { this._columns.push(`SUM(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName || 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 || 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 || 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 || this[_fields][String(key)]?.C2()}`); return this; }
3792
3792
  /** GROUP_CONCAT([DISTINCT] key [ORDER BY :asc ASC] [ORDER BY :asc DESC] [SEPARATOR :separator]) */
3793
3793
  groupConcat(key, param) {
3794
3794
  this._columns.push(`GROUP_CONCAT(
@@ -3796,7 +3796,7 @@ class StreamQuery {
3796
3796
  ${param && param.asc && param.asc.length > 0 ? `ORDER BY ${param.asc.map(i => `t.${this[_fields][String(i)]?.C2()} ASC`)} ` : ''}
3797
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`)} ` : ''}
3798
3798
  SEPARATOR '${param && param.separator || ','}'
3799
- ) ${param && param.groupName || `t.${this[_fields][String(key)]?.C2()}`}`);
3799
+ ) ${param && param.groupName || this[_fields][String(key)]?.C2()}`);
3800
3800
  return this;
3801
3801
  }
3802
3802
  select(...key) { this._columns.push(...(key.map(k => `t.${this[_fields][String(k)].C3()}`))); return this; }