alasql 4.2.1 → 4.2.2
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/dist/alasql-worker.js +2 -2
- package/dist/alasql.fs.js +52 -20
- package/dist/alasql.js +52 -20
- package/dist/alasql.min.js +16 -16
- package/package.json +1 -1
package/dist/alasql-worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.2.
|
|
1
|
+
//! AlaSQL v4.2.1 build: develop-37ffe88b | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.2.
|
|
4
|
+
@version 4.2.1
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2023 Andrey Gershun & Mathias Wulff
|
package/dist/alasql.fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.2.
|
|
1
|
+
//! AlaSQL v4.2.1 build: develop-37ffe88b | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.2.
|
|
4
|
+
@version 4.2.1
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2023 Andrey Gershun & Mathias Wulff
|
|
@@ -141,8 +141,8 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
141
141
|
Current version of alasql
|
|
142
142
|
@constant {string}
|
|
143
143
|
*/
|
|
144
|
-
alasql.version = '4.2.
|
|
145
|
-
alasql.build = 'develop-
|
|
144
|
+
alasql.version = '4.2.1';
|
|
145
|
+
alasql.build = 'develop-37ffe88b';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -6629,8 +6629,10 @@ function queryfn3(query) {
|
|
|
6629
6629
|
var d = query.selectgfn(g, query.params, alasql);
|
|
6630
6630
|
|
|
6631
6631
|
for (const key in query.groupColumns) {
|
|
6632
|
-
|
|
6632
|
+
// ony remove columns where the alias is also not a column in the result
|
|
6633
|
+
if (query.groupColumns[key] !== key && d[query.groupColumns[key]] && !query.groupColumns[query.groupColumns[key]]){
|
|
6633
6634
|
delete d[query.groupColumns[key]];
|
|
6635
|
+
}
|
|
6634
6636
|
}
|
|
6635
6637
|
query.data.push(d);
|
|
6636
6638
|
}
|
|
@@ -10705,13 +10707,28 @@ yy.Over = class Over {
|
|
|
10705
10707
|
s += '.indexOf(';
|
|
10706
10708
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))>-1)';
|
|
10707
10709
|
} else if (Array.isArray(this.right)) {
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10710
|
+
if (!alasql.options.cache || this.right.filter((value) => value instanceof yy.ParamValue).length > 0) {
|
|
10711
|
+
// When not using cache, or when the array contains parameters, we need to re-create the Set
|
|
10712
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10713
|
+
s =
|
|
10714
|
+
'(new Set([' +
|
|
10715
|
+
this.right.map(ref).join(',') +
|
|
10716
|
+
']).has(alasql.utils.getValueOf(' +
|
|
10717
|
+
leftJS() +
|
|
10718
|
+
')))';
|
|
10719
|
+
} else {
|
|
10720
|
+
// Use a cache to not re-create the Set on every identitical query
|
|
10721
|
+
if (!alasql.sets) {
|
|
10722
|
+
alasql.sets = {};
|
|
10723
|
+
}
|
|
10724
|
+
const allValues = this.right.map((value) => value.value);
|
|
10725
|
+
const allValuesStr = allValues.join(",");
|
|
10726
|
+
if (!alasql.sets[allValuesStr]) {
|
|
10727
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10728
|
+
alasql.sets[allValuesStr] = new Set(allValues);
|
|
10729
|
+
}
|
|
10730
|
+
s = 'alasql.sets["' + allValuesStr + '"].has(alasql.utils.getValueOf(' + leftJS() + '))';
|
|
10731
|
+
}
|
|
10715
10732
|
} else {
|
|
10716
10733
|
s = '(' + rightJS() + '.indexOf(' + leftJS() + ')>-1)';
|
|
10717
10734
|
|
|
@@ -10727,13 +10744,28 @@ yy.Over = class Over {
|
|
|
10727
10744
|
s += '.indexOf(';
|
|
10728
10745
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))<0)';
|
|
10729
10746
|
} else if (Array.isArray(this.right)) {
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10747
|
+
if (!alasql.options.cache || this.right.filter((value) => value instanceof yy.ParamValue).length > 0) {
|
|
10748
|
+
// When not using cache, or when the array contains parameters, we need to re-create the Set
|
|
10749
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10750
|
+
s =
|
|
10751
|
+
'(!(new Set([' +
|
|
10752
|
+
this.right.map(ref).join(',') +
|
|
10753
|
+
']).has(alasql.utils.getValueOf(' +
|
|
10754
|
+
leftJS() +
|
|
10755
|
+
'))))';
|
|
10756
|
+
} else {
|
|
10757
|
+
// Use a cache to not re-create the Set on every identitical query
|
|
10758
|
+
if (!alasql.sets) {
|
|
10759
|
+
alasql.sets = {};
|
|
10760
|
+
}
|
|
10761
|
+
const allValues = this.right.map((value) => value.value);
|
|
10762
|
+
const allValuesStr = allValues.join(",");
|
|
10763
|
+
if (!alasql.sets[allValuesStr]) {
|
|
10764
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10765
|
+
alasql.sets[allValuesStr] = new Set(allValues);
|
|
10766
|
+
}
|
|
10767
|
+
s = '!alasql.sets["' + allValuesStr + '"].has(alasql.utils.getValueOf(' + leftJS() + '))';
|
|
10768
|
+
}
|
|
10737
10769
|
} else {
|
|
10738
10770
|
s = '(' + rightJS() + '.indexOf(';
|
|
10739
10771
|
s += leftJS() + ')==-1)';
|
|
@@ -10976,7 +11008,7 @@ yy.Over = class Over {
|
|
|
10976
11008
|
|
|
10977
11009
|
toString() {
|
|
10978
11010
|
var s;
|
|
10979
|
-
const {op, right} = this;
|
|
11011
|
+
const { op, right } = this;
|
|
10980
11012
|
const res = right.toString();
|
|
10981
11013
|
|
|
10982
11014
|
if (op === '~') {
|
package/dist/alasql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.2.
|
|
1
|
+
//! AlaSQL v4.2.1 build: develop-37ffe88b | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.2.
|
|
4
|
+
@version 4.2.1
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2023 Andrey Gershun & Mathias Wulff
|
|
@@ -141,8 +141,8 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
141
141
|
Current version of alasql
|
|
142
142
|
@constant {string}
|
|
143
143
|
*/
|
|
144
|
-
alasql.version = '4.2.
|
|
145
|
-
alasql.build = 'develop-
|
|
144
|
+
alasql.version = '4.2.1';
|
|
145
|
+
alasql.build = 'develop-37ffe88b';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -6629,8 +6629,10 @@ function queryfn3(query) {
|
|
|
6629
6629
|
var d = query.selectgfn(g, query.params, alasql);
|
|
6630
6630
|
|
|
6631
6631
|
for (const key in query.groupColumns) {
|
|
6632
|
-
|
|
6632
|
+
// ony remove columns where the alias is also not a column in the result
|
|
6633
|
+
if (query.groupColumns[key] !== key && d[query.groupColumns[key]] && !query.groupColumns[query.groupColumns[key]]){
|
|
6633
6634
|
delete d[query.groupColumns[key]];
|
|
6635
|
+
}
|
|
6634
6636
|
}
|
|
6635
6637
|
query.data.push(d);
|
|
6636
6638
|
}
|
|
@@ -10705,13 +10707,28 @@ yy.Over = class Over {
|
|
|
10705
10707
|
s += '.indexOf(';
|
|
10706
10708
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))>-1)';
|
|
10707
10709
|
} else if (Array.isArray(this.right)) {
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10710
|
+
if (!alasql.options.cache || this.right.filter((value) => value instanceof yy.ParamValue).length > 0) {
|
|
10711
|
+
// When not using cache, or when the array contains parameters, we need to re-create the Set
|
|
10712
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10713
|
+
s =
|
|
10714
|
+
'(new Set([' +
|
|
10715
|
+
this.right.map(ref).join(',') +
|
|
10716
|
+
']).has(alasql.utils.getValueOf(' +
|
|
10717
|
+
leftJS() +
|
|
10718
|
+
')))';
|
|
10719
|
+
} else {
|
|
10720
|
+
// Use a cache to not re-create the Set on every identitical query
|
|
10721
|
+
if (!alasql.sets) {
|
|
10722
|
+
alasql.sets = {};
|
|
10723
|
+
}
|
|
10724
|
+
const allValues = this.right.map((value) => value.value);
|
|
10725
|
+
const allValuesStr = allValues.join(",");
|
|
10726
|
+
if (!alasql.sets[allValuesStr]) {
|
|
10727
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10728
|
+
alasql.sets[allValuesStr] = new Set(allValues);
|
|
10729
|
+
}
|
|
10730
|
+
s = 'alasql.sets["' + allValuesStr + '"].has(alasql.utils.getValueOf(' + leftJS() + '))';
|
|
10731
|
+
}
|
|
10715
10732
|
} else {
|
|
10716
10733
|
s = '(' + rightJS() + '.indexOf(' + leftJS() + ')>-1)';
|
|
10717
10734
|
|
|
@@ -10727,13 +10744,28 @@ yy.Over = class Over {
|
|
|
10727
10744
|
s += '.indexOf(';
|
|
10728
10745
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))<0)';
|
|
10729
10746
|
} else if (Array.isArray(this.right)) {
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
|
|
10747
|
+
if (!alasql.options.cache || this.right.filter((value) => value instanceof yy.ParamValue).length > 0) {
|
|
10748
|
+
// When not using cache, or when the array contains parameters, we need to re-create the Set
|
|
10749
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10750
|
+
s =
|
|
10751
|
+
'(!(new Set([' +
|
|
10752
|
+
this.right.map(ref).join(',') +
|
|
10753
|
+
']).has(alasql.utils.getValueOf(' +
|
|
10754
|
+
leftJS() +
|
|
10755
|
+
'))))';
|
|
10756
|
+
} else {
|
|
10757
|
+
// Use a cache to not re-create the Set on every identitical query
|
|
10758
|
+
if (!alasql.sets) {
|
|
10759
|
+
alasql.sets = {};
|
|
10760
|
+
}
|
|
10761
|
+
const allValues = this.right.map((value) => value.value);
|
|
10762
|
+
const allValuesStr = allValues.join(",");
|
|
10763
|
+
if (!alasql.sets[allValuesStr]) {
|
|
10764
|
+
// leverage JS Set, which is faster for lookups than arrays
|
|
10765
|
+
alasql.sets[allValuesStr] = new Set(allValues);
|
|
10766
|
+
}
|
|
10767
|
+
s = '!alasql.sets["' + allValuesStr + '"].has(alasql.utils.getValueOf(' + leftJS() + '))';
|
|
10768
|
+
}
|
|
10737
10769
|
} else {
|
|
10738
10770
|
s = '(' + rightJS() + '.indexOf(';
|
|
10739
10771
|
s += leftJS() + ')==-1)';
|
|
@@ -10976,7 +11008,7 @@ yy.Over = class Over {
|
|
|
10976
11008
|
|
|
10977
11009
|
toString() {
|
|
10978
11010
|
var s;
|
|
10979
|
-
const {op, right} = this;
|
|
11011
|
+
const { op, right } = this;
|
|
10980
11012
|
const res = right.toString();
|
|
10981
11013
|
|
|
10982
11014
|
if (op === '~') {
|