drizzle-kit 0.20.14-95be75d → 0.20.14-a183d8b

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,211 @@
1
- export type CollusionCheckOutput = {
2
- success: boolean;
3
- message?: string;
4
- action: "config" | "cli" | "error";
5
- };
6
- export type Commands = "push:sqlite" | "introspect:sqlite" | "introspect:pg" | "generate" | "check:pg" | "check:mysql" | "check:sqlite" | "up:pg" | "up:mysql" | "up:sqlite" | "drop" | "introspect:mysql" | "push:mysql" | "push:pg";
1
+ import { TypeOf } from "zod";
2
+ export type Commands = "introspect:sqlite" | "introspect:pg" | "generate" | "check:pg" | "check:mysql" | "check:sqlite" | "up:pg" | "up:mysql" | "up:sqlite" | "drop" | "introspect:mysql" | "push";
7
3
  /**
8
4
  * This function checks an input from a user and if there are any params together with config path - return true
9
5
  * @param options - user input
10
6
  * @param inputWhitelist - whitelist some cli options that can be used together with config option
11
7
  * @returns true if there was a collision, false if everything is valid
12
8
  */
13
- export declare const checkCollisions: (options: Record<string, unknown>, command: Commands, inputWhitelist?: string[]) => CollusionCheckOutput;
9
+ export declare const assertCollisions: (options: Record<string, unknown>, command: Commands, inputWhitelist?: string[]) => "config" | "cli";
10
+ export declare const driver: import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">, import("zod").ZodLiteral<"pg">, import("zod").ZodLiteral<"mysql2">]>;
11
+ export declare const configCommonSchema: import("zod").ZodObject<{
12
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
13
+ schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
14
+ out: import("zod").ZodOptional<import("zod").ZodString>;
15
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
16
+ driver: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">, import("zod").ZodLiteral<"pg">, import("zod").ZodLiteral<"mysql2">]>>;
17
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
18
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
19
+ }, "strip", import("zod").ZodTypeAny, {
20
+ out?: string | undefined;
21
+ driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
22
+ tablesFilter?: string | string[] | undefined;
23
+ schema: string | string[];
24
+ dialect: "mysql" | "pg" | "sqlite";
25
+ breakpoints: boolean;
26
+ schemaFilter: string | string[];
27
+ }, {
28
+ out?: string | undefined;
29
+ breakpoints?: boolean | undefined;
30
+ driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
31
+ tablesFilter?: string | string[] | undefined;
32
+ schemaFilter?: string | string[] | undefined;
33
+ schema: string | string[];
34
+ dialect: "mysql" | "pg" | "sqlite";
35
+ }>;
36
+ export declare const introspectCasing: import("zod").ZodDefault<import("zod").ZodObject<{
37
+ casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
38
+ }, "strip", import("zod").ZodTypeAny, {
39
+ casing: "camel" | "preserve";
40
+ }, {
41
+ casing?: "camel" | "preserve" | undefined;
42
+ }>>;
43
+ export declare const configIntrospectSchema: import("zod").ZodObject<{
44
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
45
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
46
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
47
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
48
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
49
+ introspect: import("zod").ZodDefault<import("zod").ZodObject<{
50
+ casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
51
+ }, "strip", import("zod").ZodTypeAny, {
52
+ casing: "camel" | "preserve";
53
+ }, {
54
+ casing?: "camel" | "preserve" | undefined;
55
+ }>>;
56
+ }, "strip", import("zod").ZodTypeAny, {
57
+ schema?: string | string[] | undefined;
58
+ tablesFilter?: string | string[] | undefined;
59
+ out: string;
60
+ breakpoints: boolean;
61
+ schemaFilter: string | string[];
62
+ introspect: {
63
+ casing: "camel" | "preserve";
64
+ };
65
+ }, {
66
+ schema?: string | string[] | undefined;
67
+ out?: string | undefined;
68
+ breakpoints?: boolean | undefined;
69
+ tablesFilter?: string | string[] | undefined;
70
+ schemaFilter?: string | string[] | undefined;
71
+ introspect?: {
72
+ casing?: "camel" | "preserve" | undefined;
73
+ } | undefined;
74
+ }>;
75
+ export type ConfigIntrospectSchema = TypeOf<typeof configIntrospectSchema>;
76
+ export type ConfigIntrospectCasing = TypeOf<typeof introspectCasing>;
77
+ export declare const configIntrospectCliSchema: import("zod").ZodObject<{
78
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
79
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
80
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
81
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
82
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
83
+ introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
84
+ }, "strip", import("zod").ZodTypeAny, {
85
+ schema?: string | string[] | undefined;
86
+ tablesFilter?: string | string[] | undefined;
87
+ out: string;
88
+ breakpoints: boolean;
89
+ schemaFilter: string | string[];
90
+ introspectCasing: "camel" | "preserve";
91
+ }, {
92
+ schema?: string | string[] | undefined;
93
+ out?: string | undefined;
94
+ breakpoints?: boolean | undefined;
95
+ tablesFilter?: string | string[] | undefined;
96
+ schemaFilter?: string | string[] | undefined;
97
+ introspectCasing?: "camel" | "preserve" | undefined;
98
+ }>;
99
+ export declare const configGenerateSchema: import("zod").ZodObject<{
100
+ schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
101
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
102
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
103
+ }, "strip", import("zod").ZodTypeAny, {
104
+ schema: string | string[];
105
+ out: string;
106
+ breakpoints: boolean;
107
+ }, {
108
+ out?: string | undefined;
109
+ breakpoints?: boolean | undefined;
110
+ schema: string | string[];
111
+ }>;
112
+ export type GenerateSchema = TypeOf<typeof configGenerateSchema>;
113
+ export declare const configPushSchema: import("zod").ZodObject<{
114
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
115
+ schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
116
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
117
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
118
+ verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
119
+ strict: import("zod").ZodDefault<import("zod").ZodBoolean>;
120
+ }, "strip", import("zod").ZodTypeAny, {
121
+ tablesFilter?: string | string[] | undefined;
122
+ strict: boolean;
123
+ schema: string | string[];
124
+ dialect: "mysql" | "pg" | "sqlite";
125
+ schemaFilter: string | string[];
126
+ verbose: boolean;
127
+ }, {
128
+ strict?: boolean | undefined;
129
+ tablesFilter?: string | string[] | undefined;
130
+ schemaFilter?: string | string[] | undefined;
131
+ verbose?: boolean | undefined;
132
+ schema: string | string[];
133
+ dialect: "mysql" | "pg" | "sqlite";
134
+ }>;
135
+ export declare const mysqlConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
136
+ host: import("zod").ZodString;
137
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
138
+ user: import("zod").ZodDefault<import("zod").ZodString>;
139
+ password: import("zod").ZodOptional<import("zod").ZodString>;
140
+ database: import("zod").ZodString;
141
+ }, "strip", import("zod").ZodTypeAny, {
142
+ port?: number | undefined;
143
+ password?: string | undefined;
144
+ host: string;
145
+ user: string;
146
+ database: string;
147
+ }, {
148
+ port?: number | undefined;
149
+ user?: string | undefined;
150
+ password?: string | undefined;
151
+ host: string;
152
+ database: string;
153
+ }>, import("zod").ZodObject<{
154
+ connectionString: import("zod").ZodString;
155
+ }, "strip", import("zod").ZodTypeAny, {
156
+ connectionString: string;
157
+ }, {
158
+ connectionString: string;
159
+ }>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>;
160
+ export declare const mySqlCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
161
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
162
+ schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
163
+ out: import("zod").ZodOptional<import("zod").ZodString>;
164
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
165
+ driver: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">, import("zod").ZodLiteral<"pg">, import("zod").ZodLiteral<"mysql2">]>>;
166
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
167
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
168
+ }, "strip", import("zod").ZodTypeAny, {
169
+ out?: string | undefined;
170
+ driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
171
+ tablesFilter?: string | string[] | undefined;
172
+ schema: string | string[];
173
+ dialect: "mysql" | "pg" | "sqlite";
174
+ breakpoints: boolean;
175
+ schemaFilter: string | string[];
176
+ }, {
177
+ out?: string | undefined;
178
+ breakpoints?: boolean | undefined;
179
+ driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
180
+ tablesFilter?: string | string[] | undefined;
181
+ schemaFilter?: string | string[] | undefined;
182
+ schema: string | string[];
183
+ dialect: "mysql" | "pg" | "sqlite";
184
+ }>, import("zod").ZodUnion<[import("zod").ZodObject<{
185
+ host: import("zod").ZodString;
186
+ port: import("zod").ZodOptional<import("zod").ZodNumber>;
187
+ user: import("zod").ZodDefault<import("zod").ZodString>;
188
+ password: import("zod").ZodOptional<import("zod").ZodString>;
189
+ database: import("zod").ZodString;
190
+ }, "strip", import("zod").ZodTypeAny, {
191
+ port?: number | undefined;
192
+ password?: string | undefined;
193
+ host: string;
194
+ user: string;
195
+ database: string;
196
+ }, {
197
+ port?: number | undefined;
198
+ user?: string | undefined;
199
+ password?: string | undefined;
200
+ host: string;
201
+ database: string;
202
+ }>, import("zod").ZodObject<{
203
+ connectionString: import("zod").ZodString;
204
+ }, "strip", import("zod").ZodTypeAny, {
205
+ connectionString: string;
206
+ }, {
207
+ connectionString: string;
208
+ }>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>>;
209
+ export type MySqlCliConfig = TypeOf<typeof mySqlCliConfigSchema>;
210
+ export type CliConfig = MySqlCliConfig;
211
+ export type Driver = TypeOf<typeof driver>;
@@ -239,6 +239,7 @@ export declare const mysqlCliIntrospectParams: import("zod").ZodIntersection<imp
239
239
  uri: string;
240
240
  }>]>>;
241
241
  export declare const mysqlCliPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
242
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
242
243
  schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
243
244
  tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
244
245
  schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
@@ -248,6 +249,7 @@ export declare const mysqlCliPushParams: import("zod").ZodIntersection<import("z
248
249
  tablesFilter?: string | string[] | undefined;
249
250
  strict: boolean;
250
251
  schema: string | string[];
252
+ dialect: "mysql" | "pg" | "sqlite";
251
253
  schemaFilter: string | string[];
252
254
  verbose: boolean;
253
255
  }, {
@@ -256,6 +258,7 @@ export declare const mysqlCliPushParams: import("zod").ZodIntersection<import("z
256
258
  schemaFilter?: string | string[] | undefined;
257
259
  verbose?: boolean | undefined;
258
260
  schema: string | string[];
261
+ dialect: "mysql" | "pg" | "sqlite";
259
262
  }>, import("zod").ZodUnion<[import("zod").ZodObject<{
260
263
  driver: import("zod").ZodLiteral<"mysql2">;
261
264
  host: import("zod").ZodString;
@@ -288,6 +291,7 @@ export declare const mysqlCliPushParams: import("zod").ZodIntersection<import("z
288
291
  uri: string;
289
292
  }>]>>;
290
293
  export declare const mysqlConfigPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
294
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
291
295
  schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
292
296
  tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
293
297
  schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
@@ -297,6 +301,7 @@ export declare const mysqlConfigPushParams: import("zod").ZodIntersection<import
297
301
  tablesFilter?: string | string[] | undefined;
298
302
  strict: boolean;
299
303
  schema: string | string[];
304
+ dialect: "mysql" | "pg" | "sqlite";
300
305
  schemaFilter: string | string[];
301
306
  verbose: boolean;
302
307
  }, {
@@ -305,6 +310,7 @@ export declare const mysqlConfigPushParams: import("zod").ZodIntersection<import
305
310
  schemaFilter?: string | string[] | undefined;
306
311
  verbose?: boolean | undefined;
307
312
  schema: string | string[];
313
+ dialect: "mysql" | "pg" | "sqlite";
308
314
  }>, import("zod").ZodObject<{
309
315
  driver: import("zod").ZodLiteral<"mysql2">;
310
316
  dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
@@ -362,4 +368,3 @@ export type MySQLConnectionConfig = TypeOf<typeof mysqlConnectionConfig>;
362
368
  export declare const printCliConnectionIssues: (options: any) => void;
363
369
  export declare const printConfigConnectionIssues: (options: any) => void;
364
370
  export declare const validateMySqlIntrospect: (options: Record<string, any>) => Promise<MySQLConfigIntrospect>;
365
- export declare const validateMySqlPush: (options: Record<string, unknown>) => Promise<MySQLPushConfig>;
@@ -280,6 +280,7 @@ export declare const pgCliIntrospectParams: import("zod").ZodIntersection<import
280
280
  connectionString: string;
281
281
  }>]>>;
282
282
  export declare const pgCliPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
283
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
283
284
  schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
284
285
  tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
285
286
  schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
@@ -289,6 +290,7 @@ export declare const pgCliPushParams: import("zod").ZodIntersection<import("zod"
289
290
  tablesFilter?: string | string[] | undefined;
290
291
  strict: boolean;
291
292
  schema: string | string[];
293
+ dialect: "mysql" | "pg" | "sqlite";
292
294
  schemaFilter: string | string[];
293
295
  verbose: boolean;
294
296
  }, {
@@ -297,6 +299,7 @@ export declare const pgCliPushParams: import("zod").ZodIntersection<import("zod"
297
299
  schemaFilter?: string | string[] | undefined;
298
300
  verbose?: boolean | undefined;
299
301
  schema: string | string[];
302
+ dialect: "mysql" | "pg" | "sqlite";
300
303
  }>, import("zod").ZodUnion<[import("zod").ZodObject<{
301
304
  driver: import("zod").ZodLiteral<"pg">;
302
305
  host: import("zod").ZodString;
@@ -338,6 +341,7 @@ export declare const pgCliPushParams: import("zod").ZodIntersection<import("zod"
338
341
  connectionString: string;
339
342
  }>]>>;
340
343
  export declare const pgConfigPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
344
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
341
345
  schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
342
346
  tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
343
347
  schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
@@ -347,6 +351,7 @@ export declare const pgConfigPushParams: import("zod").ZodIntersection<import("z
347
351
  tablesFilter?: string | string[] | undefined;
348
352
  strict: boolean;
349
353
  schema: string | string[];
354
+ dialect: "mysql" | "pg" | "sqlite";
350
355
  schemaFilter: string | string[];
351
356
  verbose: boolean;
352
357
  }, {
@@ -355,6 +360,7 @@ export declare const pgConfigPushParams: import("zod").ZodIntersection<import("z
355
360
  schemaFilter?: string | string[] | undefined;
356
361
  verbose?: boolean | undefined;
357
362
  schema: string | string[];
363
+ dialect: "mysql" | "pg" | "sqlite";
358
364
  }>, import("zod").ZodUnion<[import("zod").ZodObject<{
359
365
  driver: import("zod").ZodLiteral<"pg">;
360
366
  dbCredentials: import("zod").ZodObject<{
@@ -435,4 +441,3 @@ export type PgCliIntrospect = TypeOf<typeof pgCliIntrospectParams>;
435
441
  export type PgConnectionConfig = TypeOf<typeof pgConnectionConfig>;
436
442
  export declare const printConfigConnectionIssues: (options: any) => void;
437
443
  export declare const validatePgIntrospect: (options: Record<string, any>) => Promise<PgConfigIntrospect>;
438
- export declare const validatePgPush: (options: Record<string, unknown>) => Promise<PgPushConfig>;
@@ -1,5 +1,4 @@
1
1
  import { TypeOf } from "zod";
2
- import { SQLiteCliConfig } from "../commands/sqliteUtils";
3
2
  export declare const sqliteConnectionCli: import("zod").ZodUnion<[import("zod").ZodObject<{
4
3
  driver: import("zod").ZodLiteral<"turso">;
5
4
  url: import("zod").ZodString;
@@ -31,6 +30,165 @@ export declare const sqliteConnectionCli: import("zod").ZodUnion<[import("zod").
31
30
  url: string;
32
31
  driver: "libsql";
33
32
  }>]>;
33
+ export declare const sqliteConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
34
+ driver: import("zod").ZodLiteral<"turso">;
35
+ dbCredentials: import("zod").ZodObject<{
36
+ url: import("zod").ZodString;
37
+ authToken: import("zod").ZodOptional<import("zod").ZodString>;
38
+ }, "strip", import("zod").ZodTypeAny, {
39
+ authToken?: string | undefined;
40
+ url: string;
41
+ }, {
42
+ authToken?: string | undefined;
43
+ url: string;
44
+ }>;
45
+ }, "strip", import("zod").ZodTypeAny, {
46
+ driver: "turso";
47
+ dbCredentials: {
48
+ authToken?: string | undefined;
49
+ url: string;
50
+ };
51
+ }, {
52
+ driver: "turso";
53
+ dbCredentials: {
54
+ authToken?: string | undefined;
55
+ url: string;
56
+ };
57
+ }>, import("zod").ZodObject<{
58
+ driver: import("zod").ZodLiteral<"libsql">;
59
+ dbCredentials: import("zod").ZodObject<{
60
+ url: import("zod").ZodString;
61
+ }, "strip", import("zod").ZodTypeAny, {
62
+ url: string;
63
+ }, {
64
+ url: string;
65
+ }>;
66
+ }, "strip", import("zod").ZodTypeAny, {
67
+ driver: "libsql";
68
+ dbCredentials: {
69
+ url: string;
70
+ };
71
+ }, {
72
+ driver: "libsql";
73
+ dbCredentials: {
74
+ url: string;
75
+ };
76
+ }>, import("zod").ZodObject<{
77
+ driver: import("zod").ZodLiteral<"better-sqlite">;
78
+ dbCredentials: import("zod").ZodObject<{
79
+ url: import("zod").ZodString;
80
+ }, "strip", import("zod").ZodTypeAny, {
81
+ url: string;
82
+ }, {
83
+ url: string;
84
+ }>;
85
+ }, "strip", import("zod").ZodTypeAny, {
86
+ driver: "better-sqlite";
87
+ dbCredentials: {
88
+ url: string;
89
+ };
90
+ }, {
91
+ driver: "better-sqlite";
92
+ dbCredentials: {
93
+ url: string;
94
+ };
95
+ }>]>;
96
+ export declare const sqliteCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
97
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
98
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
99
+ breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
100
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
101
+ schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
102
+ introspect: import("zod").ZodDefault<import("zod").ZodObject<{
103
+ casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
104
+ }, "strip", import("zod").ZodTypeAny, {
105
+ casing: "camel" | "preserve";
106
+ }, {
107
+ casing?: "camel" | "preserve" | undefined;
108
+ }>>;
109
+ }, "strip", import("zod").ZodTypeAny, {
110
+ schema?: string | string[] | undefined;
111
+ tablesFilter?: string | string[] | undefined;
112
+ out: string;
113
+ breakpoints: boolean;
114
+ schemaFilter: string | string[];
115
+ introspect: {
116
+ casing: "camel" | "preserve";
117
+ };
118
+ }, {
119
+ schema?: string | string[] | undefined;
120
+ out?: string | undefined;
121
+ breakpoints?: boolean | undefined;
122
+ tablesFilter?: string | string[] | undefined;
123
+ schemaFilter?: string | string[] | undefined;
124
+ introspect?: {
125
+ casing?: "camel" | "preserve" | undefined;
126
+ } | undefined;
127
+ }>, import("zod").ZodUnion<[import("zod").ZodObject<{
128
+ driver: import("zod").ZodLiteral<"turso">;
129
+ dbCredentials: import("zod").ZodObject<{
130
+ url: import("zod").ZodString;
131
+ authToken: import("zod").ZodOptional<import("zod").ZodString>;
132
+ }, "strip", import("zod").ZodTypeAny, {
133
+ authToken?: string | undefined;
134
+ url: string;
135
+ }, {
136
+ authToken?: string | undefined;
137
+ url: string;
138
+ }>;
139
+ }, "strip", import("zod").ZodTypeAny, {
140
+ driver: "turso";
141
+ dbCredentials: {
142
+ authToken?: string | undefined;
143
+ url: string;
144
+ };
145
+ }, {
146
+ driver: "turso";
147
+ dbCredentials: {
148
+ authToken?: string | undefined;
149
+ url: string;
150
+ };
151
+ }>, import("zod").ZodObject<{
152
+ driver: import("zod").ZodLiteral<"libsql">;
153
+ dbCredentials: import("zod").ZodObject<{
154
+ url: import("zod").ZodString;
155
+ }, "strip", import("zod").ZodTypeAny, {
156
+ url: string;
157
+ }, {
158
+ url: string;
159
+ }>;
160
+ }, "strip", import("zod").ZodTypeAny, {
161
+ driver: "libsql";
162
+ dbCredentials: {
163
+ url: string;
164
+ };
165
+ }, {
166
+ driver: "libsql";
167
+ dbCredentials: {
168
+ url: string;
169
+ };
170
+ }>, import("zod").ZodObject<{
171
+ driver: import("zod").ZodLiteral<"better-sqlite">;
172
+ dbCredentials: import("zod").ZodObject<{
173
+ url: import("zod").ZodString;
174
+ }, "strip", import("zod").ZodTypeAny, {
175
+ url: string;
176
+ }, {
177
+ url: string;
178
+ }>;
179
+ }, "strip", import("zod").ZodTypeAny, {
180
+ driver: "better-sqlite";
181
+ dbCredentials: {
182
+ url: string;
183
+ };
184
+ }, {
185
+ driver: "better-sqlite";
186
+ dbCredentials: {
187
+ url: string;
188
+ };
189
+ }>]>>;
190
+ export type SQLiteCliConfig = TypeOf<typeof sqliteCliConfigSchema>;
191
+ export type SQLiteConnectionConfig = TypeOf<typeof sqliteConnectionSchema>;
34
192
  export declare const sqliteCliIntrospectParams: import("zod").ZodIntersection<import("zod").ZodObject<{
35
193
  schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
36
194
  out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
@@ -84,6 +242,7 @@ export declare const sqliteCliIntrospectParams: import("zod").ZodIntersection<im
84
242
  driver: "libsql";
85
243
  }>]>>;
86
244
  export declare const sqliteCliPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
245
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
87
246
  schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
88
247
  tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
89
248
  schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
@@ -93,6 +252,7 @@ export declare const sqliteCliPushParams: import("zod").ZodIntersection<import("
93
252
  tablesFilter?: string | string[] | undefined;
94
253
  strict: boolean;
95
254
  schema: string | string[];
255
+ dialect: "mysql" | "pg" | "sqlite";
96
256
  schemaFilter: string | string[];
97
257
  verbose: boolean;
98
258
  }, {
@@ -101,6 +261,7 @@ export declare const sqliteCliPushParams: import("zod").ZodIntersection<import("
101
261
  schemaFilter?: string | string[] | undefined;
102
262
  verbose?: boolean | undefined;
103
263
  schema: string | string[];
264
+ dialect: "mysql" | "pg" | "sqlite";
104
265
  }>, import("zod").ZodUnion<[import("zod").ZodObject<{
105
266
  driver: import("zod").ZodLiteral<"turso">;
106
267
  url: import("zod").ZodString;
@@ -133,6 +294,7 @@ export declare const sqliteCliPushParams: import("zod").ZodIntersection<import("
133
294
  driver: "libsql";
134
295
  }>]>>;
135
296
  export declare const sqliteConfigPushParams: import("zod").ZodIntersection<import("zod").ZodObject<{
297
+ dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
136
298
  schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
137
299
  tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
138
300
  schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
@@ -142,6 +304,7 @@ export declare const sqliteConfigPushParams: import("zod").ZodIntersection<impor
142
304
  tablesFilter?: string | string[] | undefined;
143
305
  strict: boolean;
144
306
  schema: string | string[];
307
+ dialect: "mysql" | "pg" | "sqlite";
145
308
  schemaFilter: string | string[];
146
309
  verbose: boolean;
147
310
  }, {
@@ -150,6 +313,7 @@ export declare const sqliteConfigPushParams: import("zod").ZodIntersection<impor
150
313
  schemaFilter?: string | string[] | undefined;
151
314
  verbose?: boolean | undefined;
152
315
  schema: string | string[];
316
+ dialect: "mysql" | "pg" | "sqlite";
153
317
  }>, import("zod").ZodUnion<[import("zod").ZodObject<{
154
318
  driver: import("zod").ZodLiteral<"turso">;
155
319
  dbCredentials: import("zod").ZodObject<{
@@ -216,5 +380,3 @@ export declare const sqliteConfigPushParams: import("zod").ZodIntersection<impor
216
380
  export type SQLitePushConfig = TypeOf<typeof sqliteConfigPushParams>;
217
381
  export declare const printConfigConnectionIssues: (options: any) => void;
218
382
  export declare const validateIntrospect: (options: Record<string, any>) => Promise<SQLiteCliConfig>;
219
- export declare const validatePush: (options: Record<string, unknown>) => Promise<SQLitePushConfig>;
220
- export declare const validateGenerate: () => void;
@@ -1,4 +1,6 @@
1
1
  import type { Client } from "@libsql/client";
2
+ import { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
3
+ import { MySql2Database } from "drizzle-orm/mysql2";
2
4
  import type { PgDatabase } from "drizzle-orm/pg-core";
3
5
  import type { Client as PgClient } from "pg";
4
6
  export declare abstract class DrizzleDbClient<T = any> {
@@ -11,10 +13,22 @@ export declare class DrizzleORMPgClient extends DrizzleDbClient<PgDatabase<any>>
11
13
  query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
12
14
  run(query: string): Promise<void>;
13
15
  }
16
+ export declare class DrizzleORMMySQLClient extends DrizzleDbClient<MySql2Database<any>> {
17
+ query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
18
+ run(query: string): Promise<void>;
19
+ }
20
+ export declare class DrizzleORMSQLiteClient extends DrizzleDbClient<BetterSQLite3Database<any>> {
21
+ query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
22
+ run(query: string): Promise<void>;
23
+ }
14
24
  export declare class BetterSqlite extends DrizzleDbClient {
15
25
  run(query: string): Promise<void>;
16
26
  query(query: string): Promise<any[]>;
17
27
  }
28
+ export declare class MySQL2Client extends DrizzleDbClient {
29
+ run(query: string): Promise<void>;
30
+ query(query: string): Promise<any>;
31
+ }
18
32
  export declare class TursoSqlite extends DrizzleDbClient<Client> {
19
33
  run(query: string): Promise<void>;
20
34
  query(query: string): Promise<any[]>;
package/global.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export declare const originUUID = "00000000-0000-0000-0000-000000000000";
2
2
  export declare const snapshotVersion = "5";
3
3
  export declare function assertUnreachable(x: never): never;
4
+ export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
package/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Dialect } from "./schemaValidator";
1
2
  export type DbConnection = {
2
3
  driver: "turso";
3
4
  dbCredentials: {
@@ -45,13 +46,14 @@ export type DbConnection = {
45
46
  };
46
47
  };
47
48
  export type Config = {
48
- out?: string | undefined;
49
- breakpoints?: boolean | undefined;
50
- tablesFilter?: string | string[] | undefined;
51
- schemaFilter?: string | string[] | undefined;
49
+ dialect?: Dialect;
50
+ out?: string;
51
+ breakpoints?: boolean;
52
+ tablesFilter?: string | string[];
53
+ schemaFilter?: string | string[];
52
54
  schema?: string | string[];
53
- verbose?: boolean | undefined;
54
- strict?: boolean | undefined;
55
+ verbose?: boolean;
56
+ strict?: boolean;
55
57
  } & {
56
58
  introspect?: {
57
59
  casing: "camel" | "preserve";
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Dialect } from "./schemaValidator";
1
2
  export type DbConnection = {
2
3
  driver: "turso";
3
4
  dbCredentials: {
@@ -45,13 +46,14 @@ export type DbConnection = {
45
46
  };
46
47
  };
47
48
  export type Config = {
48
- out?: string | undefined;
49
- breakpoints?: boolean | undefined;
50
- tablesFilter?: string | string[] | undefined;
51
- schemaFilter?: string | string[] | undefined;
49
+ dialect?: Dialect;
50
+ out?: string;
51
+ breakpoints?: boolean;
52
+ tablesFilter?: string | string[];
53
+ schemaFilter?: string | string[];
52
54
  schema?: string | string[];
53
- verbose?: boolean | undefined;
54
- strict?: boolean | undefined;
55
+ verbose?: boolean;
56
+ strict?: boolean;
55
57
  } & {
56
58
  introspect?: {
57
59
  casing: "camel" | "preserve";
@@ -1,5 +1,5 @@
1
1
  import "./@types/utils";
2
- import { ConfigIntrospectCasing } from "./cli/commands/utils";
2
+ import type { ConfigIntrospectCasing } from "./cli/validations/common";
3
3
  import { MySqlSchemaInternal } from "./serializer/mysqlSchema";
4
4
  export declare const schemaToTypeScript: (schema: MySqlSchemaInternal, casing: ConfigIntrospectCasing["casing"]) => {
5
5
  file: string;