alasql 4.2.3 → 4.2.4

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 CHANGED
@@ -1,18 +1,17 @@
1
- - _AlaSQL is an unfunded open source project installed 150k+ times each month. [Please donate your time](https://github.com/AlaSQL/alasql/issues?q=is%3Aopen+label%3A%22Help+wanted%22+sort%3Aupdated-desc). We appreciate any and all contributions we can get._
1
+ - _AlaSQL is an unfunded open source project installed 140k+ times each month. [Please donate your time](https://github.com/AlaSQL/alasql/issues?q=is%3Aopen+label%3A%22Help+wanted%22+sort%3Aupdated-desc). We appreciate any and all contributions we can get._
2
2
 
3
- - _Have a question? Ask on [Stack Overflow](http://stackoverflow.com/questions/ask?tags=AlaSQL) using the "alasql" tag._
3
+ - _Have a question? [Ask the AlaSQL bot](https://chat.openai.com/g/g-XcBL24WTe-alasql-bot) or post on [Stack Overflow](http://stackoverflow.com/questions/ask?tags=AlaSQL)._
4
4
 
5
5
  [![CI-test](https://github.com/alasql/alasql/workflows/CI-test/badge.svg)](https://github.com/alasql/alasql/actions)
6
6
  [![NPM downloads](http://img.shields.io/npm/dm/alasql.svg?style=flat&label=npm%20downloads)](https://npm-stat.com/charts.html?package=alasql)
7
7
  [![OPEN open source software](https://img.shields.io/badge/Open--OSS-%E2%9C%94-brightgreen.svg)](http://open-oss.com)
8
8
  [![Release](https://img.shields.io/github/release/alasql/alasql.svg?label=npm&a)](https://www.npmjs.com/package/alasql)
9
- [![Stars](https://img.shields.io/github/stars/alasql/alasql.svg?label=Github%20%E2%98%85&a)](https://github.com/alasql/alasql)
10
9
  [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/AlaSQL/alasql.svg)](http://isitmaintained.com/project/AlaSQL/alasql "Average time to resolve an issue")
11
10
  [![Coverage]( https://img.shields.io/codecov/c/github/alasql/alasql/develop.svg)](https://rawgit.com/alasql/alasql/develop/test/coverage/lcov-report/dist/alasql.fs.js.html)
12
11
  [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/AlaSQL/alasql/badge)](https://securityscorecards.dev/viewer/?uri=github.com/AlaSQL/alasql)
13
12
  [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/328/badge)](https://bestpractices.coreinfrastructure.org/projects/328)
14
13
  [![](https://data.jsdelivr.com/v1/package/npm/alasql/badge?style=rounded)](https://www.jsdelivr.com/package/npm/alasql)
15
-
14
+ [![Stars](https://img.shields.io/github/stars/alasql/alasql.svg?label=Github%20%E2%98%85&a)](https://github.com/alasql/alasql)
16
15
 
17
16
 
18
17
 
@@ -652,4 +651,6 @@ and other people for useful tools, which make our work much easier.
652
651
 
653
652
  ----
654
653
  <a href="http://alasql.org"><img src="https://cloud.githubusercontent.com/assets/1063454/14003946/d6e5c076-f156-11e5-8238-e62d2a8d20dc.png" align="right" alt="AlaSQL logo"/></a>
655
- © 2014-2023, Andrey Gershun (agershun@gmail.com) & Mathias Rangel Wulff (m@rawu.dk)
654
+ © 2014-2024, Andrey Gershun (agershun@gmail.com) & Mathias Rangel Wulff (m@rawu.dk)
655
+
656
+ See [this article](https://console.substack.com/p/console-187) for a bit of information about the motivation and background.
package/build.sh CHANGED
@@ -27,7 +27,6 @@ branch=$(git rev-parse --abbrev-ref HEAD | rexreplace '[^0-9a-z-]' '.' | rexre
27
27
  commit=$(git rev-parse --short HEAD)
28
28
 
29
29
 
30
-
31
30
  echo '\nPrepare types'
32
31
  cp 'types/alasql.d.ts' dist/
33
32
 
@@ -36,19 +35,14 @@ echo '\nPrepare echo plugin'
36
35
  cp 'src/echo/alasql-echo.js' dist/
37
36
 
38
37
 
39
-
40
38
  echo '\nPrepare prolog'
41
39
  cp 'src/prolog/alasql-prolog.js' dist/
42
40
 
43
41
 
44
-
45
-
46
-
47
-
48
42
  echo '\nBuild alasql.js files'
49
- outfile_fs="dist/alasql.fs.js"
50
43
  outfile="dist/alasql.js"
51
44
  outfile_min="dist/alasql.min.js"
45
+ outfile_fs="dist/alasql.fs.js"
52
46
 
53
47
  echo '# Concat all parts'
54
48
  cat \
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.2.2 build: develop-a55b6500 | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.2.3 build: develop-aada421c | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.2.2
4
+ @version 4.2.3
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2023 Andrey Gershun & Mathias Wulff
package/dist/alasql.d.ts CHANGED
@@ -82,6 +82,62 @@ declare module 'alasql' {
82
82
  [x: string]: userFromFunction;
83
83
  }
84
84
 
85
+ /**
86
+ * AlaSQL database object. This is a lightweight implimentation
87
+ *
88
+ * @interface database
89
+ */
90
+ interface database {
91
+ /**
92
+ * The database ID.
93
+ *
94
+ * @type {string}
95
+ * @memberof database
96
+ */
97
+ databaseid: string;
98
+
99
+ /**
100
+ * The collection of tables in the database.
101
+ *
102
+ * @type {tableLookUp}
103
+ * @memberof database
104
+ */
105
+ tables: tableLookUp;
106
+ }
107
+
108
+ /**
109
+ * AlaSQL table object. This is a lightweight implimentation
110
+ *
111
+ * @interface table
112
+ */
113
+ interface table {
114
+ /**
115
+ * The array of data stored in the table which can be queried
116
+ *
117
+ * @type {any[]}
118
+ * @memberof table
119
+ */
120
+ data: any[];
121
+ }
122
+
123
+ /**
124
+ * AlaSQL database dictionary
125
+ *
126
+ * @interface databaseLookUp
127
+ */
128
+ interface databaseLookUp {
129
+ [databaseName: string]: database;
130
+ }
131
+
132
+ /**
133
+ * AlaSQL table dictionary
134
+ *
135
+ * @interface tableLookUp
136
+ */
137
+ interface tableLookUp {
138
+ [tableName: string]: table;
139
+ }
140
+
85
141
  interface AlaSQL {
86
142
  options: AlaSQLOptions;
87
143
  error: Error;
@@ -94,6 +150,43 @@ declare module 'alasql' {
94
150
  autoval(tablename: string, colname: string, getNext?: boolean): number;
95
151
  yy: {};
96
152
  setXLSX(xlsxlib: typeof xlsx): void;
153
+
154
+ /**
155
+ * Array of databases in the AlaSQL object.
156
+ *
157
+ * @type {databaseLookUp}
158
+ * @memberof AlaSQL
159
+ */
160
+ databases: databaseLookUp;
161
+
162
+ /**
163
+ * Equivalent to alasql('USE '+databaseid). This will change the current
164
+ * database to the one specified. This will update the useid property and
165
+ * the tables property.
166
+ *
167
+ * @param {string} databaseid
168
+ * @memberof AlaSQL
169
+ */
170
+ use(databaseid: string): void;
171
+
172
+ /**
173
+ * The current database ID. If no database is selected, this is the
174
+ * default database ID (called alasql).
175
+ *
176
+ * @type {string}
177
+ * @memberof AlaSQL
178
+ */
179
+ useid: string;
180
+
181
+ /**
182
+ * Array of the tables in the default database (called alasql). If
183
+ * the database is changes via a USE statement or the use method, this
184
+ * becomes the tables in the new database.
185
+ *
186
+ * @type {tableLookUp}
187
+ * @memberof AlaSQL
188
+ */
189
+ tables: tableLookUp;
97
190
  }
98
191
 
99
192
  const alasql: AlaSQL;