alasql 2.1.5 → 2.1.7
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/.editorconfig +11 -0
- package/.eslintignore +2 -0
- package/README.md +1 -1
- package/dist/alasql-worker.js +2 -2
- package/dist/alasql-worker.min.js +1 -1
- package/dist/alasql.fs.js +59 -506
- package/dist/alasql.js +57 -506
- package/dist/alasql.min.js +14 -2
- package/package.json +5 -4
package/dist/alasql.fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.1.
|
|
1
|
+
//! AlaSQL v2.1.6-develop-8399ae92 | © 2014-2022 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.1.
|
|
4
|
+
@version 2.1.6-develop-8399ae92
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
|
|
@@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
142
142
|
Current version of alasql
|
|
143
143
|
@constant {string}
|
|
144
144
|
*/
|
|
145
|
-
alasql.version = '2.1.
|
|
145
|
+
alasql.version = '2.1.6-develop-8399ae92';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -3484,13 +3484,19 @@ var loadFile = (utils.loadFile = function (path, asy, success, error) {
|
|
|
3484
3484
|
});
|
|
3485
3485
|
} else {
|
|
3486
3486
|
if (/^[a-z]+:\/\//i.test(path)) {
|
|
3487
|
-
var
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3487
|
+
var fetch = require('node-fetch');
|
|
3488
|
+
fetch(path)
|
|
3489
|
+
.then((response) => response.arrayBuffer())
|
|
3490
|
+
.then((buf) => {
|
|
3491
|
+
var a = new Uint8Array(buf);
|
|
3492
|
+
var b = [...a].map((e) => String.fromCharCode(e)).join('');
|
|
3493
|
+
success(cutbom(b));
|
|
3494
|
+
})
|
|
3495
|
+
.catch((e) => {
|
|
3496
|
+
if (error) return error(e);
|
|
3497
|
+
console.error(e);
|
|
3498
|
+
throw e;
|
|
3499
|
+
});
|
|
3494
3500
|
} else {
|
|
3495
3501
|
//If async callthen call async
|
|
3496
3502
|
if (asy) {
|
|
@@ -3620,17 +3626,19 @@ var loadBinaryFile = (utils.loadBinaryFile = function (
|
|
|
3620
3626
|
fs = require('fs');
|
|
3621
3627
|
|
|
3622
3628
|
if (/^[a-z]+:\/\//i.test(path)) {
|
|
3623
|
-
var
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3629
|
+
var fetch = require('node-fetch');
|
|
3630
|
+
fetch(path)
|
|
3631
|
+
.then((response) => response.arrayBuffer())
|
|
3632
|
+
.then((buf) => {
|
|
3633
|
+
var a = new Uint8Array(buf);
|
|
3634
|
+
var b = [...a].map((e) => String.fromCharCode(e)).join('');
|
|
3635
|
+
success(b);
|
|
3636
|
+
})
|
|
3637
|
+
.catch((e) => {
|
|
3638
|
+
if (error) return error(e);
|
|
3639
|
+
console.error(e);
|
|
3640
|
+
throw e;
|
|
3641
|
+
});
|
|
3634
3642
|
} else {
|
|
3635
3643
|
if (runAsync) {
|
|
3636
3644
|
fs.readFile(path, function (err, data) {
|
|
@@ -4848,422 +4856,7 @@ alasql.compile = function (sql, databaseid) {
|
|
|
4848
4856
|
//
|
|
4849
4857
|
|
|
4850
4858
|
if (!utils.global.Promise) {
|
|
4851
|
-
|
|
4852
|
-
//*not-for-browser/*
|
|
4853
|
-
utils.global.Promise = require('es6-promise').Promise;
|
|
4854
|
-
//*/
|
|
4855
|
-
} else {
|
|
4856
|
-
/*!
|
|
4857
|
-
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
4858
|
-
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
4859
|
-
* @license Licensed under MIT license
|
|
4860
|
-
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
|
|
4861
|
-
* @version 3.2.1
|
|
4862
|
-
*/
|
|
4863
|
-
(function () {
|
|
4864
|
-
'use strict';
|
|
4865
|
-
function t(t) {
|
|
4866
|
-
return 'function' == typeof t || ('object' == typeof t && null !== t);
|
|
4867
|
-
}
|
|
4868
|
-
function e(t) {
|
|
4869
|
-
return 'function' == typeof t;
|
|
4870
|
-
}
|
|
4871
|
-
function n(t) {
|
|
4872
|
-
G = t;
|
|
4873
|
-
}
|
|
4874
|
-
function r(t) {
|
|
4875
|
-
Q = t;
|
|
4876
|
-
}
|
|
4877
|
-
function o() {
|
|
4878
|
-
return function () {
|
|
4879
|
-
process.nextTick(a);
|
|
4880
|
-
};
|
|
4881
|
-
}
|
|
4882
|
-
function i() {
|
|
4883
|
-
return function () {
|
|
4884
|
-
B(a);
|
|
4885
|
-
};
|
|
4886
|
-
}
|
|
4887
|
-
function s() {
|
|
4888
|
-
var t = 0,
|
|
4889
|
-
e = new X(a),
|
|
4890
|
-
n = document.createTextNode('');
|
|
4891
|
-
return (
|
|
4892
|
-
e.observe(n, {characterData: !0}),
|
|
4893
|
-
function () {
|
|
4894
|
-
n.data = t = ++t % 2;
|
|
4895
|
-
}
|
|
4896
|
-
);
|
|
4897
|
-
}
|
|
4898
|
-
function u() {
|
|
4899
|
-
var t = new MessageChannel();
|
|
4900
|
-
return (
|
|
4901
|
-
(t.port1.onmessage = a),
|
|
4902
|
-
function () {
|
|
4903
|
-
t.port2.postMessage(0);
|
|
4904
|
-
}
|
|
4905
|
-
);
|
|
4906
|
-
}
|
|
4907
|
-
function c() {
|
|
4908
|
-
return function () {
|
|
4909
|
-
setTimeout(a, 1);
|
|
4910
|
-
};
|
|
4911
|
-
}
|
|
4912
|
-
function a() {
|
|
4913
|
-
for (var t = 0; J > t; t += 2) {
|
|
4914
|
-
var e = tt[t],
|
|
4915
|
-
n = tt[t + 1];
|
|
4916
|
-
e(n), (tt[t] = void 0), (tt[t + 1] = void 0);
|
|
4917
|
-
}
|
|
4918
|
-
J = 0;
|
|
4919
|
-
}
|
|
4920
|
-
function f() {
|
|
4921
|
-
try {
|
|
4922
|
-
var t = require,
|
|
4923
|
-
e = t('vertx');
|
|
4924
|
-
return (B = e.runOnLoop || e.runOnContext), i();
|
|
4925
|
-
} catch (n) {
|
|
4926
|
-
return c();
|
|
4927
|
-
}
|
|
4928
|
-
}
|
|
4929
|
-
function l(t, e) {
|
|
4930
|
-
var n = this,
|
|
4931
|
-
r = new this.constructor(p);
|
|
4932
|
-
void 0 === r[rt] && k(r);
|
|
4933
|
-
var o = n._state;
|
|
4934
|
-
if (o) {
|
|
4935
|
-
var i = arguments[o - 1];
|
|
4936
|
-
Q(function () {
|
|
4937
|
-
x(o, r, i, n._result);
|
|
4938
|
-
});
|
|
4939
|
-
} else E(n, r, t, e);
|
|
4940
|
-
return r;
|
|
4941
|
-
}
|
|
4942
|
-
function h(t) {
|
|
4943
|
-
var e = this;
|
|
4944
|
-
if (t && 'object' == typeof t && t.constructor === e) return t;
|
|
4945
|
-
var n = new e(p);
|
|
4946
|
-
return g(n, t), n;
|
|
4947
|
-
}
|
|
4948
|
-
function p() {}
|
|
4949
|
-
function _() {
|
|
4950
|
-
return new TypeError('You cannot resolve a promise with itself');
|
|
4951
|
-
}
|
|
4952
|
-
function d() {
|
|
4953
|
-
return new TypeError('A promises callback cannot return that same promise.');
|
|
4954
|
-
}
|
|
4955
|
-
function v(t) {
|
|
4956
|
-
try {
|
|
4957
|
-
return t.then;
|
|
4958
|
-
} catch (e) {
|
|
4959
|
-
return (ut.error = e), ut;
|
|
4960
|
-
}
|
|
4961
|
-
}
|
|
4962
|
-
function y(t, e, n, r) {
|
|
4963
|
-
try {
|
|
4964
|
-
t.call(e, n, r);
|
|
4965
|
-
} catch (o) {
|
|
4966
|
-
return o;
|
|
4967
|
-
}
|
|
4968
|
-
}
|
|
4969
|
-
function m(t, e, n) {
|
|
4970
|
-
Q(function (t) {
|
|
4971
|
-
var r = !1,
|
|
4972
|
-
o = y(
|
|
4973
|
-
n,
|
|
4974
|
-
e,
|
|
4975
|
-
function (n) {
|
|
4976
|
-
r || ((r = !0), e !== n ? g(t, n) : S(t, n));
|
|
4977
|
-
},
|
|
4978
|
-
function (e) {
|
|
4979
|
-
r || ((r = !0), j(t, e));
|
|
4980
|
-
},
|
|
4981
|
-
'Settle: ' + (t._label || ' unknown promise')
|
|
4982
|
-
);
|
|
4983
|
-
!r && o && ((r = !0), j(t, o));
|
|
4984
|
-
}, t);
|
|
4985
|
-
}
|
|
4986
|
-
function b(t, e) {
|
|
4987
|
-
e._state === it
|
|
4988
|
-
? S(t, e._result)
|
|
4989
|
-
: e._state === st
|
|
4990
|
-
? j(t, e._result)
|
|
4991
|
-
: E(
|
|
4992
|
-
e,
|
|
4993
|
-
void 0,
|
|
4994
|
-
function (e) {
|
|
4995
|
-
g(t, e);
|
|
4996
|
-
},
|
|
4997
|
-
function (e) {
|
|
4998
|
-
j(t, e);
|
|
4999
|
-
}
|
|
5000
|
-
);
|
|
5001
|
-
}
|
|
5002
|
-
function w(t, n, r) {
|
|
5003
|
-
n.constructor === t.constructor && r === et && constructor.resolve === nt
|
|
5004
|
-
? b(t, n)
|
|
5005
|
-
: r === ut
|
|
5006
|
-
? j(t, ut.error)
|
|
5007
|
-
: void 0 === r
|
|
5008
|
-
? S(t, n)
|
|
5009
|
-
: e(r)
|
|
5010
|
-
? m(t, n, r)
|
|
5011
|
-
: S(t, n);
|
|
5012
|
-
}
|
|
5013
|
-
function g(e, n) {
|
|
5014
|
-
e === n ? j(e, _()) : t(n) ? w(e, n, v(n)) : S(e, n);
|
|
5015
|
-
}
|
|
5016
|
-
function A(t) {
|
|
5017
|
-
t._onerror && t._onerror(t._result), T(t);
|
|
5018
|
-
}
|
|
5019
|
-
function S(t, e) {
|
|
5020
|
-
t._state === ot &&
|
|
5021
|
-
((t._result = e), (t._state = it), 0 !== t._subscribers.length && Q(T, t));
|
|
5022
|
-
}
|
|
5023
|
-
function j(t, e) {
|
|
5024
|
-
t._state === ot && ((t._state = st), (t._result = e), Q(A, t));
|
|
5025
|
-
}
|
|
5026
|
-
function E(t, e, n, r) {
|
|
5027
|
-
var o = t._subscribers,
|
|
5028
|
-
i = o.length;
|
|
5029
|
-
(t._onerror = null),
|
|
5030
|
-
(o[i] = e),
|
|
5031
|
-
(o[i + it] = n),
|
|
5032
|
-
(o[i + st] = r),
|
|
5033
|
-
0 === i && t._state && Q(T, t);
|
|
5034
|
-
}
|
|
5035
|
-
function T(t) {
|
|
5036
|
-
var e = t._subscribers,
|
|
5037
|
-
n = t._state;
|
|
5038
|
-
if (0 !== e.length) {
|
|
5039
|
-
for (var r, o, i = t._result, s = 0; s < e.length; s += 3)
|
|
5040
|
-
(r = e[s]), (o = e[s + n]), r ? x(n, r, o, i) : o(i);
|
|
5041
|
-
t._subscribers.length = 0;
|
|
5042
|
-
}
|
|
5043
|
-
}
|
|
5044
|
-
function M() {
|
|
5045
|
-
this.error = null;
|
|
5046
|
-
}
|
|
5047
|
-
function P(t, e) {
|
|
5048
|
-
try {
|
|
5049
|
-
return t(e);
|
|
5050
|
-
} catch (n) {
|
|
5051
|
-
return (ct.error = n), ct;
|
|
5052
|
-
}
|
|
5053
|
-
}
|
|
5054
|
-
function x(t, n, r, o) {
|
|
5055
|
-
var i,
|
|
5056
|
-
s,
|
|
5057
|
-
u,
|
|
5058
|
-
c,
|
|
5059
|
-
a = e(r);
|
|
5060
|
-
if (a) {
|
|
5061
|
-
if (((i = P(r, o)), i === ct ? ((c = !0), (s = i.error), (i = null)) : (u = !0), n === i))
|
|
5062
|
-
return void j(n, d());
|
|
5063
|
-
} else (i = o), (u = !0);
|
|
5064
|
-
n._state !== ot ||
|
|
5065
|
-
(a && u ? g(n, i) : c ? j(n, s) : t === it ? S(n, i) : t === st && j(n, i));
|
|
5066
|
-
}
|
|
5067
|
-
function C(t, e) {
|
|
5068
|
-
try {
|
|
5069
|
-
e(
|
|
5070
|
-
function (e) {
|
|
5071
|
-
g(t, e);
|
|
5072
|
-
},
|
|
5073
|
-
function (e) {
|
|
5074
|
-
j(t, e);
|
|
5075
|
-
}
|
|
5076
|
-
);
|
|
5077
|
-
} catch (n) {
|
|
5078
|
-
j(t, n);
|
|
5079
|
-
}
|
|
5080
|
-
}
|
|
5081
|
-
function O() {
|
|
5082
|
-
return at++;
|
|
5083
|
-
}
|
|
5084
|
-
function k(t) {
|
|
5085
|
-
(t[rt] = at++), (t._state = void 0), (t._result = void 0), (t._subscribers = []);
|
|
5086
|
-
}
|
|
5087
|
-
function Y(t) {
|
|
5088
|
-
return new _t(this, t).promise;
|
|
5089
|
-
}
|
|
5090
|
-
function q(t) {
|
|
5091
|
-
var e = this;
|
|
5092
|
-
return new e(
|
|
5093
|
-
I(t)
|
|
5094
|
-
? function (n, r) {
|
|
5095
|
-
for (var o = t.length, i = 0; o > i; i++) e.resolve(t[i]).then(n, r);
|
|
5096
|
-
}
|
|
5097
|
-
: function (t, e) {
|
|
5098
|
-
e(new TypeError('You must pass an array to race.'));
|
|
5099
|
-
}
|
|
5100
|
-
);
|
|
5101
|
-
}
|
|
5102
|
-
function F(t) {
|
|
5103
|
-
var e = this,
|
|
5104
|
-
n = new e(p);
|
|
5105
|
-
return j(n, t), n;
|
|
5106
|
-
}
|
|
5107
|
-
function D() {
|
|
5108
|
-
throw new TypeError(
|
|
5109
|
-
'You must pass a resolver function as the first argument to the promise constructor'
|
|
5110
|
-
);
|
|
5111
|
-
}
|
|
5112
|
-
function K() {
|
|
5113
|
-
throw new TypeError(
|
|
5114
|
-
"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."
|
|
5115
|
-
);
|
|
5116
|
-
}
|
|
5117
|
-
function L(t) {
|
|
5118
|
-
(this[rt] = O()),
|
|
5119
|
-
(this._result = this._state = void 0),
|
|
5120
|
-
(this._subscribers = []),
|
|
5121
|
-
p !== t && ('function' != typeof t && D(), this instanceof L ? C(this, t) : K());
|
|
5122
|
-
}
|
|
5123
|
-
function N(t, e) {
|
|
5124
|
-
(this._instanceConstructor = t),
|
|
5125
|
-
(this.promise = new t(p)),
|
|
5126
|
-
this.promise[rt] || k(this.promise),
|
|
5127
|
-
Array.isArray(e)
|
|
5128
|
-
? ((this._input = e),
|
|
5129
|
-
(this.length = e.length),
|
|
5130
|
-
(this._remaining = e.length),
|
|
5131
|
-
(this._result = new Array(this.length)),
|
|
5132
|
-
0 === this.length
|
|
5133
|
-
? S(this.promise, this._result)
|
|
5134
|
-
: ((this.length = this.length || 0),
|
|
5135
|
-
this._enumerate(),
|
|
5136
|
-
0 === this._remaining && S(this.promise, this._result)))
|
|
5137
|
-
: j(this.promise, U());
|
|
5138
|
-
}
|
|
5139
|
-
function U() {
|
|
5140
|
-
return new Error('Array Methods must be provided an Array');
|
|
5141
|
-
}
|
|
5142
|
-
function W() {
|
|
5143
|
-
var t;
|
|
5144
|
-
if ('undefined' != typeof global) t = global;
|
|
5145
|
-
else if ('undefined' != typeof self) t = self;
|
|
5146
|
-
else
|
|
5147
|
-
try {
|
|
5148
|
-
t = Function('return this')();
|
|
5149
|
-
} catch (e) {
|
|
5150
|
-
throw new Error(
|
|
5151
|
-
'polyfill failed because global object is unavailable in this environment'
|
|
5152
|
-
);
|
|
5153
|
-
}
|
|
5154
|
-
var n = t.Promise;
|
|
5155
|
-
(!n || '[object Promise]' !== Object.prototype.toString.call(n.resolve()) || n.cast) &&
|
|
5156
|
-
(t.Promise = pt);
|
|
5157
|
-
}
|
|
5158
|
-
var z;
|
|
5159
|
-
z = Array.isArray
|
|
5160
|
-
? Array.isArray
|
|
5161
|
-
: function (t) {
|
|
5162
|
-
return '[object Array]' === Object.prototype.toString.call(t);
|
|
5163
|
-
};
|
|
5164
|
-
var B,
|
|
5165
|
-
G,
|
|
5166
|
-
H,
|
|
5167
|
-
I = z,
|
|
5168
|
-
J = 0,
|
|
5169
|
-
Q = function (t, e) {
|
|
5170
|
-
(tt[J] = t), (tt[J + 1] = e), (J += 2), 2 === J && (G ? G(a) : H());
|
|
5171
|
-
},
|
|
5172
|
-
R = 'undefined' != typeof window ? window : void 0,
|
|
5173
|
-
V = R || {},
|
|
5174
|
-
X = V.MutationObserver || V.WebKitMutationObserver,
|
|
5175
|
-
Z =
|
|
5176
|
-
'undefined' == typeof self &&
|
|
5177
|
-
'undefined' != typeof process &&
|
|
5178
|
-
'[object process]' === {}.toString.call(process),
|
|
5179
|
-
$ =
|
|
5180
|
-
'undefined' != typeof Uint8ClampedArray &&
|
|
5181
|
-
'undefined' != typeof importScripts &&
|
|
5182
|
-
'undefined' != typeof MessageChannel,
|
|
5183
|
-
tt = new Array(1e3);
|
|
5184
|
-
H = Z ? o() : X ? s() : $ ? u() : void 0 === R && 'function' == typeof require ? f() : c();
|
|
5185
|
-
var et = l,
|
|
5186
|
-
nt = h,
|
|
5187
|
-
rt = Math.random().toString(36).substring(16),
|
|
5188
|
-
ot = void 0,
|
|
5189
|
-
it = 1,
|
|
5190
|
-
st = 2,
|
|
5191
|
-
ut = new M(),
|
|
5192
|
-
ct = new M(),
|
|
5193
|
-
at = 0,
|
|
5194
|
-
ft = Y,
|
|
5195
|
-
lt = q,
|
|
5196
|
-
ht = F,
|
|
5197
|
-
pt = L;
|
|
5198
|
-
(L.all = ft),
|
|
5199
|
-
(L.race = lt),
|
|
5200
|
-
(L.resolve = nt),
|
|
5201
|
-
(L.reject = ht),
|
|
5202
|
-
(L._setScheduler = n),
|
|
5203
|
-
(L._setAsap = r),
|
|
5204
|
-
(L._asap = Q),
|
|
5205
|
-
(L.prototype = {
|
|
5206
|
-
constructor: L,
|
|
5207
|
-
then: et,
|
|
5208
|
-
catch: function (t) {
|
|
5209
|
-
return this.then(null, t);
|
|
5210
|
-
},
|
|
5211
|
-
});
|
|
5212
|
-
var _t = N;
|
|
5213
|
-
(N.prototype._enumerate = function () {
|
|
5214
|
-
for (var t = this.length, e = this._input, n = 0; this._state === ot && t > n; n++)
|
|
5215
|
-
this._eachEntry(e[n], n);
|
|
5216
|
-
}),
|
|
5217
|
-
(N.prototype._eachEntry = function (t, e) {
|
|
5218
|
-
var n = this._instanceConstructor,
|
|
5219
|
-
r = n.resolve;
|
|
5220
|
-
if (r === nt) {
|
|
5221
|
-
var o = v(t);
|
|
5222
|
-
if (o === et && t._state !== ot) this._settledAt(t._state, e, t._result);
|
|
5223
|
-
else if ('function' != typeof o) this._remaining--, (this._result[e] = t);
|
|
5224
|
-
else if (n === pt) {
|
|
5225
|
-
var i = new n(p);
|
|
5226
|
-
w(i, t, o), this._willSettleAt(i, e);
|
|
5227
|
-
} else
|
|
5228
|
-
this._willSettleAt(
|
|
5229
|
-
new n(function (e) {
|
|
5230
|
-
e(t);
|
|
5231
|
-
}),
|
|
5232
|
-
e
|
|
5233
|
-
);
|
|
5234
|
-
} else this._willSettleAt(r(t), e);
|
|
5235
|
-
}),
|
|
5236
|
-
(N.prototype._settledAt = function (t, e, n) {
|
|
5237
|
-
var r = this.promise;
|
|
5238
|
-
r._state === ot && (this._remaining--, t === st ? j(r, n) : (this._result[e] = n)),
|
|
5239
|
-
0 === this._remaining && S(r, this._result);
|
|
5240
|
-
}),
|
|
5241
|
-
(N.prototype._willSettleAt = function (t, e) {
|
|
5242
|
-
var n = this;
|
|
5243
|
-
E(
|
|
5244
|
-
t,
|
|
5245
|
-
void 0,
|
|
5246
|
-
function (t) {
|
|
5247
|
-
n._settledAt(it, e, t);
|
|
5248
|
-
},
|
|
5249
|
-
function (t) {
|
|
5250
|
-
n._settledAt(st, e, t);
|
|
5251
|
-
}
|
|
5252
|
-
);
|
|
5253
|
-
});
|
|
5254
|
-
var dt = W,
|
|
5255
|
-
vt = {Promise: pt, polyfill: dt};
|
|
5256
|
-
'function' == typeof define && define.amd
|
|
5257
|
-
? define(function () {
|
|
5258
|
-
return vt;
|
|
5259
|
-
})
|
|
5260
|
-
: 'undefined' != typeof module && module.exports
|
|
5261
|
-
? (module.exports = vt)
|
|
5262
|
-
: 'undefined' != typeof this && (this.ES6Promise = vt),
|
|
5263
|
-
dt();
|
|
5264
|
-
}.call(this));
|
|
5265
|
-
|
|
5266
|
-
}
|
|
4859
|
+
utils.global.Promise = Promise;
|
|
5267
4860
|
}
|
|
5268
4861
|
|
|
5269
4862
|
var promiseExec = function (sql, params, counterStep, counterTotal) {
|
|
@@ -10508,8 +10101,8 @@ yy.Over.prototype.toString = function () {
|
|
|
10508
10101
|
*/
|
|
10509
10102
|
|
|
10510
10103
|
/**
|
|
10511
|
-
|
|
10512
|
-
|
|
10104
|
+
Expression statement ( = 2*2; )
|
|
10105
|
+
@class
|
|
10513
10106
|
@param {object} params Initial parameters
|
|
10514
10107
|
*/
|
|
10515
10108
|
yy.ExpressionStatement = function (params) {
|
|
@@ -10633,8 +10226,7 @@ yy.JavaScript.prototype.toString = function () {
|
|
|
10633
10226
|
return s;
|
|
10634
10227
|
};
|
|
10635
10228
|
|
|
10636
|
-
yy.JavaScript.prototype.toJS = function (
|
|
10637
|
-
|
|
10229
|
+
yy.JavaScript.prototype.toJS = function () {
|
|
10638
10230
|
return '(' + this.value + ')';
|
|
10639
10231
|
};
|
|
10640
10232
|
yy.JavaScript.prototype.execute = function (databaseid, params, cb) {
|
|
@@ -10683,8 +10275,6 @@ yy.Join.prototype.toString = function () {
|
|
|
10683
10275
|
return s;
|
|
10684
10276
|
};
|
|
10685
10277
|
|
|
10686
|
-
// }
|
|
10687
|
-
|
|
10688
10278
|
/**
|
|
10689
10279
|
Table class
|
|
10690
10280
|
@class
|
|
@@ -10762,6 +10352,7 @@ yy.Op.prototype.toString = function () {
|
|
|
10762
10352
|
|
|
10763
10353
|
return s;
|
|
10764
10354
|
}
|
|
10355
|
+
|
|
10765
10356
|
return (
|
|
10766
10357
|
this.left.toString() +
|
|
10767
10358
|
' ' +
|
|
@@ -10773,7 +10364,6 @@ yy.Op.prototype.toString = function () {
|
|
|
10773
10364
|
};
|
|
10774
10365
|
|
|
10775
10366
|
yy.Op.prototype.findAggregator = function (query) {
|
|
10776
|
-
|
|
10777
10367
|
if (this.left && this.left.findAggregator) {
|
|
10778
10368
|
this.left.findAggregator(query);
|
|
10779
10369
|
}
|
|
@@ -10905,17 +10495,28 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
10905
10495
|
}
|
|
10906
10496
|
|
|
10907
10497
|
if (this.op === 'IS') {
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10498
|
+
const leftOperand = leftJS();
|
|
10499
|
+
const rightOperand = rightJS();
|
|
10500
|
+
if (
|
|
10501
|
+
this.right instanceof yy.NullValue ||
|
|
10502
|
+
(this.right.op === 'NOT' && this.right.right instanceof yy.NullValue)
|
|
10503
|
+
) {
|
|
10504
|
+
s = `(
|
|
10505
|
+
(${leftOperand}==null) // Cant be ===
|
|
10506
|
+
===
|
|
10507
|
+
(${rightOperand}==null) // Cant be ===
|
|
10508
|
+
)`;
|
|
10509
|
+
} else {
|
|
10510
|
+
s = `(
|
|
10511
|
+
(${leftOperand} == ${rightOperand})
|
|
10512
|
+
||
|
|
10513
|
+
(
|
|
10514
|
+
${leftOperand} < 0
|
|
10515
|
+
&&
|
|
10516
|
+
true == ${rightOperand}
|
|
10517
|
+
)
|
|
10518
|
+
)`;
|
|
10519
|
+
}
|
|
10919
10520
|
}
|
|
10920
10521
|
|
|
10921
10522
|
if (this.op === '==') {
|
|
@@ -10978,7 +10579,6 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
10978
10579
|
')' +
|
|
10979
10580
|
')' +
|
|
10980
10581
|
')';
|
|
10981
|
-
|
|
10982
10582
|
}
|
|
10983
10583
|
|
|
10984
10584
|
if (this.op === 'IN') {
|
|
@@ -11014,13 +10614,10 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11014
10614
|
if (this.op === 'NOT IN') {
|
|
11015
10615
|
if (this.right instanceof yy.Select) {
|
|
11016
10616
|
s = '(';
|
|
11017
|
-
//this.query.queriesdata['+this.queriesidx+']
|
|
11018
|
-
// s += 'alasql.utils.flatArray(this.query.queriesfn['+(this.queriesidx)+'](params,null,p))';
|
|
11019
10617
|
s += 'alasql.utils.flatArray(this.queriesfn[' + this.queriesidx + '](params,null,p))';
|
|
11020
10618
|
s += '.indexOf(';
|
|
11021
10619
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))<0)';
|
|
11022
10620
|
} else if (Array.isArray(this.right)) {
|
|
11023
|
-
// if(this.right.length == 0) return 'true';
|
|
11024
10621
|
s = '([' + this.right.map(ref).join(',') + '].indexOf(';
|
|
11025
10622
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))<0)';
|
|
11026
10623
|
} else {
|
|
@@ -11034,7 +10631,6 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11034
10631
|
if (this.allsome === 'ALL') {
|
|
11035
10632
|
var s;
|
|
11036
10633
|
if (this.right instanceof yy.Select) {
|
|
11037
|
-
// var s = 'this.query.queriesdata['+this.queriesidx+']';
|
|
11038
10634
|
s = 'alasql.utils.flatArray(this.query.queriesfn[' + this.queriesidx + '](params,null,p))';
|
|
11039
10635
|
|
|
11040
10636
|
s += '.every(function(b){return (';
|
|
@@ -11053,7 +10649,6 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11053
10649
|
if (this.allsome === 'SOME' || this.allsome === 'ANY') {
|
|
11054
10650
|
var s;
|
|
11055
10651
|
if (this.right instanceof yy.Select) {
|
|
11056
|
-
// var s = 'this.query.queriesdata['+this.queriesidx+']';
|
|
11057
10652
|
s = 'alasql.utils.flatArray(this.query.queriesfn[' + this.queriesidx + '](params,null,p))';
|
|
11058
10653
|
s += '.some(function(b){return (';
|
|
11059
10654
|
s += leftJS() + ')' + op + 'b})';
|
|
@@ -11092,12 +10687,9 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11092
10687
|
// // + ')';
|
|
11093
10688
|
// }
|
|
11094
10689
|
|
|
11095
|
-
// Change names
|
|
11096
|
-
|
|
11097
10690
|
var expr = s || '(' + leftJS() + op + rightJS() + ')';
|
|
11098
10691
|
|
|
11099
10692
|
var declareRefs = 'y=[(' + refs.join('), (') + ')]';
|
|
11100
|
-
|
|
11101
10693
|
if (op === '&&' || op === '||' || op === 'IS' || op === 'IS NULL' || op === 'IS NOT NULL') {
|
|
11102
10694
|
return '(' + declareRefs + ', ' + expr + ')';
|
|
11103
10695
|
}
|
|
@@ -11149,8 +10741,6 @@ yy.StringValue.prototype.toType = function () {
|
|
|
11149
10741
|
};
|
|
11150
10742
|
|
|
11151
10743
|
yy.StringValue.prototype.toJS = function () {
|
|
11152
|
-
|
|
11153
|
-
// return "'"+doubleqq(this.value)+"'";
|
|
11154
10744
|
return "'" + escapeq(this.value) + "'";
|
|
11155
10745
|
};
|
|
11156
10746
|
|
|
@@ -11183,8 +10773,6 @@ yy.ArrayValue.prototype.toType = function () {
|
|
|
11183
10773
|
};
|
|
11184
10774
|
|
|
11185
10775
|
yy.ArrayValue.prototype.toJS = function (context, tableid, defcols) {
|
|
11186
|
-
|
|
11187
|
-
// return "'"+doubleqq(this.value)+"'";
|
|
11188
10776
|
return (
|
|
11189
10777
|
'[(' +
|
|
11190
10778
|
this.value
|
|
@@ -11332,7 +10920,6 @@ yy.Column = function (params) {
|
|
|
11332
10920
|
yy.Column.prototype.toString = function () {
|
|
11333
10921
|
var s;
|
|
11334
10922
|
if (this.columnid == +this.columnid) {
|
|
11335
|
-
// jshint ignore:line
|
|
11336
10923
|
s = '[' + this.columnid + ']';
|
|
11337
10924
|
} else {
|
|
11338
10925
|
s = this.columnid;
|
|
@@ -11351,7 +10938,6 @@ yy.Column.prototype.toString = function () {
|
|
|
11351
10938
|
};
|
|
11352
10939
|
|
|
11353
10940
|
yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
11354
|
-
|
|
11355
10941
|
var s = '';
|
|
11356
10942
|
if (!this.tableid && tableid === '' && !defcols) {
|
|
11357
10943
|
if (this.columnid !== '_') {
|
|
@@ -11365,17 +10951,10 @@ yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11365
10951
|
}
|
|
11366
10952
|
} else {
|
|
11367
10953
|
if (context === 'g') {
|
|
11368
|
-
// if(this.columnid == '_') {
|
|
11369
|
-
// } else {
|
|
11370
10954
|
s = "g['" + this.nick + "']";
|
|
11371
|
-
// }
|
|
11372
10955
|
} else if (this.tableid) {
|
|
11373
10956
|
if (this.columnid !== '_') {
|
|
11374
|
-
// if() {
|
|
11375
|
-
// s = context+'[\''+tableid + '\'][\''+this.tableid+'\'][\''+this.columnid+'\']';
|
|
11376
|
-
// } else {
|
|
11377
10957
|
s = context + "['" + this.tableid + "']['" + this.columnid + "']";
|
|
11378
|
-
// }
|
|
11379
10958
|
} else {
|
|
11380
10959
|
if (context === 'g') {
|
|
11381
10960
|
s = "g['_']";
|
|
@@ -11398,22 +10977,13 @@ yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11398
10977
|
|
|
11399
10978
|
} else {
|
|
11400
10979
|
if (this.columnid !== '_') {
|
|
11401
|
-
// if(defcols['.'][this.tableid]) {
|
|
11402
|
-
|
|
11403
|
-
// s = context+'[\''+tableid + '\'][\''+this.tableid + '\'][\''+this.columnid+'\']';
|
|
11404
|
-
// } else {
|
|
11405
10980
|
s = context + "['" + (this.tableid || tableid) + "']['" + this.columnid + "']";
|
|
11406
|
-
// }
|
|
11407
10981
|
} else {
|
|
11408
10982
|
s = context + "['" + (this.tableid || tableid) + "']";
|
|
11409
10983
|
}
|
|
11410
10984
|
}
|
|
11411
10985
|
} else if (tableid === -1) {
|
|
11412
|
-
// if(this.columnid != '') {
|
|
11413
10986
|
s = context + "['" + this.columnid + "']";
|
|
11414
|
-
// } else {
|
|
11415
|
-
// s = context;
|
|
11416
|
-
// }
|
|
11417
10987
|
} else {
|
|
11418
10988
|
if (this.columnid !== '_') {
|
|
11419
10989
|
s = context + "['" + (this.tableid || tableid) + "']['" + this.columnid + "']";
|
|
@@ -11422,9 +10992,6 @@ yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11422
10992
|
}
|
|
11423
10993
|
}
|
|
11424
10994
|
}
|
|
11425
|
-
|
|
11426
|
-
// console.trace(new Error());
|
|
11427
|
-
|
|
11428
10995
|
return s;
|
|
11429
10996
|
};
|
|
11430
10997
|
|
|
@@ -11456,16 +11023,8 @@ yy.AggrValue.prototype.toString = function () {
|
|
|
11456
11023
|
};
|
|
11457
11024
|
|
|
11458
11025
|
yy.AggrValue.prototype.findAggregator = function (query) {
|
|
11459
|
-
|
|
11460
|
-
// var colas = this.as || this.toString();
|
|
11461
|
-
|
|
11462
11026
|
var colas = escapeq(this.toString()) + ':' + query.selectGroup.length;
|
|
11463
|
-
|
|
11464
|
-
// if(!query.selectColumns[colas]) {
|
|
11465
|
-
// }
|
|
11466
|
-
|
|
11467
11027
|
var found = false;
|
|
11468
|
-
|
|
11469
11028
|
if (!found) {
|
|
11470
11029
|
if (!this.nick) {
|
|
11471
11030
|
this.nick = colas;
|
|
@@ -11482,8 +11041,6 @@ yy.AggrValue.prototype.findAggregator = function (query) {
|
|
|
11482
11041
|
}
|
|
11483
11042
|
query.selectGroup.push(this);
|
|
11484
11043
|
}
|
|
11485
|
-
|
|
11486
|
-
// this.reduced = true;
|
|
11487
11044
|
return;
|
|
11488
11045
|
};
|
|
11489
11046
|
|
|
@@ -11505,8 +11062,7 @@ yy.AggrValue.prototype.toType = function () {
|
|
|
11505
11062
|
return this.expression.toType();
|
|
11506
11063
|
};
|
|
11507
11064
|
|
|
11508
|
-
yy.AggrValue.prototype.toJS = function (
|
|
11509
|
-
|
|
11065
|
+
yy.AggrValue.prototype.toJS = function () {
|
|
11510
11066
|
var colas = this.nick;
|
|
11511
11067
|
if (colas === undefined) {
|
|
11512
11068
|
colas = this.toString();
|
|
@@ -11517,6 +11073,7 @@ yy.AggrValue.prototype.toJS = function (/*context, tableid, defcols*/) {
|
|
|
11517
11073
|
yy.OrderExpression = function (params) {
|
|
11518
11074
|
return yy.extend(this, params);
|
|
11519
11075
|
};
|
|
11076
|
+
|
|
11520
11077
|
yy.OrderExpression.prototype.toString = yy.Expression.prototype.toString;
|
|
11521
11078
|
|
|
11522
11079
|
yy.GroupExpression = function (params) {
|
|
@@ -15750,10 +15307,6 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
|
|
|
15750
15307
|
return res;
|
|
15751
15308
|
};
|
|
15752
15309
|
|
|
15753
|
-
// Console functions
|
|
15754
|
-
|
|
15755
|
-
/* global alasql, yy */
|
|
15756
|
-
|
|
15757
15310
|
alasql.test = function (name, times, fn) {
|
|
15758
15311
|
if (arguments.length === 0) {
|
|
15759
15312
|
alasql.log(alasql.con.results);
|
|
@@ -19779,7 +19332,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
|
19779
19332
|
|
|
19780
19333
|
/*only-for-browser/*
|
|
19781
19334
|
if(utils.isCordova || utils.isMeteorServer || utils.isNode ){
|
|
19782
|
-
console.
|
|
19335
|
+
console.log('It looks like you are using the browser version of AlaSQL. Please use the alasql.fs.js file instead.')
|
|
19783
19336
|
}
|
|
19784
19337
|
//*/
|
|
19785
19338
|
|