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.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,18 @@ 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
|
+
})["catch"]((e) => {
|
|
3495
|
+
if (error) return error(e);
|
|
3496
|
+
console.error(e);
|
|
3497
|
+
throw e;
|
|
3498
|
+
});
|
|
3494
3499
|
} else {
|
|
3495
3500
|
//If async callthen call async
|
|
3496
3501
|
if (asy) {
|
|
@@ -3619,17 +3624,18 @@ var loadBinaryFile = (utils.loadBinaryFile = function (
|
|
|
3619
3624
|
fs = require('fs');
|
|
3620
3625
|
|
|
3621
3626
|
if (/^[a-z]+:\/\//i.test(path)) {
|
|
3622
|
-
var
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3627
|
+
var fetch = require('node-fetch');
|
|
3628
|
+
fetch(path)
|
|
3629
|
+
.then((response) => response.arrayBuffer())
|
|
3630
|
+
.then((buf) => {
|
|
3631
|
+
var a = new Uint8Array(buf);
|
|
3632
|
+
var b = [...a].map((e) => String.fromCharCode(e)).join('');
|
|
3633
|
+
success(b);
|
|
3634
|
+
})["catch"]((e) => {
|
|
3635
|
+
if (error) return error(e);
|
|
3636
|
+
console.error(e);
|
|
3637
|
+
throw e;
|
|
3638
|
+
});
|
|
3633
3639
|
} else {
|
|
3634
3640
|
if (runAsync) {
|
|
3635
3641
|
fs.readFile(path, function (err, data) {
|
|
@@ -4842,422 +4848,7 @@ alasql.compile = function (sql, databaseid) {
|
|
|
4842
4848
|
//
|
|
4843
4849
|
|
|
4844
4850
|
if (!utils.global.Promise) {
|
|
4845
|
-
|
|
4846
|
-
/*not-for-browser/*
|
|
4847
|
-
utils.global.Promise = require('es6-promise').Promise;
|
|
4848
|
-
//*/
|
|
4849
|
-
} else {
|
|
4850
|
-
/*!
|
|
4851
|
-
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
4852
|
-
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
4853
|
-
* @license Licensed under MIT license
|
|
4854
|
-
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
|
|
4855
|
-
* @version 3.2.1
|
|
4856
|
-
*/
|
|
4857
|
-
(function () {
|
|
4858
|
-
'use strict';
|
|
4859
|
-
function t(t) {
|
|
4860
|
-
return 'function' == typeof t || ('object' == typeof t && null !== t);
|
|
4861
|
-
}
|
|
4862
|
-
function e(t) {
|
|
4863
|
-
return 'function' == typeof t;
|
|
4864
|
-
}
|
|
4865
|
-
function n(t) {
|
|
4866
|
-
G = t;
|
|
4867
|
-
}
|
|
4868
|
-
function r(t) {
|
|
4869
|
-
Q = t;
|
|
4870
|
-
}
|
|
4871
|
-
function o() {
|
|
4872
|
-
return function () {
|
|
4873
|
-
process.nextTick(a);
|
|
4874
|
-
};
|
|
4875
|
-
}
|
|
4876
|
-
function i() {
|
|
4877
|
-
return function () {
|
|
4878
|
-
B(a);
|
|
4879
|
-
};
|
|
4880
|
-
}
|
|
4881
|
-
function s() {
|
|
4882
|
-
var t = 0,
|
|
4883
|
-
e = new X(a),
|
|
4884
|
-
n = document.createTextNode('');
|
|
4885
|
-
return (
|
|
4886
|
-
e.observe(n, {characterData: !0}),
|
|
4887
|
-
function () {
|
|
4888
|
-
n.data = t = ++t % 2;
|
|
4889
|
-
}
|
|
4890
|
-
);
|
|
4891
|
-
}
|
|
4892
|
-
function u() {
|
|
4893
|
-
var t = new MessageChannel();
|
|
4894
|
-
return (
|
|
4895
|
-
(t.port1.onmessage = a),
|
|
4896
|
-
function () {
|
|
4897
|
-
t.port2.postMessage(0);
|
|
4898
|
-
}
|
|
4899
|
-
);
|
|
4900
|
-
}
|
|
4901
|
-
function c() {
|
|
4902
|
-
return function () {
|
|
4903
|
-
setTimeout(a, 1);
|
|
4904
|
-
};
|
|
4905
|
-
}
|
|
4906
|
-
function a() {
|
|
4907
|
-
for (var t = 0; J > t; t += 2) {
|
|
4908
|
-
var e = tt[t],
|
|
4909
|
-
n = tt[t + 1];
|
|
4910
|
-
e(n), (tt[t] = void 0), (tt[t + 1] = void 0);
|
|
4911
|
-
}
|
|
4912
|
-
J = 0;
|
|
4913
|
-
}
|
|
4914
|
-
function f() {
|
|
4915
|
-
try {
|
|
4916
|
-
var t = require,
|
|
4917
|
-
e = t('vertx');
|
|
4918
|
-
return (B = e.runOnLoop || e.runOnContext, i());
|
|
4919
|
-
} catch (n) {
|
|
4920
|
-
return c();
|
|
4921
|
-
}
|
|
4922
|
-
}
|
|
4923
|
-
function l(t, e) {
|
|
4924
|
-
var n = this,
|
|
4925
|
-
r = new this.constructor(p);
|
|
4926
|
-
void 0 === r[rt] && k(r);
|
|
4927
|
-
var o = n._state;
|
|
4928
|
-
if (o) {
|
|
4929
|
-
var i = arguments[o - 1];
|
|
4930
|
-
Q(function () {
|
|
4931
|
-
x(o, r, i, n._result);
|
|
4932
|
-
});
|
|
4933
|
-
} else E(n, r, t, e);
|
|
4934
|
-
return r;
|
|
4935
|
-
}
|
|
4936
|
-
function h(t) {
|
|
4937
|
-
var e = this;
|
|
4938
|
-
if (t && 'object' == typeof t && t.constructor === e) return t;
|
|
4939
|
-
var n = new e(p);
|
|
4940
|
-
return (g(n, t), n);
|
|
4941
|
-
}
|
|
4942
|
-
function p() {}
|
|
4943
|
-
function _() {
|
|
4944
|
-
return new TypeError('You cannot resolve a promise with itself');
|
|
4945
|
-
}
|
|
4946
|
-
function d() {
|
|
4947
|
-
return new TypeError('A promises callback cannot return that same promise.');
|
|
4948
|
-
}
|
|
4949
|
-
function v(t) {
|
|
4950
|
-
try {
|
|
4951
|
-
return t.then;
|
|
4952
|
-
} catch (e) {
|
|
4953
|
-
return (ut.error = e, ut);
|
|
4954
|
-
}
|
|
4955
|
-
}
|
|
4956
|
-
function y(t, e, n, r) {
|
|
4957
|
-
try {
|
|
4958
|
-
t.call(e, n, r);
|
|
4959
|
-
} catch (o) {
|
|
4960
|
-
return o;
|
|
4961
|
-
}
|
|
4962
|
-
}
|
|
4963
|
-
function m(t, e, n) {
|
|
4964
|
-
Q(function (t) {
|
|
4965
|
-
var r = !1,
|
|
4966
|
-
o = y(
|
|
4967
|
-
n,
|
|
4968
|
-
e,
|
|
4969
|
-
function (n) {
|
|
4970
|
-
r || ((r = !0), e !== n ? g(t, n) : S(t, n));
|
|
4971
|
-
},
|
|
4972
|
-
function (e) {
|
|
4973
|
-
r || ((r = !0), j(t, e));
|
|
4974
|
-
},
|
|
4975
|
-
'Settle: ' + (t._label || ' unknown promise')
|
|
4976
|
-
);
|
|
4977
|
-
!r && o && ((r = !0), j(t, o));
|
|
4978
|
-
}, t);
|
|
4979
|
-
}
|
|
4980
|
-
function b(t, e) {
|
|
4981
|
-
e._state === it
|
|
4982
|
-
? S(t, e._result)
|
|
4983
|
-
: e._state === st
|
|
4984
|
-
? j(t, e._result)
|
|
4985
|
-
: E(
|
|
4986
|
-
e,
|
|
4987
|
-
void 0,
|
|
4988
|
-
function (e) {
|
|
4989
|
-
g(t, e);
|
|
4990
|
-
},
|
|
4991
|
-
function (e) {
|
|
4992
|
-
j(t, e);
|
|
4993
|
-
}
|
|
4994
|
-
);
|
|
4995
|
-
}
|
|
4996
|
-
function w(t, n, r) {
|
|
4997
|
-
n.constructor === t.constructor && r === et && constructor.resolve === nt
|
|
4998
|
-
? b(t, n)
|
|
4999
|
-
: r === ut
|
|
5000
|
-
? j(t, ut.error)
|
|
5001
|
-
: void 0 === r
|
|
5002
|
-
? S(t, n)
|
|
5003
|
-
: e(r)
|
|
5004
|
-
? m(t, n, r)
|
|
5005
|
-
: S(t, n);
|
|
5006
|
-
}
|
|
5007
|
-
function g(e, n) {
|
|
5008
|
-
e === n ? j(e, _()) : t(n) ? w(e, n, v(n)) : S(e, n);
|
|
5009
|
-
}
|
|
5010
|
-
function A(t) {
|
|
5011
|
-
t._onerror && t._onerror(t._result), T(t);
|
|
5012
|
-
}
|
|
5013
|
-
function S(t, e) {
|
|
5014
|
-
t._state === ot &&
|
|
5015
|
-
((t._result = e), (t._state = it), 0 !== t._subscribers.length && Q(T, t));
|
|
5016
|
-
}
|
|
5017
|
-
function j(t, e) {
|
|
5018
|
-
t._state === ot && ((t._state = st), (t._result = e), Q(A, t));
|
|
5019
|
-
}
|
|
5020
|
-
function E(t, e, n, r) {
|
|
5021
|
-
var o = t._subscribers,
|
|
5022
|
-
i = o.length;
|
|
5023
|
-
(t._onerror = null),
|
|
5024
|
-
(o[i] = e),
|
|
5025
|
-
(o[i + it] = n),
|
|
5026
|
-
(o[i + st] = r),
|
|
5027
|
-
0 === i && t._state && Q(T, t);
|
|
5028
|
-
}
|
|
5029
|
-
function T(t) {
|
|
5030
|
-
var e = t._subscribers,
|
|
5031
|
-
n = t._state;
|
|
5032
|
-
if (0 !== e.length) {
|
|
5033
|
-
for (var r, o, i = t._result, s = 0; s < e.length; s += 3)
|
|
5034
|
-
(r = e[s]), (o = e[s + n]), r ? x(n, r, o, i) : o(i);
|
|
5035
|
-
t._subscribers.length = 0;
|
|
5036
|
-
}
|
|
5037
|
-
}
|
|
5038
|
-
function M() {
|
|
5039
|
-
this.error = null;
|
|
5040
|
-
}
|
|
5041
|
-
function P(t, e) {
|
|
5042
|
-
try {
|
|
5043
|
-
return t(e);
|
|
5044
|
-
} catch (n) {
|
|
5045
|
-
return (ct.error = n, ct);
|
|
5046
|
-
}
|
|
5047
|
-
}
|
|
5048
|
-
function x(t, n, r, o) {
|
|
5049
|
-
var i,
|
|
5050
|
-
s,
|
|
5051
|
-
u,
|
|
5052
|
-
c,
|
|
5053
|
-
a = e(r);
|
|
5054
|
-
if (a) {
|
|
5055
|
-
if (((i = P(r, o)), i === ct ? ((c = !0), (s = i.error), (i = null)) : (u = !0), n === i))
|
|
5056
|
-
return void j(n, d());
|
|
5057
|
-
} else (i = o), (u = !0);
|
|
5058
|
-
n._state !== ot ||
|
|
5059
|
-
(a && u ? g(n, i) : c ? j(n, s) : t === it ? S(n, i) : t === st && j(n, i));
|
|
5060
|
-
}
|
|
5061
|
-
function C(t, e) {
|
|
5062
|
-
try {
|
|
5063
|
-
e(
|
|
5064
|
-
function (e) {
|
|
5065
|
-
g(t, e);
|
|
5066
|
-
},
|
|
5067
|
-
function (e) {
|
|
5068
|
-
j(t, e);
|
|
5069
|
-
}
|
|
5070
|
-
);
|
|
5071
|
-
} catch (n) {
|
|
5072
|
-
j(t, n);
|
|
5073
|
-
}
|
|
5074
|
-
}
|
|
5075
|
-
function O() {
|
|
5076
|
-
return at++;
|
|
5077
|
-
}
|
|
5078
|
-
function k(t) {
|
|
5079
|
-
(t[rt] = at++), (t._state = void 0), (t._result = void 0), (t._subscribers = []);
|
|
5080
|
-
}
|
|
5081
|
-
function Y(t) {
|
|
5082
|
-
return new _t(this, t).promise;
|
|
5083
|
-
}
|
|
5084
|
-
function q(t) {
|
|
5085
|
-
var e = this;
|
|
5086
|
-
return new e(
|
|
5087
|
-
I(t)
|
|
5088
|
-
? function (n, r) {
|
|
5089
|
-
for (var o = t.length, i = 0; o > i; i++) e.resolve(t[i]).then(n, r);
|
|
5090
|
-
}
|
|
5091
|
-
: function (t, e) {
|
|
5092
|
-
e(new TypeError('You must pass an array to race.'));
|
|
5093
|
-
}
|
|
5094
|
-
);
|
|
5095
|
-
}
|
|
5096
|
-
function F(t) {
|
|
5097
|
-
var e = this,
|
|
5098
|
-
n = new e(p);
|
|
5099
|
-
return (j(n, t), n);
|
|
5100
|
-
}
|
|
5101
|
-
function D() {
|
|
5102
|
-
throw new TypeError(
|
|
5103
|
-
'You must pass a resolver function as the first argument to the promise constructor'
|
|
5104
|
-
);
|
|
5105
|
-
}
|
|
5106
|
-
function K() {
|
|
5107
|
-
throw new TypeError(
|
|
5108
|
-
"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."
|
|
5109
|
-
);
|
|
5110
|
-
}
|
|
5111
|
-
function L(t) {
|
|
5112
|
-
(this[rt] = O()),
|
|
5113
|
-
(this._result = this._state = void 0),
|
|
5114
|
-
(this._subscribers = []),
|
|
5115
|
-
p !== t && ('function' != typeof t && D(), this instanceof L ? C(this, t) : K());
|
|
5116
|
-
}
|
|
5117
|
-
function N(t, e) {
|
|
5118
|
-
(this._instanceConstructor = t),
|
|
5119
|
-
(this.promise = new t(p)),
|
|
5120
|
-
this.promise[rt] || k(this.promise),
|
|
5121
|
-
Array.isArray(e)
|
|
5122
|
-
? ((this._input = e),
|
|
5123
|
-
(this.length = e.length),
|
|
5124
|
-
(this._remaining = e.length),
|
|
5125
|
-
(this._result = new Array(this.length)),
|
|
5126
|
-
0 === this.length
|
|
5127
|
-
? S(this.promise, this._result)
|
|
5128
|
-
: ((this.length = this.length || 0),
|
|
5129
|
-
this._enumerate(),
|
|
5130
|
-
0 === this._remaining && S(this.promise, this._result)))
|
|
5131
|
-
: j(this.promise, U());
|
|
5132
|
-
}
|
|
5133
|
-
function U() {
|
|
5134
|
-
return new Error('Array Methods must be provided an Array');
|
|
5135
|
-
}
|
|
5136
|
-
function W() {
|
|
5137
|
-
var t;
|
|
5138
|
-
if ('undefined' != typeof global) t = global;
|
|
5139
|
-
else if ('undefined' != typeof self) t = self;
|
|
5140
|
-
else
|
|
5141
|
-
try {
|
|
5142
|
-
t = Function('return this')();
|
|
5143
|
-
} catch (e) {
|
|
5144
|
-
throw new Error(
|
|
5145
|
-
'polyfill failed because global object is unavailable in this environment'
|
|
5146
|
-
);
|
|
5147
|
-
}
|
|
5148
|
-
var n = t.Promise;
|
|
5149
|
-
(!n || '[object Promise]' !== Object.prototype.toString.call(n.resolve()) || n.cast) &&
|
|
5150
|
-
(t.Promise = pt);
|
|
5151
|
-
}
|
|
5152
|
-
var z;
|
|
5153
|
-
z = Array.isArray
|
|
5154
|
-
? Array.isArray
|
|
5155
|
-
: function (t) {
|
|
5156
|
-
return '[object Array]' === Object.prototype.toString.call(t);
|
|
5157
|
-
};
|
|
5158
|
-
var B,
|
|
5159
|
-
G,
|
|
5160
|
-
H,
|
|
5161
|
-
I = z,
|
|
5162
|
-
J = 0,
|
|
5163
|
-
Q = function (t, e) {
|
|
5164
|
-
(tt[J] = t), (tt[J + 1] = e), (J += 2), 2 === J && (G ? G(a) : H());
|
|
5165
|
-
},
|
|
5166
|
-
R = 'undefined' != typeof window ? window : void 0,
|
|
5167
|
-
V = R || {},
|
|
5168
|
-
X = V.MutationObserver || V.WebKitMutationObserver,
|
|
5169
|
-
Z =
|
|
5170
|
-
'undefined' == typeof self &&
|
|
5171
|
-
'undefined' != typeof process &&
|
|
5172
|
-
'[object process]' === {}.toString.call(process),
|
|
5173
|
-
$ =
|
|
5174
|
-
'undefined' != typeof Uint8ClampedArray &&
|
|
5175
|
-
'undefined' != typeof importScripts &&
|
|
5176
|
-
'undefined' != typeof MessageChannel,
|
|
5177
|
-
tt = new Array(1e3);
|
|
5178
|
-
H = Z ? o() : X ? s() : $ ? u() : void 0 === R && 'function' == typeof require ? f() : c();
|
|
5179
|
-
var et = l,
|
|
5180
|
-
nt = h,
|
|
5181
|
-
rt = Math.random().toString(36).substring(16),
|
|
5182
|
-
ot = void 0,
|
|
5183
|
-
it = 1,
|
|
5184
|
-
st = 2,
|
|
5185
|
-
ut = new M(),
|
|
5186
|
-
ct = new M(),
|
|
5187
|
-
at = 0,
|
|
5188
|
-
ft = Y,
|
|
5189
|
-
lt = q,
|
|
5190
|
-
ht = F,
|
|
5191
|
-
pt = L;
|
|
5192
|
-
(L.all = ft),
|
|
5193
|
-
(L.race = lt),
|
|
5194
|
-
(L.resolve = nt),
|
|
5195
|
-
(L.reject = ht),
|
|
5196
|
-
(L._setScheduler = n),
|
|
5197
|
-
(L._setAsap = r),
|
|
5198
|
-
(L._asap = Q),
|
|
5199
|
-
(L.prototype = {
|
|
5200
|
-
constructor: L,
|
|
5201
|
-
then: et,
|
|
5202
|
-
"catch": function (t) {
|
|
5203
|
-
return this.then(null, t);
|
|
5204
|
-
},
|
|
5205
|
-
});
|
|
5206
|
-
var _t = N;
|
|
5207
|
-
(N.prototype._enumerate = function () {
|
|
5208
|
-
for (var t = this.length, e = this._input, n = 0; this._state === ot && t > n; n++)
|
|
5209
|
-
this._eachEntry(e[n], n);
|
|
5210
|
-
}),
|
|
5211
|
-
(N.prototype._eachEntry = function (t, e) {
|
|
5212
|
-
var n = this._instanceConstructor,
|
|
5213
|
-
r = n.resolve;
|
|
5214
|
-
if (r === nt) {
|
|
5215
|
-
var o = v(t);
|
|
5216
|
-
if (o === et && t._state !== ot) this._settledAt(t._state, e, t._result);
|
|
5217
|
-
else if ('function' != typeof o) this._remaining--, (this._result[e] = t);
|
|
5218
|
-
else if (n === pt) {
|
|
5219
|
-
var i = new n(p);
|
|
5220
|
-
w(i, t, o), this._willSettleAt(i, e);
|
|
5221
|
-
} else
|
|
5222
|
-
this._willSettleAt(
|
|
5223
|
-
new n(function (e) {
|
|
5224
|
-
e(t);
|
|
5225
|
-
}),
|
|
5226
|
-
e
|
|
5227
|
-
);
|
|
5228
|
-
} else this._willSettleAt(r(t), e);
|
|
5229
|
-
}),
|
|
5230
|
-
(N.prototype._settledAt = function (t, e, n) {
|
|
5231
|
-
var r = this.promise;
|
|
5232
|
-
r._state === ot && (this._remaining--, t === st ? j(r, n) : (this._result[e] = n)),
|
|
5233
|
-
0 === this._remaining && S(r, this._result);
|
|
5234
|
-
}),
|
|
5235
|
-
(N.prototype._willSettleAt = function (t, e) {
|
|
5236
|
-
var n = this;
|
|
5237
|
-
E(
|
|
5238
|
-
t,
|
|
5239
|
-
void 0,
|
|
5240
|
-
function (t) {
|
|
5241
|
-
n._settledAt(it, e, t);
|
|
5242
|
-
},
|
|
5243
|
-
function (t) {
|
|
5244
|
-
n._settledAt(st, e, t);
|
|
5245
|
-
}
|
|
5246
|
-
);
|
|
5247
|
-
});
|
|
5248
|
-
var dt = W,
|
|
5249
|
-
vt = {Promise: pt, polyfill: dt};
|
|
5250
|
-
'function' == typeof define && define.amd
|
|
5251
|
-
? define(function () {
|
|
5252
|
-
return vt;
|
|
5253
|
-
})
|
|
5254
|
-
: 'undefined' != typeof module && module.exports
|
|
5255
|
-
? (module.exports = vt)
|
|
5256
|
-
: 'undefined' != typeof this && (this.ES6Promise = vt),
|
|
5257
|
-
dt();
|
|
5258
|
-
}.call(this));
|
|
5259
|
-
|
|
5260
|
-
}
|
|
4851
|
+
utils.global.Promise = Promise;
|
|
5261
4852
|
}
|
|
5262
4853
|
|
|
5263
4854
|
var promiseExec = function (sql, params, counterStep, counterTotal) {
|
|
@@ -10502,8 +10093,8 @@ yy.Over.prototype.toString = function () {
|
|
|
10502
10093
|
*/
|
|
10503
10094
|
|
|
10504
10095
|
/**
|
|
10505
|
-
|
|
10506
|
-
|
|
10096
|
+
Expression statement ( = 2*2; )
|
|
10097
|
+
@class
|
|
10507
10098
|
@param {object} params Initial parameters
|
|
10508
10099
|
*/
|
|
10509
10100
|
yy.ExpressionStatement = function (params) {
|
|
@@ -10627,8 +10218,7 @@ yy.JavaScript.prototype.toString = function () {
|
|
|
10627
10218
|
return s;
|
|
10628
10219
|
};
|
|
10629
10220
|
|
|
10630
|
-
yy.JavaScript.prototype.toJS = function (
|
|
10631
|
-
|
|
10221
|
+
yy.JavaScript.prototype.toJS = function () {
|
|
10632
10222
|
return '(' + this.value + ')';
|
|
10633
10223
|
};
|
|
10634
10224
|
yy.JavaScript.prototype.execute = function (databaseid, params, cb) {
|
|
@@ -10677,8 +10267,6 @@ yy.Join.prototype.toString = function () {
|
|
|
10677
10267
|
return s;
|
|
10678
10268
|
};
|
|
10679
10269
|
|
|
10680
|
-
// }
|
|
10681
|
-
|
|
10682
10270
|
/**
|
|
10683
10271
|
Table class
|
|
10684
10272
|
@class
|
|
@@ -10756,6 +10344,7 @@ yy.Op.prototype.toString = function () {
|
|
|
10756
10344
|
|
|
10757
10345
|
return s;
|
|
10758
10346
|
}
|
|
10347
|
+
|
|
10759
10348
|
return (
|
|
10760
10349
|
this.left.toString() +
|
|
10761
10350
|
' ' +
|
|
@@ -10767,7 +10356,6 @@ yy.Op.prototype.toString = function () {
|
|
|
10767
10356
|
};
|
|
10768
10357
|
|
|
10769
10358
|
yy.Op.prototype.findAggregator = function (query) {
|
|
10770
|
-
|
|
10771
10359
|
if (this.left && this.left.findAggregator) {
|
|
10772
10360
|
this.left.findAggregator(query);
|
|
10773
10361
|
}
|
|
@@ -10899,17 +10487,28 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
10899
10487
|
}
|
|
10900
10488
|
|
|
10901
10489
|
if (this.op === 'IS') {
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10490
|
+
const leftOperand = leftJS();
|
|
10491
|
+
const rightOperand = rightJS();
|
|
10492
|
+
if (
|
|
10493
|
+
this.right instanceof yy.NullValue ||
|
|
10494
|
+
(this.right.op === 'NOT' && this.right.right instanceof yy.NullValue)
|
|
10495
|
+
) {
|
|
10496
|
+
s = `(
|
|
10497
|
+
(${leftOperand}==null) // Cant be ===
|
|
10498
|
+
===
|
|
10499
|
+
(${rightOperand}==null) // Cant be ===
|
|
10500
|
+
)`;
|
|
10501
|
+
} else {
|
|
10502
|
+
s = `(
|
|
10503
|
+
(${leftOperand} == ${rightOperand})
|
|
10504
|
+
||
|
|
10505
|
+
(
|
|
10506
|
+
${leftOperand} < 0
|
|
10507
|
+
&&
|
|
10508
|
+
true == ${rightOperand}
|
|
10509
|
+
)
|
|
10510
|
+
)`;
|
|
10511
|
+
}
|
|
10913
10512
|
}
|
|
10914
10513
|
|
|
10915
10514
|
if (this.op === '==') {
|
|
@@ -10972,7 +10571,6 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
10972
10571
|
')' +
|
|
10973
10572
|
')' +
|
|
10974
10573
|
')';
|
|
10975
|
-
|
|
10976
10574
|
}
|
|
10977
10575
|
|
|
10978
10576
|
if (this.op === 'IN') {
|
|
@@ -11008,13 +10606,10 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11008
10606
|
if (this.op === 'NOT IN') {
|
|
11009
10607
|
if (this.right instanceof yy.Select) {
|
|
11010
10608
|
s = '(';
|
|
11011
|
-
//this.query.queriesdata['+this.queriesidx+']
|
|
11012
|
-
// s += 'alasql.utils.flatArray(this.query.queriesfn['+(this.queriesidx)+'](params,null,p))';
|
|
11013
10609
|
s += 'alasql.utils.flatArray(this.queriesfn[' + this.queriesidx + '](params,null,p))';
|
|
11014
10610
|
s += '.indexOf(';
|
|
11015
10611
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))<0)';
|
|
11016
10612
|
} else if (Array.isArray(this.right)) {
|
|
11017
|
-
// if(this.right.length == 0) return 'true';
|
|
11018
10613
|
s = '([' + this.right.map(ref).join(',') + '].indexOf(';
|
|
11019
10614
|
s += 'alasql.utils.getValueOf(' + leftJS() + '))<0)';
|
|
11020
10615
|
} else {
|
|
@@ -11028,7 +10623,6 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11028
10623
|
if (this.allsome === 'ALL') {
|
|
11029
10624
|
var s;
|
|
11030
10625
|
if (this.right instanceof yy.Select) {
|
|
11031
|
-
// var s = 'this.query.queriesdata['+this.queriesidx+']';
|
|
11032
10626
|
s = 'alasql.utils.flatArray(this.query.queriesfn[' + this.queriesidx + '](params,null,p))';
|
|
11033
10627
|
|
|
11034
10628
|
s += '.every(function(b){return (';
|
|
@@ -11047,7 +10641,6 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11047
10641
|
if (this.allsome === 'SOME' || this.allsome === 'ANY') {
|
|
11048
10642
|
var s;
|
|
11049
10643
|
if (this.right instanceof yy.Select) {
|
|
11050
|
-
// var s = 'this.query.queriesdata['+this.queriesidx+']';
|
|
11051
10644
|
s = 'alasql.utils.flatArray(this.query.queriesfn[' + this.queriesidx + '](params,null,p))';
|
|
11052
10645
|
s += '.some(function(b){return (';
|
|
11053
10646
|
s += leftJS() + ')' + op + 'b})';
|
|
@@ -11086,12 +10679,9 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11086
10679
|
// // + ')';
|
|
11087
10680
|
// }
|
|
11088
10681
|
|
|
11089
|
-
// Change names
|
|
11090
|
-
|
|
11091
10682
|
var expr = s || '(' + leftJS() + op + rightJS() + ')';
|
|
11092
10683
|
|
|
11093
10684
|
var declareRefs = 'y=[(' + refs.join('), (') + ')]';
|
|
11094
|
-
|
|
11095
10685
|
if (op === '&&' || op === '||' || op === 'IS' || op === 'IS NULL' || op === 'IS NOT NULL') {
|
|
11096
10686
|
return '(' + declareRefs + ', ' + expr + ')';
|
|
11097
10687
|
}
|
|
@@ -11143,8 +10733,6 @@ yy.StringValue.prototype.toType = function () {
|
|
|
11143
10733
|
};
|
|
11144
10734
|
|
|
11145
10735
|
yy.StringValue.prototype.toJS = function () {
|
|
11146
|
-
|
|
11147
|
-
// return "'"+doubleqq(this.value)+"'";
|
|
11148
10736
|
return "'" + escapeq(this.value) + "'";
|
|
11149
10737
|
};
|
|
11150
10738
|
|
|
@@ -11177,8 +10765,6 @@ yy.ArrayValue.prototype.toType = function () {
|
|
|
11177
10765
|
};
|
|
11178
10766
|
|
|
11179
10767
|
yy.ArrayValue.prototype.toJS = function (context, tableid, defcols) {
|
|
11180
|
-
|
|
11181
|
-
// return "'"+doubleqq(this.value)+"'";
|
|
11182
10768
|
return (
|
|
11183
10769
|
'[(' +
|
|
11184
10770
|
this.value
|
|
@@ -11326,7 +10912,6 @@ yy.Column = function (params) {
|
|
|
11326
10912
|
yy.Column.prototype.toString = function () {
|
|
11327
10913
|
var s;
|
|
11328
10914
|
if (this.columnid == +this.columnid) {
|
|
11329
|
-
// jshint ignore:line
|
|
11330
10915
|
s = '[' + this.columnid + ']';
|
|
11331
10916
|
} else {
|
|
11332
10917
|
s = this.columnid;
|
|
@@ -11345,7 +10930,6 @@ yy.Column.prototype.toString = function () {
|
|
|
11345
10930
|
};
|
|
11346
10931
|
|
|
11347
10932
|
yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
11348
|
-
|
|
11349
10933
|
var s = '';
|
|
11350
10934
|
if (!this.tableid && tableid === '' && !defcols) {
|
|
11351
10935
|
if (this.columnid !== '_') {
|
|
@@ -11359,17 +10943,10 @@ yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11359
10943
|
}
|
|
11360
10944
|
} else {
|
|
11361
10945
|
if (context === 'g') {
|
|
11362
|
-
// if(this.columnid == '_') {
|
|
11363
|
-
// } else {
|
|
11364
10946
|
s = "g['" + this.nick + "']";
|
|
11365
|
-
// }
|
|
11366
10947
|
} else if (this.tableid) {
|
|
11367
10948
|
if (this.columnid !== '_') {
|
|
11368
|
-
// if() {
|
|
11369
|
-
// s = context+'[\''+tableid + '\'][\''+this.tableid+'\'][\''+this.columnid+'\']';
|
|
11370
|
-
// } else {
|
|
11371
10949
|
s = context + "['" + this.tableid + "']['" + this.columnid + "']";
|
|
11372
|
-
// }
|
|
11373
10950
|
} else {
|
|
11374
10951
|
if (context === 'g') {
|
|
11375
10952
|
s = "g['_']";
|
|
@@ -11392,22 +10969,13 @@ yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11392
10969
|
|
|
11393
10970
|
} else {
|
|
11394
10971
|
if (this.columnid !== '_') {
|
|
11395
|
-
// if(defcols['.'][this.tableid]) {
|
|
11396
|
-
|
|
11397
|
-
// s = context+'[\''+tableid + '\'][\''+this.tableid + '\'][\''+this.columnid+'\']';
|
|
11398
|
-
// } else {
|
|
11399
10972
|
s = context + "['" + (this.tableid || tableid) + "']['" + this.columnid + "']";
|
|
11400
|
-
// }
|
|
11401
10973
|
} else {
|
|
11402
10974
|
s = context + "['" + (this.tableid || tableid) + "']";
|
|
11403
10975
|
}
|
|
11404
10976
|
}
|
|
11405
10977
|
} else if (tableid === -1) {
|
|
11406
|
-
// if(this.columnid != '') {
|
|
11407
10978
|
s = context + "['" + this.columnid + "']";
|
|
11408
|
-
// } else {
|
|
11409
|
-
// s = context;
|
|
11410
|
-
// }
|
|
11411
10979
|
} else {
|
|
11412
10980
|
if (this.columnid !== '_') {
|
|
11413
10981
|
s = context + "['" + (this.tableid || tableid) + "']['" + this.columnid + "']";
|
|
@@ -11416,9 +10984,6 @@ yy.Column.prototype.toJS = function (context, tableid, defcols) {
|
|
|
11416
10984
|
}
|
|
11417
10985
|
}
|
|
11418
10986
|
}
|
|
11419
|
-
|
|
11420
|
-
// console.trace(new Error());
|
|
11421
|
-
|
|
11422
10987
|
return s;
|
|
11423
10988
|
};
|
|
11424
10989
|
|
|
@@ -11450,16 +11015,8 @@ yy.AggrValue.prototype.toString = function () {
|
|
|
11450
11015
|
};
|
|
11451
11016
|
|
|
11452
11017
|
yy.AggrValue.prototype.findAggregator = function (query) {
|
|
11453
|
-
|
|
11454
|
-
// var colas = this.as || this.toString();
|
|
11455
|
-
|
|
11456
11018
|
var colas = escapeq(this.toString()) + ':' + query.selectGroup.length;
|
|
11457
|
-
|
|
11458
|
-
// if(!query.selectColumns[colas]) {
|
|
11459
|
-
// }
|
|
11460
|
-
|
|
11461
11019
|
var found = false;
|
|
11462
|
-
|
|
11463
11020
|
if (!found) {
|
|
11464
11021
|
if (!this.nick) {
|
|
11465
11022
|
this.nick = colas;
|
|
@@ -11476,8 +11033,6 @@ yy.AggrValue.prototype.findAggregator = function (query) {
|
|
|
11476
11033
|
}
|
|
11477
11034
|
query.selectGroup.push(this);
|
|
11478
11035
|
}
|
|
11479
|
-
|
|
11480
|
-
// this.reduced = true;
|
|
11481
11036
|
return;
|
|
11482
11037
|
};
|
|
11483
11038
|
|
|
@@ -11499,8 +11054,7 @@ yy.AggrValue.prototype.toType = function () {
|
|
|
11499
11054
|
return this.expression.toType();
|
|
11500
11055
|
};
|
|
11501
11056
|
|
|
11502
|
-
yy.AggrValue.prototype.toJS = function (
|
|
11503
|
-
|
|
11057
|
+
yy.AggrValue.prototype.toJS = function () {
|
|
11504
11058
|
var colas = this.nick;
|
|
11505
11059
|
if (colas === undefined) {
|
|
11506
11060
|
colas = this.toString();
|
|
@@ -11511,6 +11065,7 @@ yy.AggrValue.prototype.toJS = function (/*context, tableid, defcols*/) {
|
|
|
11511
11065
|
yy.OrderExpression = function (params) {
|
|
11512
11066
|
return yy.extend(this, params);
|
|
11513
11067
|
};
|
|
11068
|
+
|
|
11514
11069
|
yy.OrderExpression.prototype.toString = yy.Expression.prototype.toString;
|
|
11515
11070
|
|
|
11516
11071
|
yy.GroupExpression = function (params) {
|
|
@@ -15744,10 +15299,6 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
|
|
|
15744
15299
|
return res;
|
|
15745
15300
|
};
|
|
15746
15301
|
|
|
15747
|
-
// Console functions
|
|
15748
|
-
|
|
15749
|
-
/* global alasql, yy */
|
|
15750
|
-
|
|
15751
15302
|
alasql.test = function (name, times, fn) {
|
|
15752
15303
|
if (arguments.length === 0) {
|
|
15753
15304
|
alasql.log(alasql.con.results);
|
|
@@ -19773,7 +19324,7 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
|
19773
19324
|
|
|
19774
19325
|
//*only-for-browser/*
|
|
19775
19326
|
if(utils.isCordova || utils.isMeteorServer || utils.isNode ){
|
|
19776
|
-
console.
|
|
19327
|
+
console.log('It looks like you are using the browser version of AlaSQL. Please use the alasql.fs.js file instead.')
|
|
19777
19328
|
}
|
|
19778
19329
|
//*/
|
|
19779
19330
|
|