sqlmath 0.0.4 → 2022.3.5
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/.npmignore +10 -0
- package/CHANGELOG.md +7 -0
- package/README.md +3 -3
- package/_binary_sqlmath_napi8_darwin_x64.node +0 -0
- package/_binary_sqlmath_napi8_linux_x64.node +0 -0
- package/_binary_sqlmath_napi8_win32_x64.node +0 -0
- package/jslint.mjs +217 -149
- package/package.json +1 -1
- package/sqlmath.mjs +191 -44
- package/.gitconfig +0 -25
- package/.github/workflows/ci.yml +0 -119
- package/.github/workflows/publish.yml +0 -67
- package/.gitignore +0 -20
- package/asset_image_folder_open_solid.svg +0 -1
- package/jslint_ci.sh +0 -2795
- package/sqlite3.c +0 -248548
- package/sqlite3_ext.c +0 -8372
- package/sqlite3_shell.c +0 -22436
- package/sqlmath_base.c +0 -1832
- package/sqlmath_custom.c +0 -78
- package/sqlmath_custom.cpp +0 -0
- package/sqlmath_custom.mjs +0 -4
- package/sqlmath_old.js +0 -31038
package/package.json
CHANGED
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"test2": "sh jslint_ci.sh shCiBase",
|
|
38
38
|
"test_win32": "node -e \"require('child_process').spawn('C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe',['-c','npm run test' + ' ' + process.argv.slice(1).join(' ')],{stdio:['ignore',1,2]});\""
|
|
39
39
|
},
|
|
40
|
-
"version": "
|
|
40
|
+
"version": "2022.3.5"
|
|
41
41
|
}
|
package/sqlmath.mjs
CHANGED
|
@@ -8,7 +8,8 @@ let {
|
|
|
8
8
|
assertJsonEqual,
|
|
9
9
|
assertOrThrow,
|
|
10
10
|
debugInline,
|
|
11
|
-
noop
|
|
11
|
+
noop,
|
|
12
|
+
objectDeepCopyWithKeysSorted
|
|
12
13
|
} = jslint;
|
|
13
14
|
let local = Object.assign({}, jslint);
|
|
14
15
|
|
|
@@ -17,7 +18,7 @@ function assertNumericalEqual(aa, bb, message) {
|
|
|
17
18
|
// This function will assert aa - bb <= Number.EPSILON
|
|
18
19
|
|
|
19
20
|
assertOrThrow(aa, "value cannot be 0 or falsy");
|
|
20
|
-
if (!(Math.abs(aa - bb) <= Number.EPSILON)) {
|
|
21
|
+
if (!(Math.abs((aa - bb) / Math.max(aa, bb)) <= 256 * Number.EPSILON)) {
|
|
21
22
|
throw new Error(
|
|
22
23
|
JSON.stringify(aa) + " != " + JSON.stringify(bb) + (
|
|
23
24
|
message
|
|
@@ -58,10 +59,10 @@ file sqlmath.js
|
|
|
58
59
|
let SQLITE_OPEN_URI = 0x00000040; /* Ok for sqlite3_open_v2() */
|
|
59
60
|
let SQLITE_OPEN_WAL = 0x00080000; /* VFS only */
|
|
60
61
|
let addon;
|
|
61
|
-
let
|
|
62
|
+
let consoleError = console.error;
|
|
63
|
+
let dbDict = new WeakMap(); // private map of sqlite-database-connections
|
|
62
64
|
let requireCjs = createRequire(import.meta.url);
|
|
63
65
|
let testList;
|
|
64
|
-
// private map of sqlite-database-connections
|
|
65
66
|
|
|
66
67
|
function cCall(func, argList) {
|
|
67
68
|
// this function will serialize <argList> to a c <baton>,
|
|
@@ -168,8 +169,12 @@ file sqlmath.js
|
|
|
168
169
|
bindList = [],
|
|
169
170
|
db,
|
|
170
171
|
responseType,
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
sql,
|
|
173
|
+
tmpColList,
|
|
174
|
+
tmpColListPriority,
|
|
175
|
+
tmpCsv,
|
|
176
|
+
tmpRowList,
|
|
177
|
+
tmpTableName
|
|
173
178
|
}) {
|
|
174
179
|
// this function will exec <sql> in <db> and return <result>
|
|
175
180
|
let bindByKey = !Array.isArray(bindList);
|
|
@@ -180,10 +185,14 @@ file sqlmath.js
|
|
|
180
185
|
);
|
|
181
186
|
let result;
|
|
182
187
|
let serialize = jsToSqlSerializer();
|
|
183
|
-
if (
|
|
188
|
+
if (tmpCsv || tmpRowList) {
|
|
184
189
|
await dbTableInsertAsync({
|
|
190
|
+
colList: tmpColList,
|
|
191
|
+
colListPriority: tmpColListPriority,
|
|
192
|
+
csv: tmpCsv,
|
|
185
193
|
db,
|
|
186
|
-
rowList
|
|
194
|
+
rowList: tmpRowList,
|
|
195
|
+
tableName: tmpTableName
|
|
187
196
|
});
|
|
188
197
|
}
|
|
189
198
|
Object.entries(bindList).forEach(function ([
|
|
@@ -231,6 +240,25 @@ file sqlmath.js
|
|
|
231
240
|
}
|
|
232
241
|
}
|
|
233
242
|
|
|
243
|
+
async function dbExecWithRetryAsync(option) {
|
|
244
|
+
// this function will exec <sql> in <db> and return <result> with <retryLimit>
|
|
245
|
+
let retry = option.retryLimit || 1;
|
|
246
|
+
while (true) {
|
|
247
|
+
try {
|
|
248
|
+
return await dbExecAsync(option);
|
|
249
|
+
} catch (err) {
|
|
250
|
+
assertOrThrow(retry > 0, err);
|
|
251
|
+
consoleError(err);
|
|
252
|
+
consoleError(
|
|
253
|
+
"dbExecWithRetryAsync - retry failed sql-query with "
|
|
254
|
+
+ retry
|
|
255
|
+
+ " remaining retry"
|
|
256
|
+
);
|
|
257
|
+
retry -= 1;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
234
262
|
function dbGetLastBlobAsync({
|
|
235
263
|
bindList = [],
|
|
236
264
|
db,
|
|
@@ -306,9 +334,12 @@ file sqlmath.js
|
|
|
306
334
|
), async function () {
|
|
307
335
|
let finalizer;
|
|
308
336
|
let ptr = await cCall("__dbOpenAsync", [
|
|
309
|
-
String(filename),
|
|
337
|
+
String(filename),
|
|
338
|
+
undefined,
|
|
339
|
+
flags ?? (
|
|
310
340
|
SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE | SQLITE_OPEN_URI
|
|
311
|
-
),
|
|
341
|
+
),
|
|
342
|
+
undefined
|
|
312
343
|
]);
|
|
313
344
|
ptr = ptr[0][0];
|
|
314
345
|
finalizer = new BigInt64Array(addon.__dbFinalizerCreate());
|
|
@@ -330,13 +361,14 @@ file sqlmath.js
|
|
|
330
361
|
csv,
|
|
331
362
|
db,
|
|
332
363
|
rowList,
|
|
333
|
-
tableName
|
|
364
|
+
tableName
|
|
334
365
|
}) {
|
|
335
366
|
// this function will create-or-replace temp <tablename> with <rowList>
|
|
336
367
|
let serialize = jsToSqlSerializer();
|
|
337
368
|
let sqlCreateTable;
|
|
338
369
|
let sqlInsertRow;
|
|
339
370
|
// normalize and validate tableName
|
|
371
|
+
tableName = tableName || "__tmp1";
|
|
340
372
|
tableName = "temp." + JSON.stringify(tableName.replace((
|
|
341
373
|
/^temp\./
|
|
342
374
|
), ""));
|
|
@@ -429,9 +461,6 @@ file sqlmath.js
|
|
|
429
461
|
}
|
|
430
462
|
function bufferSetBuffer(aa, bb, offset) {
|
|
431
463
|
// this function will set buffer <bb> to buffer <aa> at <offset>
|
|
432
|
-
if (typeof bb === "string") {
|
|
433
|
-
bb = new TextEncoder().encode(bb);
|
|
434
|
-
}
|
|
435
464
|
aa = new Uint8Array(aa.buffer, aa.byteOffset, aa.byteLength);
|
|
436
465
|
bb = new Uint8Array(bb.buffer, bb.byteOffset, bb.byteLength);
|
|
437
466
|
aa.set(bb, offset);
|
|
@@ -1212,19 +1241,15 @@ Definition of the CSV Format
|
|
|
1212
1241
|
colListPriority,
|
|
1213
1242
|
rowList
|
|
1214
1243
|
}, jj) {
|
|
1215
|
-
let cc
|
|
1216
|
-
await dbTableInsertAsync({
|
|
1217
|
-
colList,
|
|
1218
|
-
colListPriority,
|
|
1219
|
-
db,
|
|
1220
|
-
rowList,
|
|
1221
|
-
tableName: "datatype_" + ii + "_" + jj
|
|
1222
|
-
});
|
|
1223
|
-
cc = noop(
|
|
1244
|
+
let cc = noop(
|
|
1224
1245
|
await dbExecAsync({
|
|
1225
1246
|
db,
|
|
1226
1247
|
responseType: "list",
|
|
1227
|
-
sql:
|
|
1248
|
+
sql: `SELECT * FROM datatype_${ii}_${jj}`,
|
|
1249
|
+
tmpColList: colList,
|
|
1250
|
+
tmpColListPriority: colListPriority,
|
|
1251
|
+
tmpRowList: rowList,
|
|
1252
|
+
tmpTableName: "datatype_" + ii + "_" + jj
|
|
1228
1253
|
})
|
|
1229
1254
|
)[0];
|
|
1230
1255
|
// debugInline(ii, jj, aa, bb, cc);
|
|
@@ -1282,12 +1307,14 @@ Definition of the CSV Format
|
|
|
1282
1307
|
sql: (`
|
|
1283
1308
|
CREATE TABLE testDbExecAsync1 AS
|
|
1284
1309
|
SELECT 101 AS c101, 102 AS c102
|
|
1310
|
+
--
|
|
1285
1311
|
UNION ALL
|
|
1286
1312
|
VALUES
|
|
1287
1313
|
(201, 202),
|
|
1288
1314
|
(301, NULL);
|
|
1289
1315
|
CREATE TABLE testDbExecAsync2 AS
|
|
1290
1316
|
SELECT 401 AS c401, 402 AS c402, 403 AS c403
|
|
1317
|
+
--
|
|
1291
1318
|
UNION ALL
|
|
1292
1319
|
VALUES
|
|
1293
1320
|
(501, 502.0123, 5030123456789),
|
|
@@ -1350,18 +1377,27 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1350
1377
|
));
|
|
1351
1378
|
// test sqlmath-defined-func handling-behavior
|
|
1352
1379
|
[
|
|
1380
|
+
"COT(NULL)", null,
|
|
1353
1381
|
"COT('-1')", -0.642092615934331,
|
|
1354
1382
|
"COT('0')", null,
|
|
1355
1383
|
"COT('1')", 0.642092615934331,
|
|
1356
1384
|
"COT(-1)", -0.642092615934331,
|
|
1357
1385
|
"COT(0)", null,
|
|
1358
1386
|
"COT(1)", 0.642092615934331,
|
|
1387
|
+
"COTH(NULL)", null,
|
|
1359
1388
|
"COTH('-1')", -1.31303528549933,
|
|
1360
1389
|
"COTH('0')", null,
|
|
1361
1390
|
"COTH('1')", 1.31303528549933,
|
|
1362
1391
|
"COTH(-1)", -1.31303528549933,
|
|
1363
1392
|
"COTH(0)", null,
|
|
1364
1393
|
"COTH(1)", 1.31303528549933,
|
|
1394
|
+
"ROUNDORZERO(NULL)", 0,
|
|
1395
|
+
"ROUNDORZERO(NULL, NULL)", 0,
|
|
1396
|
+
"ROUNDORZERO(NULL, 0.5)", 0,
|
|
1397
|
+
"ROUNDORZERO(0.5, NULL)", 1,
|
|
1398
|
+
"ROUNDORZERO(0.5, 0.5)", 1,
|
|
1399
|
+
"ROUNDORZERO(0.5, 1)", 0.5,
|
|
1400
|
+
"SIGN(NULL)", null,
|
|
1365
1401
|
"SIGN('-1')", -1,
|
|
1366
1402
|
"SIGN('0')", 0,
|
|
1367
1403
|
"SIGN('1')", 1,
|
|
@@ -1374,7 +1410,6 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1374
1410
|
"SIGN(0xffffffffffffffff)", -1,
|
|
1375
1411
|
"SIGN(1)", 1,
|
|
1376
1412
|
"SIGN(1e999)", 1,
|
|
1377
|
-
"SIGN(NULL)", null,
|
|
1378
1413
|
// sentinel
|
|
1379
1414
|
"NULL", null
|
|
1380
1415
|
].forEach(async function (sql, ii, list) {
|
|
@@ -1388,15 +1423,26 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1388
1423
|
await dbExecAsync({
|
|
1389
1424
|
db,
|
|
1390
1425
|
responseType: "dict",
|
|
1391
|
-
sql:
|
|
1426
|
+
sql: `SELECT ${sql} AS val`
|
|
1392
1427
|
})
|
|
1393
1428
|
)[0][0].val;
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1429
|
+
assertJsonEqual(bb, cc, {
|
|
1430
|
+
bb,
|
|
1431
|
+
cc,
|
|
1432
|
+
ii,
|
|
1433
|
+
sql
|
|
1434
|
+
});
|
|
1397
1435
|
});
|
|
1398
1436
|
}
|
|
1399
1437
|
|
|
1438
|
+
function testDbExecWithRetryAsync() {
|
|
1439
|
+
// this function will test dbExecWithRetryAsync's handling-behavior
|
|
1440
|
+
// test null-case handling-behavior
|
|
1441
|
+
assertErrorThrownAsync(function () {
|
|
1442
|
+
return dbExecWithRetryAsync({});
|
|
1443
|
+
}, "invalid or closed db");
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1400
1446
|
async function testDbMemoryXxx() {
|
|
1401
1447
|
// this function will test dbMemoryXxx's handling-behavior
|
|
1402
1448
|
let data;
|
|
@@ -1480,11 +1526,15 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1480
1526
|
].forEach(function ([
|
|
1481
1527
|
rowList, rgx
|
|
1482
1528
|
]) {
|
|
1483
|
-
assertErrorThrownAsync(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1529
|
+
assertErrorThrownAsync(
|
|
1530
|
+
dbTableInsertAsync.bind(
|
|
1531
|
+
undefined,
|
|
1532
|
+
{
|
|
1533
|
+
rowList
|
|
1534
|
+
}
|
|
1535
|
+
),
|
|
1536
|
+
rgx
|
|
1537
|
+
);
|
|
1488
1538
|
});
|
|
1489
1539
|
// test csv handling-behavior
|
|
1490
1540
|
[
|
|
@@ -1526,17 +1576,13 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1526
1576
|
].forEach(async function ([
|
|
1527
1577
|
aa, bb
|
|
1528
1578
|
], ii) {
|
|
1529
|
-
let cc
|
|
1530
|
-
await dbTableInsertAsync({
|
|
1531
|
-
csv: aa,
|
|
1532
|
-
db,
|
|
1533
|
-
tableName: "csv_" + ii
|
|
1534
|
-
});
|
|
1535
|
-
cc = noop(
|
|
1579
|
+
let cc = noop(
|
|
1536
1580
|
await dbExecAsync({
|
|
1537
1581
|
db,
|
|
1538
1582
|
responseType: "list",
|
|
1539
|
-
sql:
|
|
1583
|
+
sql: `SELECT * FROM temp.csv_${ii}`,
|
|
1584
|
+
tmpCsv: aa,
|
|
1585
|
+
tmpTableName: "csv_" + ii
|
|
1540
1586
|
})
|
|
1541
1587
|
)[0];
|
|
1542
1588
|
assertOrThrow(
|
|
@@ -1590,7 +1636,7 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1590
1636
|
return;
|
|
1591
1637
|
}
|
|
1592
1638
|
ii *= 0.5;
|
|
1593
|
-
sql =
|
|
1639
|
+
sql = `SELECT throwerror(${sql})`;
|
|
1594
1640
|
assertErrorThrownAsync(function () {
|
|
1595
1641
|
return dbExecAsync({
|
|
1596
1642
|
db,
|
|
@@ -1653,6 +1699,99 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1653
1699
|
});
|
|
1654
1700
|
}
|
|
1655
1701
|
|
|
1702
|
+
async function testSqlKthpercentile() {
|
|
1703
|
+
// this function will test sql-kthpercentile's handling-behavior
|
|
1704
|
+
let db = await dbOpenAsync({
|
|
1705
|
+
filename: ":memory:"
|
|
1706
|
+
});
|
|
1707
|
+
[
|
|
1708
|
+
[
|
|
1709
|
+
[], -99, 1
|
|
1710
|
+
], [
|
|
1711
|
+
[], 0, 1
|
|
1712
|
+
], [
|
|
1713
|
+
[], 0.125, 1
|
|
1714
|
+
], [
|
|
1715
|
+
[], 0.25, 2
|
|
1716
|
+
], [
|
|
1717
|
+
[], 0.375, 3
|
|
1718
|
+
], [
|
|
1719
|
+
[], 0.5, 4
|
|
1720
|
+
], [
|
|
1721
|
+
[], 0.625, 5
|
|
1722
|
+
], [
|
|
1723
|
+
[], 0.75, 6
|
|
1724
|
+
], [
|
|
1725
|
+
[], 0.875, 7
|
|
1726
|
+
], [
|
|
1727
|
+
[], 1, 8
|
|
1728
|
+
], [
|
|
1729
|
+
[], 99, 8
|
|
1730
|
+
], [
|
|
1731
|
+
[
|
|
1732
|
+
0.5
|
|
1733
|
+
], 0, 0.5
|
|
1734
|
+
], [
|
|
1735
|
+
[
|
|
1736
|
+
0.5
|
|
1737
|
+
], 0.125, 0.5
|
|
1738
|
+
], [
|
|
1739
|
+
[
|
|
1740
|
+
1.5
|
|
1741
|
+
], 0.25, 1.5
|
|
1742
|
+
], [
|
|
1743
|
+
[
|
|
1744
|
+
2.5
|
|
1745
|
+
], 0.375, 2.5
|
|
1746
|
+
], [
|
|
1747
|
+
[
|
|
1748
|
+
3.5
|
|
1749
|
+
], 0.5, 3.5
|
|
1750
|
+
], [
|
|
1751
|
+
[
|
|
1752
|
+
4.5
|
|
1753
|
+
], 0.625, 4.5
|
|
1754
|
+
], [
|
|
1755
|
+
[
|
|
1756
|
+
5.5
|
|
1757
|
+
], 0.75, 5.5
|
|
1758
|
+
], [
|
|
1759
|
+
[
|
|
1760
|
+
6.5
|
|
1761
|
+
], 0.875, 6.5
|
|
1762
|
+
], [
|
|
1763
|
+
[
|
|
1764
|
+
7.5
|
|
1765
|
+
], 1, 8
|
|
1766
|
+
]
|
|
1767
|
+
].forEach(async function ([
|
|
1768
|
+
data, kk, expected
|
|
1769
|
+
], ii) {
|
|
1770
|
+
let actual;
|
|
1771
|
+
data = data.concat([
|
|
1772
|
+
undefined, undefined, 8, 7, 6, 5, 4, 3, 2, 1, undefined
|
|
1773
|
+
]);
|
|
1774
|
+
actual = noop(
|
|
1775
|
+
await dbExecAsync({
|
|
1776
|
+
db,
|
|
1777
|
+
sql: (`
|
|
1778
|
+
SELECT kthpercentile(val, ${kk}) AS val FROM __tmp${ii};
|
|
1779
|
+
`),
|
|
1780
|
+
tmpRowList: data.map(function (val) {
|
|
1781
|
+
return {
|
|
1782
|
+
val
|
|
1783
|
+
};
|
|
1784
|
+
}),
|
|
1785
|
+
tmpTableName: `__tmp${ii}`
|
|
1786
|
+
})
|
|
1787
|
+
)[0][0].val;
|
|
1788
|
+
assertJsonEqual(actual, expected, {
|
|
1789
|
+
data,
|
|
1790
|
+
kk
|
|
1791
|
+
});
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1656
1795
|
addon = requireCjs(
|
|
1657
1796
|
"./_binary_sqlmath"
|
|
1658
1797
|
+ "_napi8"
|
|
@@ -1666,11 +1805,13 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1666
1805
|
testDbBind,
|
|
1667
1806
|
testDbCloseAsync,
|
|
1668
1807
|
testDbExecAsync,
|
|
1808
|
+
testDbExecWithRetryAsync,
|
|
1669
1809
|
testDbMemoryXxx,
|
|
1670
1810
|
testDbOpenAsync,
|
|
1671
1811
|
testDbTableInsertAsync,
|
|
1672
1812
|
testSqlError,
|
|
1673
|
-
testSqlExt
|
|
1813
|
+
testSqlExt,
|
|
1814
|
+
testSqlKthpercentile
|
|
1674
1815
|
];
|
|
1675
1816
|
Object.assign(local, {
|
|
1676
1817
|
SQLITE_MAX_LENGTH2,
|
|
@@ -1699,15 +1840,21 @@ SELECT * FROM testDbExecAsync2;
|
|
|
1699
1840
|
assertNumericalEqual,
|
|
1700
1841
|
dbCloseAsync,
|
|
1701
1842
|
dbExecAsync,
|
|
1843
|
+
dbExecWithRetryAsync,
|
|
1702
1844
|
dbGetLastBlobAsync,
|
|
1703
1845
|
dbMemoryLoadAsync,
|
|
1704
1846
|
dbMemorySaveAsync,
|
|
1705
1847
|
dbOpenAsync,
|
|
1706
1848
|
dbTableInsertAsync,
|
|
1707
1849
|
debugInline,
|
|
1850
|
+
objectDeepCopyWithKeysSorted,
|
|
1708
1851
|
testAll,
|
|
1709
1852
|
testList
|
|
1710
1853
|
});
|
|
1854
|
+
if (process.env.npm_config_mode_test) {
|
|
1855
|
+
// mock consoleError
|
|
1856
|
+
consoleError = noop;
|
|
1857
|
+
}
|
|
1711
1858
|
}());
|
|
1712
1859
|
|
|
1713
1860
|
export default Object.freeze(local);
|
package/.gitconfig
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
[branch "alpha"]
|
|
2
|
-
merge = refs/heads/alpha
|
|
3
|
-
remote = origin
|
|
4
|
-
[branch "base"]
|
|
5
|
-
merge = refs/heads/base
|
|
6
|
-
remote = origin
|
|
7
|
-
[core]
|
|
8
|
-
# autocrlf = false
|
|
9
|
-
autocrlf = input
|
|
10
|
-
bare = false
|
|
11
|
-
# filemode = false
|
|
12
|
-
logallrefupdates = true
|
|
13
|
-
repositoryformatversion = 0
|
|
14
|
-
[diff]
|
|
15
|
-
algorithm = histogram
|
|
16
|
-
[pull]
|
|
17
|
-
ff = only
|
|
18
|
-
[receive]
|
|
19
|
-
denyCurrentBranch = warn
|
|
20
|
-
[remote "origin"]
|
|
21
|
-
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
22
|
-
url = https://github.com/user/sqlmath
|
|
23
|
-
[remote "upstream"]
|
|
24
|
-
fetch = +refs/heads/*:refs/remotes/upstream/*
|
|
25
|
-
url = https://github.com/sqlmath/sqlmath
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# this workflow will run nodejs coverages and tests
|
|
2
|
-
# and upload build-artifacts to branch-gh-pages
|
|
3
|
-
name: ci
|
|
4
|
-
on:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- alpha
|
|
8
|
-
- beta
|
|
9
|
-
- master
|
|
10
|
-
- sandbox
|
|
11
|
-
workflow_dispatch:
|
|
12
|
-
branches:
|
|
13
|
-
- alpha
|
|
14
|
-
- beta
|
|
15
|
-
- master
|
|
16
|
-
- sandbox
|
|
17
|
-
jobs:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# shCiBase - start
|
|
21
|
-
job1:
|
|
22
|
-
strategy:
|
|
23
|
-
matrix:
|
|
24
|
-
architecture:
|
|
25
|
-
# - arm64
|
|
26
|
-
- x64
|
|
27
|
-
# - x86
|
|
28
|
-
node_version:
|
|
29
|
-
# - 12
|
|
30
|
-
- 14
|
|
31
|
-
- 16
|
|
32
|
-
os:
|
|
33
|
-
- macos-latest
|
|
34
|
-
- ubuntu-latest
|
|
35
|
-
- windows-latest
|
|
36
|
-
name: job1 . node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
|
|
37
|
-
runs-on: ${{ matrix.os }}
|
|
38
|
-
steps:
|
|
39
|
-
# disable autocrlf in windows
|
|
40
|
-
- run: git config --global core.autocrlf false
|
|
41
|
-
# https://github.com/actions/checkout
|
|
42
|
-
- uses: actions/checkout@v2
|
|
43
|
-
# https://github.com/actions/cache
|
|
44
|
-
- uses: actions/cache@v2
|
|
45
|
-
with:
|
|
46
|
-
key: ${{ matrix.architecture }}-${{ matrix.node_version }}-${{ matrix.os }}-${{ hashFiles('./package.json') }}
|
|
47
|
-
path: .cache
|
|
48
|
-
# https://github.com/actions/setup-node
|
|
49
|
-
- uses: actions/setup-node@v2
|
|
50
|
-
with:
|
|
51
|
-
node-version: ${{ matrix.node_version }}
|
|
52
|
-
architecture: ${{ matrix.architecture }}
|
|
53
|
-
# fetch jslint_ci.sh from trusted source
|
|
54
|
-
- run: git fetch origin alpha && git checkout origin/alpha .ci.sh jslint_ci.sh
|
|
55
|
-
# run nodejs coverages and tests
|
|
56
|
-
- run: sh jslint_ci.sh shCiBase
|
|
57
|
-
# shCiBase - end
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
# shCiArtifactUpload - start
|
|
61
|
-
# fetch jslint_ci.sh from trusted source
|
|
62
|
-
- run: git fetch origin alpha && git checkout origin/alpha .ci.sh jslint_ci.sh
|
|
63
|
-
# upload build-artifacts to branch-gh-pages
|
|
64
|
-
- run: sh jslint_ci.sh shCiArtifactUpload
|
|
65
|
-
env:
|
|
66
|
-
CI_NODE_VERSION_ARCH_PLATFORM: v16.x64.linux
|
|
67
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
68
|
-
# shCiArtifactUpload - end
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
# upload binaries - start
|
|
72
|
-
- uses: actions/upload-artifact@v2
|
|
73
|
-
with:
|
|
74
|
-
name: binaries
|
|
75
|
-
path: _binary_*
|
|
76
|
-
# upload binaries - end
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
job2:
|
|
80
|
-
needs: job1
|
|
81
|
-
strategy:
|
|
82
|
-
matrix:
|
|
83
|
-
architecture:
|
|
84
|
-
# - arm64
|
|
85
|
-
- x64
|
|
86
|
-
# - x86
|
|
87
|
-
node_version:
|
|
88
|
-
# - 12
|
|
89
|
-
# - 14
|
|
90
|
-
- 16
|
|
91
|
-
os:
|
|
92
|
-
# - macos-latest
|
|
93
|
-
- ubuntu-latest
|
|
94
|
-
# - windows-latest
|
|
95
|
-
name: job2 . node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
|
|
96
|
-
runs-on: ${{ matrix.os }}
|
|
97
|
-
steps:
|
|
98
|
-
# disable autocrlf in windows
|
|
99
|
-
- run: git config --global core.autocrlf false
|
|
100
|
-
# https://github.com/actions/checkout
|
|
101
|
-
- uses: actions/checkout@v2
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
# download binaries - start
|
|
105
|
-
- uses: actions/download-artifact@v2
|
|
106
|
-
with:
|
|
107
|
-
name: binaries
|
|
108
|
-
# download binaries - end
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# shCiArtifactUpload2 - start
|
|
112
|
-
# fetch jslint_ci.sh from trusted source
|
|
113
|
-
- run: git fetch origin alpha && git checkout origin/alpha .ci.sh jslint_ci.sh
|
|
114
|
-
# upload build-artifacts to branch-gh-pages
|
|
115
|
-
- run: sh jslint_ci.sh shCiArtifactUpload2
|
|
116
|
-
env:
|
|
117
|
-
CI_NODE_VERSION_ARCH_PLATFORM: v16.x64.linux
|
|
118
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
119
|
-
# shCiArtifactUpload2 - end
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# Publishing packages to npm and GitHub Packages
|
|
2
|
-
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-npm-and-github-packages
|
|
3
|
-
name: publish
|
|
4
|
-
on:
|
|
5
|
-
release:
|
|
6
|
-
types: [created]
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
branches:
|
|
9
|
-
- alpha
|
|
10
|
-
- beta
|
|
11
|
-
- master
|
|
12
|
-
- sandbox
|
|
13
|
-
jobs:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# npm publish - start
|
|
17
|
-
build:
|
|
18
|
-
strategy:
|
|
19
|
-
matrix:
|
|
20
|
-
architecture:
|
|
21
|
-
# - arm64
|
|
22
|
-
- x64
|
|
23
|
-
# - x86
|
|
24
|
-
node_version:
|
|
25
|
-
# - 12
|
|
26
|
-
# - 14
|
|
27
|
-
- 16
|
|
28
|
-
os:
|
|
29
|
-
# - macos-latest
|
|
30
|
-
- ubuntu-latest
|
|
31
|
-
# - windows-latest
|
|
32
|
-
name: job1 . node . v${{ matrix.node_version }} . ${{ matrix.architecture }} . ${{ matrix.os }}
|
|
33
|
-
runs-on: ${{ matrix.os }}
|
|
34
|
-
permissions:
|
|
35
|
-
contents: read
|
|
36
|
-
packages: write
|
|
37
|
-
steps:
|
|
38
|
-
|
|
39
|
-
# Setup .npmrc file to publish to GitHub Packages
|
|
40
|
-
- run: rm -f /home/runner/work/_temp/.npmrc
|
|
41
|
-
- uses: actions/checkout@v2
|
|
42
|
-
- uses: actions/setup-node@v2
|
|
43
|
-
with:
|
|
44
|
-
node-version: ${{ matrix.node_version }}
|
|
45
|
-
architecture: ${{ matrix.architecture }}
|
|
46
|
-
registry-url: 'https://npm.pkg.github.com'
|
|
47
|
-
# Defaults to the user or organization that owns the workflow file
|
|
48
|
-
# scope: '@octocat'
|
|
49
|
-
# Publish to GitHub Packages
|
|
50
|
-
- run: sh jslint_ci.sh shCiNpmPublish
|
|
51
|
-
env:
|
|
52
|
-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
53
|
-
NPM_REGISTRY: github
|
|
54
|
-
|
|
55
|
-
# Setup .npmrc file to publish to npm
|
|
56
|
-
- run: rm -f /home/runner/work/_temp/.npmrc
|
|
57
|
-
- uses: actions/checkout@v2
|
|
58
|
-
- uses: actions/setup-node@v2
|
|
59
|
-
with:
|
|
60
|
-
node-version: ${{ matrix.node_version }}
|
|
61
|
-
architecture: ${{ matrix.architecture }}
|
|
62
|
-
registry-url: 'https://registry.npmjs.org'
|
|
63
|
-
# Publish to npm
|
|
64
|
-
- run: sh jslint_ci.sh shCiNpmPublish
|
|
65
|
-
env:
|
|
66
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
67
|
-
# npm publish - end
|
package/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="folder-open" class="svg-inline--fa fa-folder-open fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"></path></svg>
|