mutano 1.1.0 → 2.1.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.
Files changed (4) hide show
  1. package/README.md +412 -33
  2. package/dist/main.d.ts +70 -14
  3. package/dist/main.js +579 -96
  4. package/package.json +31 -29
package/README.md CHANGED
@@ -1,13 +1,22 @@
1
- # mutano
1
+ # Mutano
2
2
 
3
- Converts Prisma/MySQL/PostgreSQL/SQLite schemas to Zod interfaces
3
+ Converts Prisma/MySQL/PostgreSQL/SQLite schemas to Zod schemas, TypeScript interfaces, or Kysely type definitions
4
+
5
+ ## Features
6
+
7
+ - Generates Zod schemas, Typescript interfaces or Kysely type definitions for MySQL, PostgreSQL, SQLite, and Prisma schemas
8
+ - Supports camelCase conversion
9
+ - Handles nullable, default, auto-increment and enum fields
10
+ - Supports custom type overrides via configuration or database comments
11
+ - Intelligently handles field nullability based on operation type (table, insertable, updateable, selectable)
12
+ - All fields in updateable schemas are automatically made optional
4
13
 
5
14
  ## Installation
6
15
 
7
16
  Install `mutano` with npm
8
17
 
9
18
  ```bash
10
- npm install mutano --save-dev
19
+ npm install mutano
11
20
  ```
12
21
 
13
22
  ## Usage/Examples
@@ -17,17 +26,72 @@ Create user table:
17
26
  ```sql
18
27
  CREATE TABLE `user` (
19
28
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
20
- `name` varchar(255) NOT NULL COMMENT '@zod(z.string().min(10).max(255))', -- this will override the type
29
+ `name` varchar(255) NOT NULL COMMENT '@zod(z.string().min(10).max(255))', -- this will override the Zod type
21
30
  `username` varchar(255) NOT NULL,
22
31
  `password` varchar(255) NOT NULL,
23
32
  `profile_picture` varchar(255) DEFAULT NULL,
33
+ `metadata` json NOT NULL COMMENT '@ts(Record<string, unknown>)', -- this will override the TypeScript type
24
34
  `role` enum('admin','user') NOT NULL,
25
35
  PRIMARY KEY (`id`)
26
36
  );
27
37
  ```
28
38
  Use the mutano API:
29
39
 
30
- ### MySQL Example
40
+ ### MySQL Example with Zod Schemas
41
+
42
+ ```typescript
43
+ import { generate } from 'mutano'
44
+
45
+ await generate({
46
+ origin: {
47
+ type: 'mysql',
48
+ host: '127.0.0.1',
49
+ port: 3306,
50
+ user: 'root',
51
+ password: 'secret',
52
+ database: 'myapp',
53
+ overrideTypes: {
54
+ json: 'z.record(z.string())'
55
+ }
56
+ },
57
+ destinations: [{
58
+ type: 'zod',
59
+ useDateType: true,
60
+ useTrim: false,
61
+ nullish: false, // When true, nullable fields use nullish() instead of nullable()
62
+ folder: './generated',
63
+ suffix: 'schema'
64
+ }]
65
+ })
66
+ ```
67
+
68
+ ### MySQL Example with TypeScript Type Aliases (Instead of Interfaces)
69
+
70
+ ```typescript
71
+ import { generate } from 'mutano'
72
+
73
+ await generate({
74
+ origin: {
75
+ type: 'mysql',
76
+ host: '127.0.0.1',
77
+ port: 3306,
78
+ user: 'root',
79
+ password: 'secret',
80
+ database: 'myapp',
81
+ overrideTypes: {
82
+ json: 'z.record(z.string())'
83
+ }
84
+ },
85
+ destinations: [{
86
+ type: 'ts',
87
+ modelType: 'type', // Generate TypeScript type aliases instead of interfaces
88
+ folder: './types',
89
+ suffix: 'types'
90
+ }]
91
+ })
92
+ ```
93
+
94
+ ### MySQL Example with Custom Header for TypeScript
31
95
 
32
96
  ```typescript
33
97
  import { generate } from 'mutano'
@@ -44,9 +108,92 @@ await generate({
44
108
  json: 'z.record(z.string())'
45
109
  }
46
110
  },
111
+ destinations: [{
112
+ type: 'ts',
113
+ header: "import type { CustomType } from './types';\nimport type { BaseModel } from './models';"
114
+ }]
47
115
  })
48
116
  ```
49
117
 
118
+ ### MySQL Example with Custom Header for Zod
119
+
120
+ ```typescript
121
+ import { generate } from 'mutano'
122
+
123
+ await generate({
124
+ origin: {
125
+ type: 'mysql',
126
+ host: '127.0.0.1',
127
+ port: 3306,
128
+ user: 'root',
129
+ password: 'secret',
130
+ database: 'myapp',
131
+ overrideTypes: {
132
+ json: 'z.record(z.string())'
133
+ }
134
+ },
135
+ destinations: [{
136
+ type: 'zod',
137
+ header: "import { z } from 'zod';\nimport { CustomValidator } from './validators';"
138
+ }]
139
+ })
140
+ ```
141
+
142
+ ### MySQL Example with Kysely Type Definitions (Custom Schema Name)
143
+
144
+ ```typescript
145
+ import { generate } from 'mutano'
146
+
147
+ await generate({
148
+ origin: {
149
+ type: 'mysql',
150
+ host: '127.0.0.1',
151
+ port: 3306,
152
+ user: 'root',
153
+ password: 'secret',
154
+ database: 'myapp',
155
+ overrideTypes: {
156
+ json: 'z.record(z.string())'
157
+ }
158
+ },
159
+ destinations: [{
160
+ type: 'kysely',
161
+ schemaName: 'Database', // Default is 'DB'
162
+ header: "import { Generated, ColumnType } from 'kysely';\nimport { CustomTypes } from './types';",
163
+ folder: './db/types',
164
+ suffix: 'db'
165
+ }]
166
+ })
167
+ ```
168
+
169
+ ### Example with Dry Run Option
170
+
171
+ ```typescript
172
+ import { generate } from 'mutano'
173
+
174
+ // Generate without writing to disk
175
+ const output = await generate({
176
+ origin: {
177
+ type: 'mysql',
178
+ host: '127.0.0.1',
179
+ port: 3306,
180
+ user: 'root',
181
+ password: 'secret',
182
+ database: 'myapp'
183
+ },
184
+ destinations: [{
185
+ type: 'zod'
186
+ }],
187
+ dryRun: true // Return content instead of writing to files
188
+ })
189
+
190
+ // Output is an object where keys are filenames and values are file content
191
+ console.log(Object.keys(output)) // ['user.ts', 'product.ts', ...]
192
+
193
+ // You can access the content for a specific file
194
+ console.log(output['user.ts'])
195
+ ```
196
+
50
197
  ### PostgreSQL Example
51
198
 
52
199
  ```typescript
@@ -65,6 +212,10 @@ await generate({
65
212
  jsonb: 'z.record(z.string())'
66
213
  }
67
214
  },
215
+ destinations: [{
216
+ type: 'zod',
217
+ useDateType: true
218
+ }]
68
219
  })
69
220
  ```
70
221
 
@@ -81,13 +232,59 @@ await generate({
81
232
  json: 'z.record(z.string())'
82
233
  }
83
234
  },
235
+ destinations: [{
236
+ type: 'ts'
237
+ }]
238
+ })
239
+ ```
240
+
241
+ ### Example with Multiple Destinations
242
+
243
+ ```typescript
244
+ import { generate } from 'mutano'
245
+
246
+ await generate({
247
+ origin: {
248
+ type: 'mysql',
249
+ host: '127.0.0.1',
250
+ port: 3306,
251
+ user: 'root',
252
+ password: 'secret',
253
+ database: 'myapp',
254
+ overrideTypes: {
255
+ json: 'z.record(z.string())'
256
+ }
257
+ },
258
+ destinations: [
259
+ {
260
+ type: 'zod',
261
+ useDateType: true,
262
+ folder: './generated/zod',
263
+ suffix: 'schema'
264
+ },
265
+ {
266
+ type: 'ts',
267
+ folder: './generated/types',
268
+ suffix: 'type'
269
+ },
270
+ {
271
+ type: 'kysely',
272
+ folder: './generated/kysely',
273
+ suffix: 'db'
274
+ }
275
+ ]
84
276
  })
85
277
  ```
86
278
 
87
- The generator will create a `user.ts` file with the following contents:
279
+ This will generate all three types of output files for each table in your database, placing them in separate folders with appropriate suffixes.
280
+
281
+ The generator will create `user.type.ts`, `user.schema.ts`, and `user.db.ts` files with the following contents:
282
+
283
+ ### Zod Schema Output Example with Custom Header
88
284
 
89
285
  ```typescript
90
- import z from 'zod'
286
+ import { z } from 'zod';
287
+ import { CustomValidator } from './validators';
91
288
 
92
289
  export const user = z.object({
93
290
  id: z.number().nonnegative(),
@@ -107,16 +304,16 @@ export const insertable_user = z.object({
107
304
  })
108
305
 
109
306
  export const updateable_user = z.object({
110
- name: z.string().min(10).max(255),
111
- username: z.string(),
112
- password: z.string(),
113
- profile_picture: z.string().nullable(),
114
- role: z.enum(['admin', 'user']),
307
+ name: z.string().min(10).max(255).optional(),
308
+ username: z.string().optional(),
309
+ password: z.string().optional(),
310
+ profile_picture: z.string().nullable().optional(),
311
+ role: z.enum(['admin', 'user']).optional(),
115
312
  })
116
313
 
117
314
  export const selectable_user = z.object({
118
315
  id: z.number().nonnegative(),
119
- name: z.string().min(10).max(255),
316
+ name: z.string(),
120
317
  username: z.string(),
121
318
  password: z.string(),
122
319
  profile_picture: z.string().nullable(),
@@ -129,6 +326,95 @@ export type UpdateableUserType = z.infer<typeof updateable_user>
129
326
  export type SelectableUserType = z.infer<typeof selectable_user>
130
327
  ```
131
328
 
329
+ ### TypeScript Interface Output Example with Custom Header
330
+
331
+ ```typescript
332
+ import { CustomType } from './types';
333
+ import { BaseModel } from './models';
334
+
335
+ // TypeScript interfaces for user
336
+
337
+ export interface User {
338
+ id: number;
339
+ name: string;
340
+ username: string;
341
+ password: string;
342
+ profile_picture: string | null;
343
+ metadata: Record<string, unknown>; // Custom type from @ts comment
344
+ role: 'admin' | 'user';
345
+ }
346
+
347
+ export interface InsertableUser {
348
+ name: string | null; // Optional because it has a default value
349
+ username: string;
350
+ password: string;
351
+ profile_picture: string | null;
352
+ metadata: Record<string, unknown>; // Custom type from @ts comment
353
+ role: 'admin' | 'user';
354
+ }
355
+
356
+ export interface UpdateableUser {
357
+ name: string | null; // Optional for updates
358
+ username: string | null; // Optional for updates
359
+ password: string | null; // Optional for updates
360
+ profile_picture: string | null;
361
+ metadata: Record<string, unknown> | null; // Custom type from @ts comment, optional for updates
362
+ role: 'admin' | 'user' | null; // Optional for updates
363
+ }
364
+
365
+ export interface SelectableUser {
366
+ id: number;
367
+ name: string;
368
+ username: string;
369
+ password: string;
370
+ profile_picture: string | null;
371
+ metadata: Record<string, unknown>; // Custom type from @ts comment
372
+ role: 'admin' | 'user';
373
+ }
374
+ ```
375
+
376
+ ### Kysely Type Definitions Output Example
377
+
378
+ ```typescript
379
+ import { Generated, ColumnType, Selectable, Insertable, Updateable } from 'kysely';
380
+
381
+ // JSON type definitions
382
+ export type Json = ColumnType<JsonValue, string, string>;
383
+
384
+ export type JsonArray = JsonValue[];
385
+
386
+ export type JsonObject = {
387
+ [x: string]: JsonValue | undefined;
388
+ };
389
+
390
+ export type JsonPrimitive = boolean | number | string | null;
391
+
392
+ export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
393
+
394
+ // Kysely type definitions for user
395
+
396
+ // This interface defines the structure of the 'user' table
397
+ export interface UserTable {
398
+ id: Generated<number>;
399
+ name: string;
400
+ username: string;
401
+ password: string;
402
+ profile_picture: string | null;
403
+ metadata: Json;
404
+ role: 'admin' | 'user';
405
+ }
406
+
407
+ // Define the database interface
408
+ export interface DB {
409
+ user: UserTable;
410
+ }
411
+
412
+ // Use these types for inserting, selecting and updating the table
413
+ export type User = Selectable<UserTable>;
414
+ export type NewUser = Insertable<UserTable>;
415
+ export type UserUpdate = Updateable<UserTable>;
416
+ ```
417
+
132
418
  ## Config
133
419
 
134
420
  ```json
@@ -177,40 +463,66 @@ export type SelectableUserType = z.infer<typeof selectable_user>
177
463
  "Json": "z.record(z.string())"
178
464
  }
179
465
  },
466
+ "destinations": [
467
+ {
468
+ "type": "zod",
469
+ "useDateType": true,
470
+ "useTrim": false,
471
+ "nullish": false, // When true, nullable fields use nullish() instead of nullable()
472
+ "requiredString": false, // When true, adds min(1) validation to non-nullable string fields
473
+ "header": "import { z } from 'zod';\nimport { CustomValidator } from './validators';",
474
+ "folder": "@zod",
475
+ "suffix": "table"
476
+ },
477
+ {
478
+ "type": "ts",
479
+ "enumType": "union",
480
+ "modelType": "interface",
481
+ "header": "import { CustomType } from './types';\nimport { BaseModel } from './models';",
482
+ "folder": "types",
483
+ "suffix": "type"
484
+ },
485
+ {
486
+ "type": "kysely",
487
+ "schemaName": "Database",
488
+ "header": "import { Generated, ColumnType } from 'kysely';\nimport { CustomTypes } from './types';",
489
+ "folder": "kysely",
490
+ "suffix": "db"
491
+ }
492
+ ],
180
493
  "tables": ["user", "log"],
181
494
  "ignore": ["log", "/^temp/"],
182
- "folder": "@zod",
183
- "suffix": "table",
184
495
  "camelCase": false,
185
- "nullish": false,
186
- "requiredString": false,
187
- "useTrim": false,
188
- "useDateType": false,
189
496
  "silent": false,
190
- "zodCommentTypes": true,
191
- "overrideTypes": {
192
- "tinyint": "z.boolean()"
193
- }
497
+ "dryRun": false,
498
+ "magicComments": true
194
499
  }
195
500
  ```
196
501
 
197
502
  | Option | Description |
198
503
  | ------ | ----------- |
199
- | tables | Filter the tables to include only those specified. |
200
- | ignore | Filter the tables to exclude those specified. If a table name begins and ends with "/", it will be processed as a regular expression. |
201
- | folder | Specify the output directory. |
202
- | suffix | Suffix to the name of a generated file. (eg: `user.table.ts`) |
504
+ | destinations | An array of destination configurations to generate multiple output formats from a single origin |
505
+ | destinations[].type | The type of output to generate: "zod", "ts", or "kysely" |
506
+ | destinations[].useDateType | (Zod only) Use a specialized Zod type for date-like fields instead of string |
507
+ | destinations[].useTrim | (Zod only) Use `z.string().trim()` instead of `z.string()` |
508
+ | destinations[].nullish | (Zod only) Use `nullish()` instead of `nullable()` for nullable fields. In updateable schemas, fields that were already nullable will become nullish |
509
+ | destinations[].requiredString | (Zod only) Add `min(1)` for non-nullable string fields |
510
+ | destinations[].enumType | (TypeScript only) How to represent enum types: "union" (default) or "enum" |
511
+ | destinations[].modelType | (TypeScript only) How to represent models: "interface" (default) or "type" |
512
+ | destinations[].schemaName | (Kysely only) Name of the database interface (default: "DB") |
513
+ | destinations[].header | Custom header to include at the beginning of generated files (e.g., custom imports) |
514
+ | destinations[].folder | Specify the output directory for the generated files |
515
+ | destinations[].suffix | Suffix to the name of a generated file (eg: `user.table.ts`) |
516
+ | tables | Filter the tables to include only those specified |
517
+ | ignore | Filter the tables to exclude those specified. If a table name begins and ends with "/", it will be processed as a regular expression |
203
518
  | camelCase | Convert all table names and their properties to camelcase. (eg: `profile_picture` becomes `profilePicture`) |
204
- | nullish | Set schema as `nullish` instead of `nullable` |
205
- | requiredString | Add `min(1)` for string schema |
206
- | useDateType | Use a specialized Zod type for date-like fields instead of string
207
- | useTrim | Use `z.string().trim()` instead of `z.string()` |
208
519
  | silent | Don't log anything to the console |
209
- | magicComments | Use @zod comment to override entire type (unsupported by SQLite) |
520
+ | dryRun | When true, doesn't write files to disk but returns an object with filenames as keys and generated content as values |
521
+ | magicComments | Use @zod and @ts comments to override types (unsupported by SQLite) |
210
522
 
211
523
  ## overrideTypes
212
524
 
213
- You can override the default Zod type for a specific column type. This is specific to each database type and is placed inside the origin object. Each database type has its own set of valid types that can be overridden:
525
+ You can override the default type for a specific column type. This is specific to each database type and is placed inside the origin object. Each database type has its own set of valid types that can be overridden:
214
526
 
215
527
  ### MySQL overrideTypes
216
528
 
@@ -279,4 +591,71 @@ You can override the default Zod type for a specific column type. This is specif
279
591
  }
280
592
  }
281
593
  }
594
+ ```
595
+
596
+ ## Magic Comments
597
+
598
+ ### @zod Comments
599
+
600
+ You can use the `@zod` comment to override the Zod type for a specific column. This is useful when you want to add custom validation or transformation to a field.
601
+
602
+ ```sql
603
+ CREATE TABLE `user` (
604
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
605
+ `name` varchar(255) NOT NULL COMMENT '@zod(z.string().min(10).max(255))',
606
+ `email` varchar(255) NOT NULL COMMENT '@zod(z.string().email())',
607
+ PRIMARY KEY (`id`)
608
+ );
609
+ ```
610
+
611
+ This will generate:
612
+
613
+ ```typescript
614
+ export const user = z.object({
615
+ id: z.number().nonnegative(),
616
+ name: z.string().min(10).max(255),
617
+ email: z.string().email(),
618
+ })
619
+ ```
620
+
621
+ ### @ts Comments
622
+
623
+ You can use the `@ts` comment to override the TypeScript type for a specific column. This is useful when you want to specify a more precise type for a field.
624
+
625
+ ```sql
626
+ CREATE TABLE `user` (
627
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
628
+ `metadata` json NOT NULL COMMENT '@ts(Record<string, unknown>)',
629
+ `settings` json NOT NULL COMMENT '@ts(UserSettings)',
630
+ PRIMARY KEY (`id`)
631
+ );
632
+ ```
633
+
634
+ This will generate:
635
+
636
+ ```typescript
637
+ export interface User {
638
+ id: number;
639
+ metadata: Record<string, unknown>;
640
+ settings: UserSettings;
641
+ }
642
+ ```
643
+
644
+ You can use complex TypeScript types in the `@ts` comment:
645
+
646
+ ```sql
647
+ CREATE TABLE `product` (
648
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
649
+ `variants` json NOT NULL COMMENT '@ts(Array<{ id: string; price: number; stock: number }>)',
650
+ PRIMARY KEY (`id`)
651
+ );
652
+ ```
653
+
654
+ This will generate:
655
+
656
+ ```typescript
657
+ export interface Product {
658
+ id: number;
659
+ variants: Array<{ id: string; price: number; stock: number }>;
660
+ }
282
661
  ```
package/dist/main.d.ts CHANGED
@@ -1,6 +1,22 @@
1
- export declare function getType(op: 'table' | 'insertable' | 'updateable' | 'selectable', desc: Desc, config: Config): string;
2
- export declare function generate(config: Config): Promise<string[]>;
3
- type ValidTypes = 'date' | 'datetime' | 'timestamp' | 'time' | 'year' | 'char' | 'varchar' | 'tinytext' | 'text' | 'mediumtext' | 'longtext' | 'json' | 'decimal' | 'tinyint' | 'smallint' | 'mediumint' | 'int' | 'bigint' | 'float' | 'double';
1
+ export declare function getType(op: 'table' | 'insertable' | 'updateable' | 'selectable', desc: Desc, config: Config, destination: Destination, tableName?: string): string;
2
+ export interface GenerateContentParams {
3
+ table: string;
4
+ describes: Desc[];
5
+ config: Config;
6
+ destination: Destination;
7
+ isCamelCase: boolean;
8
+ enumDeclarations: Record<string, string[]>;
9
+ defaultZodHeader: string;
10
+ defaultKyselyHeader: string;
11
+ }
12
+ export declare function generateContent({ table, describes, config, destination, isCamelCase, enumDeclarations, defaultZodHeader, defaultKyselyHeader, }: GenerateContentParams): string;
13
+ export declare const defaultKyselyHeader = "import { Generated, ColumnType, Selectable, Insertable, Updateable } from 'kysely';\n\n";
14
+ export declare const defaultZodHeader = "import { z } from 'zod';\n\n";
15
+ export declare function generate(config: Config): Promise<string[] | Record<string, string>>;
16
+ type MySQLValidTypes = 'date' | 'datetime' | 'timestamp' | 'time' | 'year' | 'char' | 'varchar' | 'tinytext' | 'text' | 'mediumtext' | 'longtext' | 'json' | 'decimal' | 'tinyint' | 'smallint' | 'mediumint' | 'int' | 'bigint' | 'float' | 'double' | 'enum';
17
+ type PostgresValidTypes = 'date' | 'timestamp' | 'timestamptz' | 'timestamp without time zone' | 'timestamp with time zone' | 'time' | 'timetz' | 'interval' | 'character' | 'varchar' | 'character varying' | 'text' | 'json' | 'jsonb' | 'uuid' | 'name' | 'citext' | 'numeric' | 'decimal' | 'smallint' | 'integer' | 'bigint' | 'real' | 'double precision' | 'serial' | 'bigserial' | 'boolean' | 'bool' | 'USER-DEFINED';
18
+ type SQLiteValidTypes = 'datetime' | 'text' | 'character' | 'varchar' | 'varying character' | 'nchar' | 'native character' | 'nvarchar' | 'clob' | 'json' | 'int' | 'integer' | 'tinyint' | 'smallint' | 'mediumint' | 'bigint' | 'unsigned big int' | 'int2' | 'int8' | 'real' | 'double' | 'double precision' | 'float' | 'numeric' | 'decimal' | 'boolean';
19
+ type PrismaValidTypes = 'DateTime' | 'String' | 'Decimal' | 'BigInt' | 'Bytes' | 'Json' | 'Int' | 'Float' | 'Boolean' | 'Enum';
4
20
  export interface Desc {
5
21
  Field: string;
6
22
  Default: string | null;
@@ -10,10 +26,36 @@ export interface Desc {
10
26
  Null: 'YES' | 'NO';
11
27
  Comment: string;
12
28
  }
29
+ export type Destination = {
30
+ type: 'zod';
31
+ header?: string;
32
+ useDateType?: boolean;
33
+ useTrim?: boolean;
34
+ nullish?: boolean;
35
+ requiredString?: boolean;
36
+ folder?: string;
37
+ suffix?: string;
38
+ } | {
39
+ type: 'ts';
40
+ header?: string;
41
+ enumType?: 'enum' | 'union';
42
+ modelType?: 'interface' | 'type';
43
+ folder?: string;
44
+ suffix?: string;
45
+ } | {
46
+ type: 'kysely';
47
+ header?: string;
48
+ schemaName?: string;
49
+ folder?: string;
50
+ suffix?: string;
51
+ };
13
52
  export interface Config {
14
53
  origin: {
15
54
  type: 'prisma';
16
55
  path: string;
56
+ overrideTypes?: {
57
+ [k in PrismaValidTypes]?: string;
58
+ };
17
59
  } | {
18
60
  type: 'mysql';
19
61
  host: string;
@@ -21,21 +63,35 @@ export interface Config {
21
63
  user: string;
22
64
  password: string;
23
65
  database: string;
66
+ overrideTypes?: {
67
+ [k in MySQLValidTypes]?: string;
68
+ };
69
+ ssl?: Record<string, any>;
70
+ } | {
71
+ type: 'postgres';
72
+ host: string;
73
+ port: number;
74
+ user: string;
75
+ password: string;
76
+ database: string;
77
+ schema?: string;
78
+ overrideTypes?: {
79
+ [k in PostgresValidTypes]?: string;
80
+ };
81
+ ssl?: Record<string, any>;
82
+ } | {
83
+ type: 'sqlite';
84
+ path: string;
85
+ overrideTypes?: {
86
+ [k in SQLiteValidTypes]?: string;
87
+ };
24
88
  };
89
+ destinations: Destination[];
25
90
  tables?: string[];
26
91
  ignore?: string[];
27
- folder?: string;
28
- suffix?: string;
29
92
  camelCase?: boolean;
30
- nullish?: boolean;
31
- requiredString?: boolean;
32
- useDateType?: boolean;
33
- useTrim?: boolean;
34
93
  silent?: boolean;
35
- zodCommentTypes?: boolean;
36
- ssl?: Record<string, any>;
37
- overrideTypes?: {
38
- [k in ValidTypes]?: string;
39
- };
94
+ dryRun?: boolean;
95
+ magicComments?: boolean;
40
96
  }
41
97
  export {};