@flowblade/sqlduck 0.5.0 → 0.6.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/dist/index.cjs +3 -3
- package/dist/index.d.cts +7 -8
- package/dist/index.d.mts +7 -8
- package/dist/index.mjs +3 -3
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -59,14 +59,14 @@ const createOnDataAppendedCollector = () => {
|
|
|
59
59
|
return (currentTotalRows) => {
|
|
60
60
|
const cbTimeMs = Math.round(Date.now() - lastCallbackTimeStart);
|
|
61
61
|
const cbTotalRows = currentTotalRows - appendedTotalRows;
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const stats = {
|
|
63
|
+
totalRows: currentTotalRows,
|
|
64
64
|
timeMs: cbTimeMs,
|
|
65
65
|
rowsPerSecond: Math.round(cbTotalRows / cbTimeMs * 1e3)
|
|
66
66
|
};
|
|
67
67
|
appendedTotalRows = currentTotalRows;
|
|
68
68
|
lastCallbackTimeStart = Date.now();
|
|
69
|
-
return
|
|
69
|
+
return stats;
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
const createMap = {
|
package/dist/index.d.cts
CHANGED
|
@@ -3,22 +3,22 @@ import * as z from "zod";
|
|
|
3
3
|
import { ZodObject } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/appender/data-appender-callback.d.ts
|
|
6
|
-
type
|
|
6
|
+
type OnDataAppendedStats = {
|
|
7
7
|
/**
|
|
8
|
-
* Total number of rows appended so far
|
|
8
|
+
* Total number of rows appended so far (all batches included)
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
totalRows: number;
|
|
11
11
|
/**
|
|
12
12
|
* Time taken to append the last batch in milliseconds
|
|
13
13
|
*/
|
|
14
14
|
timeMs: number;
|
|
15
15
|
/**
|
|
16
|
-
* Estimated rows per seconds
|
|
16
|
+
* Estimated rows per seconds based on the current batch
|
|
17
17
|
*/
|
|
18
18
|
rowsPerSecond: number;
|
|
19
19
|
};
|
|
20
|
-
type OnDataAppendedSyncCb = (
|
|
21
|
-
type OnDataAppendedAsyncCb = (
|
|
20
|
+
type OnDataAppendedSyncCb = (stats: OnDataAppendedStats) => void;
|
|
21
|
+
type OnDataAppendedAsyncCb = (stats: OnDataAppendedStats) => Promise<void>;
|
|
22
22
|
type OnDataAppendedCb = OnDataAppendedSyncCb | OnDataAppendedAsyncCb;
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/table/table.d.ts
|
|
@@ -140,7 +140,6 @@ declare class SqlDuck {
|
|
|
140
140
|
* onDataAppended: ({ total }) => {
|
|
141
141
|
* console.log(`Appended ${total} rows so far`);
|
|
142
142
|
* },
|
|
143
|
-
* onDataAppendedBatchSize: 4096, // Call onDataAppended every 4096 rows
|
|
144
143
|
* createOptions: {
|
|
145
144
|
* create: 'CREATE_OR_REPLACE',
|
|
146
145
|
* },
|
|
@@ -159,4 +158,4 @@ declare const zodCodecs: {
|
|
|
159
158
|
readonly bigintToString: z.ZodCodec<z.ZodBigInt, z.ZodString>;
|
|
160
159
|
};
|
|
161
160
|
//#endregion
|
|
162
|
-
export { SqlDuck, type SqlDuckParams, Table, getTableCreateFromZod, zodCodecs };
|
|
161
|
+
export { type OnDataAppendedCb, type OnDataAppendedStats, SqlDuck, type SqlDuckParams, Table, type ToTableParams, getTableCreateFromZod, zodCodecs };
|
package/dist/index.d.mts
CHANGED
|
@@ -3,22 +3,22 @@ import * as z from "zod";
|
|
|
3
3
|
import { ZodObject } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/appender/data-appender-callback.d.ts
|
|
6
|
-
type
|
|
6
|
+
type OnDataAppendedStats = {
|
|
7
7
|
/**
|
|
8
|
-
* Total number of rows appended so far
|
|
8
|
+
* Total number of rows appended so far (all batches included)
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
totalRows: number;
|
|
11
11
|
/**
|
|
12
12
|
* Time taken to append the last batch in milliseconds
|
|
13
13
|
*/
|
|
14
14
|
timeMs: number;
|
|
15
15
|
/**
|
|
16
|
-
* Estimated rows per seconds
|
|
16
|
+
* Estimated rows per seconds based on the current batch
|
|
17
17
|
*/
|
|
18
18
|
rowsPerSecond: number;
|
|
19
19
|
};
|
|
20
|
-
type OnDataAppendedSyncCb = (
|
|
21
|
-
type OnDataAppendedAsyncCb = (
|
|
20
|
+
type OnDataAppendedSyncCb = (stats: OnDataAppendedStats) => void;
|
|
21
|
+
type OnDataAppendedAsyncCb = (stats: OnDataAppendedStats) => Promise<void>;
|
|
22
22
|
type OnDataAppendedCb = OnDataAppendedSyncCb | OnDataAppendedAsyncCb;
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/table/table.d.ts
|
|
@@ -140,7 +140,6 @@ declare class SqlDuck {
|
|
|
140
140
|
* onDataAppended: ({ total }) => {
|
|
141
141
|
* console.log(`Appended ${total} rows so far`);
|
|
142
142
|
* },
|
|
143
|
-
* onDataAppendedBatchSize: 4096, // Call onDataAppended every 4096 rows
|
|
144
143
|
* createOptions: {
|
|
145
144
|
* create: 'CREATE_OR_REPLACE',
|
|
146
145
|
* },
|
|
@@ -159,4 +158,4 @@ declare const zodCodecs: {
|
|
|
159
158
|
readonly bigintToString: z.ZodCodec<z.ZodBigInt, z.ZodString>;
|
|
160
159
|
};
|
|
161
160
|
//#endregion
|
|
162
|
-
export { SqlDuck, type SqlDuckParams, Table, getTableCreateFromZod, zodCodecs };
|
|
161
|
+
export { type OnDataAppendedCb, type OnDataAppendedStats, SqlDuck, type SqlDuckParams, Table, type ToTableParams, getTableCreateFromZod, zodCodecs };
|
package/dist/index.mjs
CHANGED
|
@@ -38,14 +38,14 @@ const createOnDataAppendedCollector = () => {
|
|
|
38
38
|
return (currentTotalRows) => {
|
|
39
39
|
const cbTimeMs = Math.round(Date.now() - lastCallbackTimeStart);
|
|
40
40
|
const cbTotalRows = currentTotalRows - appendedTotalRows;
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const stats = {
|
|
42
|
+
totalRows: currentTotalRows,
|
|
43
43
|
timeMs: cbTimeMs,
|
|
44
44
|
rowsPerSecond: Math.round(cbTotalRows / cbTimeMs * 1e3)
|
|
45
45
|
};
|
|
46
46
|
appendedTotalRows = currentTotalRows;
|
|
47
47
|
lastCallbackTimeStart = Date.now();
|
|
48
|
-
return
|
|
48
|
+
return stats;
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
const createMap = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowblade/sqlduck",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@flowblade/core": "^0.2.25",
|
|
52
|
-
"@flowblade/source-duckdb": "^0.17.
|
|
53
|
-
"@flowblade/sql-tag": "^0.
|
|
52
|
+
"@flowblade/source-duckdb": "^0.17.3",
|
|
53
|
+
"@flowblade/sql-tag": "^0.3.0",
|
|
54
54
|
"@standard-schema/spec": "^1.1.0",
|
|
55
55
|
"p-mutex": "^1.0.0",
|
|
56
56
|
"valibot": "^1.2.0",
|
|
@@ -64,18 +64,18 @@
|
|
|
64
64
|
"@dotenvx/dotenvx": "1.51.4",
|
|
65
65
|
"@duckdb/node-api": "1.4.3-r.3",
|
|
66
66
|
"@faker-js/faker": "10.2.0",
|
|
67
|
-
"@flowblade/source-kysely": "^1.2.
|
|
67
|
+
"@flowblade/source-kysely": "^1.2.1",
|
|
68
68
|
"@httpx/assert": "0.16.7",
|
|
69
69
|
"@size-limit/esbuild": "12.0.0",
|
|
70
70
|
"@size-limit/file": "12.0.0",
|
|
71
71
|
"@testcontainers/mssqlserver": "11.11.0",
|
|
72
72
|
"@total-typescript/ts-reset": "0.6.1",
|
|
73
73
|
"@traversable/zod": "0.0.57",
|
|
74
|
-
"@types/node": "25.0.
|
|
75
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
76
|
-
"@typescript-eslint/parser": "8.
|
|
77
|
-
"@vitest/coverage-v8": "4.0.
|
|
78
|
-
"@vitest/ui": "4.0.
|
|
74
|
+
"@types/node": "25.0.6",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "8.53.0",
|
|
76
|
+
"@typescript-eslint/parser": "8.53.0",
|
|
77
|
+
"@vitest/coverage-v8": "4.0.17",
|
|
78
|
+
"@vitest/ui": "4.0.17",
|
|
79
79
|
"ansis": "4.2.0",
|
|
80
80
|
"browserslist-to-esbuild": "2.1.1",
|
|
81
81
|
"core-js": "3.47.0",
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
"tarn": "3.0.2",
|
|
97
97
|
"tedious": "19.2.0",
|
|
98
98
|
"testcontainers": "11.11.0",
|
|
99
|
-
"tsdown": "0.
|
|
99
|
+
"tsdown": "0.19.0",
|
|
100
100
|
"tsx": "4.21.0",
|
|
101
101
|
"typedoc": "0.28.15",
|
|
102
102
|
"typedoc-plugin-markdown": "4.9.0",
|
|
103
103
|
"typescript": "5.9.3",
|
|
104
|
-
"vite-tsconfig-paths": "6.0.
|
|
105
|
-
"vitest": "4.0.
|
|
104
|
+
"vite-tsconfig-paths": "6.0.4",
|
|
105
|
+
"vitest": "4.0.17"
|
|
106
106
|
},
|
|
107
107
|
"files": [
|
|
108
108
|
"dist"
|