@yolean/evidence-universal-sql 0.0.0-stage → 3.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,459 @@
1
+ # @evidence-dev/universal-sql
2
+
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 81977b64b: deployment.dataScope: pages with that route parameter load data/ and api/ from <basePath>/<value>/, and prerender their query results there.
8
+
9
+ ## 3.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - First release under the @yolean npm scope, from the frozen upstream legacy framework at 40.1.8
14
+
15
+ ## 3.0.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 937971eaa: Package updates for CVEs. See https://github.com/evidence-dev/evidence/pull/3255
20
+
21
+ ## 3.0.0
22
+
23
+ ### Major Changes
24
+
25
+ - b28f63f23: Update DuckDB to latest packages:
26
+
27
+ - Switch to @duckdb/node-api from duckdb-async
28
+ - Update duckdb-wasm to latest release
29
+
30
+ This release also has small data fixes across several packages:
31
+
32
+ - Better handling of NULL values when discovering column types
33
+ - Fix batch processing of parquet files
34
+ - Fix error with temporary parquet files when reloading data in dev environment
35
+
36
+ ## 2.2.11
37
+
38
+ ### Patch Changes
39
+
40
+ - 6d2782e64: Fixed base path not being applied to data file (parquet) URLs. This resolves an issue where applications deployed with a base path would fail to load data files, resulting in 404 errors.
41
+
42
+ The fix restores the dependency injection pattern for the `addBasePath` function in `setParquetURLs`, ensuring that base paths are correctly applied to all data requests in both monorepo and published package environments.
43
+
44
+ ## 2.2.10
45
+
46
+ ### Patch Changes
47
+
48
+ - 64486c669: bump vitest
49
+ - fc185c44c: Fix type errors
50
+
51
+ ## 2.2.9
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [17eb07aff]
56
+ - Updated dependencies [bcb0bf5dd]
57
+ - @evidence-dev/sdk@3.0.8
58
+
59
+ ## 2.2.8
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [243229f46]
64
+ - @evidence-dev/sdk@3.0.7
65
+
66
+ ## 2.2.7
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [c7547d83f]
71
+ - @evidence-dev/sdk@3.0.6
72
+
73
+ ## 2.2.6
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [f81376743]
78
+ - @evidence-dev/sdk@3.0.5
79
+
80
+ ## 2.2.5
81
+
82
+ ### Patch Changes
83
+
84
+ - f416a339d: workaround bug in duckdb-wasm that errors when fully null date column is read as parquet
85
+ - Updated dependencies [309e27b51]
86
+ - Updated dependencies [730321d90]
87
+ - @evidence-dev/sdk@3.0.4
88
+
89
+ ## 2.2.4
90
+
91
+ ### Patch Changes
92
+
93
+ - Updated dependencies [706963a42]
94
+ - @evidence-dev/sdk@3.0.3
95
+
96
+ ## 2.2.3
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [2efb8df3e]
101
+ - @evidence-dev/sdk@3.0.2
102
+
103
+ ## 2.2.2
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [288f87ec6]
108
+ - @evidence-dev/sdk@3.0.1
109
+
110
+ ## 2.2.1
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies [e2c95d172]
115
+ - @evidence-dev/sdk@3.0.0
116
+
117
+ ## 2.2.0
118
+
119
+ ### Minor Changes
120
+
121
+ - d2ce60038: bump duckdb to 1.29.0, fix bugs emerging from that
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies [d2ce60038]
126
+ - @evidence-dev/sdk@2.0.0
127
+
128
+ ## 2.1.11
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies [b5a096723]
133
+ - @evidence-dev/sdk@1.5.1
134
+
135
+ ## 2.1.10
136
+
137
+ ### Patch Changes
138
+
139
+ - Updated dependencies [b72e4a809]
140
+ - @evidence-dev/sdk@1.5.0
141
+
142
+ ## 2.1.9
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [08923de11]
147
+ - @evidence-dev/sdk@1.4.8
148
+
149
+ ## 2.1.8
150
+
151
+ ### Patch Changes
152
+
153
+ - Updated dependencies [00516897e]
154
+ - Updated dependencies [1de1eca52]
155
+ - @evidence-dev/sdk@1.4.7
156
+
157
+ ## 2.1.7
158
+
159
+ ### Patch Changes
160
+
161
+ - Updated dependencies [c82ba1516]
162
+ - @evidence-dev/sdk@1.4.6
163
+
164
+ ## 2.1.6
165
+
166
+ ### Patch Changes
167
+
168
+ - b2126ac1a: add --profile flag to sdk-handled cli commands, add debugging profiling and logs to build-parquet
169
+ - Updated dependencies [b2126ac1a]
170
+ - @evidence-dev/sdk@1.4.5
171
+
172
+ ## 2.1.5
173
+
174
+ ### Patch Changes
175
+
176
+ - c0e1799e2: Set 644 permissions when writing parquet files
177
+
178
+ ## 2.1.4
179
+
180
+ ### Patch Changes
181
+
182
+ - 8c2982505: Update vitest to latest
183
+
184
+ ## 2.1.3
185
+
186
+ ### Patch Changes
187
+
188
+ - b84ef07ac: Add buildOptions.batchSize to connection.yaml spec
189
+ - 6cdedceb0: Remove db-orchestrator
190
+
191
+ ## 2.1.2
192
+
193
+ ### Patch Changes
194
+
195
+ - 7620a1af: removes unused duckdb dep
196
+ - a95db3d3: Move types to devDependencies
197
+
198
+ ## 2.1.1
199
+
200
+ ### Patch Changes
201
+
202
+ - 5e0bbf31: stop blocking advanced usage of json with usql
203
+
204
+ ## 2.1.0
205
+
206
+ ### Minor Changes
207
+
208
+ - ca3e593b: - Updated major dependencies (Svelte, SvelteKit, Vite) to improve memory usage when building
209
+
210
+ ## 2.0.5
211
+
212
+ ### Patch Changes
213
+
214
+ - 5a1e46a5: Fix for svelte vite errors
215
+ - 008cf432: Roll back proxy server
216
+ - 69b9ed32: Fix file imports for evidence package
217
+
218
+ ## 2.0.4
219
+
220
+ ### Patch Changes
221
+
222
+ - 57f71211: bump duckdb-wasm and arrow
223
+
224
+ ## 2.0.3
225
+
226
+ ### Patch Changes
227
+
228
+ - f4ccf03c: Add missing type
229
+
230
+ ## 2.0.2
231
+
232
+ ### Patch Changes
233
+
234
+ - e4e7d822: fix fully null boolean column with float64 conversion
235
+
236
+ ## 2.0.1
237
+
238
+ ### Patch Changes
239
+
240
+ - 913f5919: Handle null / undefined values when columns are omitted from result sets
241
+
242
+ ## 2.0.0
243
+
244
+ ### Major Changes
245
+
246
+ - cb0fc468: This update includes major changes to the way Evidence interacts with data.
247
+ Instead of running queries against the production database, and including it
248
+ with the project as pre-rendered, static JSON data; those queries are now stored as .parquet files.
249
+
250
+ .parquet enables the use of DuckDB on the client, allowing for much greater levels of interactivity
251
+ on pages, and interoperability between different data sources (e.g. joins across postgres & mysql).
252
+
253
+ ### Minor Changes
254
+
255
+ - f62bd26e: prerenders clientside duckdb queries in their initial state to allow for some form of prerendering
256
+ - 52d81ce2: fix parameterized page prerendering
257
+
258
+ ### Patch Changes
259
+
260
+ - aa34d0b3: Queries now wait for setParquetUrls, and will time out if they are not processed within 5 seconds
261
+ - 840d1195: allow initialdata to saturate columns
262
+ - b25a95d7: Misc fixes
263
+ - fd74bd3c: Prevent queries with the same name from different connectors from colliding
264
+ - 377abb4a: Rename databases -> datasources
265
+ - 9132146b: fix vite hard refreshes, fix dropdown flickering on ssr, fix null columns
266
+ - 0ba78b67: polish working with sources
267
+ - 2aaef5fb: Convoluted javascript things to fix convoluted javascript things
268
+ - 9603c4e7: Silence DuckDB unless in debug mode
269
+ - cb74406a: fix version mismatch and windows error
270
+ - b5592a3f: Usability Improvements
271
+ - bf4a112a: Update package.json to use new datasource field
272
+ - 69126c94: change internal filename generation
273
+ - 5928e45d: Reduce risk of queries attempting to execute prior to database initialization
274
+ - ca7337ba: fix prerendering for all pages
275
+ - cd57ba69: Add new interface for datasources for fine-grained control of output
276
+ - c4822852: Support for streaming results
277
+ - 52e114cc: move date standardization
278
+ - e173ca9d: Mute parquet url messages unless debug mode
279
+ - 4d5735a2: Fix a few fs related issues
280
+ - 26ad2d2c: When rebuilding and setting parquet urls, the duckdb internal filesystem is now cleaned up to force reloads
281
+ - ca4c3b00: Don't count the database as initialized until parquet urls are set (tables are created)
282
+ - 15248699: fix for hugeints
283
+ - ef2a9106: Sources are now segmented into schemas to prevent source name conflicts
284
+ - 130950d7: add client/build time guardrails
285
+ - d1ab5e62: Bump ddb version
286
+ - 20127231: Bump all versions so version pinning works
287
+ - 9b1ac9b7: make everything use a single connection
288
+
289
+ ## 2.0.0-usql.25
290
+
291
+ ### Patch Changes
292
+
293
+ - e173ca9d: Mute parquet url messages unless debug mode
294
+
295
+ ## 2.0.0-usql.24
296
+
297
+ ### Patch Changes
298
+
299
+ - 15248699: fix for hugeints
300
+
301
+ ## 2.0.0-usql.23
302
+
303
+ ### Patch Changes
304
+
305
+ - 9603c4e7: Silence DuckDB unless in debug mode
306
+
307
+ ## 2.0.0-usql.22
308
+
309
+ ### Patch Changes
310
+
311
+ - 9132146b: fix vite hard refreshes, fix dropdown flickering on ssr, fix null columns
312
+
313
+ ## 2.0.0-usql.21
314
+
315
+ ### Patch Changes
316
+
317
+ - 2aaef5fb: Convoluted javascript things to fix convoluted javascript things
318
+
319
+ ## 2.0.0-usql.20
320
+
321
+ ### Patch Changes
322
+
323
+ - cb74406a: fix version mismatch and windows error
324
+ - d1ab5e62: Bump ddb version
325
+
326
+ ## 2.0.0-usql.19
327
+
328
+ ### Patch Changes
329
+
330
+ - Update package.json to use new datasource field
331
+
332
+ ## 2.0.0-usql.18
333
+
334
+ ### Patch Changes
335
+
336
+ - 377abb4a: Rename databases -> datasources
337
+
338
+ ## 2.0.0-usql.17
339
+
340
+ ### Patch Changes
341
+
342
+ - 840d1195: allow initialdata to saturate columns
343
+ - 26ad2d2c: When rebuilding and setting parquet urls, the duckdb internal filesystem is now cleaned up to force reloads
344
+
345
+ ## 2.0.0-usql.16
346
+
347
+ ### Patch Changes
348
+
349
+ - 4d5735a2: Fix a few fs related issues
350
+
351
+ ## 2.0.0-usql.15
352
+
353
+ ### Patch Changes
354
+
355
+ - b25a95d7: Misc fixes
356
+
357
+ ## 2.0.0-usql.14
358
+
359
+ ### Patch Changes
360
+
361
+ - fd74bd3c: Prevent queries with the same name from different connectors from colliding
362
+
363
+ ## 2.0.0-usql.13
364
+
365
+ ### Patch Changes
366
+
367
+ - b5592a3f: Usability Improvements
368
+
369
+ ## 2.0.0-usql.12
370
+
371
+ ### Patch Changes
372
+
373
+ - 0ba78b67: polish working with sources
374
+ - cd57ba69: Add new interface for datasources for fine-grained control of output
375
+
376
+ ## 2.0.0-usql.11
377
+
378
+ ### Minor Changes
379
+
380
+ - 52d81ce2: fix parameterized page prerendering
381
+
382
+ ### Patch Changes
383
+
384
+ - 130950d7: add client/build time guardrails
385
+
386
+ ## 2.0.0-usql.10
387
+
388
+ ### Patch Changes
389
+
390
+ - Support for streaming results
391
+
392
+ ## 2.0.0-usql.9
393
+
394
+ ### Patch Changes
395
+
396
+ - 52e114cc: move date standardization
397
+
398
+ ## 2.0.0-usql.8
399
+
400
+ ### Patch Changes
401
+
402
+ - 20127231: Bump all versions so version pinning works
403
+
404
+ ## 2.0.0-usql.7
405
+
406
+ ### Patch Changes
407
+
408
+ - 69126c94: change internal filename generation
409
+
410
+ ## 2.0.0-usql.6
411
+
412
+ ### Patch Changes
413
+
414
+ - Queries now wait for setParquetUrls, and will time out if they are not processed within 5 seconds
415
+
416
+ ## 2.0.0-usql.5
417
+
418
+ ### Patch Changes
419
+
420
+ - Don't count the database as initialized until parquet urls are set (tables are created)
421
+
422
+ ## 2.0.0-usql.4
423
+
424
+ ### Patch Changes
425
+
426
+ - Reduce risk of queries attempting to execute prior to database initialization
427
+
428
+ ## 2.0.0-usql.3
429
+
430
+ ### Patch Changes
431
+
432
+ - ca7337ba: fix prerendering for all pages
433
+
434
+ ## 2.0.0-usql.2
435
+
436
+ ### Patch Changes
437
+
438
+ - 9b1ac9b7: make everything use a single connection
439
+
440
+ ## 2.0.0-usql.1
441
+
442
+ ### Minor Changes
443
+
444
+ - f62bd26e: prerenders clientside duckdb queries in their initial state to allow for some form of prerendering
445
+
446
+ ### Patch Changes
447
+
448
+ - ef2a9106: Sources are now segmented into schemas to prevent source name conflicts
449
+
450
+ ## 2.0.0-usql.0
451
+
452
+ ### Major Changes
453
+
454
+ - cb0fc468: This update includes major changes to the way Evidence interacts with data.
455
+ Instead of running queries against the production database, and including it
456
+ with the project as pre-rendered, static JSON data; those queries are now stored as .parquet files.
457
+
458
+ .parquet enables the use of DuckDB on the client, allowing for much greater levels of interactivity
459
+ on pages, and interoperability between different data sources (e.g. joins across postgres & mysql).
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright \(c\) 2023 Evidence
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files \(the "Software"\), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,47 @@
1
1
  {
2
2
  "name": "@yolean/evidence-universal-sql",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "3.1.0",
4
+ "description": "",
5
+ "keywords": [],
6
+ "author": "",
7
+ "license": "MIT",
8
+ "main": "./src/index.js",
9
+ "type": "module",
10
+ "dependencies": {
11
+ "@duckdb/duckdb-wasm": "^1.30.0",
12
+ "apache-arrow": "17.0.0",
13
+ "chalk": "^5.2.0",
14
+ "cli-progress": "^3.12.0",
15
+ "lodash.chunk": "^4.2.0",
16
+ "parquet-wasm": "0.5.0",
17
+ "web-worker": "^1.2.0"
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "default": "./src/index.js",
22
+ "types": "./src/index.d.ts"
23
+ },
24
+ "./client-duckdb": {
25
+ "browser": "./src/client-duckdb/browser.js",
26
+ "node": "./src/client-duckdb/node.js",
27
+ "types": "./src/client-duckdb/browser.d.ts"
28
+ },
29
+ "./calculate-score": {
30
+ "default": "./src/calculateScore.js",
31
+ "types": "./src/calculateScore.d.ts"
32
+ }
33
+ },
34
+ "devDependencies": {
35
+ "@types/lodash.chunk": "^4.2.7",
36
+ "@types/node": "20.11.28",
37
+ "@types/mock-fs": "^4.13.1",
38
+ "mock-fs": "^5.2.0",
39
+ "vitest": "^2.1.9"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc ./src/index.js --d --emitDeclarationOnly --allowJs",
43
+ "check": "tsc ./src/index.js --d --emitDeclarationOnly --allowJs",
44
+ "test": "vitest --run",
45
+ "test:watch": "vitest"
46
+ }
6
47
  }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Constructs a Buffer from provided table metadata
3
+ * @param {{name: string, evidenceType: string}[]} columns
4
+ * @param {any[]} data
5
+ * @returns {Promise<Uint8Array>}
6
+ */
7
+ export function buildParquetFromResultSet(
8
+ columns: { name: string; evidenceType: string }[],
9
+ data: any[]
10
+ ): Promise<Uint8Array>;
11
+
12
+ export function buildMultipartParquet<T extends Record<string, any>>(
13
+ columns: { name: string; evidenceType: string }[],
14
+ data: Generator<T[]> | Promise<Generator<T[]>> | T[] | Promise<T[]>,
15
+ tmpDir: string,
16
+ outDir: string,
17
+ outputFilename: string,
18
+ expectedRowCount?: number,
19
+ batchSize?: number
20
+ ): Promise<string | false>;