@nshiab/simple-data-analysis-core 2.0.4 → 2.0.6
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 +118 -12
- package/esm/class/Simple.d.ts +8 -2
- package/esm/class/Simple.d.ts.map +1 -1
- package/esm/class/Simple.js +9 -3
- package/esm/class/SimpleDB.d.ts +72 -1
- package/esm/class/SimpleDB.d.ts.map +1 -1
- package/esm/class/SimpleDB.js +81 -1
- package/esm/class/SimpleTable.d.ts +434 -263
- package/esm/class/SimpleTable.d.ts.map +1 -1
- package/esm/class/SimpleTable.js +441 -316
- package/esm/helpers/LogValue.d.ts +8 -0
- package/esm/helpers/LogValue.d.ts.map +1 -0
- package/esm/helpers/LogValue.js +23 -0
- package/esm/helpers/cacheTableDependencies.d.ts +9 -0
- package/esm/helpers/cacheTableDependencies.d.ts.map +1 -1
- package/esm/helpers/cacheTableDependencies.js +131 -21
- package/esm/helpers/cleanSQL.d.ts +1 -1
- package/esm/helpers/cleanSQL.d.ts.map +1 -1
- package/esm/helpers/cleanSQL.js +268 -23
- package/esm/helpers/flushAllTables.d.ts.map +1 -1
- package/esm/helpers/flushAllTables.js +23 -28
- package/esm/helpers/foldIdentifier.d.ts +3 -0
- package/esm/helpers/foldIdentifier.d.ts.map +1 -0
- package/esm/helpers/foldIdentifier.js +4 -0
- package/esm/helpers/geometryFromJSON.d.ts +3 -0
- package/esm/helpers/geometryFromJSON.d.ts.map +1 -0
- package/esm/helpers/geometryFromJSON.js +4 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.d.ts.map +1 -1
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/logData.d.ts.map +1 -1
- package/esm/helpers/logData.js +45 -44
- package/esm/helpers/makeLogConverter.d.ts +5 -0
- package/esm/helpers/makeLogConverter.d.ts.map +1 -0
- package/esm/helpers/makeLogConverter.js +64 -0
- package/esm/helpers/osmFiles.d.ts.map +1 -1
- package/esm/helpers/parseTypes.d.ts +1 -1
- package/esm/helpers/parseTypes.d.ts.map +1 -1
- package/esm/helpers/parseTypes.js +4 -0
- package/esm/helpers/pendingOps.d.ts +4 -2
- package/esm/helpers/pendingOps.d.ts.map +1 -1
- package/esm/helpers/prepareGeometry.d.ts +3 -0
- package/esm/helpers/prepareGeometry.d.ts.map +1 -0
- package/esm/helpers/prepareGeometry.js +99 -0
- package/esm/helpers/prepareJSON.d.ts +3 -0
- package/esm/helpers/prepareJSON.d.ts.map +1 -0
- package/esm/helpers/prepareJSON.js +50 -0
- package/esm/helpers/printTable.d.ts +5 -4
- package/esm/helpers/printTable.d.ts.map +1 -1
- package/esm/helpers/printTable.js +32 -36
- package/esm/helpers/queryDB.js +1 -1
- package/esm/helpers/queueAsyncBarrier.d.ts +4 -0
- package/esm/helpers/queueAsyncBarrier.d.ts.map +1 -1
- package/esm/helpers/queueAsyncBarrier.js +4 -0
- package/esm/helpers/queueOp.d.ts.map +1 -1
- package/esm/helpers/queueOp.js +5 -3
- package/esm/helpers/readMutationRows.d.ts +9 -0
- package/esm/helpers/readMutationRows.d.ts.map +1 -0
- package/esm/helpers/readMutationRows.js +94 -0
- package/esm/helpers/referencedTables.d.ts +9 -0
- package/esm/helpers/referencedTables.d.ts.map +1 -0
- package/esm/helpers/referencedTables.js +22 -0
- package/esm/helpers/runQuery.d.ts.map +1 -1
- package/esm/helpers/runQuery.js +11 -13
- package/esm/helpers/scanSQL.d.ts +7 -0
- package/esm/helpers/scanSQL.d.ts.map +1 -0
- package/esm/helpers/scanSQL.js +71 -0
- package/esm/helpers/tableRegistry.d.ts +2 -0
- package/esm/helpers/tableRegistry.d.ts.map +1 -1
- package/esm/helpers/tableRegistry.js +12 -4
- package/esm/helpers/updateColumnsWithJS.d.ts +52 -0
- package/esm/helpers/updateColumnsWithJS.d.ts.map +1 -0
- package/esm/helpers/updateColumnsWithJS.js +139 -0
- package/esm/methods/addCharacterCount.d.ts +3 -0
- package/esm/methods/addCharacterCount.d.ts.map +1 -0
- package/esm/methods/addCharacterCount.js +15 -0
- package/esm/methods/addColumn.d.ts +1 -1
- package/esm/methods/addColumn.d.ts.map +1 -1
- package/esm/methods/addGeoNoise.d.ts +7 -0
- package/esm/methods/addGeoNoise.d.ts.map +1 -0
- package/esm/methods/addGeoNoise.js +135 -0
- package/esm/methods/addNoise.d.ts +5 -0
- package/esm/methods/addNoise.d.ts.map +1 -0
- package/esm/methods/addNoise.js +53 -0
- package/esm/methods/addWordCount.d.ts +3 -0
- package/esm/methods/addWordCount.d.ts.map +1 -0
- package/esm/methods/addWordCount.js +15 -0
- package/esm/methods/bm25.d.ts.map +1 -1
- package/esm/methods/bm25.js +1 -2
- package/esm/methods/cache.d.ts.map +1 -1
- package/esm/methods/cache.js +4 -6
- package/esm/methods/columnProportions.d.ts +1 -0
- package/esm/methods/columnProportions.d.ts.map +1 -1
- package/esm/methods/columnProportions.js +7 -2
- package/esm/methods/convert.d.ts +2 -2
- package/esm/methods/convert.d.ts.map +1 -1
- package/esm/methods/convert.js +5 -0
- package/esm/methods/getBottom.d.ts +1 -1
- package/esm/methods/getBottom.d.ts.map +1 -1
- package/esm/methods/getBottom.js +2 -2
- package/esm/methods/getData.d.ts +1 -1
- package/esm/methods/getData.d.ts.map +1 -1
- package/esm/methods/getData.js +2 -2
- package/esm/methods/join.d.ts.map +1 -1
- package/esm/methods/join.js +8 -16
- package/esm/methods/joinGeo.d.ts.map +1 -1
- package/esm/methods/joinGeo.js +10 -19
- package/esm/methods/loadArray.d.ts +4 -2
- package/esm/methods/loadArray.d.ts.map +1 -1
- package/esm/methods/loadArray.js +182 -18
- package/esm/methods/loadData.js +3 -0
- package/esm/methods/loadYahooFinanceData.d.ts +10 -0
- package/esm/methods/loadYahooFinanceData.d.ts.map +1 -0
- package/esm/methods/loadYahooFinanceData.js +133 -0
- package/esm/methods/log.d.ts +7 -0
- package/esm/methods/log.d.ts.map +1 -0
- package/esm/methods/log.js +58 -0
- package/esm/methods/logBottom.d.ts +5 -0
- package/esm/methods/logBottom.d.ts.map +1 -0
- package/esm/methods/logBottom.js +9 -0
- package/esm/methods/removeTable.d.ts.map +1 -1
- package/esm/methods/removeTable.js +2 -0
- package/esm/methods/removeTables.d.ts.map +1 -1
- package/esm/methods/removeTables.js +7 -0
- package/esm/methods/renameTable.d.ts.map +1 -1
- package/esm/methods/renameTable.js +4 -0
- package/esm/methods/rowProportions.d.ts +1 -0
- package/esm/methods/rowProportions.d.ts.map +1 -1
- package/esm/methods/rowProportions.js +5 -1
- package/esm/methods/rowToText.js +2 -2
- package/esm/methods/selectTables.d.ts.map +1 -1
- package/esm/methods/selectTables.js +6 -0
- package/esm/methods/setTypes.d.ts +1 -1
- package/esm/methods/setTypes.d.ts.map +1 -1
- package/esm/methods/stream.d.ts.map +1 -1
- package/esm/methods/stream.js +2 -1
- package/esm/methods/updateWithJS.d.ts +1 -3
- package/esm/methods/updateWithJS.d.ts.map +1 -1
- package/esm/methods/updateWithJS.js +123 -37
- package/llm.md +600 -430
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/script/class/Simple.d.ts +8 -2
- package/script/class/Simple.d.ts.map +1 -1
- package/script/class/Simple.js +9 -3
- package/script/class/SimpleDB.d.ts +72 -1
- package/script/class/SimpleDB.d.ts.map +1 -1
- package/script/class/SimpleDB.js +81 -1
- package/script/class/SimpleTable.d.ts +434 -263
- package/script/class/SimpleTable.d.ts.map +1 -1
- package/script/class/SimpleTable.js +441 -316
- package/script/helpers/LogValue.d.ts +8 -0
- package/script/helpers/LogValue.d.ts.map +1 -0
- package/script/helpers/LogValue.js +26 -0
- package/script/helpers/cacheTableDependencies.d.ts +9 -0
- package/script/helpers/cacheTableDependencies.d.ts.map +1 -1
- package/script/helpers/cacheTableDependencies.js +170 -20
- package/script/helpers/cleanSQL.d.ts +1 -1
- package/script/helpers/cleanSQL.d.ts.map +1 -1
- package/script/helpers/cleanSQL.js +271 -23
- package/script/helpers/flushAllTables.d.ts.map +1 -1
- package/script/helpers/flushAllTables.js +24 -29
- package/script/helpers/foldIdentifier.d.ts +3 -0
- package/script/helpers/foldIdentifier.d.ts.map +1 -0
- package/script/helpers/foldIdentifier.js +7 -0
- package/script/helpers/geometryFromJSON.d.ts +3 -0
- package/script/helpers/geometryFromJSON.d.ts.map +1 -0
- package/script/helpers/geometryFromJSON.js +7 -0
- package/script/helpers/index.d.ts +1 -0
- package/script/helpers/index.d.ts.map +1 -1
- package/script/helpers/index.js +3 -1
- package/script/helpers/logData.d.ts.map +1 -1
- package/script/helpers/logData.js +45 -44
- package/script/helpers/makeLogConverter.d.ts +5 -0
- package/script/helpers/makeLogConverter.d.ts.map +1 -0
- package/script/helpers/makeLogConverter.js +70 -0
- package/script/helpers/osmFiles.d.ts.map +1 -1
- package/script/helpers/parseTypes.d.ts +1 -1
- package/script/helpers/parseTypes.d.ts.map +1 -1
- package/script/helpers/parseTypes.js +4 -0
- package/script/helpers/pendingOps.d.ts +4 -2
- package/script/helpers/pendingOps.d.ts.map +1 -1
- package/script/helpers/prepareGeometry.d.ts +3 -0
- package/script/helpers/prepareGeometry.d.ts.map +1 -0
- package/script/helpers/prepareGeometry.js +102 -0
- package/script/helpers/prepareJSON.d.ts +3 -0
- package/script/helpers/prepareJSON.d.ts.map +1 -0
- package/script/helpers/prepareJSON.js +53 -0
- package/script/helpers/printTable.d.ts +5 -4
- package/script/helpers/printTable.d.ts.map +1 -1
- package/script/helpers/printTable.js +32 -36
- package/script/helpers/queryDB.js +1 -1
- package/script/helpers/queueAsyncBarrier.d.ts +4 -0
- package/script/helpers/queueAsyncBarrier.d.ts.map +1 -1
- package/script/helpers/queueAsyncBarrier.js +4 -0
- package/script/helpers/queueOp.d.ts.map +1 -1
- package/script/helpers/queueOp.js +4 -2
- package/script/helpers/readMutationRows.d.ts +9 -0
- package/script/helpers/readMutationRows.d.ts.map +1 -0
- package/script/helpers/readMutationRows.js +97 -0
- package/script/helpers/referencedTables.d.ts +9 -0
- package/script/helpers/referencedTables.d.ts.map +1 -0
- package/script/helpers/referencedTables.js +28 -0
- package/script/helpers/runQuery.d.ts.map +1 -1
- package/script/helpers/runQuery.js +11 -13
- package/script/helpers/scanSQL.d.ts +7 -0
- package/script/helpers/scanSQL.d.ts.map +1 -0
- package/script/helpers/scanSQL.js +74 -0
- package/script/helpers/tableRegistry.d.ts +2 -0
- package/script/helpers/tableRegistry.d.ts.map +1 -1
- package/script/helpers/tableRegistry.js +16 -4
- package/script/helpers/updateColumnsWithJS.d.ts +52 -0
- package/script/helpers/updateColumnsWithJS.d.ts.map +1 -0
- package/script/helpers/updateColumnsWithJS.js +145 -0
- package/script/methods/addCharacterCount.d.ts +3 -0
- package/script/methods/addCharacterCount.d.ts.map +1 -0
- package/script/methods/addCharacterCount.js +21 -0
- package/script/methods/addColumn.d.ts +1 -1
- package/script/methods/addColumn.d.ts.map +1 -1
- package/script/methods/addGeoNoise.d.ts +7 -0
- package/script/methods/addGeoNoise.d.ts.map +1 -0
- package/script/methods/addGeoNoise.js +141 -0
- package/script/methods/addNoise.d.ts +5 -0
- package/script/methods/addNoise.d.ts.map +1 -0
- package/script/methods/addNoise.js +59 -0
- package/script/methods/addWordCount.d.ts +3 -0
- package/script/methods/addWordCount.d.ts.map +1 -0
- package/script/methods/addWordCount.js +21 -0
- package/script/methods/bm25.d.ts.map +1 -1
- package/script/methods/bm25.js +1 -2
- package/script/methods/cache.d.ts.map +1 -1
- package/script/methods/cache.js +3 -5
- package/script/methods/columnProportions.d.ts +1 -0
- package/script/methods/columnProportions.d.ts.map +1 -1
- package/script/methods/columnProportions.js +7 -2
- package/script/methods/convert.d.ts +2 -2
- package/script/methods/convert.d.ts.map +1 -1
- package/script/methods/convert.js +5 -0
- package/script/methods/getBottom.d.ts +1 -1
- package/script/methods/getBottom.d.ts.map +1 -1
- package/script/methods/getBottom.js +2 -2
- package/script/methods/getData.d.ts +1 -1
- package/script/methods/getData.d.ts.map +1 -1
- package/script/methods/getData.js +2 -2
- package/script/methods/join.d.ts.map +1 -1
- package/script/methods/join.js +8 -16
- package/script/methods/joinGeo.d.ts.map +1 -1
- package/script/methods/joinGeo.js +10 -19
- package/script/methods/loadArray.d.ts +4 -2
- package/script/methods/loadArray.d.ts.map +1 -1
- package/script/methods/loadArray.js +181 -17
- package/script/methods/loadData.js +3 -0
- package/script/methods/loadYahooFinanceData.d.ts +10 -0
- package/script/methods/loadYahooFinanceData.d.ts.map +1 -0
- package/script/methods/loadYahooFinanceData.js +139 -0
- package/script/methods/log.d.ts +7 -0
- package/script/methods/log.d.ts.map +1 -0
- package/script/methods/log.js +64 -0
- package/script/methods/logBottom.d.ts +5 -0
- package/script/methods/logBottom.d.ts.map +1 -0
- package/script/methods/logBottom.js +15 -0
- package/script/methods/removeTable.d.ts.map +1 -1
- package/script/methods/removeTable.js +2 -0
- package/script/methods/removeTables.d.ts.map +1 -1
- package/script/methods/removeTables.js +7 -0
- package/script/methods/renameTable.d.ts.map +1 -1
- package/script/methods/renameTable.js +4 -0
- package/script/methods/rowProportions.d.ts +1 -0
- package/script/methods/rowProportions.d.ts.map +1 -1
- package/script/methods/rowProportions.js +5 -1
- package/script/methods/rowToText.js +2 -2
- package/script/methods/selectTables.d.ts.map +1 -1
- package/script/methods/selectTables.js +6 -0
- package/script/methods/setTypes.d.ts +1 -1
- package/script/methods/setTypes.d.ts.map +1 -1
- package/script/methods/stream.d.ts.map +1 -1
- package/script/methods/stream.js +2 -1
- package/script/methods/updateWithJS.d.ts +1 -3
- package/script/methods/updateWithJS.d.ts.map +1 -1
- package/script/methods/updateWithJS.js +122 -36
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import quoteIdentifier from "./quoteIdentifier.js";
|
|
2
|
+
import readMutationRows from "./readMutationRows.js";
|
|
3
|
+
import { retainRegisteredTables } from "./tableRegistry.js";
|
|
4
|
+
import { executePreparedArray, prepareArray } from "../methods/loadArray.js";
|
|
5
|
+
/**
|
|
6
|
+
* Generates columns from selected input columns, keeping other SQL values in
|
|
7
|
+
* DuckDB. Call from an asynchronous extension barrier. The callback must return
|
|
8
|
+
* one row per input row in the same order; only the declared output columns are
|
|
9
|
+
* stored. Existing output columns are replaced, with types inferred from the
|
|
10
|
+
* generated values. Generation runs sequentially in bounded batches (1,000 rows
|
|
11
|
+
* by default); callbacks must not depend on receiving the whole table. Non-null
|
|
12
|
+
* output types must agree across batches. All-null batches defer type inference.
|
|
13
|
+
* Only one batch of inputs and outputs is retained by this helper in JavaScript;
|
|
14
|
+
* callers must also bound their own buffering. Reads finish before callbacks or
|
|
15
|
+
* writes use the shared connection. The original table is replaced only after
|
|
16
|
+
* staging succeeds. Empty tables are unchanged and do not invoke the callback;
|
|
17
|
+
* outputs that remain null in every batch use VARCHAR.
|
|
18
|
+
*
|
|
19
|
+
* Untouched geometry columns remain in DuckDB, preserving their values, types
|
|
20
|
+
* and CRS without GeoJSON conversion. Geometry columns cannot be selected as
|
|
21
|
+
* inputs or overwritten as outputs; use updateWithJS() for editable GeoJSON.
|
|
22
|
+
* This SQL-only preservation path accepts any source CRS.
|
|
23
|
+
*
|
|
24
|
+
* @param table - Table to enrich.
|
|
25
|
+
* @param inputColumns - Columns available to the callback.
|
|
26
|
+
* @param outputColumns - Generated columns to add or replace.
|
|
27
|
+
* @param generate - Produces one result per input row, in input order.
|
|
28
|
+
* @param options - Controls the maximum rows read, generated, and staged at once.
|
|
29
|
+
* @returns Resolves after merging the generated columns into the table.
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* queueAsyncBarrier(table, {
|
|
33
|
+
* method: "label()",
|
|
34
|
+
* parameters: null,
|
|
35
|
+
* execute: () => updateColumnsWithJS(table, ["name"], ["label"], async (rows) =>
|
|
36
|
+
* rows.map((row) => ({ label: String(row.name).toUpperCase() })),
|
|
37
|
+
* { batchSize: 500 }),
|
|
38
|
+
* });
|
|
39
|
+
* await table.log();
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export default async function updateColumnsWithJS(table, inputColumns, outputColumns, generate, options = {}) {
|
|
43
|
+
const batchSize = options.batchSize ?? 1000;
|
|
44
|
+
if (!Number.isSafeInteger(batchSize) || batchSize < 1) {
|
|
45
|
+
throw new Error("batchSize must be a positive safe integer.");
|
|
46
|
+
}
|
|
47
|
+
if (inputColumns.length === 0 || outputColumns.length === 0) {
|
|
48
|
+
throw new Error("Input and output columns must not be empty.");
|
|
49
|
+
}
|
|
50
|
+
if (new Set(outputColumns.map((name) => name.toLowerCase())).size !==
|
|
51
|
+
outputColumns.length) {
|
|
52
|
+
throw new Error("Output columns must be unique.");
|
|
53
|
+
}
|
|
54
|
+
const types = await table.getTypes();
|
|
55
|
+
for (const [name, type] of Object.entries(types)) {
|
|
56
|
+
if (type.toUpperCase().startsWith("GEOMETRY") &&
|
|
57
|
+
[...inputColumns, ...outputColumns].some((column) => column.toLowerCase() === name.toLowerCase())) {
|
|
58
|
+
throw new Error(`Geometry column ${JSON.stringify(name)} cannot be an input or output of updateColumnsWithJS(); use updateWithJS() for editable GeoJSON.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const suffix = crypto.randomUUID().replaceAll("-", "");
|
|
62
|
+
const id = `__sda_id_${suffix}`;
|
|
63
|
+
const snapshot = `__sda_source_${suffix}`;
|
|
64
|
+
const staged = table.sdb.newTable(`__sda_generated_${suffix}`);
|
|
65
|
+
const batch = table.sdb.newTable(`__sda_batch_${suffix}`);
|
|
66
|
+
const q = quoteIdentifier;
|
|
67
|
+
try {
|
|
68
|
+
// A SQL snapshot gives every row a stable identity, including duplicate rows
|
|
69
|
+
// and user columns named rowid. No untouched values cross the JS boundary.
|
|
70
|
+
await table.sdb.customQuery(`CREATE TEMP TABLE ${q(snapshot)} AS SELECT *, row_number() OVER () AS ${q(id)} FROM ${q(table.name)}`);
|
|
71
|
+
const knownTypes = new Map();
|
|
72
|
+
let lastId = "0";
|
|
73
|
+
let hasRows = false;
|
|
74
|
+
while (true) {
|
|
75
|
+
const upperId = BigInt(lastId) + BigInt(batchSize);
|
|
76
|
+
const { rows } = await readMutationRows(table.connection, `SELECT ${q(id)}, ${inputColumns.map(q).join(", ")} FROM ${q(snapshot)} WHERE ${q(id)} > ${lastId} AND ${q(id)} <= ${upperId}
|
|
77
|
+
ORDER BY ${q(id)} LIMIT ${batchSize}`);
|
|
78
|
+
if (rows.length === 0)
|
|
79
|
+
break;
|
|
80
|
+
const ids = rows.map((row) => String(row[id]));
|
|
81
|
+
lastId = ids[ids.length - 1];
|
|
82
|
+
for (const row of rows)
|
|
83
|
+
delete row[id];
|
|
84
|
+
const generated = await generate(rows);
|
|
85
|
+
if (generated.length !== ids.length) {
|
|
86
|
+
throw new Error("Column generation must return one row per input row.");
|
|
87
|
+
}
|
|
88
|
+
// Generated vectors retain this helper's existing inference contract.
|
|
89
|
+
await executePreparedArray(batch, prepareArray(generated.map((row, i) => ({
|
|
90
|
+
...Object.fromEntries(outputColumns.map((name) => [name, row[name]])),
|
|
91
|
+
[id]: ids[i],
|
|
92
|
+
}))));
|
|
93
|
+
const batchTypes = await batch.getTypes();
|
|
94
|
+
for (const name of outputColumns) {
|
|
95
|
+
const nonNull = generated.some((row) => row[name] !== null && row[name] !== undefined);
|
|
96
|
+
if (!nonNull)
|
|
97
|
+
continue;
|
|
98
|
+
const previous = knownTypes.get(name);
|
|
99
|
+
const current = batchTypes[name];
|
|
100
|
+
if (previous !== undefined && previous !== current) {
|
|
101
|
+
throw new Error(`Generated column ${JSON.stringify(name)} changed type from ${previous} to ${current}.`);
|
|
102
|
+
}
|
|
103
|
+
if (previous === undefined) {
|
|
104
|
+
knownTypes.set(name, current);
|
|
105
|
+
if (hasRows) {
|
|
106
|
+
await table.sdb.customQuery(`ALTER TABLE ${q(staged.name)} ALTER COLUMN ${q(name)} TYPE ${current} USING NULL`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!hasRows) {
|
|
111
|
+
await table.sdb.customQuery(`CREATE TEMP TABLE ${q(staged.name)} AS SELECT * FROM ${q(batch.name)}`);
|
|
112
|
+
hasRows = true;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
await table.sdb.customQuery(`INSERT INTO ${q(staged.name)} SELECT * FROM ${q(batch.name)}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (!hasRows)
|
|
119
|
+
return;
|
|
120
|
+
const outputs = new Map(outputColumns.map((name) => [name.toLowerCase(), name]));
|
|
121
|
+
const columns = Object.keys(types).map((name) => {
|
|
122
|
+
const replacement = outputs.get(name.toLowerCase());
|
|
123
|
+
return replacement === undefined
|
|
124
|
+
? `original.${q(name)}`
|
|
125
|
+
: `generated.${q(replacement)} AS ${q(name)}`;
|
|
126
|
+
});
|
|
127
|
+
const existing = new Set(Object.keys(types).map((name) => name.toLowerCase()));
|
|
128
|
+
for (const name of outputColumns) {
|
|
129
|
+
if (!existing.has(name.toLowerCase())) {
|
|
130
|
+
columns.push(`generated.${q(name)}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
await table.sdb.customQuery(`CREATE OR REPLACE TABLE ${q(table.name)} AS SELECT ${columns.join(", ")} FROM ${q(snapshot)} original JOIN ${q(staged.name)} generated ON original.${q(id)} = CAST(generated.${q(id)} AS BIGINT) ORDER BY original.${q(id)}`);
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
await table.sdb.customQuery(`DROP TABLE IF EXISTS ${q(snapshot)}; DROP TABLE IF EXISTS ${q(staged.name)}; DROP TABLE IF EXISTS ${q(batch.name)};`);
|
|
137
|
+
retainRegisteredTables(table.sdb, (item) => item !== staged && item !== batch);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addCharacterCount.d.ts","sourceRoot":"","sources":["../../src/methods/addCharacterCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAKvD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,QAclB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assertNewColumns from "../helpers/assertNewColumns.js";
|
|
2
|
+
import queueOp from "../helpers/queueOp.js";
|
|
3
|
+
import quoteIdentifier from "../helpers/quoteIdentifier.js";
|
|
4
|
+
export default function addCharacterCount(simpleTable, column, newColumn) {
|
|
5
|
+
queueOp(simpleTable, {
|
|
6
|
+
kind: "fusable",
|
|
7
|
+
method: "addCharacterCount()",
|
|
8
|
+
parameters: { column, newColumn },
|
|
9
|
+
needsSchema: true,
|
|
10
|
+
buildSelect: (input, types) => {
|
|
11
|
+
assertNewColumns(types, [newColumn], "addCharacterCount()");
|
|
12
|
+
return `SELECT *, LENGTH(${quoteIdentifier(column)}) AS ${quoteIdentifier(newColumn)} FROM ${input}`;
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type SimpleTable from "../class/SimpleTable.js";
|
|
2
|
-
export default function addColumn(simpleTable: SimpleTable, newColumn: string, type: "integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean" | `geometry('${string}')` | `GEOMETRY('${string}')`, definition: string): void;
|
|
2
|
+
export default function addColumn(simpleTable: SimpleTable, newColumn: string, type: "integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean" | "json" | "JSON" | `float[${number}]` | `FLOAT[${number}]` | `geometry('${string}')` | `GEOMETRY('${string}')`, definition: string): void;
|
|
3
3
|
//# sourceMappingURL=addColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addColumn.d.ts","sourceRoot":"","sources":["../../src/methods/addColumn.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,IAAI,EACA,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,0BAA0B,GAC1B,SAAS,GACT,aAAa,MAAM,IAAI,GACvB,aAAa,MAAM,IAAI,EAC3B,UAAU,EAAE,MAAM,QAuBnB"}
|
|
1
|
+
{"version":3,"file":"addColumn.d.ts","sourceRoot":"","sources":["../../src/methods/addColumn.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,IAAI,EACA,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,0BAA0B,GAC1B,SAAS,GACT,MAAM,GACN,MAAM,GACN,SAAS,MAAM,GAAG,GAClB,SAAS,MAAM,GAAG,GAClB,aAAa,MAAM,IAAI,GACvB,aAAa,MAAM,IAAI,EAC3B,UAAU,EAAE,MAAM,QAuBnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type SimpleTable from "../class/SimpleTable.js";
|
|
2
|
+
export default function addGeoNoise(simpleTable: SimpleTable, maxDistance: number, options?: {
|
|
3
|
+
column?: string;
|
|
4
|
+
unit?: "m" | "km";
|
|
5
|
+
onlyDuplicates?: boolean;
|
|
6
|
+
}): void;
|
|
7
|
+
//# sourceMappingURL=addGeoNoise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addGeoNoise.d.ts","sourceRoot":"","sources":["../../src/methods/addGeoNoise.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAKvD,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CACrB,QA2CP"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import findGeoColumnFromSchema from "../helpers/findGeoColumnFromSchema.js";
|
|
2
|
+
import queueOp from "../helpers/queueOp.js";
|
|
3
|
+
import quoteIdentifier from "../helpers/quoteIdentifier.js";
|
|
4
|
+
// This is the mean Earth radius used by DuckDB's ST_Distance_Sphere().
|
|
5
|
+
const EARTH_RADIUS_METERS = 6_371_000;
|
|
6
|
+
export default function addGeoNoise(simpleTable, maxDistance, options = {}) {
|
|
7
|
+
// This validation doesn't need the database, so it stays at call time.
|
|
8
|
+
if (!Number.isFinite(maxDistance) || maxDistance < 0) {
|
|
9
|
+
throw new Error("addGeoNoise() maxDistance must be a finite number greater than or equal to 0.");
|
|
10
|
+
}
|
|
11
|
+
if (options.unit !== undefined && options.unit !== "m" && options.unit !== "km") {
|
|
12
|
+
throw new Error('addGeoNoise() options.unit must be "m" or "km".');
|
|
13
|
+
}
|
|
14
|
+
options = structuredClone(options);
|
|
15
|
+
const maxDistanceMeters = options.unit === "km"
|
|
16
|
+
? maxDistance * 1_000
|
|
17
|
+
: maxDistance;
|
|
18
|
+
if (maxDistanceMeters > Math.PI * EARTH_RADIUS_METERS) {
|
|
19
|
+
throw new Error("addGeoNoise() maxDistance cannot exceed half the Earth's circumference.");
|
|
20
|
+
}
|
|
21
|
+
queueOp(simpleTable, {
|
|
22
|
+
kind: "fusable",
|
|
23
|
+
method: "addGeoNoise()",
|
|
24
|
+
parameters: { maxDistance, options },
|
|
25
|
+
needsSchema: true,
|
|
26
|
+
needsSpatial: true,
|
|
27
|
+
preservesSchema: true,
|
|
28
|
+
buildSelect: (input, schema) => {
|
|
29
|
+
const column = options.column ??
|
|
30
|
+
findGeoColumnFromSchema(schema, "addGeoNoise()", simpleTable.name);
|
|
31
|
+
return addGeoNoiseSelect(input, schema, column, maxDistanceMeters, options.onlyDuplicates === true);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function addGeoNoiseSelect(input, schema, column, maxDistanceMeters, onlyDuplicates) {
|
|
36
|
+
const type = schema[column];
|
|
37
|
+
if (type === undefined) {
|
|
38
|
+
throw new Error(`addGeoNoise() could not find column ${quoteIdentifier(column)}.`);
|
|
39
|
+
}
|
|
40
|
+
if (type !== "GEOMETRY('EPSG:4326')") {
|
|
41
|
+
throw new Error(`addGeoNoise() requires an EPSG:4326 geometry column, but ${quoteIdentifier(column)} has type ${type}. Reproject it to EPSG:4326 first.`);
|
|
42
|
+
}
|
|
43
|
+
const internalNames = makeInternalNames(schema, input);
|
|
44
|
+
const quotedColumn = quoteIdentifier(column);
|
|
45
|
+
const pointError = `error('addGeoNoise() requires POINT geometries in column ${column.replaceAll("'", "''")}.')`;
|
|
46
|
+
const coordinateGuard = (coordinate) => `CASE
|
|
47
|
+
WHEN ${quotedColumn} IS NULL OR ST_IsEmpty(${quotedColumn}) THEN NULL
|
|
48
|
+
WHEN CAST(ST_GeometryType(${quotedColumn}) AS VARCHAR) <> 'POINT'
|
|
49
|
+
THEN ${pointError}
|
|
50
|
+
ELSE radians(ST_${coordinate}(${quotedColumn}))
|
|
51
|
+
END`;
|
|
52
|
+
const duplicateCount = onlyDuplicates
|
|
53
|
+
? `COUNT(*) OVER (PARTITION BY ${quotedColumn})`
|
|
54
|
+
: "2";
|
|
55
|
+
const maxAngularDistance = maxDistanceMeters / EARTH_RADIUS_METERS;
|
|
56
|
+
const latitudeExpression = `asin(
|
|
57
|
+
sin(${quoteIdentifier(internalNames.latitude)}) * cos(${quoteIdentifier(internalNames.angularDistance)}) +
|
|
58
|
+
cos(${quoteIdentifier(internalNames.latitude)}) * sin(${quoteIdentifier(internalNames.angularDistance)}) * cos(${quoteIdentifier(internalNames.bearing)})
|
|
59
|
+
)`;
|
|
60
|
+
const longitudeExpression = `${quoteIdentifier(internalNames.longitude)} + atan2(
|
|
61
|
+
sin(${quoteIdentifier(internalNames.bearing)}) * sin(${quoteIdentifier(internalNames.angularDistance)}) * cos(${quoteIdentifier(internalNames.latitude)}),
|
|
62
|
+
cos(${quoteIdentifier(internalNames.angularDistance)}) -
|
|
63
|
+
sin(${quoteIdentifier(internalNames.latitude)}) * sin(${quoteIdentifier(internalNames.destinationLatitude)})
|
|
64
|
+
)`;
|
|
65
|
+
const replacement = `CASE
|
|
66
|
+
WHEN ${quotedColumn} IS NULL OR ST_IsEmpty(${quotedColumn}) THEN ${quotedColumn}
|
|
67
|
+
WHEN ${quoteIdentifier(internalNames.duplicateCount)} <= 1 THEN ${quotedColumn}
|
|
68
|
+
ELSE ST_Point(
|
|
69
|
+
degrees(atan2(
|
|
70
|
+
sin(${quoteIdentifier(internalNames.destinationLongitude)}),
|
|
71
|
+
cos(${quoteIdentifier(internalNames.destinationLongitude)})
|
|
72
|
+
)),
|
|
73
|
+
degrees(${quoteIdentifier(internalNames.destinationLatitude)})
|
|
74
|
+
)::GEOMETRY('EPSG:4326')
|
|
75
|
+
END AS ${quotedColumn}`;
|
|
76
|
+
const outputColumns = Object.keys(schema).map((outputColumn) => outputColumn === column ? replacement : quoteIdentifier(outputColumn)).join(", ");
|
|
77
|
+
return `WITH ${quoteIdentifier(internalNames.randomValues)} AS MATERIALIZED (
|
|
78
|
+
SELECT *,
|
|
79
|
+
random() AS ${quoteIdentifier(internalNames.distanceRandom)},
|
|
80
|
+
random() AS ${quoteIdentifier(internalNames.bearingRandom)},
|
|
81
|
+
${duplicateCount} AS ${quoteIdentifier(internalNames.duplicateCount)}
|
|
82
|
+
FROM ${input}
|
|
83
|
+
),
|
|
84
|
+
${quoteIdentifier(internalNames.start)} AS (
|
|
85
|
+
SELECT *,
|
|
86
|
+
${coordinateGuard("Y")} AS ${quoteIdentifier(internalNames.latitude)},
|
|
87
|
+
${coordinateGuard("X")} AS ${quoteIdentifier(internalNames.longitude)},
|
|
88
|
+
2 * pi() * ${quoteIdentifier(internalNames.bearingRandom)} AS ${quoteIdentifier(internalNames.bearing)},
|
|
89
|
+
2 * asin(
|
|
90
|
+
sqrt(${quoteIdentifier(internalNames.distanceRandom)}) *
|
|
91
|
+
sin(${maxAngularDistance} / 2)
|
|
92
|
+
) AS ${quoteIdentifier(internalNames.angularDistance)}
|
|
93
|
+
FROM ${quoteIdentifier(internalNames.randomValues)}
|
|
94
|
+
),
|
|
95
|
+
${quoteIdentifier(internalNames.destinationLatitudeCte)} AS (
|
|
96
|
+
SELECT *, ${latitudeExpression} AS ${quoteIdentifier(internalNames.destinationLatitude)}
|
|
97
|
+
FROM ${quoteIdentifier(internalNames.start)}
|
|
98
|
+
),
|
|
99
|
+
${quoteIdentifier(internalNames.destination)} AS (
|
|
100
|
+
SELECT *, ${longitudeExpression} AS ${quoteIdentifier(internalNames.destinationLongitude)}
|
|
101
|
+
FROM ${quoteIdentifier(internalNames.destinationLatitudeCte)}
|
|
102
|
+
)
|
|
103
|
+
SELECT ${outputColumns}
|
|
104
|
+
FROM ${quoteIdentifier(internalNames.destination)}`;
|
|
105
|
+
}
|
|
106
|
+
function makeInternalNames(schema, input) {
|
|
107
|
+
const used = new Set(Object.keys(schema));
|
|
108
|
+
if (input.startsWith('"') && input.endsWith('"')) {
|
|
109
|
+
used.add(input.slice(1, -1).replaceAll('""', '"'));
|
|
110
|
+
}
|
|
111
|
+
const next = (base) => {
|
|
112
|
+
let name = base;
|
|
113
|
+
let suffix = 2;
|
|
114
|
+
while (used.has(name)) {
|
|
115
|
+
name = `${base}_${suffix++}`;
|
|
116
|
+
}
|
|
117
|
+
used.add(name);
|
|
118
|
+
return name;
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
randomValues: next("__sda_add_geo_noise_random_values"),
|
|
122
|
+
start: next("__sda_add_geo_noise_start"),
|
|
123
|
+
destinationLatitudeCte: next("__sda_add_geo_noise_latitude_result"),
|
|
124
|
+
destination: next("__sda_add_geo_noise_result"),
|
|
125
|
+
distanceRandom: next("__sda_add_geo_noise_distance_random"),
|
|
126
|
+
bearingRandom: next("__sda_add_geo_noise_bearing_random"),
|
|
127
|
+
duplicateCount: next("__sda_add_geo_noise_duplicate_count"),
|
|
128
|
+
latitude: next("__sda_add_geo_noise_latitude"),
|
|
129
|
+
longitude: next("__sda_add_geo_noise_longitude"),
|
|
130
|
+
bearing: next("__sda_add_geo_noise_bearing"),
|
|
131
|
+
angularDistance: next("__sda_add_geo_noise_angular_distance"),
|
|
132
|
+
destinationLatitude: next("__sda_add_geo_noise_destination_latitude"),
|
|
133
|
+
destinationLongitude: next("__sda_add_geo_noise_destination_longitude"),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addNoise.d.ts","sourceRoot":"","sources":["../../src/methods/addNoise.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,QAwC3C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import assertColumnsExist from "../helpers/assertColumnsExist.js";
|
|
2
|
+
import keepNumericalColumns from "../helpers/keepNumericalColumns.js";
|
|
3
|
+
import queueOp from "../helpers/queueOp.js";
|
|
4
|
+
import quoteIdentifier from "../helpers/quoteIdentifier.js";
|
|
5
|
+
import stringToArray from "../helpers/stringToArray.js";
|
|
6
|
+
export default function addNoise(simpleTable, columns, max, options = {}) {
|
|
7
|
+
// This validation doesn't need the database, so it stays at call time.
|
|
8
|
+
if (!Number.isFinite(max) || max < 0) {
|
|
9
|
+
throw new Error("addNoise() max must be a finite number greater than or equal to 0.");
|
|
10
|
+
}
|
|
11
|
+
const cols = stringToArray(columns);
|
|
12
|
+
if (cols.length === 0) {
|
|
13
|
+
throw new Error("addNoise() requires at least one column.");
|
|
14
|
+
}
|
|
15
|
+
const duplicateColumns = cols.filter((column, index) => cols.indexOf(column) !== index);
|
|
16
|
+
if (duplicateColumns.length > 0) {
|
|
17
|
+
const duplicates = [...new Set(duplicateColumns)];
|
|
18
|
+
throw new Error(`addNoise() received duplicate column${duplicates.length === 1 ? "" : "s"} ${duplicates.map(quoteIdentifier).join(", ")}. Include each column only once.`);
|
|
19
|
+
}
|
|
20
|
+
options = structuredClone(options);
|
|
21
|
+
queueOp(simpleTable, {
|
|
22
|
+
kind: "fusable",
|
|
23
|
+
method: "addNoise()",
|
|
24
|
+
parameters: { columns: cols, max, options },
|
|
25
|
+
needsSchema: true,
|
|
26
|
+
outputSchema: (schema) => ({
|
|
27
|
+
...schema,
|
|
28
|
+
...Object.fromEntries(cols.map((column) => [column, "DOUBLE"])),
|
|
29
|
+
}),
|
|
30
|
+
buildSelect: (input, schema) => addNoiseSelect(input, schema, cols, max, options.onlyDuplicates === true),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function addNoiseSelect(input, schema, columns, max, onlyDuplicates) {
|
|
34
|
+
assertColumnsExist(schema, columns, "addNoise()");
|
|
35
|
+
const numericalColumns = new Set(keepNumericalColumns(schema));
|
|
36
|
+
const nonNumericalColumns = columns.filter((column) => !numericalColumns.has(column));
|
|
37
|
+
if (nonNumericalColumns.length > 0) {
|
|
38
|
+
throw new Error(`addNoise() requires numeric columns, but ${nonNumericalColumns.map((column) => `${quoteIdentifier(column)} has type ${schema[column]}`).join(", ")}. Convert ${nonNumericalColumns.length === 1 ? "it" : "them"} to a numeric type first.`);
|
|
39
|
+
}
|
|
40
|
+
const replacements = columns.map((column) => {
|
|
41
|
+
const quotedColumn = quoteIdentifier(column);
|
|
42
|
+
const duplicateCondition = onlyDuplicates
|
|
43
|
+
? `COUNT(*) OVER (PARTITION BY ${quotedColumn}) > 1`
|
|
44
|
+
: "TRUE";
|
|
45
|
+
return `CASE
|
|
46
|
+
WHEN ${quotedColumn} IS NULL THEN NULL
|
|
47
|
+
WHEN ${duplicateCondition}
|
|
48
|
+
THEN CAST(${quotedColumn} AS DOUBLE) + (random() * 2 - 1) * ${max}
|
|
49
|
+
ELSE CAST(${quotedColumn} AS DOUBLE)
|
|
50
|
+
END AS ${quotedColumn}`;
|
|
51
|
+
}).join(", ");
|
|
52
|
+
return `SELECT * REPLACE (${replacements}) FROM ${input}`;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addWordCount.d.ts","sourceRoot":"","sources":["../../src/methods/addWordCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAKvD,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,QAclB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import assertNewColumns from "../helpers/assertNewColumns.js";
|
|
2
|
+
import queueOp from "../helpers/queueOp.js";
|
|
3
|
+
import quoteIdentifier from "../helpers/quoteIdentifier.js";
|
|
4
|
+
export default function addWordCount(simpleTable, column, newColumn) {
|
|
5
|
+
queueOp(simpleTable, {
|
|
6
|
+
kind: "fusable",
|
|
7
|
+
method: "addWordCount()",
|
|
8
|
+
parameters: { column, newColumn },
|
|
9
|
+
needsSchema: true,
|
|
10
|
+
buildSelect: (input, types) => {
|
|
11
|
+
assertNewColumns(types, [newColumn], "addWordCount()");
|
|
12
|
+
return `SELECT *, ARRAY_LENGTH(REGEXP_EXTRACT_ALL(${quoteIdentifier(column)}, '[^[:space:]]+')) AS ${quoteIdentifier(newColumn)} FROM ${input}`;
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bm25.d.ts","sourceRoot":"","sources":["../../src/methods/bm25.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bm25.d.ts","sourceRoot":"","sources":["../../src/methods/bm25.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAMvD,MAAM,CAAC,OAAO,UAAU,IAAI,CAC1B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,OAAO,CAAC,EACJ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,GACX,YAAY,GACZ,OAAO,GACP,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,GACT,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,GACL,WAAW,CA4Bb"}
|
package/esm/methods/bm25.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import quoteIdentifier from "../helpers/quoteIdentifier.js";
|
|
2
|
-
import camelCase from "../helpers/camelCase.js";
|
|
3
2
|
import queryDB from "../helpers/queryDB.js";
|
|
4
3
|
import mergeOptions from "../helpers/mergeOptions.js";
|
|
5
4
|
import queueOp from "../helpers/queueOp.js";
|
|
@@ -39,7 +38,7 @@ async function executeBm25(simpleTable, outputTable, text, idColumn, textColumn,
|
|
|
39
38
|
const selectClause = typeof options.scoreColumn === "string"
|
|
40
39
|
? `* EXCLUDE(score), score AS ${quoteIdentifier(options.scoreColumn)}`
|
|
41
40
|
: `* EXCLUDE(score)`;
|
|
42
|
-
await queryDB(simpleTable, `CREATE OR REPLACE TABLE ${quoteIdentifier(outputTable.name)} AS SELECT ${selectClause} FROM (SELECT *, ${quoteIdentifier(`fts_main_${
|
|
41
|
+
await queryDB(simpleTable, `CREATE OR REPLACE TABLE ${quoteIdentifier(outputTable.name)} AS SELECT ${selectClause} FROM (SELECT *, ${quoteIdentifier(`fts_main_${simpleTable.name}`)}.match_bm25(${quoteIdentifier(idColumn)}, ?${typeof options.k === "number" ? `, k := ${options.k}` : ""}${typeof options.b === "number" ? `, b := ${options.b}` : ""}${options.conjunctive === true ? `, conjunctive := 1` : ""}) AS score FROM ${quoteIdentifier(simpleTable.name)}) sq WHERE score NOT NULL${minScoreCondition} ORDER BY score DESC LIMIT ${count};`, mergeOptions(simpleTable, {
|
|
43
42
|
table: simpleTable.name,
|
|
44
43
|
method: "bm25",
|
|
45
44
|
parameters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/methods/cache.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/methods/cache.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AA4DvD,wBAA8B,KAAK,CAAC,KAAK,SAAS,WAAW,EAC3D,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC/C,OAAO,GAAE;IACP,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,iBA4LP"}
|
package/esm/methods/cache.js
CHANGED
|
@@ -6,11 +6,12 @@ import { cacheEntryExpired, cacheLoadMessage, cacheTtlMessage, } from "../helper
|
|
|
6
6
|
import serializeCacheInputs, { getCacheInputLabel, } from "../helpers/serializeCacheInputs.js";
|
|
7
7
|
import { createTableGenerationId, peekTableGeneration, restoreTableGeneration, } from "../helpers/tableGeneration.js";
|
|
8
8
|
import { loadCacheDatabase, writeCacheDatabase, } from "../helpers/cacheDatabase.js";
|
|
9
|
-
import { cacheTableDependenciesMatch, captureCacheTableDependencies, changedCacheTableDependenciesMessage, recordCacheTableAccess, unchangedCacheTableDependenciesMessage, } from "../helpers/cacheTableDependencies.js";
|
|
9
|
+
import { assertCacheTableMutation, cacheTableDependenciesMatch, captureCacheTableDependencies, changedCacheTableDependenciesMessage, recordCacheTableAccess, unchangedCacheTableDependenciesMessage, } from "../helpers/cacheTableDependencies.js";
|
|
10
10
|
const CACHE_FORMAT_VERSION = "duckdb-v4";
|
|
11
11
|
export default async function cache(table, compute, options = {}) {
|
|
12
12
|
// If cache() is itself called from another cache computation, the outer
|
|
13
13
|
// computation depends on the table produced here.
|
|
14
|
+
assertCacheTableMutation(table);
|
|
14
15
|
recordCacheTableAccess(table);
|
|
15
16
|
options.verbose &&
|
|
16
17
|
console.log(`\ncache() for ${table.name}`);
|
|
@@ -31,12 +32,13 @@ export default async function cache(table, compute, options = {}) {
|
|
|
31
32
|
const inputs = options.inputs?.filter((input) => input !== table) ?? [];
|
|
32
33
|
const hasInputs = inputs.length > 0;
|
|
33
34
|
const serializedInputs = hasInputs ? serializeCacheInputs(inputs) : null;
|
|
34
|
-
const codeHash = createHash(functionBody);
|
|
35
|
+
const codeHash = createHash(JSON.stringify([table.sdb.expressionSyntax, functionBody]));
|
|
35
36
|
const inputHashes = hasInputs
|
|
36
37
|
? inputs.map((input) => createHash(serializeCacheInputs([input])))
|
|
37
38
|
: [];
|
|
38
39
|
const hash = createHash(JSON.stringify([
|
|
39
40
|
CACHE_FORMAT_VERSION,
|
|
41
|
+
table.sdb.expressionSyntax,
|
|
40
42
|
table.name,
|
|
41
43
|
entryGeneration,
|
|
42
44
|
functionBody,
|
|
@@ -119,10 +121,6 @@ async function runAndWrite(table, compute, cacheSources, cacheSourcesPath, cache
|
|
|
119
121
|
const start = Date.now();
|
|
120
122
|
const tableDependencies = await captureCacheTableDependencies(table, async () => {
|
|
121
123
|
await compute(table);
|
|
122
|
-
// run() only queues the sync builders in the user's callback; the actual
|
|
123
|
-
// computation happens at the flush, so it must be included in the timing
|
|
124
|
-
// that decides how much the cache saves on later hits.
|
|
125
|
-
await flushAllTables(table.sdb);
|
|
126
124
|
});
|
|
127
125
|
const end = Date.now();
|
|
128
126
|
const duration = end - start;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type SimpleTable from "../class/SimpleTable.js";
|
|
2
2
|
export default function columnProportions(simpleTable: SimpleTable, column: string, newColumn: string, options?: {
|
|
3
3
|
by?: string | string[];
|
|
4
|
+
base?: number;
|
|
4
5
|
decimals?: number;
|
|
5
6
|
}): void;
|
|
6
7
|
//# sourceMappingURL=columnProportions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnProportions.d.ts","sourceRoot":"","sources":["../../src/methods/columnProportions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACd,
|
|
1
|
+
{"version":3,"file":"columnProportions.d.ts","sourceRoot":"","sources":["../../src/methods/columnProportions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACd,QAqCP"}
|
|
@@ -3,6 +3,10 @@ import assertNewColumns from "../helpers/assertNewColumns.js";
|
|
|
3
3
|
import queueOp from "../helpers/queueOp.js";
|
|
4
4
|
import stringToArray from "../helpers/stringToArray.js";
|
|
5
5
|
export default function columnProportions(simpleTable, column, newColumn, options = {}) {
|
|
6
|
+
if (options.base !== undefined &&
|
|
7
|
+
(!Number.isFinite(options.base) || options.base <= 0)) {
|
|
8
|
+
throw new Error("columnProportions() options.base must be a finite number greater than 0.");
|
|
9
|
+
}
|
|
6
10
|
options = structuredClone(options);
|
|
7
11
|
queueOp(simpleTable, {
|
|
8
12
|
kind: "fusable",
|
|
@@ -15,9 +19,10 @@ export default function columnProportions(simpleTable, column, newColumn, option
|
|
|
15
19
|
const partition = by.length === 0
|
|
16
20
|
? ""
|
|
17
21
|
: `PARTITION BY ${by.map((d) => `${quoteIdentifier(d)}`).join(",")}`;
|
|
22
|
+
const proportion = `${quoteIdentifier(column)} / sum(${quoteIdentifier(column)}) OVER(${partition}) * ${options.base ?? 1}`;
|
|
18
23
|
return typeof options.decimals === "number"
|
|
19
|
-
? `SELECT *, ROUND(${
|
|
20
|
-
: `SELECT *, ${
|
|
24
|
+
? `SELECT *, ROUND(${proportion}, ${options.decimals}) AS ${quoteIdentifier(newColumn)} FROM ${input}`
|
|
25
|
+
: `SELECT *, ${proportion} AS ${quoteIdentifier(newColumn)} FROM ${input}`;
|
|
21
26
|
},
|
|
22
27
|
});
|
|
23
28
|
}
|
package/esm/methods/convert.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type SimpleTable from "../class/SimpleTable.js";
|
|
2
2
|
import type { TableSchema } from "../helpers/pendingOps.js";
|
|
3
3
|
export default function convert(simpleTable: SimpleTable, types: {
|
|
4
|
-
[key: string]: "integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean"
|
|
4
|
+
[key: string]: "integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean" | "json" | "JSON" | `float[${number}]` | `FLOAT[${number}]` | `geometry('${string}')` | `GEOMETRY('${string}')`;
|
|
5
5
|
}, options?: {
|
|
6
6
|
strict?: boolean;
|
|
7
7
|
datetimeFormat?: string;
|
|
8
8
|
}): void;
|
|
9
|
-
export declare function convertSelect(input: string, columns: string[], columnsTypes: ("integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean")[], allColumns: string[], allTypes: TableSchema, options: {
|
|
9
|
+
export declare function convertSelect(input: string, columns: string[], columnsTypes: ("integer" | "float" | "number" | "string" | "date" | "time" | "datetime" | "datetimeTz" | "bigint" | "double" | "varchar" | "timestamp" | "timestamp with time zone" | "boolean" | "json" | "JSON" | `float[${number}]` | `FLOAT[${number}]` | `geometry('${string}')` | `GEOMETRY('${string}')`)[], allColumns: string[], allTypes: TableSchema, options: {
|
|
10
10
|
datetimeFormat?: string;
|
|
11
11
|
strict?: boolean;
|
|
12
12
|
}): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/methods/convert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;IACL,CAAC,GAAG,EAAE,MAAM,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,0BAA0B,GAC1B,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/methods/convert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;IACL,CAAC,GAAG,EAAE,MAAM,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,0BAA0B,GAC1B,SAAS,GACT,MAAM,GACN,MAAM,GACN,SAAS,MAAM,GAAG,GAClB,SAAS,MAAM,GAAG,GAClB,aAAa,MAAM,IAAI,GACvB,aAAa,MAAM,IAAI,CAAC;CAC7B,EACD,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACpB,QAkDP;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,CACV,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,0BAA0B,GAC1B,SAAS,GACT,MAAM,GACN,MAAM,GACN,SAAS,MAAM,GAAG,GAClB,SAAS,MAAM,GAAG,GAClB,aAAa,MAAM,IAAI,GACvB,aAAa,MAAM,IAAI,CAC1B,EAAE,EACH,UAAU,EAAE,MAAM,EAAE,EACpB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,UAuFvD"}
|
package/esm/methods/convert.js
CHANGED
|
@@ -9,6 +9,7 @@ export default function convert(simpleTable, types, options = {}) {
|
|
|
9
9
|
method: "convert()",
|
|
10
10
|
parameters: { types, options },
|
|
11
11
|
needsSchema: true,
|
|
12
|
+
needsSpatial: Object.values(types).some((type) => type.toLowerCase().startsWith("geometry")),
|
|
12
13
|
outputSchema: (allTypes) => ({
|
|
13
14
|
...allTypes,
|
|
14
15
|
...Object.fromEntries(Object.entries(types).map(([column, type]) => [
|
|
@@ -78,6 +79,10 @@ export function convertSelect(input, columns, columnsTypes, allColumns, allTypes
|
|
|
78
79
|
else if (msToTimestamp) {
|
|
79
80
|
query += ` TIMESTAMP '1970-01-01 00:00:00' + to_milliseconds(${quoteIdentifier(column)}) AS ${quoteIdentifier(column)},`;
|
|
80
81
|
}
|
|
82
|
+
else if (options.strict === false && expectedType.startsWith("GEOMETRY")) {
|
|
83
|
+
// DuckDB's geometry parser can throw even inside TRY_CAST.
|
|
84
|
+
query += ` TRY(CAST(${quoteIdentifier(column)} AS ${expectedType})) AS ${quoteIdentifier(column)},`;
|
|
85
|
+
}
|
|
81
86
|
else if (stringToNumber) {
|
|
82
87
|
// Thousand separators would make the cast fail.
|
|
83
88
|
query += ` ${cast}(REPLACE(${quoteIdentifier(column)}, ',', '') AS ${parseType(columnsTypes[indexOf])}) AS ${quoteIdentifier(column)},`;
|
|
@@ -2,7 +2,7 @@ import type SimpleTable from "../class/SimpleTable.js";
|
|
|
2
2
|
export default function getBottom(simpleTable: SimpleTable, count: number, options?: {
|
|
3
3
|
originalOrder?: boolean;
|
|
4
4
|
conditions?: string;
|
|
5
|
-
}): Promise<{
|
|
5
|
+
}, method?: "getBottom()" | "logBottom()"): Promise<{
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
}[]>;
|
|
8
8
|
//# sourceMappingURL=getBottom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBottom.d.ts","sourceRoot":"","sources":["../../src/methods/getBottom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,wBAA8B,SAAS,CACrC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB;;
|
|
1
|
+
{"version":3,"file":"getBottom.d.ts","sourceRoot":"","sources":["../../src/methods/getBottom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAEvD,wBAA8B,SAAS,CACrC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB,EACN,MAAM,GAAE,aAAa,GAAG,aAA6B;;KA6BtD"}
|
package/esm/methods/getBottom.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import quoteIdentifier from "../helpers/quoteIdentifier.js";
|
|
2
2
|
import mergeOptions from "../helpers/mergeOptions.js";
|
|
3
3
|
import queryDB from "../helpers/queryDB.js";
|
|
4
|
-
export default async function getBottom(simpleTable, count, options = {}) {
|
|
4
|
+
export default async function getBottom(simpleTable, count, options = {}, method = "getBottom()") {
|
|
5
5
|
const queryResult = await queryDB(simpleTable, `WITH "numberedRowsForGetBottom" AS (
|
|
6
6
|
SELECT *, row_number() OVER () as "rowNumberForGetBottom" FROM ${quoteIdentifier(simpleTable.name)}${options.conditions ? ` WHERE ${options.conditions}` : ""}
|
|
7
7
|
)
|
|
8
8
|
SELECT * FROM "numberedRowsForGetBottom" ORDER BY "rowNumberForGetBottom" DESC LIMIT ${count};`, mergeOptions(simpleTable, {
|
|
9
9
|
table: simpleTable.name,
|
|
10
10
|
returnData: true,
|
|
11
|
-
method
|
|
11
|
+
method,
|
|
12
12
|
parameters: { count, options },
|
|
13
13
|
}));
|
|
14
14
|
if (!queryResult) {
|
package/esm/methods/getData.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export default function getData(simpleTable: SimpleTable, options?: {
|
|
|
3
3
|
columns?: string | string[];
|
|
4
4
|
conditions?: string;
|
|
5
5
|
limit?: number;
|
|
6
|
-
}): Promise<{
|
|
6
|
+
}, method?: "getData()" | "log()"): Promise<{
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
}[]>;
|
|
9
9
|
//# sourceMappingURL=getData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../src/methods/getData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAIvD,wBAA8B,OAAO,CACnC,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX;;
|
|
1
|
+
{"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../src/methods/getData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AAIvD,wBAA8B,OAAO,CACnC,WAAW,EAAE,WAAW,EACxB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX,EACN,MAAM,GAAE,WAAW,GAAG,OAAqB;;KAmC5C"}
|