alasql 2.0.5 → 2.0.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/README.md +44 -44
- package/dist/alasql-worker.js +2 -2
- package/dist/alasql-worker.min.js +1 -1
- package/dist/alasql.fs.js +23 -5
- package/dist/alasql.js +23 -5
- package/dist/alasql.min.js +2 -2
- package/package.json +1 -1
- package/yarn-error.log +4440 -0
- package/.github/dependabot.yml +0 -8
- package/.github/renovate.json5 +0 -16
- package/.github/workflows/nodejs.yml +0 -29
- package/.husky/pre-commit +0 -4
package/README.md
CHANGED
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
- _Wondering if you should upgrade to v2? You probably should, but check the two breaking changes [here](https://github.com/AlaSQL/alasql/releases/tag/v2.0.1)_
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
[](https://github.com/alasql/alasql/actions)
|
|
9
9
|
[](https://npm-stat.com/charts.html?package=alasql)
|
|
10
10
|
[](http://open-oss.com)
|
|
11
|
-
[](https://www.npmjs.com/package/alasql)
|
|
12
|
+
[](https://github.com/alasql/alasql)
|
|
13
|
+
[](http://isitmaintained.com/project/\n/alasql "Average time to resolve an issue")
|
|
14
|
+
[](https://rawgit.com/alasql/alasql/develop/test/coverage/lcov-report/dist/alasql.fs.js.html)
|
|
15
15
|
[](https://bestpractices.coreinfrastructure.org/projects/328)
|
|
16
16
|
[](https://www.jsdelivr.com/package/npm/alasql)
|
|
17
17
|
[](https://github.com/prettier/prettier)
|
|
18
|
-
[](https://app.fossa.io/projects/git%2Bgithub.com%2Falasql%2Falasql?ref=badge_small)
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -35,9 +35,9 @@ This library is designed for:
|
|
|
35
35
|
* Easy ETL and options for persistence by data import / manipulation / export of several formats
|
|
36
36
|
* All major browsers, Node.js, and mobile applications
|
|
37
37
|
|
|
38
|
-
We focus on [speed](https://github.com/
|
|
38
|
+
We focus on [speed](https://github.com/alasql/alasql/wiki/Speed) by taking advantage of the dynamic nature of JavaScript when building up queries. Real-world solutions demand flexibility regarding where data comes from and where it is to be stored. We focus on flexibility by making sure you can [import/export](https://github.com/alasql/alasql/wiki/Import-export) and query directly on data stored in Excel (both `.xls` and `.xlsx`), CSV, JSON, TAB, IndexedDB, LocalStorage, and SQLite files.
|
|
39
39
|
|
|
40
|
-
The library adds the comfort of a full database engine to your JavaScript app. No, really - it's working towards a full database engine complying with [most of the SQL-99 language](https://github.com/
|
|
40
|
+
The library adds the comfort of a full database engine to your JavaScript app. No, really - it's working towards a full database engine complying with [most of the SQL-99 language](https://github.com/alasql/alasql/wiki/Supported-SQL-statements), spiced up with additional syntax for NoSQL (schema-less) data and graph networks.
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
#### Traditional SQL Table
|
|
@@ -126,17 +126,17 @@ For the browser: include [alasql.min.js](https://cdn.jsdelivr.net/npm/alasql)
|
|
|
126
126
|
|
|
127
127
|
## Getting started
|
|
128
128
|
|
|
129
|
-
See the ["Getting started" section of the wiki](https://github.com/
|
|
129
|
+
See the ["Getting started" section of the wiki](https://github.com/alasql/alasql/wiki/Getting%20started)
|
|
130
130
|
|
|
131
|
-
More advanced topics are covered in other wiki sections like ["Data manipulation"](https://github.com/
|
|
131
|
+
More advanced topics are covered in other wiki sections like ["Data manipulation"](https://github.com/alasql/alasql/wiki/Data-manipulation) and in questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/alasql)
|
|
132
132
|
|
|
133
133
|
Other links:
|
|
134
134
|
|
|
135
|
-
* Documentation: [Github wiki](https://github.com/
|
|
135
|
+
* Documentation: [Github wiki](https://github.com/alasql/alasql/wiki)
|
|
136
136
|
|
|
137
137
|
* Library CDN: [jsDelivr.com](http://www.jsdelivr.com/#!alasql)
|
|
138
138
|
|
|
139
|
-
* Feedback: [Open an issue](https://github.com/
|
|
139
|
+
* Feedback: [Open an issue](https://github.com/alasql/alasql/issues/new)
|
|
140
140
|
|
|
141
141
|
* Try online: <a href="http://alasql.org/console?CREATE TABLE cities (city string, population number);INSERT INTO cities VALUES ('Rome',2863223), ('Paris',2249975),('Berlin',3517424), ('Madrid',3041579);SELECT * FROM cities WHERE population < 3500000 ORDER BY population DESC">Playground</a>
|
|
142
142
|
|
|
@@ -146,11 +146,11 @@ Other links:
|
|
|
146
146
|
## Please note
|
|
147
147
|
|
|
148
148
|
**All contributions are extremely welcome and greatly appreciated(!)** -
|
|
149
|
-
The project has never received any funding and is based on unpaid voluntary work: [We really (really) love pull requests](https://github.com/
|
|
149
|
+
The project has never received any funding and is based on unpaid voluntary work: [We really (really) love pull requests](https://github.com/alasql/alasql/blob/develop/CONTRIBUTING.md)
|
|
150
150
|
|
|
151
|
-
The AlaSQL project depends on your contribution of code and <s>may</s> have [bugs](https://github.com/
|
|
151
|
+
The AlaSQL project depends on your contribution of code and <s>may</s> have [bugs](https://github.com/alasql/alasql/labels/%21%20Bug). So please, submit any bugs and suggestions [as an issue](https://github.com/alasql/alasql/issues/new).
|
|
152
152
|
|
|
153
|
-
Please check out the [limitations of the library](https://github.com/
|
|
153
|
+
Please check out the [limitations of the library](https://github.com/alasql/alasql#limitations).
|
|
154
154
|
|
|
155
155
|
## Performance
|
|
156
156
|
|
|
@@ -160,14 +160,14 @@ AlaSQL is designed for speed and includes some of the classic SQL engine optimiz
|
|
|
160
160
|
* Joined tables are pre-indexed
|
|
161
161
|
* `WHERE` expressions are pre-filtered for joins
|
|
162
162
|
|
|
163
|
-
See more [performance-related info on the wiki](https://github.com/
|
|
163
|
+
See more [performance-related info on the wiki](https://github.com/alasql/alasql/wiki/Speed)
|
|
164
164
|
|
|
165
165
|
## Features you might like
|
|
166
166
|
|
|
167
167
|
|
|
168
168
|
### Traditional SQL
|
|
169
169
|
|
|
170
|
-
Use "good old" SQL on your data with multiple levels of: `JOIN`, `VIEW`, `GROUP BY`, `UNION`, `PRIMARY KEY`, `ANY`, `ALL`, `IN`, `ROLLUP()`, `CUBE()`, `GROUPING SETS()`, `CROSS APPLY`, `OUTER APPLY`, `WITH SELECT`, and subqueries. [The wiki lists supported SQL statements and keywords](https://github.com/
|
|
170
|
+
Use "good old" SQL on your data with multiple levels of: `JOIN`, `VIEW`, `GROUP BY`, `UNION`, `PRIMARY KEY`, `ANY`, `ALL`, `IN`, `ROLLUP()`, `CUBE()`, `GROUPING SETS()`, `CROSS APPLY`, `OUTER APPLY`, `WITH SELECT`, and subqueries. [The wiki lists supported SQL statements and keywords](https://github.com/alasql/alasql/wiki/SQL%20keywords).
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
|
|
@@ -183,7 +183,7 @@ alasql.fn.myfn = function(a,b) {
|
|
|
183
183
|
var res = alasql('SELECT myfn(a,b) FROM one');
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
You can also define your own aggregator functions (like your own `SUM(...)`). See more [in the wiki](https://github.com/
|
|
186
|
+
You can also define your own aggregator functions (like your own `SUM(...)`). See more [in the wiki](https://github.com/alasql/alasql/wiki/User-Defined-Functions)
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
### Compiled statements and functions
|
|
@@ -194,7 +194,7 @@ ins(1,10);
|
|
|
194
194
|
ins(2,20);
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
See more [in the wiki](https://github.com/
|
|
197
|
+
See more [in the wiki](https://github.com/alasql/alasql/wiki/Compile)
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
### SELECT against your JavaScript data
|
|
@@ -206,7 +206,7 @@ var data = [{a:1,b:1,c:1},{a:1,b:2,c:1},{a:1,b:3,c:1}, {a:2,b:1,c:1}];
|
|
|
206
206
|
var res = alasql('SELECT a, COUNT(*) AS b FROM ? GROUP BY a', [data] );
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
See more ideas for creative data manipulation [in the wiki](https://github.com/
|
|
209
|
+
See more ideas for creative data manipulation [in the wiki](https://github.com/alasql/alasql/wiki/Getting-started)
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
|
|
@@ -278,46 +278,46 @@ $ alasql "VALUE OF SELECT COUNT(*) AS abc FROM TXT('README.md') WHERE LENGTH([0]
|
|
|
278
278
|
// Number of lines with more than 140 characters in README.md
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
[More examples are included in the wiki](https://github.com/
|
|
281
|
+
[More examples are included in the wiki](https://github.com/alasql/alasql/wiki/AlaSQL-CLI)
|
|
282
282
|
|
|
283
283
|
|
|
284
284
|
## Features you might love
|
|
285
285
|
|
|
286
286
|
### AlaSQL ♥ D3.js
|
|
287
287
|
|
|
288
|
-
AlaSQL plays nice with d3.js and gives you a convenient way to integrate a specific subset of your data with the visual powers of D3. See more about [D3.js and AlaSQL in the wiki](https://github.com/
|
|
288
|
+
AlaSQL plays nice with d3.js and gives you a convenient way to integrate a specific subset of your data with the visual powers of D3. See more about [D3.js and AlaSQL in the wiki](https://github.com/alasql/alasql/wiki/d3.js)
|
|
289
289
|
|
|
290
290
|
### AlaSQL ♥ Excel
|
|
291
291
|
|
|
292
|
-
AlaSQL can export data to both [Excel 2003 (.xls)](https://github.com/
|
|
292
|
+
AlaSQL can export data to both [Excel 2003 (.xls)](https://github.com/alasql/alasql/wiki/XLS) and [Excel 2007 (.xlsx)](https://github.com/alasql/alasql/wiki/XLSX) formats with coloring of cells and other Excel formatting functions.
|
|
293
293
|
|
|
294
294
|
### AlaSQL ♥ Meteor
|
|
295
295
|
|
|
296
|
-
Meteor is amazing. You can query directly on your Meteor collections with SQL - simple and easy. See more about [Meteor and AlaSQL in the wiki](https://github.com/
|
|
296
|
+
Meteor is amazing. You can query directly on your Meteor collections with SQL - simple and easy. See more about [Meteor and AlaSQL in the wiki](https://github.com/alasql/alasql/wiki/Meteor)
|
|
297
297
|
|
|
298
298
|
### AlaSQL ♥ Angular.js
|
|
299
299
|
|
|
300
|
-
Angular is great. In addition to normal data manipulation, AlaSQL works like a charm for exporting your present scope to Excel. See more about [Angular and AlaSQL in the wiki](https://github.com/
|
|
300
|
+
Angular is great. In addition to normal data manipulation, AlaSQL works like a charm for exporting your present scope to Excel. See more about [Angular and AlaSQL in the wiki](https://github.com/alasql/alasql/wiki/Angular.js)
|
|
301
301
|
|
|
302
302
|
### AlaSQL ♥ Google Maps
|
|
303
303
|
|
|
304
|
-
Pinpointing data on a map should be easy. AlaSQL is great to prepare source data for Google Maps from, for example, Excel or CSV, making it one unit of work for fetching and identifying what's relevant. See more about [Google Maps and AlaSQL in the wiki](https://github.com/
|
|
304
|
+
Pinpointing data on a map should be easy. AlaSQL is great to prepare source data for Google Maps from, for example, Excel or CSV, making it one unit of work for fetching and identifying what's relevant. See more about [Google Maps and AlaSQL in the wiki](https://github.com/alasql/alasql/wiki/Google-maps)
|
|
305
305
|
|
|
306
306
|
### AlaSQL ♥ Google Spreadsheets
|
|
307
307
|
|
|
308
|
-
AlaSQL can query data directly from a Google spreadsheet. A good "partnership" for easy editing and powerful data manipulation. See more about [Google Spreadsheets and AlaSQL in the wiki](https://github.com/
|
|
308
|
+
AlaSQL can query data directly from a Google spreadsheet. A good "partnership" for easy editing and powerful data manipulation. See more about [Google Spreadsheets and AlaSQL in the wiki](https://github.com/alasql/alasql/wiki/Google-Spreadsheets)
|
|
309
309
|
|
|
310
310
|
### Miss a feature?
|
|
311
|
-
Take charge and [add your idea](http://feathub.com/
|
|
311
|
+
Take charge and [add your idea](http://feathub.com/alasql/alasql/features/new) or [vote for your favorite feature](http://feathub.com/alasql/alasql) to be implemented:
|
|
312
312
|
|
|
313
|
-
[](http://feathub.com/alasql/alasql)
|
|
314
314
|
|
|
315
315
|
|
|
316
316
|
## Limitations
|
|
317
317
|
|
|
318
|
-
Please be aware that AlaSQL has [bugs](https://github.com/
|
|
318
|
+
Please be aware that AlaSQL has [bugs](https://github.com/alasql/alasql/labels/Bug). Beside having some bugs, there are a number of limitations:
|
|
319
319
|
|
|
320
|
-
0. AlaSQL has a (long) list of keywords that must be escaped if used for column names. When selecting a field named `key` please write ``` SELECT `key` FROM ... ``` instead. This is also the case for words like ``` `value` ```, ``` `read` ```, ``` `count` ```, ``` `by` ```, ``` `top` ```, ``` `path` ```, ``` `deleted` ```, ``` `work` ``` and ``` `offset` ```. Please consult the [full list of keywords](https://github.com/
|
|
320
|
+
0. AlaSQL has a (long) list of keywords that must be escaped if used for column names. When selecting a field named `key` please write ``` SELECT `key` FROM ... ``` instead. This is also the case for words like ``` `value` ```, ``` `read` ```, ``` `count` ```, ``` `by` ```, ``` `top` ```, ``` `path` ```, ``` `deleted` ```, ``` `work` ``` and ``` `offset` ```. Please consult the [full list of keywords](https://github.com/alasql/alasql/wiki/AlaSQL-Keywords).
|
|
321
321
|
|
|
322
322
|
0. It is OK to `SELECT` 1000000 records or to `JOIN` two tables with 10000 records in each (You can use streaming functions to work with longer datasources - see [test/test143.js](test/test143.js)) but be aware that the workload is multiplied so `SELECT`ing from more than 8 tables with just 100 rows in each will show bad performance. This is one of our top priorities to make better.
|
|
323
323
|
|
|
@@ -329,11 +329,11 @@ Please be aware that AlaSQL has [bugs](https://github.com/agershun/alasql/labels
|
|
|
329
329
|
|
|
330
330
|
0. At the moment AlaSQL does not work with JSZip 3.0.0 - please use version 2.x.
|
|
331
331
|
|
|
332
|
-
0. `JOIN`ing a sub-`SELECT` does not work. Please use a `with` structure ([Example here](https://github.com/
|
|
332
|
+
0. `JOIN`ing a sub-`SELECT` does not work. Please use a `with` structure ([Example here](https://github.com/alasql/alasql/issues/832#issuecomment-377574550)) or fetch the sub-`SELECT` to a variable and pass it as an argument ([Example here](https://github.com/alasql/alasql/issues/832#issuecomment-377559478)).
|
|
333
333
|
|
|
334
334
|
0. AlaSQL uses the [FileSaver.js](https://github.com/eligrey/FileSaver.js/) library for saving files locally from the browser. Please be aware that it does not save files in Safari 8.0.
|
|
335
335
|
|
|
336
|
-
There are probably many others. Please help us fix them by [submitting an issue](https://github.com/
|
|
336
|
+
There are probably many others. Please help us fix them by [submitting an issue](https://github.com/alasql/alasql/issues). Thank you!
|
|
337
337
|
|
|
338
338
|
|
|
339
339
|
## How To
|
|
@@ -526,7 +526,7 @@ var res = alasql('SEARCH / ANY(>> >> #Alice) name');
|
|
|
526
526
|
console.log(res) // ['Olga','Helen']
|
|
527
527
|
```
|
|
528
528
|
|
|
529
|
-
See more [in the wiki](https://github.com/
|
|
529
|
+
See more [in the wiki](https://github.com/alasql/alasql/wiki/GRAPH)
|
|
530
530
|
|
|
531
531
|
### localStorage and DOM-storage
|
|
532
532
|
|
|
@@ -553,7 +553,7 @@ to use `COMMIT` statement to save all data from in-memory mirror to localStorage
|
|
|
553
553
|
|
|
554
554
|
### Plugins
|
|
555
555
|
|
|
556
|
-
AlaSQL supports plugins. To install a plugin you need to use the `REQUIRE` statement. See more [in the wiki](https://github.com/
|
|
556
|
+
AlaSQL supports plugins. To install a plugin you need to use the `REQUIRE` statement. See more [in the wiki](https://github.com/alasql/alasql/wiki/Plugins)
|
|
557
557
|
|
|
558
558
|
### Alaserver - simple database server
|
|
559
559
|
|
|
@@ -574,7 +574,7 @@ Warning: Alaserver is not multi-threaded, not concurrent, and not secured.
|
|
|
574
574
|
|
|
575
575
|
### Regression tests
|
|
576
576
|
|
|
577
|
-
AlaSQL currently has over 1200 regression tests, but they only cover [](https://rawgit.com/alasql/alasql/develop/test/coverage/lcov-report/dist/alasql.fs.js.html)
|
|
578
578
|
of the codebase.
|
|
579
579
|
|
|
580
580
|
AlaSQL uses `mocha` for regression tests. Install `mocha` and run
|
|
@@ -609,8 +609,8 @@ See [Contributing](CONTRIBUTING.md) for details.
|
|
|
609
609
|
|
|
610
610
|
Thanks to all the people who already contributed!
|
|
611
611
|
|
|
612
|
-
<a href="https://github.com/
|
|
613
|
-
<img src="https://contributors-img.web.app/image?repo=
|
|
612
|
+
<a href="https://github.com/alasql/alasql/graphs/contributors">
|
|
613
|
+
<img src="https://contributors-img.web.app/image?repo=alasql/alasql" />
|
|
614
614
|
</a>
|
|
615
615
|
|
|
616
616
|
|
|
@@ -621,14 +621,14 @@ MIT - see [MIT licence information](LICENSE)
|
|
|
621
621
|
|
|
622
622
|
## Main contributors
|
|
623
623
|
|
|
624
|
-
* [Andrey Gershun](https://github.com/
|
|
624
|
+
* [Andrey Gershun](https://github.com/alasql)
|
|
625
625
|
* [Mathias Rangel Wulff](https://twitter.com/rangelwulff)
|
|
626
626
|
|
|
627
627
|
AlaSQL is an [OPEN Open Source Project](http://openopensource.org/). This means that:
|
|
628
628
|
|
|
629
629
|
> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
|
|
630
630
|
|
|
631
|
-
We appreciate any and all contributions we can get. If you feel like contributing, have a look at [CONTRIBUTING.md](https://github.com/
|
|
631
|
+
We appreciate any and all contributions we can get. If you feel like contributing, have a look at [CONTRIBUTING.md](https://github.com/alasql/alasql/blob/develop/CONTRIBUTING.md)
|
|
632
632
|
|
|
633
633
|
|
|
634
634
|
## Credits
|
|
@@ -644,10 +644,10 @@ and other people for useful tools, which make our work much easier.
|
|
|
644
644
|
|
|
645
645
|
### Related projects that have inspired us
|
|
646
646
|
|
|
647
|
-
* [AlaX](http://github.com/
|
|
648
|
-
* [WebSQLShim](http://github.com/
|
|
649
|
-
* [AlaMDX](http://github.com/
|
|
650
|
-
* [Other similar projects](http://github.com/
|
|
647
|
+
* [AlaX](http://github.com/alasql/alax) - Export to Excel with colors and formats
|
|
648
|
+
* [WebSQLShim](http://github.com/alasql/WebSQLShim) - WebSQL shim over IndexedDB (work in progress)
|
|
649
|
+
* [AlaMDX](http://github.com/alasql/alamdx) - JavaScript MDX OLAP library (work in progress)
|
|
650
|
+
* [Other similar projects](http://github.com/alasql/alasql/wiki/Similar-Projects.md) - list of databases on JavaScript
|
|
651
651
|
|
|
652
652
|
|
|
653
653
|
|
package/dist/alasql-worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.0.
|
|
1
|
+
//! AlaSQL v2.0.7-develop-c0ecdf55undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.0.
|
|
4
|
+
@version 2.0.7-develop-c0ecdf55undefined
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
//! AlaSQL v2.0.
|
|
1
|
+
//! AlaSQL v2.0.7-develop-c0ecdf55undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
|
|
2
2
|
!function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.alasql=e()}(this,function(){function i(r,e,o){"function"==typeof(e=e||[])&&(scope=o,o=e,e=[]),"object"!=typeof e&&(e=[e]);var t=i.lastid++;i.buffer[t]=o,i.webworker.postMessage({id:t,sql:r,params:e})}var a;if(i.options={},i.options.progress=function(){},isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)},i.promise=function(){throw new Error("Please include a Promise/A+ library")},"undefined"!=typeof Promise&&(a=function(r,e,n,s){return new Promise(function(o,t){i(r,e,function(r,e){e?t(e):(n&&s&&!1!==i.options.progress&&i.options.progress(n,s),o(r))})})},i.promise=function(r,e){if("undefined"==typeof Promise)throw new Error("Please include a Promise/A+ library");if("string"==typeof r)return a(r,e);if(!isArray(r)||r.length<1||void 0!==e)throw new Error("Error in .promise parameters");var o=r;if(!(o.length<1)){for(var t,n,s=[],i=0;i<o.length;i++){if("string"==typeof(n=o[i])&&(n=[n]),!isArray(n)||n.length<1||2<n.length)throw new Error("Error in .promise parameter");t=n[0],n=n[1]||void 0,s.push(a(t,n,i,o.length))}return Promise.all(s)}}),i=i||!1)return i.worker=function(){throw new Error("Can find webworker in this enviroment")},"undefined"!=typeof Worker&&(i.worker=function(r,e,o){if(void 0===(r=!0===r?void 0:r))for(var t=document.getElementsByTagName("script"),n=0;n<t.length;n++){if("alasql-worker.js"===t[n].src.substr(-16).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-16)+"alasql.js";break}if("alasql-worker.min.js"===t[n].src.substr(-20).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-20)+"alasql.min.js";break}if("alasql.js"===t[n].src.substr(-9).toLowerCase()){r=t[n].src;break}if("alasql.min.js"===t[n].src.substr(-13).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-13)+"alasql.min.js";break}}if(void 0===r)throw new Error("Path to alasql.js is not specified");var s;!1!==r?(s=(s="importScripts('")+r+"');self.onmessage = function(event) {alasql(event.data.sql,event.data.params, function(data){postMessage({id:event.data.id, data:data});});}",s=new Blob([s],{type:"text/plain"}),i.webworker=new Worker(URL.createObjectURL(s)),i.webworker.onmessage=function(r){var e=r.data.id;i.buffer[e](r.data.data),delete i.buffer[e]},i.webworker.onerror=function(r){throw r},1<arguments.length&&i("REQUIRE "+e.map(function(r){return'"'+r+'"'}).join(","),[],o)):!1===r&&delete i.webworker}),i.lastid=0,i.buffer={},i.worker(),i;throw new Error("alasql was not found")});
|
package/dist/alasql.fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.0.
|
|
1
|
+
//! AlaSQL v2.0.7-develop-c0ecdf55undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.0.
|
|
4
|
+
@version 2.0.7-develop-c0ecdf55undefined
|
|
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.0.
|
|
145
|
+
alasql.version = '2.0.7-develop-c0ecdf55undefined';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -13292,6 +13292,7 @@ stdfn.ASCII = function (a) {
|
|
|
13292
13292
|
*/
|
|
13293
13293
|
stdfn.COALESCE = function () {
|
|
13294
13294
|
for (var i = 0; i < arguments.length; i++) {
|
|
13295
|
+
if (arguments[i] === null) continue;
|
|
13295
13296
|
if (typeof arguments[i] == 'undefined') continue;
|
|
13296
13297
|
if (typeof arguments[i] == 'number' && isNaN(arguments[i])) continue;
|
|
13297
13298
|
return arguments[i];
|
|
@@ -13390,8 +13391,25 @@ alasql.stdfn.DATEDIFF = function (period, d1, d2) {
|
|
|
13390
13391
|
};
|
|
13391
13392
|
|
|
13392
13393
|
alasql.stdfn.DATEADD = function (period, interval, d) {
|
|
13393
|
-
var nd = new Date(d)
|
|
13394
|
-
|
|
13394
|
+
var nd = new Date(d);
|
|
13395
|
+
var period = period.toLowerCase();
|
|
13396
|
+
|
|
13397
|
+
switch (period) {
|
|
13398
|
+
case 'year':
|
|
13399
|
+
nd.setFullYear(nd.getFullYear() + interval);
|
|
13400
|
+
break;
|
|
13401
|
+
case 'quarter':
|
|
13402
|
+
nd.setMonth(nd.getMonth() + interval * 3);
|
|
13403
|
+
break;
|
|
13404
|
+
case 'month':
|
|
13405
|
+
nd.setMonth(nd.getMonth() + interval);
|
|
13406
|
+
break;
|
|
13407
|
+
default:
|
|
13408
|
+
nd = new Date(nd.getTime() + interval * PERIODS[period]);
|
|
13409
|
+
break;
|
|
13410
|
+
}
|
|
13411
|
+
|
|
13412
|
+
return nd;
|
|
13395
13413
|
};
|
|
13396
13414
|
|
|
13397
13415
|
alasql.stdfn.INTERVAL = function (interval, period) {
|
package/dist/alasql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v2.0.
|
|
1
|
+
//! AlaSQL v2.0.7-develop-c0ecdf55undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 2.0.
|
|
4
|
+
@version 2.0.7-develop-c0ecdf55undefined
|
|
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.0.
|
|
145
|
+
alasql.version = '2.0.7-develop-c0ecdf55undefined';
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
Debug flag
|
|
@@ -13287,6 +13287,7 @@ stdfn.ASCII = function (a) {
|
|
|
13287
13287
|
*/
|
|
13288
13288
|
stdfn.COALESCE = function () {
|
|
13289
13289
|
for (var i = 0; i < arguments.length; i++) {
|
|
13290
|
+
if (arguments[i] === null) continue;
|
|
13290
13291
|
if (typeof arguments[i] == 'undefined') continue;
|
|
13291
13292
|
if (typeof arguments[i] == 'number' && isNaN(arguments[i])) continue;
|
|
13292
13293
|
return arguments[i];
|
|
@@ -13385,8 +13386,25 @@ alasql.stdfn.DATEDIFF = function (period, d1, d2) {
|
|
|
13385
13386
|
};
|
|
13386
13387
|
|
|
13387
13388
|
alasql.stdfn.DATEADD = function (period, interval, d) {
|
|
13388
|
-
var nd = new Date(d)
|
|
13389
|
-
|
|
13389
|
+
var nd = new Date(d);
|
|
13390
|
+
var period = period.toLowerCase();
|
|
13391
|
+
|
|
13392
|
+
switch (period) {
|
|
13393
|
+
case 'year':
|
|
13394
|
+
nd.setFullYear(nd.getFullYear() + interval);
|
|
13395
|
+
break;
|
|
13396
|
+
case 'quarter':
|
|
13397
|
+
nd.setMonth(nd.getMonth() + interval * 3);
|
|
13398
|
+
break;
|
|
13399
|
+
case 'month':
|
|
13400
|
+
nd.setMonth(nd.getMonth() + interval);
|
|
13401
|
+
break;
|
|
13402
|
+
default:
|
|
13403
|
+
nd = new Date(nd.getTime() + interval * PERIODS[period]);
|
|
13404
|
+
break;
|
|
13405
|
+
}
|
|
13406
|
+
|
|
13407
|
+
return nd;
|
|
13390
13408
|
};
|
|
13391
13409
|
|
|
13392
13410
|
alasql.stdfn.INTERVAL = function (interval, period) {
|