datafolder 1.0.3 → 1.0.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/README.md +34 -28
- package/index.js +1 -2
- package/package.json +3 -2
- package/scripts/airbnb2_queries.js +9 -11
- package/scripts/airbnb_queries.js +9 -9
- package/scripts/express.js +2 -1
- package/scripts/flights.js +1 -1
- package/scripts/flights2_queries.js +91 -92
- package/scripts/flights_queries.js +99 -100
- package/src/QyDB.js +30 -4
- package/src/QyFile.js +1 -1
- package/src/QySnapshots.js +130 -127
- package/src/rpc/getSubItems.js +9 -25
- package/src/rpc/queryFiles.js +2 -25
- package/static/datafolderui/query-editor.js +6 -1
|
@@ -6,94 +6,93 @@ import { deepEqual } from "node:assert/strict";
|
|
|
6
6
|
|
|
7
7
|
function query1(qyDB) {
|
|
8
8
|
console.time("query1");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
]);
|
|
9
|
+
deepEqual(
|
|
10
|
+
[...new Set(qyDB.queryFiles("flights/**", { _from: "airports/LAX" }).map((x) => x.prop("_to"))).values()],
|
|
11
|
+
[
|
|
12
|
+
"airports/CVG",
|
|
13
|
+
"airports/SMF",
|
|
14
|
+
"airports/ATL",
|
|
15
|
+
"airports/MSP",
|
|
16
|
+
"airports/DFW",
|
|
17
|
+
"airports/PHL",
|
|
18
|
+
"airports/IAH",
|
|
19
|
+
"airports/TUS",
|
|
20
|
+
"airports/ORD",
|
|
21
|
+
"airports/PDX",
|
|
22
|
+
"airports/MIA",
|
|
23
|
+
"airports/SFO",
|
|
24
|
+
"airports/DEN",
|
|
25
|
+
"airports/IAD",
|
|
26
|
+
"airports/SJC",
|
|
27
|
+
"airports/PHX",
|
|
28
|
+
"airports/SEA",
|
|
29
|
+
"airports/SLC",
|
|
30
|
+
"airports/JFK",
|
|
31
|
+
"airports/SAN",
|
|
32
|
+
"airports/ONT",
|
|
33
|
+
"airports/LAS",
|
|
34
|
+
"airports/MCI",
|
|
35
|
+
"airports/MDW",
|
|
36
|
+
"airports/FLL",
|
|
37
|
+
"airports/AUS",
|
|
38
|
+
"airports/EWR",
|
|
39
|
+
"airports/CLE",
|
|
40
|
+
"airports/SBP",
|
|
41
|
+
"airports/MEM",
|
|
42
|
+
"airports/SBA",
|
|
43
|
+
"airports/CLT",
|
|
44
|
+
"airports/COS",
|
|
45
|
+
"airports/ASE",
|
|
46
|
+
"airports/ICT",
|
|
47
|
+
"airports/HOU",
|
|
48
|
+
"airports/YUM",
|
|
49
|
+
"airports/STL",
|
|
50
|
+
"airports/FAT",
|
|
51
|
+
"airports/ABQ",
|
|
52
|
+
"airports/BOI",
|
|
53
|
+
"airports/BOS",
|
|
54
|
+
"airports/LIH",
|
|
55
|
+
"airports/HNL",
|
|
56
|
+
"airports/SMX",
|
|
57
|
+
"airports/MRY",
|
|
58
|
+
"airports/DTW",
|
|
59
|
+
"airports/RNO",
|
|
60
|
+
"airports/MCO",
|
|
61
|
+
"airports/OXR",
|
|
62
|
+
"airports/OAK",
|
|
63
|
+
"airports/OGG",
|
|
64
|
+
"airports/KOA",
|
|
65
|
+
"airports/BWI",
|
|
66
|
+
"airports/CLD",
|
|
67
|
+
"airports/IND",
|
|
68
|
+
"airports/PSP",
|
|
69
|
+
"airports/ELP",
|
|
70
|
+
"airports/TPA",
|
|
71
|
+
"airports/OKC",
|
|
72
|
+
"airports/MSY",
|
|
73
|
+
"airports/SNA",
|
|
74
|
+
"airports/IYK",
|
|
75
|
+
"airports/IPL",
|
|
76
|
+
"airports/SAT",
|
|
77
|
+
"airports/MOD",
|
|
78
|
+
"airports/BNA",
|
|
79
|
+
"airports/DCA",
|
|
80
|
+
"airports/SGU",
|
|
81
|
+
"airports/BFL",
|
|
82
|
+
"airports/EUG",
|
|
83
|
+
"airports/EGE",
|
|
84
|
+
"airports/GEG",
|
|
85
|
+
"airports/BDL",
|
|
86
|
+
"airports/JAX",
|
|
87
|
+
"airports/CMH",
|
|
88
|
+
"airports/PIT",
|
|
89
|
+
"airports/RDU",
|
|
90
|
+
"airports/SJU",
|
|
91
|
+
"airports/XNA",
|
|
92
|
+
"airports/MTJ",
|
|
93
|
+
"airports/JAC",
|
|
94
|
+
],
|
|
95
|
+
);
|
|
97
96
|
console.timeEnd("query1");
|
|
98
97
|
}
|
|
99
98
|
|
|
@@ -120,7 +119,7 @@ function query2(qyDB) {
|
|
|
120
119
|
{ Day: (x) => x >= 5 && x <= 7 },
|
|
121
120
|
],
|
|
122
121
|
})
|
|
123
|
-
.map((x) => x.
|
|
122
|
+
.map((x) => x.prop("FlightNum"))
|
|
124
123
|
.sort((x, y) => x - y),
|
|
125
124
|
[
|
|
126
125
|
6635, 646, 6541, 5651, 6541, 5648, 687, 309, 6678, 6678, 6636, 439, 1567, 6635, 5647, 6541, 5660, 6541,
|
|
@@ -358,16 +357,16 @@ function query3(qyDB) {
|
|
|
358
357
|
|
|
359
358
|
function query4(qyDB) {
|
|
360
359
|
console.time("query4");
|
|
361
|
-
|
|
362
|
-
.queryFiles("flights", { Month: 1, Day: 5, FlightNum: 860 })
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
360
|
+
deepEqual(
|
|
361
|
+
qyDB.queryFiles("flights", { Month: 1, Day: 5, FlightNum: 860 }).map((x) => x.view(["_from", "_to"])),
|
|
362
|
+
[
|
|
363
|
+
{ _from: "airports/IAD", _to: "airports/BOS" },
|
|
364
|
+
{ _from: "airports/PBI", _to: "airports/JFK" },
|
|
365
|
+
{ _from: "airports/ORD", _to: "airports/DTW" },
|
|
366
|
+
{ _from: "airports/PHX", _to: "airports/DEN" },
|
|
367
|
+
{ _from: "airports/SEA", _to: "airports/ATL" },
|
|
368
|
+
],
|
|
369
|
+
);
|
|
371
370
|
console.timeEnd("query4");
|
|
372
371
|
}
|
|
373
372
|
|
|
@@ -377,7 +376,7 @@ function query5(qyDB) {
|
|
|
377
376
|
deepEqual(
|
|
378
377
|
qyDB
|
|
379
378
|
.queryFiles("airports", { vip: true })
|
|
380
|
-
.map((x) => x.
|
|
379
|
+
.map((x) => x.prop("name"))
|
|
381
380
|
.sort(),
|
|
382
381
|
[
|
|
383
382
|
"Amarillo International",
|
package/src/QyDB.js
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
} from "./QyBatch.js";
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
|
-
QyCache as
|
|
14
|
+
QyCache as a
|
|
15
15
|
} from "./QyCache.js";
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
-
getDefaultOptions as
|
|
18
|
+
getDefaultOptions as n
|
|
19
19
|
} from "./QyDefaultOptions.js";
|
|
20
20
|
|
|
21
21
|
import {
|
|
@@ -34,7 +34,7 @@ class h extends t {
|
|
|
34
34
|
s(e) && (t = e, e = d), super(), Object.assign(this, {
|
|
35
35
|
rootFolder: e,
|
|
36
36
|
options: {
|
|
37
|
-
...
|
|
37
|
+
...n("QyDB"),
|
|
38
38
|
...t
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -44,7 +44,7 @@ class h extends t {
|
|
|
44
44
|
return this.qyCache || (e = {
|
|
45
45
|
...this.options,
|
|
46
46
|
...e
|
|
47
|
-
}, t = new
|
|
47
|
+
}, t = new a(this.rootFolder, e, this), Object.assign(this, {
|
|
48
48
|
qyCache: t,
|
|
49
49
|
fetch: new r(t),
|
|
50
50
|
batch: new i(t, e),
|
|
@@ -144,6 +144,32 @@ class h extends t {
|
|
|
144
144
|
callRpc(e, t, r) {
|
|
145
145
|
return this.qyCache.callRpc(e, t, r);
|
|
146
146
|
}
|
|
147
|
+
fileListToTree(e, t) {
|
|
148
|
+
var r, i = t, a = {};
|
|
149
|
+
for (r of e) {
|
|
150
|
+
var n, s = r.parentList;
|
|
151
|
+
let t = a;
|
|
152
|
+
for (n of s) {
|
|
153
|
+
var {
|
|
154
|
+
name: m,
|
|
155
|
+
fullPathHash: d
|
|
156
|
+
} = n;
|
|
157
|
+
let e = t.subdirMap;
|
|
158
|
+
e = e || (t.subdirMap = {}), t = (t = e[m]) || (e[m] = {
|
|
159
|
+
fullPathHash: d
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
let e = t.fileMap;
|
|
163
|
+
(e = e || (t.fileMap = {}))[r.name] = {
|
|
164
|
+
fileContent: r.view(i, !0),
|
|
165
|
+
fileContentKey: r.fileContentKey
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
tree: a,
|
|
170
|
+
count: e.length
|
|
171
|
+
};
|
|
172
|
+
}
|
|
147
173
|
}
|
|
148
174
|
|
|
149
175
|
export {
|
package/src/QyFile.js
CHANGED
|
@@ -102,7 +102,7 @@ class o extends e {
|
|
|
102
102
|
return o;
|
|
103
103
|
}(this, n, e, t);
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
prop(e, t = l, n) {
|
|
106
106
|
var i;
|
|
107
107
|
if (t) return e = r(this.fileContent, d(e) ? e : [ e ]), i = t.$link, null != i ? y(this, e, i, t[h], n) : n || t === c ? e : structuredClone(e);
|
|
108
108
|
}
|