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.
- package/package.json +1 -1
- package/sql.js +6 -6
package/package.json
CHANGED
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 ||
|
|
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 ||
|
|
3789
|
-
avg(key, legName, distinct) { this._columns.push(`AVG(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName ||
|
|
3790
|
-
max(key, legName, distinct) { this._columns.push(`MAX(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName ||
|
|
3791
|
-
min(key, legName, distinct) { this._columns.push(`MIN(${distinct ? 'DISTINCT' : ''} t.${this[_fields][String(key)]?.C2()}) ${legName ||
|
|
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 ||
|
|
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; }
|