@flowblade/sqlduck 0.36.1 → 0.36.3

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 CHANGED
@@ -2,20 +2,18 @@
2
2
 
3
3
  > Currently experimental
4
4
 
5
-
6
5
  - 🛡️ DuckDB table creation from Zod schemas.
7
6
  - 🧩 Easily ingest data from generators or async iterables.
8
7
 
9
-
10
8
  ## Quick start
11
9
 
12
10
  ### Create a database connection
13
11
 
14
12
  ```typescript
15
- import { DuckDBInstance } from '@duckdb/node-api';
13
+ import { DuckDBInstance } from "@duckdb/node-api";
16
14
  DuckDBInstance.create(undefined, {
17
- access_mode: 'READ_WRITE',
18
- max_memory: '512M',
15
+ access_mode: "READ_WRITE",
16
+ max_memory: "512M",
19
17
  });
20
18
  export const conn = await instance.connect();
21
19
  ```
@@ -29,50 +27,48 @@ import { conn } from "./db.config.ts";
29
27
 
30
28
  const dbManager = new DuckDatabaseManager(conn);
31
29
  const database = await dbManager.attach({
32
- type: 'memory', // can be 'filesystem', ...
33
- alias: 'mydb',
34
- options: { COMPRESS: 'false' },
30
+ type: "memory", // can be 'filesystem', ...
31
+ alias: "mydb",
32
+ options: { COMPRESS: "false" },
35
33
  });
36
34
 
37
35
  const sqlDuck = new SqlDuck({ conn });
38
36
 
39
37
  // Define a zod schema, it will be used to create the table
40
38
  const userSchema = z.object({
41
- id: z.int32().min(1).meta({ primaryKey: true }),
42
- name: z.string(),
39
+ id: z.int32().min(1).meta({ primaryKey: true }),
40
+ name: z.string(),
43
41
  });
44
42
 
45
43
  // Example of a datasource (can be generator, async generator, async iterable)
46
- async function* getUsers(): AsyncIterableIterator<
47
- z.infer<typeof userSchema>
48
- > {
49
- // database or api call
50
- yield { id: 1, name: 'John' };
51
- yield { id: 2, name: 'Jane' };
44
+ async function* getUsers(): AsyncIterableIterator<z.infer<typeof userSchema>> {
45
+ // database or api call
46
+ yield { id: 1, name: "John" };
47
+ yield { id: 2, name: "Jane" };
52
48
  }
53
49
 
54
50
  // Create a table from the schema and the datasource
55
51
  const result = await sqlDuck.toTable({
56
- table: new Table({ name: 'user', database: database.alias }),
57
- schema: userSchema, // The schema to use to create the table
58
- rowStream: getUsers(), // The async iterable that yields rows
59
- // 👇Optional:
60
- chunkSize: 2048, // Number of rows to append when using duckdb appender. Default is 2048
61
- onChunkAppended: ({ timeMs, totalRows, rowsPerSecond }) => {
62
- console.log(
63
- `Appended ${totalRows} in time ${timeMs}ms, est: ${rowsPerSecond} rows/s`
64
- );
65
- },
66
- // Optional table creation options
67
- createOptions: {
68
- create: 'CREATE_OR_REPLACE',
69
- },
52
+ table: new Table({ name: "user", database: database.alias }),
53
+ schema: userSchema, // The schema to use to create the table
54
+ rowStream: getUsers(), // The async iterable that yields rows
55
+ // 👇Optional:
56
+ chunkSize: 2048, // Number of rows to append when using duckdb appender. Default is 2048
57
+ onChunkAppended: ({ timeMs, totalRows, rowsPerSecond }) => {
58
+ console.log(
59
+ `Appended ${totalRows} in time ${timeMs}ms, est: ${rowsPerSecond} rows/s`
60
+ );
61
+ },
62
+ // Optional table creation options
63
+ createOptions: {
64
+ create: "CREATE_OR_REPLACE",
65
+ },
70
66
  });
71
67
 
72
68
  console.log(`Inserted ${result.totalRows} rows in ${result.timeMs}ms`);
73
69
  console.log(`Table created with DDL: ${result.createTableDDL}`);
74
70
 
75
- const reader = await conn.runAndReadAll('select * from mydb.user');
71
+ const reader = await conn.runAndReadAll("select * from mydb.user");
76
72
  const rows = reader.getRowObjectsJS();
77
73
  // [{id: 1, name: 'John'}, {id: 2, name: 'Jane'}]]
78
74
  ```
@@ -18,11 +18,21 @@ var FileSystemUtils = class {
18
18
  *
19
19
  * @throws Error if it can't be created
20
20
  */
21
- createDirectory = (path) => {
21
+ createDirectory = (path, recursive = true) => {
22
22
  try {
23
- fs.mkdirSync(path, { recursive: true });
23
+ fs.mkdirSync(path, { recursive });
24
+ this.#logger.debug(`Successfully created directory '${path}'`, {
25
+ path,
26
+ recursive: true
27
+ });
24
28
  } catch (err) {
25
- if (err.code !== "EEXIST") throw err;
29
+ if (err.code !== "EEXIST") {
30
+ this.#logger.warning(`Couldn't create directory '${path}': ${err}.message`, {
31
+ path,
32
+ recursive: true
33
+ });
34
+ throw err;
35
+ }
26
36
  }
27
37
  };
28
38
  /**
@@ -86,7 +96,7 @@ var FileSystemUtils = class {
86
96
  */
87
97
  isSamePath = (path1, path2) => {
88
98
  if (typeof path1 !== "string" || typeof path2 !== "string" || path1.trim().length === 0 || path2.trim().length === 0) return false;
89
- return path.resolve(path1) == path.resolve(path2);
99
+ return path.resolve(path1) === path.resolve(path2);
90
100
  };
91
101
  /**
92
102
  * Check whether two paths (file, directory...) exists and are identical by comparing their real paths.
@@ -10,7 +10,7 @@ declare class FileSystemUtils {
10
10
  *
11
11
  * @throws Error if it can't be created
12
12
  */
13
- createDirectory: (path: string) => void;
13
+ createDirectory: (path: string, recursive?: boolean) => void;
14
14
  /**
15
15
  * Create a directory recursively if it doesn't exist and ensure it's writable
16
16
  */
@@ -1,2 +1,2 @@
1
- import { t as FileSystemUtils } from "../file-system-utils-DT6smf4C.mjs";
1
+ import { t as FileSystemUtils } from "../file-system-utils-C7A41ZM2.mjs";
2
2
  export { FileSystemUtils };
@@ -8,9 +8,9 @@ declare const duckAllConnectionOptionsZodSchema: z.ZodObject<{
8
8
  compress: z.ZodOptional<z.ZodBoolean>;
9
9
  type: z.ZodOptional<z.ZodEnum<{
10
10
  DUCKDB: "DUCKDB";
11
- SQLITE: "SQLITE";
12
11
  MYSQL: "MYSQL";
13
12
  PostgreSQL: "PostgreSQL";
13
+ SQLITE: "SQLITE";
14
14
  }>>;
15
15
  blockSize: z.ZodOptional<z.ZodInt32>;
16
16
  rowGroupSize: z.ZodOptional<z.ZodInt32>;
@@ -36,9 +36,9 @@ declare const duckConnectionParamsZodSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
36
36
  compress: z.ZodOptional<z.ZodBoolean>;
37
37
  type: z.ZodOptional<z.ZodEnum<{
38
38
  DUCKDB: "DUCKDB";
39
- SQLITE: "SQLITE";
40
39
  MYSQL: "MYSQL";
41
40
  PostgreSQL: "PostgreSQL";
41
+ SQLITE: "SQLITE";
42
42
  }>>;
43
43
  blockSize: z.ZodOptional<z.ZodInt32>;
44
44
  rowGroupSize: z.ZodOptional<z.ZodInt32>;
@@ -65,9 +65,9 @@ declare const duckConnectionParamsZodSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
65
65
  compress: z.ZodOptional<z.ZodBoolean>;
66
66
  type: z.ZodOptional<z.ZodEnum<{
67
67
  DUCKDB: "DUCKDB";
68
- SQLITE: "SQLITE";
69
68
  MYSQL: "MYSQL";
70
69
  PostgreSQL: "PostgreSQL";
70
+ SQLITE: "SQLITE";
71
71
  }>>;
72
72
  blockSize: z.ZodOptional<z.ZodInt32>;
73
73
  rowGroupSize: z.ZodOptional<z.ZodInt32>;
@@ -103,7 +103,7 @@ declare const duckDsnZodSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<
103
103
  options?: {
104
104
  accessMode?: "READ_ONLY" | "READ_WRITE" | undefined;
105
105
  compress?: boolean | undefined;
106
- type?: "DUCKDB" | "SQLITE" | "MYSQL" | "PostgreSQL" | undefined;
106
+ type?: "DUCKDB" | "MYSQL" | "PostgreSQL" | "SQLITE" | undefined;
107
107
  blockSize?: number | undefined;
108
108
  rowGroupSize?: number | undefined;
109
109
  storageVersion?: string | undefined;
@@ -118,7 +118,7 @@ declare const duckDsnZodSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<
118
118
  options?: {
119
119
  accessMode?: "READ_ONLY" | "READ_WRITE" | undefined;
120
120
  compress?: boolean | undefined;
121
- type?: "DUCKDB" | "SQLITE" | "MYSQL" | "PostgreSQL" | undefined;
121
+ type?: "DUCKDB" | "MYSQL" | "PostgreSQL" | "SQLITE" | undefined;
122
122
  blockSize?: number | undefined;
123
123
  rowGroupSize?: number | undefined;
124
124
  storageVersion?: string | undefined;
@@ -137,9 +137,9 @@ declare const duckDsnZodSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<
137
137
  compress: z.ZodOptional<z.ZodBoolean>;
138
138
  type: z.ZodOptional<z.ZodEnum<{
139
139
  DUCKDB: "DUCKDB";
140
- SQLITE: "SQLITE";
141
140
  MYSQL: "MYSQL";
142
141
  PostgreSQL: "PostgreSQL";
142
+ SQLITE: "SQLITE";
143
143
  }>>;
144
144
  blockSize: z.ZodOptional<z.ZodInt32>;
145
145
  rowGroupSize: z.ZodOptional<z.ZodInt32>;
@@ -166,9 +166,9 @@ declare const duckDsnZodSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<
166
166
  compress: z.ZodOptional<z.ZodBoolean>;
167
167
  type: z.ZodOptional<z.ZodEnum<{
168
168
  DUCKDB: "DUCKDB";
169
- SQLITE: "SQLITE";
170
169
  MYSQL: "MYSQL";
171
170
  PostgreSQL: "PostgreSQL";
171
+ SQLITE: "SQLITE";
172
172
  }>>;
173
173
  blockSize: z.ZodOptional<z.ZodInt32>;
174
174
  rowGroupSize: z.ZodOptional<z.ZodInt32>;
@@ -208,7 +208,7 @@ declare const duckValidatorsZod: {
208
208
  };
209
209
  //#endregion
210
210
  //#region src/validation/zod/ensure-zod-table-schema.d.ts
211
- type TObject = Record<string, string | number | null | undefined | boolean | Date>;
211
+ type TObject = Record<string, string | number | null | undefined | boolean | Date | (string | number | null | boolean)[]>;
212
212
  declare const EXPLICIT_GENERIC_REQUIRED: unique symbol;
213
213
  type RequireExplicitGeneric = TObject & {
214
214
  [EXPLICIT_GENERIC_REQUIRED]: never;
@@ -247,12 +247,12 @@ type RequireExplicitGeneric = TObject & {
247
247
  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>;
248
248
  //#endregion
249
249
  //#region src/validation/zod/infer-zod-relaxed-data-schema.d.ts
250
- type MapRelaxedZodSchemaField<T extends z.ZodTypeAny> = T extends z.ZodDate ? string | Date : T extends z.ZodISODate ? string | Date : T extends z.ZodOptional<any> ? MapRelaxedZodSchemaField<T['_def']['innerType']> | undefined : T extends z.ZodNullable<any> ? MapRelaxedZodSchemaField<T['_def']['innerType']> | null : z.infer<T>;
250
+ type MapRelaxedZodSchemaField<T extends z.ZodTypeAny> = T extends z.ZodDate ? string | Date : T extends z.ZodISODate ? string | Date : T extends z.ZodOptional<any> ? MapRelaxedZodSchemaField<T["_def"]["innerType"]> | undefined : T extends z.ZodNullable<any> ? MapRelaxedZodSchemaField<T["_def"]["innerType"]> | null : z.infer<T>;
251
251
  /**
252
252
  * Add string type to all Date properties so it makes it an union between
253
253
  * Date | string
254
254
  */
255
- type InferZodRelaxedDataSchema<T extends z.ZodObject<any>> = { [K in keyof T['shape']]: MapRelaxedZodSchemaField<T['shape'][K]>; };
255
+ type InferZodRelaxedDataSchema<T extends z.ZodObject<any>> = { [K in keyof T["shape"]]: MapRelaxedZodSchemaField<T["shape"][K]>; };
256
256
  //#endregion
257
257
  //#region src/validation/zod/table-schema-zod.d.ts
258
258
  type ZodSchemaSupportedTypes = z.ZodString | z.ZodNumber | z.ZodInt | z.ZodInt32 | z.ZodUInt32 | z.ZodBigInt | z.ZodBoolean | z.ZodDate | z.ZodISODateTime | z.ZodISOTime | z.ZodISODate | z.ZodEmail | z.ZodURL | z.ZodUUID | z.ZodCUID | z.ZodCUID2 | z.ZodULID | z.ZodEnum | z.ZodArray;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { l as DuckConnectionParams, n as InferZodRelaxedDataSchema, t as TableSchemaZod } from "./index-Z9LfGsCV.mjs";
1
+ import { l as DuckConnectionParams, n as InferZodRelaxedDataSchema, t as TableSchemaZod } from "./index-BSjZdjW_.mjs";
2
2
  import { DuckDBConnection, DuckDBDecimalType, DuckDBListType, DuckDBType } from "@duckdb/node-api";
3
3
  import { Logger } from "@logtape/logtape";
4
4
  import * as z from "zod";
@@ -79,12 +79,12 @@ declare class Table {
79
79
  //#endregion
80
80
  //#region src/table/get-table-create-from-zod.d.ts
81
81
  type TableCreateOptions = {
82
- create?: 'CREATE' | 'CREATE_OR_REPLACE' | 'IF_NOT_EXISTS';
82
+ create?: "CREATE" | "CREATE_OR_REPLACE" | "IF_NOT_EXISTS";
83
83
  };
84
84
  type DuckdbColumnTypeMap<TKeys extends string> = Map<TKeys, DuckDBType>;
85
85
  type TableCreateFromZodResult<TSchema extends TableSchemaZod> = {
86
86
  ddl: string;
87
- columnTypes: DuckdbColumnTypeMap<Exclude<keyof TSchema['shape'], symbol | number>>;
87
+ columnTypes: DuckdbColumnTypeMap<Exclude<keyof TSchema["shape"], symbol | number>>;
88
88
  };
89
89
  type GetTableCreateFromZodParams<TSchema extends TableSchemaZod> = {
90
90
  table: Table;
@@ -279,7 +279,7 @@ declare const duckDatabaseManagerZodSchemas: {
279
279
  //#region src/manager/database/duck-database-manager.d.ts
280
280
  type GetDatabaseInfo = z.infer<typeof duckDatabaseManagerZodSchemas.getDatabases>;
281
281
  type AttachOptions = {
282
- behaviour: 'OR REPLACE';
282
+ behaviour: "OR REPLACE";
283
283
  /**
284
284
  * Since duckdb 1.5.4, the ATTACH OR REPLACE fails if the database is already attached.
285
285
  * If this option is set to true, when an attachOrReplace fails with the already attached
@@ -291,7 +291,7 @@ type AttachOptions = {
291
291
  */
292
292
  runDetachIfAttachOrReplaceFailWithAlreadyAttached?: boolean;
293
293
  } | {
294
- behaviour: 'IF NOT EXISTS';
294
+ behaviour: "IF NOT EXISTS";
295
295
  };
296
296
  declare class DuckDatabaseManager {
297
297
  #private;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as sqlduckDefaultLogtapeLogger, r as flowbladeLogtapeSqlduckConfig, t as FileSystemUtils } from "./file-system-utils-DT6smf4C.mjs";
1
+ import { n as sqlduckDefaultLogtapeLogger, r as flowbladeLogtapeSqlduckConfig, t as FileSystemUtils } from "./file-system-utils-C7A41ZM2.mjs";
2
2
  import { t as duckReservedKeywords } from "./duck-reserved-keywords-BzYA7jvN.mjs";
3
3
  import { c as duckValidatorsZod, r as assertValidAliasName, s as duckConnectionParamsZodSchema } from "./zod-DB5FHzXW.mjs";
4
4
  import { BIGINT, BOOLEAN, DATE, DECIMAL, DOUBLE, DuckDBDataChunk, DuckDBDateValue, DuckDBDecimalType, DuckDBDecimalValue, DuckDBInstanceCache, DuckDBListType, DuckDBTimestampMillisecondsValue, DuckDBTypeId, ENUM, FLOAT, HUGEINT, INTEGER, LIST, SMALLINT, TIMESTAMP, TIMESTAMP_MS, TINYINT, UBIGINT, UHUGEINT, UINTEGER, USMALLINT, UTINYINT, UUID, VARCHAR, listValue } from "@duckdb/node-api";
@@ -69,14 +69,14 @@ var DuckMemory = class {
69
69
  const { orderBy } = params ?? {};
70
70
  const query = this.#applyOrderBy(`SELECT tag, memory_usage_bytes, temporary_storage_bytes
71
71
  FROM duckdb_memory() as m`, orderBy);
72
- return (await this.#conn.run(query)).getRowObjectsJS();
72
+ return await (await this.#conn.run(query)).getRowObjectsJS();
73
73
  };
74
74
  getByTag = async (tag) => {
75
75
  if (!duckMemoryTags.includes(tag)) throw new Error(`Invalid DuckDB memory tag: ${tag}`);
76
76
  const query = `SELECT tag, memory_usage_bytes, temporary_storage_bytes
77
77
  FROM duckdb_memory() as m
78
78
  WHERE tag = '${tag}'`;
79
- return this.#exec.getOneRowObjectJS(query);
79
+ return await this.#exec.getOneRowObjectJS(query);
80
80
  };
81
81
  getSummary = async () => {
82
82
  const rows = await this.getAll();
@@ -483,13 +483,13 @@ var DuckDatabaseManager = class {
483
483
  * ```
484
484
  */
485
485
  attachOrReplace = async (dbParams, options) => {
486
- return this.attach(dbParams, {
486
+ return await this.attach(dbParams, {
487
487
  behaviour: "OR REPLACE",
488
488
  runDetachIfAttachOrReplaceFailWithAlreadyAttached: options?.runDetachIfAttachOrReplaceFailWithAlreadyAttached
489
489
  });
490
490
  };
491
491
  attachIfNotExists = async (dbParams) => {
492
- return this.attach(dbParams, { behaviour: "IF NOT EXISTS" });
492
+ return await this.attach(dbParams, { behaviour: "IF NOT EXISTS" });
493
493
  };
494
494
  /**
495
495
  * Check whether a specific database name / alias is currently attached
@@ -536,7 +536,7 @@ var DuckDatabaseManager = class {
536
536
  getDatabases = async (params) => {
537
537
  const { includeInternal = false } = params ?? {};
538
538
  const internalFilter = includeInternal ? "1=1" : "internal = false";
539
- return this.#executor.getRowObjectsJS("getDatabases", `select database_name,
539
+ return await this.#executor.getRowObjectsJS("getDatabases", `select database_name,
540
540
  database_oid,
541
541
  path,
542
542
  comment,
@@ -639,7 +639,7 @@ var DuckDatabaseManager = class {
639
639
  return { status: "created" };
640
640
  };
641
641
  #getFs = () => {
642
- if (this.#fs === void 0) this.#fs = new FileSystemUtils({ logger: this.#logger });
642
+ this.#fs ??= new FileSystemUtils({ logger: this.#logger });
643
643
  return this.#fs;
644
644
  };
645
645
  };
@@ -1016,7 +1016,7 @@ var SqlDuck = class {
1016
1016
  const isAsyncCb = onChunkAppended !== void 0 && isOnChunkAppendedAsyncCb(onChunkAppended);
1017
1017
  for await (const dataChunk of columnStream) {
1018
1018
  const chunk = DuckDBDataChunk.create(chunkTypes);
1019
- const columns = new Array(numColumns);
1019
+ const columns = Array.from({ length: numColumns });
1020
1020
  for (let i = 0; i < numColumns; i++) columns[i] = dataChunk[columnKeys[i]];
1021
1021
  totalRows += columns[0]?.length ?? 0;
1022
1022
  chunk.setColumns(columns);
@@ -7,7 +7,7 @@ type SqlTagInformation = {
7
7
  declare const compileDuckQuery: <T extends SelectQueryBuilder<any, any, any>>(query: T) => SqlTagInformation;
8
8
  //#endregion
9
9
  //#region src/integrations/kysely/create-duck-kysely-query-builder.d.ts
10
- type KyselyQueryBuilder<TDatabase> = Pick<Kysely<TDatabase>, 'mergeInto' | 'selectFrom' | 'selectNoFrom' | 'deleteFrom' | 'updateTable' | 'insertInto' | 'replaceInto' | 'with' | 'withRecursive' | 'withTables'>;
10
+ type KyselyQueryBuilder<TDatabase> = Pick<Kysely<TDatabase>, "mergeInto" | "selectFrom" | "selectNoFrom" | "deleteFrom" | "updateTable" | "insertInto" | "replaceInto" | "with" | "withRecursive" | "withTables">;
11
11
  declare const createDuckKysekyQueryBuilder: <TDatabase>(params?: {
12
12
  schema?: string;
13
13
  }) => KyselyQueryBuilder<TDatabase>;
@@ -50,7 +50,7 @@ declare const duckDsnValibotSchema: v.SchemaWithPipe<readonly [v.StringSchema<un
50
50
  options?: {
51
51
  accessMode?: "READ_ONLY" | "READ_WRITE" | undefined;
52
52
  compress?: boolean | undefined;
53
- type?: "DUCKDB" | "SQLITE" | "MYSQL" | "PostgreSQL" | undefined;
53
+ type?: "DUCKDB" | "MYSQL" | "PostgreSQL" | "SQLITE" | undefined;
54
54
  blockSize?: number | undefined;
55
55
  rowGroupSize?: number | undefined;
56
56
  storageVersion?: string | undefined;
@@ -65,7 +65,7 @@ declare const duckDsnValibotSchema: v.SchemaWithPipe<readonly [v.StringSchema<un
65
65
  options?: {
66
66
  accessMode?: "READ_ONLY" | "READ_WRITE" | undefined;
67
67
  compress?: boolean | undefined;
68
- type?: "DUCKDB" | "SQLITE" | "MYSQL" | "PostgreSQL" | undefined;
68
+ type?: "DUCKDB" | "MYSQL" | "PostgreSQL" | "SQLITE" | undefined;
69
69
  blockSize?: number | undefined;
70
70
  rowGroupSize?: number | undefined;
71
71
  storageVersion?: string | undefined;
@@ -1,2 +1,2 @@
1
- import { a as duckDsnZodSchema, c as assertValidTableName, d as duckConnectionParamsZodSchema, i as duckValidatorsZod, n as InferZodRelaxedDataSchema, o as assertValidAliasName, r as ensureZodTableSchema, s as assertValidSchemaName, t as TableSchemaZod, u as duckAllConnectionOptionsZodSchema } from "../../index-Z9LfGsCV.mjs";
1
+ import { a as duckDsnZodSchema, c as assertValidTableName, d as duckConnectionParamsZodSchema, i as duckValidatorsZod, n as InferZodRelaxedDataSchema, o as assertValidAliasName, r as ensureZodTableSchema, s as assertValidSchemaName, t as TableSchemaZod, u as duckAllConnectionOptionsZodSchema } from "../../index-BSjZdjW_.mjs";
2
2
  export { type InferZodRelaxedDataSchema, type TableSchemaZod, assertValidAliasName, assertValidSchemaName, assertValidTableName, duckAllConnectionOptionsZodSchema, duckConnectionParamsZodSchema, duckDsnZodSchema, duckValidatorsZod, ensureZodTableSchema };
package/package.json CHANGED
@@ -1,41 +1,56 @@
1
1
  {
2
2
  "name": "@flowblade/sqlduck",
3
- "version": "0.36.1",
3
+ "version": "0.36.3",
4
+ "homepage": "https://github.com/belgattitude/flowblade",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Vanvelthem Sébastien",
8
+ "url": "https://github.com/belgattitude"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/belgattitude/flowblade.git",
13
+ "directory": "packages/sqlduck"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
4
18
  "type": "module",
5
19
  "sideEffects": false,
20
+ "imports": {
21
+ "#/tests/data/*": "./tests/data/*",
22
+ "#/tests/utils/*": "./tests/utils/*"
23
+ },
6
24
  "exports": {
7
25
  ".": {
26
+ "flowblade-monorepo-source": "./src/index.ts",
8
27
  "types": "./dist/index.d.mts",
9
28
  "default": "./dist/index.mjs"
10
29
  },
11
30
  "./filesystem": {
31
+ "flowblade-monorepo-source": "./src/filesystem/index.ts",
12
32
  "types": "./dist/filesystem/index.d.mts",
13
33
  "default": "./dist/filesystem/index.mjs"
14
34
  },
15
35
  "./zod": {
36
+ "flowblade-monorepo-source": "./src/zod/index.ts",
16
37
  "types": "./dist/validation/zod/index.d.mts",
17
38
  "default": "./dist/validation/zod/index.mjs"
18
39
  },
19
40
  "./valibot": {
41
+ "flowblade-monorepo-source": "./src/valibot/index.ts",
20
42
  "types": "./dist/validation/valibot/index.d.mts",
21
43
  "default": "./dist/validation/valibot/index.mjs"
22
44
  },
23
45
  "./kysely": {
46
+ "flowblade-monorepo-source": "./src/kysely/index.ts",
24
47
  "types": "./dist/integrations/kysely/index.d.mts",
25
48
  "default": "./dist/integrations/kysely/index.mjs"
26
49
  },
27
50
  "./package.json": "./package.json"
28
51
  },
29
- "author": {
30
- "name": "Vanvelthem Sébastien",
31
- "url": "https://github.com/belgattitude"
32
- },
33
- "license": "MIT",
34
- "homepage": "https://github.com/belgattitude/flowblade",
35
- "repository": {
36
- "type": "git",
37
- "url": "git+https://github.com/belgattitude/flowblade.git",
38
- "directory": "packages/sqlduck"
52
+ "publishConfig": {
53
+ "directory": "_release/package"
39
54
  },
40
55
  "scripts": {
41
56
  "clean": "rimraf ./dist ./coverage ./tsconfig.tsbuildinfo",
@@ -58,12 +73,14 @@
58
73
  "test-e2e": "vitest -c vitest.e2e.config.ts run",
59
74
  "test-e2e-bun": "bun --bun run vitest -c vitest.e2e.config.ts run",
60
75
  "test-e2e-watch": "vitest -c vitest.e2e.config.ts --ui",
61
- "typecheck": "tsgo --project tsconfig.json --noEmit",
62
- "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mjs,.cjs,.mts,.cts --cache --cache-location ../../../.cache/eslint/sqlduck.eslintcache",
63
- "fix-staged": "lint-staged --allow-empty",
76
+ "typecheck": "tsc --project tsconfig.json --noEmit",
77
+ "lint": "ultracite check",
78
+ "lint-fix": "ultracite fix",
64
79
  "check-dist": "es-check --config=.escheckrc.json",
65
80
  "check-pub": "publint",
66
- "check-size-disabled": "size-limit"
81
+ "check-size-disabled": "size-limit",
82
+ "check": "ultracite check",
83
+ "fix": "ultracite fix"
67
84
  },
68
85
  "dependencies": {
69
86
  "@flowblade/core": "^0.2.29",
@@ -78,21 +95,7 @@
78
95
  "p-queue": "^9.3.3",
79
96
  "zod": "^4.4.3"
80
97
  },
81
- "peerDependencies": {
82
- "@duckdb/node-api": "^1.5.3-r.2",
83
- "kysely": "^0.29.0",
84
- "valibot": "^1.3.1"
85
- },
86
- "peerDependenciesMeta": {
87
- "kysely": {
88
- "optional": true
89
- },
90
- "valibot": {
91
- "optional": true
92
- }
93
- },
94
98
  "devDependencies": {
95
- "@belgattitude/eslint-config-bases": "8.19.1",
96
99
  "@dotenvx/dotenvx": "2.21.0",
97
100
  "@duckdb/node-api": "1.5.5-r.4",
98
101
  "@faker-js/faker": "10.6.0",
@@ -104,9 +107,6 @@
104
107
  "@testcontainers/mssqlserver": "12.1.0",
105
108
  "@total-typescript/ts-reset": "0.6.1",
106
109
  "@types/node": "26.2.0",
107
- "@typescript-eslint/eslint-plugin": "8.67.0",
108
- "@typescript-eslint/parser": "8.67.0",
109
- "@typescript/native-preview": "7.0.0-dev.20260707.2",
110
110
  "@vitest/coverage-v8": "4.1.11",
111
111
  "@vitest/ui": "4.1.11",
112
112
  "ansis": "4.3.1",
@@ -114,15 +114,17 @@
114
114
  "core-js": "3.50.0",
115
115
  "cross-env": "10.1.0",
116
116
  "es-check": "9.6.4",
117
- "es-toolkit": "1.50.0",
117
+ "es-toolkit": "1.51.0",
118
118
  "esbuild": "0.28.2",
119
- "eslint": "8.57.1",
119
+ "eslint-plugin-sonarjs": "^4.2.0",
120
120
  "execa": "10.0.1",
121
121
  "is-in-ci": "2.0.0",
122
122
  "kysely": "0.29.5",
123
123
  "mitata": "1.0.34",
124
124
  "npm-run-all2": "9.0.3",
125
- "prettier": "3.9.6",
125
+ "oxfmt": "0.64.0",
126
+ "oxlint": "1.79.0",
127
+ "oxlint-tsgolint": "7.0.2001",
126
128
  "publint": "0.3.23",
127
129
  "regexp.escape": "2.0.1",
128
130
  "rimraf": "6.1.3",
@@ -135,14 +137,22 @@
135
137
  "tsx": "4.23.12",
136
138
  "typedoc": "0.28.20",
137
139
  "typedoc-plugin-markdown": "4.12.0",
138
- "typescript": "6.0.3",
140
+ "typescript": "7.0.2",
141
+ "ultracite": "7.10.6",
139
142
  "valibot": "1.4.2",
140
143
  "vitest": "4.1.11"
141
144
  },
142
- "files": [
143
- "dist"
144
- ],
145
- "publishConfig": {
146
- "directory": "_release/package"
145
+ "peerDependencies": {
146
+ "@duckdb/node-api": "^1.5.3-r.2",
147
+ "kysely": "^0.29.0",
148
+ "valibot": "^1.3.1"
149
+ },
150
+ "peerDependenciesMeta": {
151
+ "kysely": {
152
+ "optional": true
153
+ },
154
+ "valibot": {
155
+ "optional": true
156
+ }
147
157
  }
148
158
  }