drizzle-kit 0.20.0-f39d8bc → 0.20.1-56e7be6
Sign up to get free protection for your applications and to get access to all the features.
- package/@types/utils.d.ts +12 -0
- package/{index.cjs → bin.cjs} +28995 -37098
- package/cli/commands/migrate.d.ts +260 -0
- package/cli/commands/mysqlUp.d.ts +4 -0
- package/cli/commands/pgConnect.d.ts +5 -0
- package/cli/commands/pgIntrospect.d.ts +116 -0
- package/cli/commands/pgPushUtils.d.ts +14 -0
- package/cli/commands/pgUp.d.ts +4 -0
- package/cli/commands/sqliteIntrospect.d.ts +102 -0
- package/cli/commands/sqliteUtils.d.ts +162 -0
- package/cli/commands/upFolders.d.ts +27 -0
- package/cli/commands/utils.d.ts +265 -0
- package/cli/selector-ui.d.ts +13 -0
- package/cli/utils.d.ts +11 -0
- package/cli/validations/common.d.ts +13 -0
- package/cli/validations/mysql.d.ts +365 -0
- package/cli/validations/outputs.d.ts +40 -0
- package/cli/validations/pg.d.ts +438 -0
- package/cli/validations/sqlite.d.ts +220 -0
- package/cli/validations/studio.d.ts +593 -0
- package/cli/views.d.ts +61 -0
- package/drivers/index.d.ts +25 -0
- package/global.d.ts +3 -0
- package/index.d.mts +105 -0
- package/index.d.ts +48 -1
- package/index.js +31 -0
- package/index.mjs +7 -0
- package/introspect.d.ts +4 -0
- package/jsonDiffer.d.ts +76 -0
- package/jsonStatements.d.ts +349 -0
- package/migrationPreparator.d.ts +35 -0
- package/orm-extenstions/d1-driver/driver.d.ts +8 -0
- package/orm-extenstions/d1-driver/session.d.ts +51 -0
- package/orm-extenstions/d1-driver/wrangler-client.d.ts +3 -0
- package/package.json +26 -9
- package/schemaValidator.d.ts +1306 -0
- package/serializer/index.d.ts +9 -0
- package/serializer/mysqlImports.d.ts +6 -0
- package/serializer/mysqlSchema.d.ts +3833 -0
- package/serializer/mysqlSerializer.d.ts +7 -0
- package/serializer/pgImports.d.ts +11 -0
- package/serializer/pgSchema.d.ts +4244 -0
- package/serializer/pgSerializer.d.ts +9 -0
- package/serializer/sqliteImports.d.ts +5 -0
- package/serializer/sqliteSchema.d.ts +3227 -0
- package/serializer/sqliteSerializer.d.ts +8 -0
- package/serializer/studioUtils.d.ts +53 -0
- package/snapshotsDiffer.d.ts +2660 -0
- package/sqlgenerator.d.ts +33 -0
- package/sqlite-introspect.d.ts +5 -0
- package/utils/words.d.ts +7 -0
- package/utils-studio.d.ts +5 -0
- package/utils-studio.js +3367 -0
- package/utils.d.ts +211 -0
- package/utils.js +52586 -11755
- package/loader.mjs +0 -57
@@ -0,0 +1,593 @@
|
|
1
|
+
import { TypeOf } from "zod";
|
2
|
+
export declare const studioSpecificConnections: import("zod").ZodObject<{
|
3
|
+
driver: import("zod").ZodLiteral<"d1">;
|
4
|
+
dbCredentials: import("zod").ZodObject<{
|
5
|
+
wranglerConfigPath: import("zod").ZodString;
|
6
|
+
dbName: import("zod").ZodString;
|
7
|
+
}, "strip", import("zod").ZodTypeAny, {
|
8
|
+
wranglerConfigPath: string;
|
9
|
+
dbName: string;
|
10
|
+
}, {
|
11
|
+
wranglerConfigPath: string;
|
12
|
+
dbName: string;
|
13
|
+
}>;
|
14
|
+
}, "strip", import("zod").ZodTypeAny, {
|
15
|
+
driver: "d1";
|
16
|
+
dbCredentials: {
|
17
|
+
wranglerConfigPath: string;
|
18
|
+
dbName: string;
|
19
|
+
};
|
20
|
+
}, {
|
21
|
+
driver: "d1";
|
22
|
+
dbCredentials: {
|
23
|
+
wranglerConfigPath: string;
|
24
|
+
dbName: string;
|
25
|
+
};
|
26
|
+
}>;
|
27
|
+
export declare const stuioSqliteConnectionConfig: import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodObject<{
|
28
|
+
driver: import("zod").ZodLiteral<"turso">;
|
29
|
+
dbCredentials: import("zod").ZodObject<{
|
30
|
+
url: import("zod").ZodString;
|
31
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
32
|
+
}, "strip", import("zod").ZodTypeAny, {
|
33
|
+
authToken?: string | undefined;
|
34
|
+
url: string;
|
35
|
+
}, {
|
36
|
+
authToken?: string | undefined;
|
37
|
+
url: string;
|
38
|
+
}>;
|
39
|
+
}, "strip", import("zod").ZodTypeAny, {
|
40
|
+
driver: "turso";
|
41
|
+
dbCredentials: {
|
42
|
+
authToken?: string | undefined;
|
43
|
+
url: string;
|
44
|
+
};
|
45
|
+
}, {
|
46
|
+
driver: "turso";
|
47
|
+
dbCredentials: {
|
48
|
+
authToken?: string | undefined;
|
49
|
+
url: string;
|
50
|
+
};
|
51
|
+
}>, import("zod").ZodObject<{
|
52
|
+
driver: import("zod").ZodLiteral<"libsql">;
|
53
|
+
dbCredentials: import("zod").ZodObject<{
|
54
|
+
url: import("zod").ZodString;
|
55
|
+
}, "strip", import("zod").ZodTypeAny, {
|
56
|
+
url: string;
|
57
|
+
}, {
|
58
|
+
url: string;
|
59
|
+
}>;
|
60
|
+
}, "strip", import("zod").ZodTypeAny, {
|
61
|
+
driver: "libsql";
|
62
|
+
dbCredentials: {
|
63
|
+
url: string;
|
64
|
+
};
|
65
|
+
}, {
|
66
|
+
driver: "libsql";
|
67
|
+
dbCredentials: {
|
68
|
+
url: string;
|
69
|
+
};
|
70
|
+
}>, import("zod").ZodObject<{
|
71
|
+
driver: import("zod").ZodLiteral<"better-sqlite">;
|
72
|
+
dbCredentials: import("zod").ZodObject<{
|
73
|
+
url: import("zod").ZodString;
|
74
|
+
}, "strip", import("zod").ZodTypeAny, {
|
75
|
+
url: string;
|
76
|
+
}, {
|
77
|
+
url: string;
|
78
|
+
}>;
|
79
|
+
}, "strip", import("zod").ZodTypeAny, {
|
80
|
+
driver: "better-sqlite";
|
81
|
+
dbCredentials: {
|
82
|
+
url: string;
|
83
|
+
};
|
84
|
+
}, {
|
85
|
+
driver: "better-sqlite";
|
86
|
+
dbCredentials: {
|
87
|
+
url: string;
|
88
|
+
};
|
89
|
+
}>]>, import("zod").ZodObject<{
|
90
|
+
driver: import("zod").ZodLiteral<"d1">;
|
91
|
+
dbCredentials: import("zod").ZodObject<{
|
92
|
+
wranglerConfigPath: import("zod").ZodString;
|
93
|
+
dbName: import("zod").ZodString;
|
94
|
+
}, "strip", import("zod").ZodTypeAny, {
|
95
|
+
wranglerConfigPath: string;
|
96
|
+
dbName: string;
|
97
|
+
}, {
|
98
|
+
wranglerConfigPath: string;
|
99
|
+
dbName: string;
|
100
|
+
}>;
|
101
|
+
}, "strip", import("zod").ZodTypeAny, {
|
102
|
+
driver: "d1";
|
103
|
+
dbCredentials: {
|
104
|
+
wranglerConfigPath: string;
|
105
|
+
dbName: string;
|
106
|
+
};
|
107
|
+
}, {
|
108
|
+
driver: "d1";
|
109
|
+
dbCredentials: {
|
110
|
+
wranglerConfigPath: string;
|
111
|
+
dbName: string;
|
112
|
+
};
|
113
|
+
}>]>;
|
114
|
+
export declare const studioConfidConnections: import("zod").ZodUnion<[import("zod").ZodObject<{
|
115
|
+
driver: import("zod").ZodLiteral<"mysql2">;
|
116
|
+
dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
|
117
|
+
host: import("zod").ZodString;
|
118
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
119
|
+
user: import("zod").ZodDefault<import("zod").ZodString>;
|
120
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
121
|
+
database: import("zod").ZodString;
|
122
|
+
}, "strip", import("zod").ZodTypeAny, {
|
123
|
+
port?: number | undefined;
|
124
|
+
password?: string | undefined;
|
125
|
+
host: string;
|
126
|
+
user: string;
|
127
|
+
database: string;
|
128
|
+
}, {
|
129
|
+
port?: number | undefined;
|
130
|
+
user?: string | undefined;
|
131
|
+
password?: string | undefined;
|
132
|
+
host: string;
|
133
|
+
database: string;
|
134
|
+
}>, import("zod").ZodObject<{
|
135
|
+
uri: import("zod").ZodString;
|
136
|
+
}, "strip", import("zod").ZodTypeAny, {
|
137
|
+
uri: string;
|
138
|
+
}, {
|
139
|
+
uri: string;
|
140
|
+
}>]>;
|
141
|
+
}, "strip", import("zod").ZodTypeAny, {
|
142
|
+
driver: "mysql2";
|
143
|
+
dbCredentials: {
|
144
|
+
port?: number | undefined;
|
145
|
+
password?: string | undefined;
|
146
|
+
host: string;
|
147
|
+
user: string;
|
148
|
+
database: string;
|
149
|
+
} | {
|
150
|
+
uri: string;
|
151
|
+
};
|
152
|
+
}, {
|
153
|
+
driver: "mysql2";
|
154
|
+
dbCredentials: {
|
155
|
+
port?: number | undefined;
|
156
|
+
user?: string | undefined;
|
157
|
+
password?: string | undefined;
|
158
|
+
host: string;
|
159
|
+
database: string;
|
160
|
+
} | {
|
161
|
+
uri: string;
|
162
|
+
};
|
163
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
164
|
+
driver: import("zod").ZodLiteral<"pg">;
|
165
|
+
dbCredentials: import("zod").ZodObject<{
|
166
|
+
host: import("zod").ZodString;
|
167
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
168
|
+
user: import("zod").ZodDefault<import("zod").ZodString>;
|
169
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
170
|
+
database: import("zod").ZodString;
|
171
|
+
ssl: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
172
|
+
type: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodLiteral<"params">>>;
|
173
|
+
}, "strip", import("zod").ZodTypeAny, {
|
174
|
+
type?: "params" | undefined;
|
175
|
+
port?: number | undefined;
|
176
|
+
password?: string | undefined;
|
177
|
+
ssl?: boolean | undefined;
|
178
|
+
host: string;
|
179
|
+
user: string;
|
180
|
+
database: string;
|
181
|
+
}, {
|
182
|
+
type?: "params" | undefined;
|
183
|
+
port?: number | undefined;
|
184
|
+
user?: string | undefined;
|
185
|
+
password?: string | undefined;
|
186
|
+
ssl?: boolean | undefined;
|
187
|
+
host: string;
|
188
|
+
database: string;
|
189
|
+
}>;
|
190
|
+
}, "strip", import("zod").ZodTypeAny, {
|
191
|
+
driver: "pg";
|
192
|
+
dbCredentials: {
|
193
|
+
type?: "params" | undefined;
|
194
|
+
port?: number | undefined;
|
195
|
+
password?: string | undefined;
|
196
|
+
ssl?: boolean | undefined;
|
197
|
+
host: string;
|
198
|
+
user: string;
|
199
|
+
database: string;
|
200
|
+
};
|
201
|
+
}, {
|
202
|
+
driver: "pg";
|
203
|
+
dbCredentials: {
|
204
|
+
type?: "params" | undefined;
|
205
|
+
port?: number | undefined;
|
206
|
+
user?: string | undefined;
|
207
|
+
password?: string | undefined;
|
208
|
+
ssl?: boolean | undefined;
|
209
|
+
host: string;
|
210
|
+
database: string;
|
211
|
+
};
|
212
|
+
}>, import("zod").ZodObject<{
|
213
|
+
driver: import("zod").ZodLiteral<"pg">;
|
214
|
+
dbCredentials: import("zod").ZodObject<{
|
215
|
+
connectionString: import("zod").ZodString;
|
216
|
+
type: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodLiteral<"url">>>;
|
217
|
+
}, "strip", import("zod").ZodTypeAny, {
|
218
|
+
type?: "url" | undefined;
|
219
|
+
connectionString: string;
|
220
|
+
}, {
|
221
|
+
type?: "url" | undefined;
|
222
|
+
connectionString: string;
|
223
|
+
}>;
|
224
|
+
}, "strip", import("zod").ZodTypeAny, {
|
225
|
+
driver: "pg";
|
226
|
+
dbCredentials: {
|
227
|
+
type?: "url" | undefined;
|
228
|
+
connectionString: string;
|
229
|
+
};
|
230
|
+
}, {
|
231
|
+
driver: "pg";
|
232
|
+
dbCredentials: {
|
233
|
+
type?: "url" | undefined;
|
234
|
+
connectionString: string;
|
235
|
+
};
|
236
|
+
}>]>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
237
|
+
driver: import("zod").ZodLiteral<"turso">;
|
238
|
+
dbCredentials: import("zod").ZodObject<{
|
239
|
+
url: import("zod").ZodString;
|
240
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
241
|
+
}, "strip", import("zod").ZodTypeAny, {
|
242
|
+
authToken?: string | undefined;
|
243
|
+
url: string;
|
244
|
+
}, {
|
245
|
+
authToken?: string | undefined;
|
246
|
+
url: string;
|
247
|
+
}>;
|
248
|
+
}, "strip", import("zod").ZodTypeAny, {
|
249
|
+
driver: "turso";
|
250
|
+
dbCredentials: {
|
251
|
+
authToken?: string | undefined;
|
252
|
+
url: string;
|
253
|
+
};
|
254
|
+
}, {
|
255
|
+
driver: "turso";
|
256
|
+
dbCredentials: {
|
257
|
+
authToken?: string | undefined;
|
258
|
+
url: string;
|
259
|
+
};
|
260
|
+
}>, import("zod").ZodObject<{
|
261
|
+
driver: import("zod").ZodLiteral<"libsql">;
|
262
|
+
dbCredentials: import("zod").ZodObject<{
|
263
|
+
url: import("zod").ZodString;
|
264
|
+
}, "strip", import("zod").ZodTypeAny, {
|
265
|
+
url: string;
|
266
|
+
}, {
|
267
|
+
url: string;
|
268
|
+
}>;
|
269
|
+
}, "strip", import("zod").ZodTypeAny, {
|
270
|
+
driver: "libsql";
|
271
|
+
dbCredentials: {
|
272
|
+
url: string;
|
273
|
+
};
|
274
|
+
}, {
|
275
|
+
driver: "libsql";
|
276
|
+
dbCredentials: {
|
277
|
+
url: string;
|
278
|
+
};
|
279
|
+
}>, import("zod").ZodObject<{
|
280
|
+
driver: import("zod").ZodLiteral<"better-sqlite">;
|
281
|
+
dbCredentials: import("zod").ZodObject<{
|
282
|
+
url: import("zod").ZodString;
|
283
|
+
}, "strip", import("zod").ZodTypeAny, {
|
284
|
+
url: string;
|
285
|
+
}, {
|
286
|
+
url: string;
|
287
|
+
}>;
|
288
|
+
}, "strip", import("zod").ZodTypeAny, {
|
289
|
+
driver: "better-sqlite";
|
290
|
+
dbCredentials: {
|
291
|
+
url: string;
|
292
|
+
};
|
293
|
+
}, {
|
294
|
+
driver: "better-sqlite";
|
295
|
+
dbCredentials: {
|
296
|
+
url: string;
|
297
|
+
};
|
298
|
+
}>]>, import("zod").ZodObject<{
|
299
|
+
driver: import("zod").ZodLiteral<"d1">;
|
300
|
+
dbCredentials: import("zod").ZodObject<{
|
301
|
+
wranglerConfigPath: import("zod").ZodString;
|
302
|
+
dbName: import("zod").ZodString;
|
303
|
+
}, "strip", import("zod").ZodTypeAny, {
|
304
|
+
wranglerConfigPath: string;
|
305
|
+
dbName: string;
|
306
|
+
}, {
|
307
|
+
wranglerConfigPath: string;
|
308
|
+
dbName: string;
|
309
|
+
}>;
|
310
|
+
}, "strip", import("zod").ZodTypeAny, {
|
311
|
+
driver: "d1";
|
312
|
+
dbCredentials: {
|
313
|
+
wranglerConfigPath: string;
|
314
|
+
dbName: string;
|
315
|
+
};
|
316
|
+
}, {
|
317
|
+
driver: "d1";
|
318
|
+
dbCredentials: {
|
319
|
+
wranglerConfigPath: string;
|
320
|
+
dbName: string;
|
321
|
+
};
|
322
|
+
}>]>;
|
323
|
+
export declare const studioConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
|
324
|
+
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
325
|
+
}, "strip", import("zod").ZodTypeAny, {
|
326
|
+
schema: string | string[];
|
327
|
+
}, {
|
328
|
+
schema: string | string[];
|
329
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
330
|
+
driver: import("zod").ZodLiteral<"mysql2">;
|
331
|
+
dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
|
332
|
+
host: import("zod").ZodString;
|
333
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
334
|
+
user: import("zod").ZodDefault<import("zod").ZodString>;
|
335
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
336
|
+
database: import("zod").ZodString;
|
337
|
+
}, "strip", import("zod").ZodTypeAny, {
|
338
|
+
port?: number | undefined;
|
339
|
+
password?: string | undefined;
|
340
|
+
host: string;
|
341
|
+
user: string;
|
342
|
+
database: string;
|
343
|
+
}, {
|
344
|
+
port?: number | undefined;
|
345
|
+
user?: string | undefined;
|
346
|
+
password?: string | undefined;
|
347
|
+
host: string;
|
348
|
+
database: string;
|
349
|
+
}>, import("zod").ZodObject<{
|
350
|
+
uri: import("zod").ZodString;
|
351
|
+
}, "strip", import("zod").ZodTypeAny, {
|
352
|
+
uri: string;
|
353
|
+
}, {
|
354
|
+
uri: string;
|
355
|
+
}>]>;
|
356
|
+
}, "strip", import("zod").ZodTypeAny, {
|
357
|
+
driver: "mysql2";
|
358
|
+
dbCredentials: {
|
359
|
+
port?: number | undefined;
|
360
|
+
password?: string | undefined;
|
361
|
+
host: string;
|
362
|
+
user: string;
|
363
|
+
database: string;
|
364
|
+
} | {
|
365
|
+
uri: string;
|
366
|
+
};
|
367
|
+
}, {
|
368
|
+
driver: "mysql2";
|
369
|
+
dbCredentials: {
|
370
|
+
port?: number | undefined;
|
371
|
+
user?: string | undefined;
|
372
|
+
password?: string | undefined;
|
373
|
+
host: string;
|
374
|
+
database: string;
|
375
|
+
} | {
|
376
|
+
uri: string;
|
377
|
+
};
|
378
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
379
|
+
driver: import("zod").ZodLiteral<"pg">;
|
380
|
+
dbCredentials: import("zod").ZodObject<{
|
381
|
+
host: import("zod").ZodString;
|
382
|
+
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
383
|
+
user: import("zod").ZodDefault<import("zod").ZodString>;
|
384
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
385
|
+
database: import("zod").ZodString;
|
386
|
+
ssl: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
387
|
+
type: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodLiteral<"params">>>;
|
388
|
+
}, "strip", import("zod").ZodTypeAny, {
|
389
|
+
type?: "params" | undefined;
|
390
|
+
port?: number | undefined;
|
391
|
+
password?: string | undefined;
|
392
|
+
ssl?: boolean | undefined;
|
393
|
+
host: string;
|
394
|
+
user: string;
|
395
|
+
database: string;
|
396
|
+
}, {
|
397
|
+
type?: "params" | undefined;
|
398
|
+
port?: number | undefined;
|
399
|
+
user?: string | undefined;
|
400
|
+
password?: string | undefined;
|
401
|
+
ssl?: boolean | undefined;
|
402
|
+
host: string;
|
403
|
+
database: string;
|
404
|
+
}>;
|
405
|
+
}, "strip", import("zod").ZodTypeAny, {
|
406
|
+
driver: "pg";
|
407
|
+
dbCredentials: {
|
408
|
+
type?: "params" | undefined;
|
409
|
+
port?: number | undefined;
|
410
|
+
password?: string | undefined;
|
411
|
+
ssl?: boolean | undefined;
|
412
|
+
host: string;
|
413
|
+
user: string;
|
414
|
+
database: string;
|
415
|
+
};
|
416
|
+
}, {
|
417
|
+
driver: "pg";
|
418
|
+
dbCredentials: {
|
419
|
+
type?: "params" | undefined;
|
420
|
+
port?: number | undefined;
|
421
|
+
user?: string | undefined;
|
422
|
+
password?: string | undefined;
|
423
|
+
ssl?: boolean | undefined;
|
424
|
+
host: string;
|
425
|
+
database: string;
|
426
|
+
};
|
427
|
+
}>, import("zod").ZodObject<{
|
428
|
+
driver: import("zod").ZodLiteral<"pg">;
|
429
|
+
dbCredentials: import("zod").ZodObject<{
|
430
|
+
connectionString: import("zod").ZodString;
|
431
|
+
type: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodLiteral<"url">>>;
|
432
|
+
}, "strip", import("zod").ZodTypeAny, {
|
433
|
+
type?: "url" | undefined;
|
434
|
+
connectionString: string;
|
435
|
+
}, {
|
436
|
+
type?: "url" | undefined;
|
437
|
+
connectionString: string;
|
438
|
+
}>;
|
439
|
+
}, "strip", import("zod").ZodTypeAny, {
|
440
|
+
driver: "pg";
|
441
|
+
dbCredentials: {
|
442
|
+
type?: "url" | undefined;
|
443
|
+
connectionString: string;
|
444
|
+
};
|
445
|
+
}, {
|
446
|
+
driver: "pg";
|
447
|
+
dbCredentials: {
|
448
|
+
type?: "url" | undefined;
|
449
|
+
connectionString: string;
|
450
|
+
};
|
451
|
+
}>]>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
452
|
+
driver: import("zod").ZodLiteral<"turso">;
|
453
|
+
dbCredentials: import("zod").ZodObject<{
|
454
|
+
url: import("zod").ZodString;
|
455
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
456
|
+
}, "strip", import("zod").ZodTypeAny, {
|
457
|
+
authToken?: string | undefined;
|
458
|
+
url: string;
|
459
|
+
}, {
|
460
|
+
authToken?: string | undefined;
|
461
|
+
url: string;
|
462
|
+
}>;
|
463
|
+
}, "strip", import("zod").ZodTypeAny, {
|
464
|
+
driver: "turso";
|
465
|
+
dbCredentials: {
|
466
|
+
authToken?: string | undefined;
|
467
|
+
url: string;
|
468
|
+
};
|
469
|
+
}, {
|
470
|
+
driver: "turso";
|
471
|
+
dbCredentials: {
|
472
|
+
authToken?: string | undefined;
|
473
|
+
url: string;
|
474
|
+
};
|
475
|
+
}>, import("zod").ZodObject<{
|
476
|
+
driver: import("zod").ZodLiteral<"libsql">;
|
477
|
+
dbCredentials: import("zod").ZodObject<{
|
478
|
+
url: import("zod").ZodString;
|
479
|
+
}, "strip", import("zod").ZodTypeAny, {
|
480
|
+
url: string;
|
481
|
+
}, {
|
482
|
+
url: string;
|
483
|
+
}>;
|
484
|
+
}, "strip", import("zod").ZodTypeAny, {
|
485
|
+
driver: "libsql";
|
486
|
+
dbCredentials: {
|
487
|
+
url: string;
|
488
|
+
};
|
489
|
+
}, {
|
490
|
+
driver: "libsql";
|
491
|
+
dbCredentials: {
|
492
|
+
url: string;
|
493
|
+
};
|
494
|
+
}>, import("zod").ZodObject<{
|
495
|
+
driver: import("zod").ZodLiteral<"better-sqlite">;
|
496
|
+
dbCredentials: import("zod").ZodObject<{
|
497
|
+
url: import("zod").ZodString;
|
498
|
+
}, "strip", import("zod").ZodTypeAny, {
|
499
|
+
url: string;
|
500
|
+
}, {
|
501
|
+
url: string;
|
502
|
+
}>;
|
503
|
+
}, "strip", import("zod").ZodTypeAny, {
|
504
|
+
driver: "better-sqlite";
|
505
|
+
dbCredentials: {
|
506
|
+
url: string;
|
507
|
+
};
|
508
|
+
}, {
|
509
|
+
driver: "better-sqlite";
|
510
|
+
dbCredentials: {
|
511
|
+
url: string;
|
512
|
+
};
|
513
|
+
}>]>, import("zod").ZodObject<{
|
514
|
+
driver: import("zod").ZodLiteral<"d1">;
|
515
|
+
dbCredentials: import("zod").ZodObject<{
|
516
|
+
wranglerConfigPath: import("zod").ZodString;
|
517
|
+
dbName: import("zod").ZodString;
|
518
|
+
}, "strip", import("zod").ZodTypeAny, {
|
519
|
+
wranglerConfigPath: string;
|
520
|
+
dbName: string;
|
521
|
+
}, {
|
522
|
+
wranglerConfigPath: string;
|
523
|
+
dbName: string;
|
524
|
+
}>;
|
525
|
+
}, "strip", import("zod").ZodTypeAny, {
|
526
|
+
driver: "d1";
|
527
|
+
dbCredentials: {
|
528
|
+
wranglerConfigPath: string;
|
529
|
+
dbName: string;
|
530
|
+
};
|
531
|
+
}, {
|
532
|
+
driver: "d1";
|
533
|
+
dbCredentials: {
|
534
|
+
wranglerConfigPath: string;
|
535
|
+
dbName: string;
|
536
|
+
};
|
537
|
+
}>]>>;
|
538
|
+
export type StudioConfig = TypeOf<typeof studioConfigSchema>;
|
539
|
+
export type StudioConfigConnections = TypeOf<typeof studioConfidConnections>;
|
540
|
+
export type StudioSqliteConnectionConfig = TypeOf<typeof stuioSqliteConnectionConfig>;
|
541
|
+
export declare const validateStudio: (options: any) => Promise<{
|
542
|
+
schema: string | string[];
|
543
|
+
} & ({
|
544
|
+
driver: "pg";
|
545
|
+
dbCredentials: {
|
546
|
+
type?: "params" | undefined;
|
547
|
+
port?: number | undefined;
|
548
|
+
password?: string | undefined;
|
549
|
+
ssl?: boolean | undefined;
|
550
|
+
host: string;
|
551
|
+
user: string;
|
552
|
+
database: string;
|
553
|
+
};
|
554
|
+
} | {
|
555
|
+
driver: "pg";
|
556
|
+
dbCredentials: {
|
557
|
+
type?: "url" | undefined;
|
558
|
+
connectionString: string;
|
559
|
+
};
|
560
|
+
} | {
|
561
|
+
driver: "turso";
|
562
|
+
dbCredentials: {
|
563
|
+
authToken?: string | undefined;
|
564
|
+
url: string;
|
565
|
+
};
|
566
|
+
} | {
|
567
|
+
driver: "libsql";
|
568
|
+
dbCredentials: {
|
569
|
+
url: string;
|
570
|
+
};
|
571
|
+
} | {
|
572
|
+
driver: "better-sqlite";
|
573
|
+
dbCredentials: {
|
574
|
+
url: string;
|
575
|
+
};
|
576
|
+
} | {
|
577
|
+
driver: "mysql2";
|
578
|
+
dbCredentials: {
|
579
|
+
port?: number | undefined;
|
580
|
+
password?: string | undefined;
|
581
|
+
host: string;
|
582
|
+
user: string;
|
583
|
+
database: string;
|
584
|
+
} | {
|
585
|
+
uri: string;
|
586
|
+
};
|
587
|
+
} | {
|
588
|
+
driver: "d1";
|
589
|
+
dbCredentials: {
|
590
|
+
wranglerConfigPath: string;
|
591
|
+
dbName: string;
|
592
|
+
};
|
593
|
+
})>;
|
package/cli/views.d.ts
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
import { Prompt, TaskView } from "hanji";
|
2
|
+
import type { CommonSchema } from "src/schemaValidator";
|
3
|
+
import type { Named } from "./commands/migrate";
|
4
|
+
export declare const warning: (msg: string) => void;
|
5
|
+
export declare const err: (msg: string) => void;
|
6
|
+
export declare const info: (msg: string, greyMsg?: string) => string;
|
7
|
+
export declare const error: (error: string, greyMsg?: string) => string;
|
8
|
+
export declare const schema: (schema: CommonSchema) => string;
|
9
|
+
export interface RenamePropmtItem<T> {
|
10
|
+
from: T;
|
11
|
+
to: T;
|
12
|
+
}
|
13
|
+
export declare const isRenamePromptItem: <T extends Named>(item: T | RenamePropmtItem<T>) => item is RenamePropmtItem<T>;
|
14
|
+
export declare class ResolveColumnSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
|
15
|
+
private readonly tableName;
|
16
|
+
private readonly base;
|
17
|
+
private readonly data;
|
18
|
+
constructor(tableName: string, base: Named, data: (RenamePropmtItem<T> | T)[]);
|
19
|
+
render(status: "idle" | "submitted" | "aborted"): string;
|
20
|
+
result(): RenamePropmtItem<T> | T;
|
21
|
+
}
|
22
|
+
export declare class ResolveTableSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
|
23
|
+
private readonly base;
|
24
|
+
private readonly state;
|
25
|
+
constructor(base: Named, data: (RenamePropmtItem<T> | T)[]);
|
26
|
+
render(status: "idle" | "submitted" | "aborted"): string;
|
27
|
+
result(): RenamePropmtItem<T> | T;
|
28
|
+
}
|
29
|
+
export declare class ResolveSchemasSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
|
30
|
+
private readonly base;
|
31
|
+
private readonly state;
|
32
|
+
constructor(base: Named, data: (RenamePropmtItem<T> | T)[]);
|
33
|
+
render(status: "idle" | "submitted" | "aborted"): string;
|
34
|
+
result(): RenamePropmtItem<T> | T;
|
35
|
+
}
|
36
|
+
export type IntrospectStatus = "fetching" | "done";
|
37
|
+
export type IntrospectStage = "tables" | "columns" | "enums" | "indexes" | "fks";
|
38
|
+
export declare class IntrospectProgress extends TaskView {
|
39
|
+
private readonly spinner;
|
40
|
+
private timeout;
|
41
|
+
private state;
|
42
|
+
constructor();
|
43
|
+
update(stage: IntrospectStage, count: number, status: IntrospectStatus): void;
|
44
|
+
private formatCount;
|
45
|
+
private statusText;
|
46
|
+
render(): string;
|
47
|
+
}
|
48
|
+
export declare class DropMigrationView<T extends {
|
49
|
+
tag: string;
|
50
|
+
}> extends Prompt<T> {
|
51
|
+
private readonly data;
|
52
|
+
constructor(data: T[]);
|
53
|
+
render(status: "idle" | "submitted" | "aborted"): string;
|
54
|
+
result(): T;
|
55
|
+
}
|
56
|
+
export declare const trimmedRange: <T>(arr: T[], index: number, limitLines: number) => {
|
57
|
+
trimmed: T[];
|
58
|
+
offset: number;
|
59
|
+
startTrimmed: boolean;
|
60
|
+
endTrimmed: boolean;
|
61
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { Client } from "@libsql/client";
|
2
|
+
import type { PgDatabase } from "drizzle-orm/pg-core";
|
3
|
+
import type { Client as PgClient } from "pg";
|
4
|
+
export declare abstract class DrizzleDbClient<T = any> {
|
5
|
+
protected db: T;
|
6
|
+
constructor(db: T);
|
7
|
+
abstract query<K = any>(query: string, values?: any[]): Promise<K[]>;
|
8
|
+
abstract run(query: string): Promise<void>;
|
9
|
+
}
|
10
|
+
export declare class DrizzleORMPgClient extends DrizzleDbClient<PgDatabase<any>> {
|
11
|
+
query<K = any>(query: string, values?: any[] | undefined): Promise<K[]>;
|
12
|
+
run(query: string): Promise<void>;
|
13
|
+
}
|
14
|
+
export declare class BetterSqlite extends DrizzleDbClient {
|
15
|
+
run(query: string): Promise<void>;
|
16
|
+
query(query: string): Promise<any[]>;
|
17
|
+
}
|
18
|
+
export declare class TursoSqlite extends DrizzleDbClient<Client> {
|
19
|
+
run(query: string): Promise<void>;
|
20
|
+
query(query: string): Promise<any[]>;
|
21
|
+
}
|
22
|
+
export declare class PgPostgres extends DrizzleDbClient<PgClient> {
|
23
|
+
query<K = any>(query: string, values?: any[]): Promise<K[]>;
|
24
|
+
run(query: string): Promise<void>;
|
25
|
+
}
|
package/global.d.ts
ADDED