@flowblade/sqlduck 0.17.0 → 0.17.2
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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as duckReservedKeywords } from "./duck-reserved-keywords-B8XUjnaY.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as duckValidatorsZod, r as assertValidAliasName, s as duckConnectionParamsZodSchema } from "./zod-D87TPB5c.mjs";
|
|
3
3
|
import { BIGINT, BOOLEAN, DOUBLE, DuckDBDataChunk, DuckDBInstanceCache, DuckDBTimestampMillisecondsValue, DuckDBTypeId, ENUM, FLOAT, HUGEINT, INTEGER, SMALLINT, TIMESTAMP, TIMESTAMP_MS, TINYINT, UBIGINT, UHUGEINT, UINTEGER, USMALLINT, UTINYINT, UUID, VARCHAR } from "@duckdb/node-api";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -109,4 +109,43 @@ declare const duckValidatorsZod: {
|
|
|
109
109
|
readonly tableName: z.ZodString;
|
|
110
110
|
};
|
|
111
111
|
//#endregion
|
|
112
|
-
|
|
112
|
+
//#region src/validation/zod/ensure-zod-table-schema.d.ts
|
|
113
|
+
type TObject = Record<string, string | number | null | undefined | boolean | Date>;
|
|
114
|
+
declare const EXPLICIT_GENERIC_REQUIRED: unique symbol;
|
|
115
|
+
type RequireExplicitGeneric = TObject & {
|
|
116
|
+
[EXPLICIT_GENERIC_REQUIRED]: never;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Helper to ensure a zod table schema is compatible with the provided type definition
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* import { ensureZodTableSchema } from '@flowblade/sqlduck/zod';
|
|
124
|
+
*
|
|
125
|
+
* type Row = {
|
|
126
|
+
* aNumber: number;
|
|
127
|
+
* aString: string;
|
|
128
|
+
* aNullableNumber: number | null;
|
|
129
|
+
* aNullableString: string | null;
|
|
130
|
+
* aBoolean: boolean;
|
|
131
|
+
* aNullableBoolean: boolean | null;
|
|
132
|
+
* aDate: Date;
|
|
133
|
+
* aNullableDate: Date | null;
|
|
134
|
+
* };
|
|
135
|
+
*
|
|
136
|
+
* const schema = ensureZodTableSchema<Row>(z.strictObject({
|
|
137
|
+
* aNumber: z.number(),
|
|
138
|
+
* aString: z.string(),
|
|
139
|
+
* aNullableNumber: z.nullable(z.number()),
|
|
140
|
+
* aNullableString: z.nullable(z.string()),
|
|
141
|
+
* aBoolean: z.boolean(),
|
|
142
|
+
* aNullableBoolean: z.nullable(z.boolean()),
|
|
143
|
+
* aDate: z.date(),
|
|
144
|
+
* aNullableDate: z.nullable(z.date()),
|
|
145
|
+
* }));
|
|
146
|
+
*
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare const ensureZodTableSchema: <T extends TObject = RequireExplicitGeneric>(schema: z.ZodObject<{ [K in keyof NoInfer<T>]-?: z.ZodType<NoInfer<T>[K]> }>) => z.ZodObject<{ [K in keyof NoInfer<T>]-?: z.ZodType<NoInfer<T>[K], unknown, z.core.$ZodTypeInternals<NoInfer<T>[K], unknown>> }, z.core.$strip>;
|
|
150
|
+
//#endregion
|
|
151
|
+
export { assertValidAliasName, assertValidSchemaName, assertValidTableName, duckAllConnectionOptionsZodSchema, duckConnectionParamsZodSchema, duckDsnZodSchema, duckValidatorsZod, ensureZodTableSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { assertValidAliasName, assertValidSchemaName, assertValidTableName, duckAllConnectionOptionsZodSchema, duckConnectionParamsZodSchema, duckDsnZodSchema, duckValidatorsZod };
|
|
1
|
+
import { a as assertValidTableName, c as duckValidatorsZod, i as assertValidSchemaName, n as duckDsnZodSchema, o as duckAllConnectionOptionsZodSchema, r as assertValidAliasName, s as duckConnectionParamsZodSchema, t as ensureZodTableSchema } from "../../zod-D87TPB5c.mjs";
|
|
2
|
+
export { assertValidAliasName, assertValidSchemaName, assertValidTableName, duckAllConnectionOptionsZodSchema, duckConnectionParamsZodSchema, duckDsnZodSchema, duckValidatorsZod, ensureZodTableSchema };
|
|
@@ -96,4 +96,40 @@ const duckDsnZodSchema = z.string().pipe(z.preprocess((dsn, ctx) => {
|
|
|
96
96
|
}
|
|
97
97
|
}, duckConnectionParamsZodSchema));
|
|
98
98
|
//#endregion
|
|
99
|
-
|
|
99
|
+
//#region src/validation/zod/ensure-zod-table-schema.ts
|
|
100
|
+
/**
|
|
101
|
+
* Helper to ensure a zod table schema is compatible with the provided type definition
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { ensureZodTableSchema } from '@flowblade/sqlduck/zod';
|
|
106
|
+
*
|
|
107
|
+
* type Row = {
|
|
108
|
+
* aNumber: number;
|
|
109
|
+
* aString: string;
|
|
110
|
+
* aNullableNumber: number | null;
|
|
111
|
+
* aNullableString: string | null;
|
|
112
|
+
* aBoolean: boolean;
|
|
113
|
+
* aNullableBoolean: boolean | null;
|
|
114
|
+
* aDate: Date;
|
|
115
|
+
* aNullableDate: Date | null;
|
|
116
|
+
* };
|
|
117
|
+
*
|
|
118
|
+
* const schema = ensureZodTableSchema<Row>(z.strictObject({
|
|
119
|
+
* aNumber: z.number(),
|
|
120
|
+
* aString: z.string(),
|
|
121
|
+
* aNullableNumber: z.nullable(z.number()),
|
|
122
|
+
* aNullableString: z.nullable(z.string()),
|
|
123
|
+
* aBoolean: z.boolean(),
|
|
124
|
+
* aNullableBoolean: z.nullable(z.boolean()),
|
|
125
|
+
* aDate: z.date(),
|
|
126
|
+
* aNullableDate: z.nullable(z.date()),
|
|
127
|
+
* }));
|
|
128
|
+
*
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
const ensureZodTableSchema = (schema) => {
|
|
132
|
+
return schema;
|
|
133
|
+
};
|
|
134
|
+
//#endregion
|
|
135
|
+
export { assertValidTableName as a, duckValidatorsZod as c, assertValidSchemaName as i, duckDsnZodSchema as n, duckAllConnectionOptionsZodSchema as o, assertValidAliasName as r, duckConnectionParamsZodSchema as s, ensureZodTableSchema as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowblade/sqlduck",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"check-size-disabled": "size-limit"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@flowblade/core": "^0.2.
|
|
60
|
-
"@flowblade/source-duckdb": "^0.20.
|
|
61
|
-
"@flowblade/sql-tag": "^0.3.
|
|
59
|
+
"@flowblade/core": "^0.2.28",
|
|
60
|
+
"@flowblade/source-duckdb": "^0.20.5",
|
|
61
|
+
"@flowblade/sql-tag": "^0.3.3",
|
|
62
62
|
"@httpx/assert": "^0.16.9",
|
|
63
63
|
"@httpx/dsn-parser": "^1.9.9",
|
|
64
|
-
"@httpx/plain-object": "^2.1.
|
|
64
|
+
"@httpx/plain-object": "^2.1.9",
|
|
65
65
|
"@logtape/logtape": "^2.0.5",
|
|
66
66
|
"@standard-schema/spec": "^1.1.0",
|
|
67
67
|
"is-safe-filename": "0.1.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"zod": "^4.3.6"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@duckdb/node-api": "^1.5.
|
|
72
|
+
"@duckdb/node-api": "^1.5.2-r.1",
|
|
73
73
|
"valibot": "^1.3.1"
|
|
74
74
|
},
|
|
75
75
|
"peerDependenciesMeta": {
|
|
@@ -78,21 +78,21 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@belgattitude/eslint-config-bases": "8.
|
|
81
|
+
"@belgattitude/eslint-config-bases": "8.13.0",
|
|
82
82
|
"@dotenvx/dotenvx": "1.61.0",
|
|
83
|
-
"@duckdb/node-api": "1.5.
|
|
83
|
+
"@duckdb/node-api": "1.5.2-r.1",
|
|
84
84
|
"@faker-js/faker": "10.4.0",
|
|
85
|
-
"@flowblade/source-kysely": "^1.3.
|
|
85
|
+
"@flowblade/source-kysely": "^1.3.3",
|
|
86
86
|
"@httpx/assert": "0.16.9",
|
|
87
87
|
"@mitata/counters": "0.0.8",
|
|
88
|
-
"@size-limit/esbuild": "12.0
|
|
89
|
-
"@size-limit/file": "12.0
|
|
88
|
+
"@size-limit/esbuild": "12.1.0",
|
|
89
|
+
"@size-limit/file": "12.1.0",
|
|
90
90
|
"@testcontainers/mssqlserver": "11.14.0",
|
|
91
91
|
"@total-typescript/ts-reset": "0.6.1",
|
|
92
|
-
"@types/node": "25.
|
|
93
|
-
"@typescript-eslint/eslint-plugin": "8.58.
|
|
94
|
-
"@typescript-eslint/parser": "8.58.
|
|
95
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
92
|
+
"@types/node": "25.6.0",
|
|
93
|
+
"@typescript-eslint/eslint-plugin": "8.58.2",
|
|
94
|
+
"@typescript-eslint/parser": "8.58.2",
|
|
95
|
+
"@typescript/native-preview": "7.0.0-dev.20260415.1",
|
|
96
96
|
"@vitest/coverage-v8": "4.1.4",
|
|
97
97
|
"@vitest/ui": "4.1.4",
|
|
98
98
|
"ansis": "4.2.0",
|
|
@@ -108,18 +108,18 @@
|
|
|
108
108
|
"kysely": "0.28.16",
|
|
109
109
|
"mitata": "1.0.34",
|
|
110
110
|
"npm-run-all2": "8.0.4",
|
|
111
|
-
"prettier": "3.8.
|
|
111
|
+
"prettier": "3.8.3",
|
|
112
112
|
"publint": "0.3.18",
|
|
113
113
|
"regexp.escape": "2.0.1",
|
|
114
114
|
"rimraf": "6.1.3",
|
|
115
|
-
"size-limit": "12.0
|
|
115
|
+
"size-limit": "12.1.0",
|
|
116
116
|
"sql-formatter": "15.7.3",
|
|
117
117
|
"tarn": "3.0.2",
|
|
118
118
|
"tedious": "19.2.1",
|
|
119
119
|
"testcontainers": "11.14.0",
|
|
120
|
-
"tsdown": "0.21.
|
|
120
|
+
"tsdown": "0.21.9",
|
|
121
121
|
"tsx": "4.21.0",
|
|
122
|
-
"typedoc": "0.28.
|
|
122
|
+
"typedoc": "0.28.19",
|
|
123
123
|
"typedoc-plugin-markdown": "4.11.0",
|
|
124
124
|
"typescript": "6.0.2",
|
|
125
125
|
"valibot": "1.3.1",
|