@flowblade/sqlduck 0.2.1 → 0.3.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 -2
- package/dist/index.d.cts +6 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -126,7 +126,7 @@ var SqlDuck = class {
|
|
|
126
126
|
toTable = async (params) => {
|
|
127
127
|
const { table, schema, chunkSize, rowStream, createOptions } = params;
|
|
128
128
|
const timeStart = Date.now();
|
|
129
|
-
const { columnTypes } = await createTableFromZod({
|
|
129
|
+
const { columnTypes, ddl } = await createTableFromZod({
|
|
130
130
|
conn: this.#duck,
|
|
131
131
|
schema,
|
|
132
132
|
table,
|
|
@@ -147,7 +147,8 @@ var SqlDuck = class {
|
|
|
147
147
|
}
|
|
148
148
|
return {
|
|
149
149
|
timeMs: Math.round(Date.now() - timeStart),
|
|
150
|
-
totalRows
|
|
150
|
+
totalRows,
|
|
151
|
+
createTableDDL: ddl
|
|
151
152
|
};
|
|
152
153
|
};
|
|
153
154
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -53,14 +53,18 @@ type ToTableParams<TSchema extends TableSchemaZod> = {
|
|
|
53
53
|
chunkSize?: number;
|
|
54
54
|
createOptions?: TableCreateOptions;
|
|
55
55
|
};
|
|
56
|
-
type
|
|
56
|
+
type ToTableResult = {
|
|
57
57
|
timeMs: number;
|
|
58
58
|
totalRows: number;
|
|
59
|
+
/**
|
|
60
|
+
* The DDL statement used to create the table.
|
|
61
|
+
*/
|
|
62
|
+
createTableDDL: string;
|
|
59
63
|
};
|
|
60
64
|
declare class SqlDuck {
|
|
61
65
|
#private;
|
|
62
66
|
constructor(params: SqlDuckParams);
|
|
63
|
-
toTable: <TSchema extends ZodObject>(params: ToTableParams<TSchema>) => Promise<
|
|
67
|
+
toTable: <TSchema extends ZodObject>(params: ToTableParams<TSchema>) => Promise<ToTableResult>;
|
|
64
68
|
}
|
|
65
69
|
//#endregion
|
|
66
70
|
//#region src/utils/zod-codecs.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -53,14 +53,18 @@ type ToTableParams<TSchema extends TableSchemaZod> = {
|
|
|
53
53
|
chunkSize?: number;
|
|
54
54
|
createOptions?: TableCreateOptions;
|
|
55
55
|
};
|
|
56
|
-
type
|
|
56
|
+
type ToTableResult = {
|
|
57
57
|
timeMs: number;
|
|
58
58
|
totalRows: number;
|
|
59
|
+
/**
|
|
60
|
+
* The DDL statement used to create the table.
|
|
61
|
+
*/
|
|
62
|
+
createTableDDL: string;
|
|
59
63
|
};
|
|
60
64
|
declare class SqlDuck {
|
|
61
65
|
#private;
|
|
62
66
|
constructor(params: SqlDuckParams);
|
|
63
|
-
toTable: <TSchema extends ZodObject>(params: ToTableParams<TSchema>) => Promise<
|
|
67
|
+
toTable: <TSchema extends ZodObject>(params: ToTableParams<TSchema>) => Promise<ToTableResult>;
|
|
64
68
|
}
|
|
65
69
|
//#endregion
|
|
66
70
|
//#region src/utils/zod-codecs.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ var SqlDuck = class {
|
|
|
105
105
|
toTable = async (params) => {
|
|
106
106
|
const { table, schema, chunkSize, rowStream, createOptions } = params;
|
|
107
107
|
const timeStart = Date.now();
|
|
108
|
-
const { columnTypes } = await createTableFromZod({
|
|
108
|
+
const { columnTypes, ddl } = await createTableFromZod({
|
|
109
109
|
conn: this.#duck,
|
|
110
110
|
schema,
|
|
111
111
|
table,
|
|
@@ -126,7 +126,8 @@ var SqlDuck = class {
|
|
|
126
126
|
}
|
|
127
127
|
return {
|
|
128
128
|
timeMs: Math.round(Date.now() - timeStart),
|
|
129
|
-
totalRows
|
|
129
|
+
totalRows,
|
|
130
|
+
createTableDDL: ddl
|
|
130
131
|
};
|
|
131
132
|
};
|
|
132
133
|
};
|