drizzle-kit 0.20.14-6ce9d1f → 0.20.14-730d763

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/bin.cjs +20593 -20020
  2. package/cli/commands/migrate.d.ts +114 -90
  3. package/cli/commands/mysqlIntrospect.d.ts +8 -14
  4. package/cli/commands/pgIntrospect.d.ts +17 -10
  5. package/cli/commands/sqliteIntrospect.d.ts +9 -9
  6. package/cli/commands/utils.d.ts +8 -261
  7. package/cli/validations/cli.d.ts +107 -0
  8. package/cli/validations/common.d.ts +205 -7
  9. package/cli/validations/mysql.d.ts +6 -1
  10. package/cli/validations/pg.d.ts +6 -1
  11. package/cli/validations/sqlite.d.ts +165 -3
  12. package/cli/views.d.ts +6 -4
  13. package/global.d.ts +3 -1
  14. package/index.js +1 -0
  15. package/introspect-mysql.d.ts +1 -1
  16. package/introspect-pg.d.ts +5 -2
  17. package/introspect-sqlite.d.ts +1 -1
  18. package/jsonDiffer.d.ts +14 -29
  19. package/jsonStatements.d.ts +38 -11
  20. package/package.json +18 -50
  21. package/payload.js +8130 -8617
  22. package/payload.mjs +8252 -8745
  23. package/schemaValidator.d.ts +72 -69
  24. package/serializer/mysqlImports.d.ts +3 -7
  25. package/serializer/mysqlSchema.d.ts +1624 -493
  26. package/serializer/mysqlSerializer.d.ts +2 -2
  27. package/serializer/pgImports.d.ts +2 -2
  28. package/serializer/pgSchema.d.ts +1260 -801
  29. package/serializer/sqliteImports.d.ts +2 -4
  30. package/serializer/sqliteSchema.d.ts +144 -570
  31. package/serializer/sqliteSerializer.d.ts +1 -1
  32. package/snapshotsDiffer.d.ts +1908 -1050
  33. package/utils/words.d.ts +1 -1
  34. package/utils-studio.js +4144 -85
  35. package/utils-studio.mjs +4144 -85
  36. package/utils.d.ts +6 -140
  37. package/utils.js +3906 -7081
  38. package/utils.mjs +3983 -7158
  39. package/cli/commands/check.d.ts +0 -2
  40. package/cli/commands/drop.d.ts +0 -4
  41. package/cli/commands/mysqlUp.d.ts +0 -4
  42. package/cli/commands/pgUp.d.ts +0 -4
  43. package/cli/commands/push.d.ts +0 -6
  44. package/cli/commands/sqliteUp.d.ts +0 -2
  45. package/cli/commands/sqliteUtils.d.ts +0 -162
  46. package/cli/commands/upFolders.d.ts +0 -27
  47. package/cli/index.d.ts +0 -71
  48. package/cli/utils.d.ts +0 -12
  49. package/cli/validations/studio.d.ts +0 -593
  50. package/orm-extenstions/d1-driver/driver.d.ts +0 -8
  51. package/orm-extenstions/d1-driver/session.d.ts +0 -51
  52. package/orm-extenstions/d1-driver/wrangler-client.d.ts +0 -3
  53. package/serializer/studioUtils.d.ts +0 -65
  54. package/utils/certs.d.ts +0 -4
@@ -1,283 +1,30 @@
1
- import { TypeOf } from "zod";
2
- import { CliParamsPush } from "..";
3
1
  import { MySQLPushConfig } from "../validations/mysql";
4
2
  import { PgPushConfig } from "../validations/pg";
5
3
  import { SQLitePushConfig } from "../validations/sqlite";
4
+ import { CliConfig } from "../validations/common";
5
+ import { Dialect } from "src/schemaValidator";
6
+ import { CliCheckConfig, CliConfigGenerate, CliParamsPush } from "../validations/cli";
6
7
  export declare const safeRegister: () => Promise<{
7
8
  unregister: () => void;
8
9
  }>;
9
10
  export type GenerateConfig = {
11
+ dialect: Dialect;
10
12
  schema: string | string[];
11
13
  out: string;
12
14
  breakpoints: boolean;
15
+ name?: string;
13
16
  custom: boolean;
14
17
  bundle: boolean;
15
18
  };
16
- export declare const prepareGenerateConfig: (options: {
17
- schema?: string | string[];
18
- out?: string;
19
- config?: string;
20
- breakpoints: boolean;
21
- custom: boolean;
22
- }) => Promise<GenerateConfig>;
19
+ export declare const prepareGenerateConfig: (options: CliConfigGenerate) => Promise<GenerateConfig>;
23
20
  export declare const preparePushConfig: (options: CliParamsPush) => Promise<{
24
21
  config: MySQLPushConfig | PgPushConfig | SQLitePushConfig;
25
22
  schemaFiles: string[];
26
23
  tablesFilter: string[];
27
24
  }>;
28
- export declare const assertOutFolder: (it: {
29
- config?: string;
30
- } | {
31
- out: string;
32
- }) => Promise<string>;
33
- 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">]>;
34
- export declare const configCommonSchema: import("zod").ZodObject<{
35
- schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
36
- out: import("zod").ZodOptional<import("zod").ZodString>;
37
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
38
- 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">]>>;
39
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
40
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
41
- }, "strip", import("zod").ZodTypeAny, {
42
- out?: string | undefined;
43
- driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
44
- tablesFilter?: string | string[] | undefined;
45
- schema: string | string[];
46
- breakpoints: boolean;
47
- schemaFilter: string | string[];
48
- }, {
49
- out?: string | undefined;
50
- driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
51
- breakpoints?: boolean | undefined;
52
- tablesFilter?: string | string[] | undefined;
53
- schemaFilter?: string | string[] | undefined;
54
- schema: string | string[];
55
- }>;
56
- export declare const introspectCasing: import("zod").ZodDefault<import("zod").ZodObject<{
57
- casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
58
- }, "strip", import("zod").ZodTypeAny, {
59
- casing: "camel" | "preserve";
60
- }, {
61
- casing?: "camel" | "preserve" | undefined;
62
- }>>;
63
- export declare const configIntrospectSchema: import("zod").ZodObject<{
64
- schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
65
- out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
66
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
67
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
68
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
69
- introspect: import("zod").ZodDefault<import("zod").ZodObject<{
70
- casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
71
- }, "strip", import("zod").ZodTypeAny, {
72
- casing: "camel" | "preserve";
73
- }, {
74
- casing?: "camel" | "preserve" | undefined;
75
- }>>;
76
- }, "strip", import("zod").ZodTypeAny, {
77
- schema?: string | string[] | undefined;
78
- tablesFilter?: string | string[] | undefined;
79
- out: string;
80
- breakpoints: boolean;
81
- schemaFilter: string | string[];
82
- introspect: {
83
- casing: "camel" | "preserve";
84
- };
85
- }, {
86
- schema?: string | string[] | undefined;
87
- out?: string | undefined;
88
- breakpoints?: boolean | undefined;
89
- tablesFilter?: string | string[] | undefined;
90
- schemaFilter?: string | string[] | undefined;
91
- introspect?: {
92
- casing?: "camel" | "preserve" | undefined;
93
- } | undefined;
94
- }>;
95
- export type ConfigIntrospectSchema = TypeOf<typeof configIntrospectSchema>;
96
- export type ConfigIntrospectCasing = TypeOf<typeof introspectCasing>;
97
- export declare const configIntrospectCliSchema: import("zod").ZodObject<{
98
- schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
99
- out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
100
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
101
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
102
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
103
- introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
104
- }, "strip", import("zod").ZodTypeAny, {
105
- schema?: string | string[] | undefined;
106
- tablesFilter?: string | string[] | undefined;
107
- out: string;
108
- breakpoints: boolean;
109
- schemaFilter: string | string[];
110
- introspectCasing: "camel" | "preserve";
111
- }, {
112
- schema?: string | string[] | undefined;
113
- out?: string | undefined;
114
- breakpoints?: boolean | undefined;
115
- tablesFilter?: string | string[] | undefined;
116
- schemaFilter?: string | string[] | undefined;
117
- introspectCasing?: "camel" | "preserve" | undefined;
118
- }>;
119
- export declare const configGenerateSchema: import("zod").ZodObject<{
120
- schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
121
- out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
122
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
123
- }, "strip", import("zod").ZodTypeAny, {
124
- schema: string | string[];
25
+ export declare const assertOutFolder: (it: CliCheckConfig) => Promise<{
125
26
  out: string;
126
- breakpoints: boolean;
127
- }, {
128
- out?: string | undefined;
129
- breakpoints?: boolean | undefined;
130
- schema: string | string[];
131
- }>;
132
- export type GenerateSchema = TypeOf<typeof configGenerateSchema>;
133
- export declare const configPushSchema: import("zod").ZodObject<{
134
- schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
135
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
136
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
137
- verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
138
- strict: import("zod").ZodDefault<import("zod").ZodBoolean>;
139
- }, "strip", import("zod").ZodTypeAny, {
140
- tablesFilter?: string | string[] | undefined;
141
- strict: boolean;
142
- schema: string | string[];
143
- schemaFilter: string | string[];
144
- verbose: boolean;
145
- }, {
146
- strict?: boolean | undefined;
147
- tablesFilter?: string | string[] | undefined;
148
- schemaFilter?: string | string[] | undefined;
149
- verbose?: boolean | undefined;
150
- schema: string | string[];
27
+ dialect: Dialect;
151
28
  }>;
152
- export declare const mysqlConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
153
- host: import("zod").ZodString;
154
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
155
- user: import("zod").ZodDefault<import("zod").ZodString>;
156
- password: import("zod").ZodOptional<import("zod").ZodString>;
157
- database: import("zod").ZodString;
158
- }, "strip", import("zod").ZodTypeAny, {
159
- port?: number | undefined;
160
- password?: string | undefined;
161
- host: string;
162
- user: string;
163
- database: string;
164
- }, {
165
- port?: number | undefined;
166
- user?: string | undefined;
167
- password?: string | undefined;
168
- host: string;
169
- database: string;
170
- }>, import("zod").ZodObject<{
171
- connectionString: import("zod").ZodString;
172
- }, "strip", import("zod").ZodTypeAny, {
173
- connectionString: string;
174
- }, {
175
- connectionString: string;
176
- }>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>;
177
- export declare const mySqlCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
178
- schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
179
- out: import("zod").ZodOptional<import("zod").ZodString>;
180
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
181
- 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">]>>;
182
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
183
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
184
- }, "strip", import("zod").ZodTypeAny, {
185
- out?: string | undefined;
186
- driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
187
- tablesFilter?: string | string[] | undefined;
188
- schema: string | string[];
189
- breakpoints: boolean;
190
- schemaFilter: string | string[];
191
- }, {
192
- out?: string | undefined;
193
- driver?: "pg" | "turso" | "better-sqlite" | "libsql" | "d1" | "mysql2" | "expo" | undefined;
194
- breakpoints?: boolean | undefined;
195
- tablesFilter?: string | string[] | undefined;
196
- schemaFilter?: string | string[] | undefined;
197
- schema: string | string[];
198
- }>, import("zod").ZodUnion<[import("zod").ZodObject<{
199
- host: import("zod").ZodString;
200
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
201
- user: import("zod").ZodDefault<import("zod").ZodString>;
202
- password: import("zod").ZodOptional<import("zod").ZodString>;
203
- database: import("zod").ZodString;
204
- }, "strip", import("zod").ZodTypeAny, {
205
- port?: number | undefined;
206
- password?: string | undefined;
207
- host: string;
208
- user: string;
209
- database: string;
210
- }, {
211
- port?: number | undefined;
212
- user?: string | undefined;
213
- password?: string | undefined;
214
- host: string;
215
- database: string;
216
- }>, import("zod").ZodObject<{
217
- connectionString: import("zod").ZodString;
218
- }, "strip", import("zod").ZodTypeAny, {
219
- connectionString: string;
220
- }, {
221
- connectionString: string;
222
- }>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>>;
223
- export declare const mySqlIntrospectConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
224
- schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
225
- out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
226
- breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
227
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
228
- schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
229
- introspect: import("zod").ZodDefault<import("zod").ZodObject<{
230
- casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
231
- }, "strip", import("zod").ZodTypeAny, {
232
- casing: "camel" | "preserve";
233
- }, {
234
- casing?: "camel" | "preserve" | undefined;
235
- }>>;
236
- }, "strip", import("zod").ZodTypeAny, {
237
- schema?: string | string[] | undefined;
238
- tablesFilter?: string | string[] | undefined;
239
- out: string;
240
- breakpoints: boolean;
241
- schemaFilter: string | string[];
242
- introspect: {
243
- casing: "camel" | "preserve";
244
- };
245
- }, {
246
- schema?: string | string[] | undefined;
247
- out?: string | undefined;
248
- breakpoints?: boolean | undefined;
249
- tablesFilter?: string | string[] | undefined;
250
- schemaFilter?: string | string[] | undefined;
251
- introspect?: {
252
- casing?: "camel" | "preserve" | undefined;
253
- } | undefined;
254
- }>, import("zod").ZodUnion<[import("zod").ZodObject<{
255
- host: import("zod").ZodString;
256
- port: import("zod").ZodOptional<import("zod").ZodNumber>;
257
- user: import("zod").ZodDefault<import("zod").ZodString>;
258
- password: import("zod").ZodOptional<import("zod").ZodString>;
259
- database: import("zod").ZodString;
260
- }, "strip", import("zod").ZodTypeAny, {
261
- port?: number | undefined;
262
- password?: string | undefined;
263
- host: string;
264
- user: string;
265
- database: string;
266
- }, {
267
- port?: number | undefined;
268
- user?: string | undefined;
269
- password?: string | undefined;
270
- host: string;
271
- database: string;
272
- }>, import("zod").ZodObject<{
273
- connectionString: import("zod").ZodString;
274
- }, "strip", import("zod").ZodTypeAny, {
275
- connectionString: string;
276
- }, {
277
- connectionString: string;
278
- }>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>>;
279
- export type MySqlCliConfig = TypeOf<typeof mySqlCliConfigSchema>;
280
- export type CliConfig = MySqlCliConfig;
281
- export type Driver = TypeOf<typeof driver>;
282
29
  export declare const drizzleConfigFromFile: (configPath?: string) => Promise<CliConfig>;
283
30
  export declare const readDrizzleConfig: (configPath?: string) => Promise<any>;
@@ -0,0 +1,107 @@
1
+ import { TypeOf } from "zod";
2
+ export declare const cliConfigGenerate: import("zod").ZodObject<{
3
+ dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
4
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
5
+ out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
6
+ config: import("zod").ZodOptional<import("zod").ZodString>;
7
+ name: import("zod").ZodOptional<import("zod").ZodString>;
8
+ breakpoints: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
9
+ custom: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
10
+ }, "strict", import("zod").ZodTypeAny, {
11
+ name?: string | undefined;
12
+ schema?: string | string[] | undefined;
13
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
14
+ config?: string | undefined;
15
+ custom: boolean;
16
+ out: string;
17
+ breakpoints: boolean;
18
+ }, {
19
+ name?: string | undefined;
20
+ custom?: boolean | undefined;
21
+ schema?: string | string[] | undefined;
22
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
23
+ config?: string | undefined;
24
+ out?: string | undefined;
25
+ breakpoints?: boolean | undefined;
26
+ }>;
27
+ export type CliConfigGenerate = TypeOf<typeof cliConfigGenerate>;
28
+ export declare const cliParamsPush: import("zod").ZodObject<{
29
+ config: import("zod").ZodOptional<import("zod").ZodString>;
30
+ dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
31
+ schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
32
+ tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
33
+ driver: import("zod").ZodOptional<import("zod").ZodString>;
34
+ connectionString: import("zod").ZodOptional<import("zod").ZodString>;
35
+ uri: import("zod").ZodOptional<import("zod").ZodString>;
36
+ host: import("zod").ZodOptional<import("zod").ZodString>;
37
+ port: import("zod").ZodOptional<import("zod").ZodString>;
38
+ user: import("zod").ZodOptional<import("zod").ZodString>;
39
+ password: import("zod").ZodOptional<import("zod").ZodString>;
40
+ database: import("zod").ZodOptional<import("zod").ZodString>;
41
+ ssl: import("zod").ZodOptional<import("zod").ZodString>;
42
+ authToken: import("zod").ZodOptional<import("zod").ZodString>;
43
+ verbose: import("zod").ZodOptional<import("zod").ZodBoolean>;
44
+ strict: import("zod").ZodOptional<import("zod").ZodBoolean>;
45
+ }, "strict", import("zod").ZodTypeAny, {
46
+ strict?: boolean | undefined;
47
+ schema?: string | string[] | undefined;
48
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
49
+ config?: string | undefined;
50
+ driver?: string | undefined;
51
+ tablesFilter?: string | string[] | undefined;
52
+ verbose?: boolean | undefined;
53
+ host?: string | undefined;
54
+ port?: string | undefined;
55
+ user?: string | undefined;
56
+ password?: string | undefined;
57
+ database?: string | undefined;
58
+ connectionString?: string | undefined;
59
+ uri?: string | undefined;
60
+ ssl?: string | undefined;
61
+ authToken?: string | undefined;
62
+ }, {
63
+ strict?: boolean | undefined;
64
+ schema?: string | string[] | undefined;
65
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
66
+ config?: string | undefined;
67
+ driver?: string | undefined;
68
+ tablesFilter?: string | string[] | undefined;
69
+ verbose?: boolean | undefined;
70
+ host?: string | undefined;
71
+ port?: string | undefined;
72
+ user?: string | undefined;
73
+ password?: string | undefined;
74
+ database?: string | undefined;
75
+ connectionString?: string | undefined;
76
+ uri?: string | undefined;
77
+ ssl?: string | undefined;
78
+ authToken?: string | undefined;
79
+ }>;
80
+ export type CliParamsPush = TypeOf<typeof cliParamsPush>;
81
+ export declare const configCheck: import("zod").ZodObject<{
82
+ dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
83
+ out: import("zod").ZodOptional<import("zod").ZodString>;
84
+ }, "strip", import("zod").ZodTypeAny, {
85
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
86
+ out?: string | undefined;
87
+ }, {
88
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
89
+ out?: string | undefined;
90
+ }>;
91
+ export declare const cliConfigCheck: import("zod").ZodIntersection<import("zod").ZodObject<{
92
+ config: import("zod").ZodOptional<import("zod").ZodString>;
93
+ }, "strip", import("zod").ZodTypeAny, {
94
+ config?: string | undefined;
95
+ }, {
96
+ config?: string | undefined;
97
+ }>, import("zod").ZodObject<{
98
+ dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
99
+ out: import("zod").ZodOptional<import("zod").ZodString>;
100
+ }, "strip", import("zod").ZodTypeAny, {
101
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
102
+ out?: string | undefined;
103
+ }, {
104
+ dialect?: "mysql" | "pg" | "sqlite" | undefined;
105
+ out?: string | undefined;
106
+ }>>;
107
+ export type CliCheckConfig = TypeOf<typeof cliConfigCheck>;
@@ -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" | "up" | "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>;