drizzle-kit 0.20.0-572b8ee → 0.20.0-588929f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{index.cjs → bin.cjs} +986 -676
- package/cli/utils.d.ts +11 -0
- package/cli/validations/mysql.d.ts +77 -126
- package/cli/validations/studio.d.ts +118 -73
- package/global.d.ts +1 -0
- package/index.d.mts +105 -0
- package/index.d.ts +2 -2
- package/index.js +31 -0
- package/index.mjs +7 -0
- package/orm-extenstions/d1-driver/session.d.ts +2 -3
- package/package.json +24 -8
- package/serializer/studioUtils.d.ts +20 -3
- package/utils.d.ts +1 -2
- package/utils.js +1071 -956
|
@@ -24,75 +24,143 @@ export declare const studioSpecificConnections: import("zod").ZodObject<{
|
|
|
24
24
|
dbName: string;
|
|
25
25
|
};
|
|
26
26
|
}>;
|
|
27
|
-
export declare const
|
|
28
|
-
driver: import("zod").ZodLiteral<"
|
|
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">;
|
|
29
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<{
|
|
30
117
|
host: import("zod").ZodString;
|
|
31
118
|
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
32
119
|
user: import("zod").ZodDefault<import("zod").ZodString>;
|
|
33
120
|
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
34
121
|
database: import("zod").ZodString;
|
|
35
|
-
type: import("zod").ZodDefault<import("zod").ZodLiteral<"params">>;
|
|
36
122
|
}, "strip", import("zod").ZodTypeAny, {
|
|
37
123
|
port?: number | undefined;
|
|
38
124
|
password?: string | undefined;
|
|
39
|
-
type: "params";
|
|
40
125
|
host: string;
|
|
41
126
|
user: string;
|
|
42
127
|
database: string;
|
|
43
128
|
}, {
|
|
44
|
-
type?: "params" | undefined;
|
|
45
129
|
port?: number | undefined;
|
|
46
130
|
user?: string | undefined;
|
|
47
131
|
password?: string | undefined;
|
|
48
132
|
host: string;
|
|
49
133
|
database: string;
|
|
50
|
-
}
|
|
134
|
+
}>, import("zod").ZodObject<{
|
|
135
|
+
uri: import("zod").ZodString;
|
|
136
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
137
|
+
uri: string;
|
|
138
|
+
}, {
|
|
139
|
+
uri: string;
|
|
140
|
+
}>]>;
|
|
51
141
|
}, "strip", import("zod").ZodTypeAny, {
|
|
52
142
|
driver: "mysql2";
|
|
53
143
|
dbCredentials: {
|
|
54
144
|
port?: number | undefined;
|
|
55
145
|
password?: string | undefined;
|
|
56
|
-
type: "params";
|
|
57
146
|
host: string;
|
|
58
147
|
user: string;
|
|
59
148
|
database: string;
|
|
149
|
+
} | {
|
|
150
|
+
uri: string;
|
|
60
151
|
};
|
|
61
152
|
}, {
|
|
62
153
|
driver: "mysql2";
|
|
63
154
|
dbCredentials: {
|
|
64
|
-
type?: "params" | undefined;
|
|
65
155
|
port?: number | undefined;
|
|
66
156
|
user?: string | undefined;
|
|
67
157
|
password?: string | undefined;
|
|
68
158
|
host: string;
|
|
69
159
|
database: string;
|
|
160
|
+
} | {
|
|
161
|
+
uri: string;
|
|
70
162
|
};
|
|
71
|
-
}>, import("zod").ZodObject<{
|
|
72
|
-
driver: import("zod").ZodLiteral<"mysql2">;
|
|
73
|
-
dbCredentials: import("zod").ZodObject<{
|
|
74
|
-
connectionString: import("zod").ZodString;
|
|
75
|
-
type: import("zod").ZodDefault<import("zod").ZodLiteral<"url">>;
|
|
76
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
77
|
-
type: "url";
|
|
78
|
-
connectionString: string;
|
|
79
|
-
}, {
|
|
80
|
-
type?: "url" | undefined;
|
|
81
|
-
connectionString: string;
|
|
82
|
-
}>;
|
|
83
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
84
|
-
driver: "mysql2";
|
|
85
|
-
dbCredentials: {
|
|
86
|
-
type: "url";
|
|
87
|
-
connectionString: string;
|
|
88
|
-
};
|
|
89
|
-
}, {
|
|
90
|
-
driver: "mysql2";
|
|
91
|
-
dbCredentials: {
|
|
92
|
-
type?: "url" | undefined;
|
|
93
|
-
connectionString: string;
|
|
94
|
-
};
|
|
95
|
-
}>]>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
163
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
96
164
|
driver: import("zod").ZodLiteral<"pg">;
|
|
97
165
|
dbCredentials: import("zod").ZodObject<{
|
|
98
166
|
host: import("zod").ZodString;
|
|
@@ -258,75 +326,56 @@ export declare const studioConfigSchema: import("zod").ZodIntersection<import("z
|
|
|
258
326
|
schema: string | string[];
|
|
259
327
|
}, {
|
|
260
328
|
schema: string | string[];
|
|
261
|
-
}>, import("zod").ZodUnion<[import("zod").
|
|
329
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
262
330
|
driver: import("zod").ZodLiteral<"mysql2">;
|
|
263
|
-
dbCredentials: import("zod").ZodObject<{
|
|
331
|
+
dbCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
264
332
|
host: import("zod").ZodString;
|
|
265
333
|
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
266
334
|
user: import("zod").ZodDefault<import("zod").ZodString>;
|
|
267
335
|
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
268
336
|
database: import("zod").ZodString;
|
|
269
|
-
type: import("zod").ZodDefault<import("zod").ZodLiteral<"params">>;
|
|
270
337
|
}, "strip", import("zod").ZodTypeAny, {
|
|
271
338
|
port?: number | undefined;
|
|
272
339
|
password?: string | undefined;
|
|
273
|
-
type: "params";
|
|
274
340
|
host: string;
|
|
275
341
|
user: string;
|
|
276
342
|
database: string;
|
|
277
343
|
}, {
|
|
278
|
-
type?: "params" | undefined;
|
|
279
344
|
port?: number | undefined;
|
|
280
345
|
user?: string | undefined;
|
|
281
346
|
password?: string | undefined;
|
|
282
347
|
host: string;
|
|
283
348
|
database: string;
|
|
284
|
-
}
|
|
349
|
+
}>, import("zod").ZodObject<{
|
|
350
|
+
uri: import("zod").ZodString;
|
|
351
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
352
|
+
uri: string;
|
|
353
|
+
}, {
|
|
354
|
+
uri: string;
|
|
355
|
+
}>]>;
|
|
285
356
|
}, "strip", import("zod").ZodTypeAny, {
|
|
286
357
|
driver: "mysql2";
|
|
287
358
|
dbCredentials: {
|
|
288
359
|
port?: number | undefined;
|
|
289
360
|
password?: string | undefined;
|
|
290
|
-
type: "params";
|
|
291
361
|
host: string;
|
|
292
362
|
user: string;
|
|
293
363
|
database: string;
|
|
364
|
+
} | {
|
|
365
|
+
uri: string;
|
|
294
366
|
};
|
|
295
367
|
}, {
|
|
296
368
|
driver: "mysql2";
|
|
297
369
|
dbCredentials: {
|
|
298
|
-
type?: "params" | undefined;
|
|
299
370
|
port?: number | undefined;
|
|
300
371
|
user?: string | undefined;
|
|
301
372
|
password?: string | undefined;
|
|
302
373
|
host: string;
|
|
303
374
|
database: string;
|
|
375
|
+
} | {
|
|
376
|
+
uri: string;
|
|
304
377
|
};
|
|
305
|
-
}>, import("zod").ZodObject<{
|
|
306
|
-
driver: import("zod").ZodLiteral<"mysql2">;
|
|
307
|
-
dbCredentials: import("zod").ZodObject<{
|
|
308
|
-
connectionString: import("zod").ZodString;
|
|
309
|
-
type: import("zod").ZodDefault<import("zod").ZodLiteral<"url">>;
|
|
310
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
311
|
-
type: "url";
|
|
312
|
-
connectionString: string;
|
|
313
|
-
}, {
|
|
314
|
-
type?: "url" | undefined;
|
|
315
|
-
connectionString: string;
|
|
316
|
-
}>;
|
|
317
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
318
|
-
driver: "mysql2";
|
|
319
|
-
dbCredentials: {
|
|
320
|
-
type: "url";
|
|
321
|
-
connectionString: string;
|
|
322
|
-
};
|
|
323
|
-
}, {
|
|
324
|
-
driver: "mysql2";
|
|
325
|
-
dbCredentials: {
|
|
326
|
-
type?: "url" | undefined;
|
|
327
|
-
connectionString: string;
|
|
328
|
-
};
|
|
329
|
-
}>]>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
378
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
|
330
379
|
driver: import("zod").ZodLiteral<"pg">;
|
|
331
380
|
dbCredentials: import("zod").ZodObject<{
|
|
332
381
|
host: import("zod").ZodString;
|
|
@@ -488,6 +537,7 @@ export declare const studioConfigSchema: import("zod").ZodIntersection<import("z
|
|
|
488
537
|
}>]>>;
|
|
489
538
|
export type StudioConfig = TypeOf<typeof studioConfigSchema>;
|
|
490
539
|
export type StudioConfigConnections = TypeOf<typeof studioConfidConnections>;
|
|
540
|
+
export type StudioSqliteConnectionConfig = TypeOf<typeof stuioSqliteConnectionConfig>;
|
|
491
541
|
export declare const validateStudio: (options: any) => Promise<{
|
|
492
542
|
schema: string | string[];
|
|
493
543
|
} & ({
|
|
@@ -528,16 +578,11 @@ export declare const validateStudio: (options: any) => Promise<{
|
|
|
528
578
|
dbCredentials: {
|
|
529
579
|
port?: number | undefined;
|
|
530
580
|
password?: string | undefined;
|
|
531
|
-
type: "params";
|
|
532
581
|
host: string;
|
|
533
582
|
user: string;
|
|
534
583
|
database: string;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
driver: "mysql2";
|
|
538
|
-
dbCredentials: {
|
|
539
|
-
type: "url";
|
|
540
|
-
connectionString: string;
|
|
584
|
+
} | {
|
|
585
|
+
uri: string;
|
|
541
586
|
};
|
|
542
587
|
} | {
|
|
543
588
|
driver: "d1";
|
package/global.d.ts
CHANGED
package/index.d.mts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export type DbConnection = {
|
|
2
|
+
driver: "turso";
|
|
3
|
+
dbCredentials: {
|
|
4
|
+
url: string;
|
|
5
|
+
authToken?: string;
|
|
6
|
+
};
|
|
7
|
+
} | {
|
|
8
|
+
driver: "better-sqlite";
|
|
9
|
+
dbCredentials: {
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
driver: "libsql";
|
|
14
|
+
dbCredentials: {
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
driver: "d1";
|
|
19
|
+
dbCredentials: {
|
|
20
|
+
wranglerConfigPath: string;
|
|
21
|
+
dbName: string;
|
|
22
|
+
};
|
|
23
|
+
} | {
|
|
24
|
+
driver: "pg";
|
|
25
|
+
dbCredentials: {
|
|
26
|
+
host: string;
|
|
27
|
+
port?: number;
|
|
28
|
+
user?: string;
|
|
29
|
+
password?: string;
|
|
30
|
+
database: string;
|
|
31
|
+
ssl?: boolean;
|
|
32
|
+
} | {
|
|
33
|
+
connectionString: string;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
driver: "mysql2";
|
|
37
|
+
dbCredentials: {
|
|
38
|
+
host: string;
|
|
39
|
+
port?: number;
|
|
40
|
+
user?: string;
|
|
41
|
+
password?: string;
|
|
42
|
+
database: string;
|
|
43
|
+
} | {
|
|
44
|
+
uri: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type Config = {
|
|
48
|
+
out?: string | undefined;
|
|
49
|
+
breakpoints?: boolean | undefined;
|
|
50
|
+
tablesFilter?: string | string[] | undefined;
|
|
51
|
+
schemaFilter?: string | string[] | undefined;
|
|
52
|
+
schema?: string | string[];
|
|
53
|
+
verbose?: boolean | undefined;
|
|
54
|
+
strict?: boolean | undefined;
|
|
55
|
+
} & {
|
|
56
|
+
introspect?: {
|
|
57
|
+
casing: "camel" | "preserve";
|
|
58
|
+
};
|
|
59
|
+
} & ({
|
|
60
|
+
driver: "turso";
|
|
61
|
+
dbCredentials: {
|
|
62
|
+
url: string;
|
|
63
|
+
authToken?: string;
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
driver: "better-sqlite";
|
|
67
|
+
dbCredentials: {
|
|
68
|
+
url: string;
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
driver: "libsql";
|
|
72
|
+
dbCredentials: {
|
|
73
|
+
url: string;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
driver: "pg";
|
|
77
|
+
dbCredentials: {
|
|
78
|
+
host: string;
|
|
79
|
+
port?: number;
|
|
80
|
+
user?: string;
|
|
81
|
+
password?: string;
|
|
82
|
+
database: string;
|
|
83
|
+
ssl?: boolean;
|
|
84
|
+
} | {
|
|
85
|
+
connectionString: string;
|
|
86
|
+
};
|
|
87
|
+
} | {
|
|
88
|
+
driver: "mysql2";
|
|
89
|
+
dbCredentials: {
|
|
90
|
+
host: string;
|
|
91
|
+
port?: number;
|
|
92
|
+
user?: string;
|
|
93
|
+
password?: string;
|
|
94
|
+
database: string;
|
|
95
|
+
} | {
|
|
96
|
+
uri: string;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
driver: "d1";
|
|
100
|
+
dbCredentials: {
|
|
101
|
+
wranglerConfigPath: string;
|
|
102
|
+
dbName: string;
|
|
103
|
+
};
|
|
104
|
+
} | {});
|
|
105
|
+
export declare function defineConfig(config: Config): Config;
|
package/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export type DbConnection = {
|
|
|
41
41
|
password?: string;
|
|
42
42
|
database: string;
|
|
43
43
|
} | {
|
|
44
|
-
|
|
44
|
+
uri: string;
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
export type Config = {
|
|
@@ -93,7 +93,7 @@ export type Config = {
|
|
|
93
93
|
password?: string;
|
|
94
94
|
database: string;
|
|
95
95
|
} | {
|
|
96
|
-
|
|
96
|
+
uri: string;
|
|
97
97
|
};
|
|
98
98
|
} | {
|
|
99
99
|
driver: "d1";
|
package/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
defineConfig: () => defineConfig
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(src_exports);
|
|
25
|
+
function defineConfig(config) {
|
|
26
|
+
return config;
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
defineConfig
|
|
31
|
+
});
|
package/index.mjs
ADDED
|
@@ -2,10 +2,9 @@ import { entityKind } from "drizzle-orm";
|
|
|
2
2
|
import type { Logger } from "drizzle-orm";
|
|
3
3
|
import { type RelationalSchemaConfig, type TablesRelationalConfig } from "drizzle-orm";
|
|
4
4
|
import { type Query } from "drizzle-orm";
|
|
5
|
-
import
|
|
5
|
+
import { SQLiteAsyncDialect, SQLiteExecuteMethod, SQLitePreparedQuery, SQLiteSession } from "drizzle-orm/sqlite-core";
|
|
6
6
|
import type { SelectedFieldsOrdered } from "drizzle-orm/sqlite-core";
|
|
7
7
|
import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteTransactionConfig } from "drizzle-orm/sqlite-core";
|
|
8
|
-
import { PreparedQuery as PreparedQueryBase, SQLiteSession } from "drizzle-orm/sqlite-core";
|
|
9
8
|
export interface SQLiteD1SessionOptions {
|
|
10
9
|
logger?: Logger;
|
|
11
10
|
}
|
|
@@ -25,7 +24,7 @@ export declare class SQLiteWranglerD1Session<TFullSchema extends Record<string,
|
|
|
25
24
|
prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, customResultMapper?: (rows: unknown[][]) => unknown): PreparedQuery;
|
|
26
25
|
transaction<T>(transaction: (tx: any) => T | Promise<T>, config?: SQLiteTransactionConfig): Promise<T>;
|
|
27
26
|
}
|
|
28
|
-
export declare class PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends
|
|
27
|
+
export declare class PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
|
|
29
28
|
type: "async";
|
|
30
29
|
run: D1WranglerResults;
|
|
31
30
|
all: T["all"];
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-kit",
|
|
3
|
-
"version": "0.20.0-
|
|
3
|
+
"version": "0.20.0-588929f",
|
|
4
4
|
"repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
|
|
5
5
|
"author": "Drizzle Team",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
8
|
-
"drizzle-kit": "./
|
|
8
|
+
"drizzle-kit": "./bin.cjs"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test:pg:push": "drizzle-kit push:pg",
|
|
@@ -35,12 +35,13 @@
|
|
|
35
35
|
"sim": "node -r esbuild-register ./dev/simulate.ts",
|
|
36
36
|
"sim:sqlite": "node -r esbuild-register ./dev/sqlite/index.ts",
|
|
37
37
|
"test": "ava test --timeout=60s",
|
|
38
|
-
"build": "rm -rf ./dist &&
|
|
38
|
+
"build": "rm -rf ./dist && tsc -p tsconfig.cli-types.json && cp dist/index.d.ts dist/index.d.mts && tsx build.ts",
|
|
39
39
|
"build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
|
|
40
40
|
"packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack",
|
|
41
41
|
"tsc": "tsc -p tsconfig.build.json",
|
|
42
42
|
"pub": "cp package.json readme.md dist/ && cd dist && npm publish",
|
|
43
|
-
"studio": "./dist/index.cjs studio --verbose"
|
|
43
|
+
"studio": "./dist/index.cjs studio --verbose",
|
|
44
|
+
"studio:dev": "tsx ./src/cli/index.ts studio --verbose"
|
|
44
45
|
},
|
|
45
46
|
"ava": {
|
|
46
47
|
"files": [
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
]
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
|
-
"@drizzle-team/studio": "^0.0.
|
|
58
|
+
"@drizzle-team/studio": "^0.0.27",
|
|
58
59
|
"@esbuild-kit/esm-loader": "^2.5.5",
|
|
59
60
|
"camelcase": "^7.0.1",
|
|
60
61
|
"chalk": "^5.2.0",
|
|
@@ -76,25 +77,40 @@
|
|
|
76
77
|
"@types/glob": "^8.1.0",
|
|
77
78
|
"@types/minimatch": "^5.1.2",
|
|
78
79
|
"@types/node": "^18.11.15",
|
|
79
|
-
"@types/pg": "^8.
|
|
80
|
+
"@types/pg": "^8.10.7",
|
|
80
81
|
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
81
82
|
"@typescript-eslint/parser": "^5.46.1",
|
|
82
83
|
"ava": "^5.1.0",
|
|
83
84
|
"better-sqlite3": "^8.4.0",
|
|
84
85
|
"dockerode": "^3.3.4",
|
|
85
86
|
"dotenv": "^16.0.3",
|
|
86
|
-
"drizzle-orm": "0.
|
|
87
|
+
"drizzle-orm": "0.29.0-d3b1c58",
|
|
88
|
+
"esbuild-node-externals": "^1.9.0",
|
|
87
89
|
"eslint": "^8.29.0",
|
|
88
90
|
"eslint-config-prettier": "^8.5.0",
|
|
89
91
|
"eslint-plugin-prettier": "^4.2.1",
|
|
90
92
|
"get-port": "^6.1.2",
|
|
91
93
|
"mysql2": "2.3.3",
|
|
92
|
-
"pg": "^8.
|
|
94
|
+
"pg": "^8.11.3",
|
|
93
95
|
"postgres": "^3.3.5",
|
|
94
96
|
"prettier": "^2.8.1",
|
|
95
97
|
"tsx": "^3.12.1",
|
|
96
98
|
"typescript": "^4.9.4",
|
|
97
99
|
"uvu": "^0.5.6",
|
|
98
100
|
"zx": "^7.2.2"
|
|
101
|
+
},
|
|
102
|
+
"exports": {
|
|
103
|
+
".": {
|
|
104
|
+
"import": {
|
|
105
|
+
"types": "./index.d.mts",
|
|
106
|
+
"default": "./index.mjs"
|
|
107
|
+
},
|
|
108
|
+
"require": {
|
|
109
|
+
"types": "./index.d.ts",
|
|
110
|
+
"default": "./index.js"
|
|
111
|
+
},
|
|
112
|
+
"types": "./index.d.mts",
|
|
113
|
+
"default": "./index.mjs"
|
|
114
|
+
}
|
|
99
115
|
}
|
|
100
116
|
}
|
|
@@ -1,19 +1,36 @@
|
|
|
1
|
+
import type { Setup } from "@drizzle-team/studio";
|
|
1
2
|
import { Relations } from "drizzle-orm";
|
|
2
3
|
import { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
|
3
4
|
import { AnyPgTable } from "drizzle-orm/pg-core";
|
|
4
5
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
6
|
+
import { MySQLConnectionConfig } from "src/cli/validations/mysql";
|
|
7
|
+
import { PgConnectionConfig } from "src/cli/validations/pg";
|
|
8
|
+
import { StudioConfigConnections, StudioSqliteConnectionConfig as StudioSQLiteConnectionConfig } from "src/cli/validations/studio";
|
|
9
|
+
export declare const preparePgSchema: (path: string | string[]) => Promise<{
|
|
10
|
+
schema: Record<string, Record<string, AnyPgTable<{}>>>;
|
|
11
|
+
relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const prepareMySqlSchema: (path: string | string[]) => Promise<{
|
|
14
|
+
schema: Record<string, Record<string, AnyMySqlTable<{}>>>;
|
|
15
|
+
relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const prepareSQLiteSchema: (path: string | string[]) => Promise<{
|
|
18
|
+
schema: Record<string, Record<string, AnySQLiteTable<{}>>>;
|
|
19
|
+
relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
20
|
+
}>;
|
|
7
21
|
export declare const prepareModels: (path: string | string[]) => Promise<{
|
|
8
22
|
pgSchema: Record<string, AnyPgTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
9
23
|
mysqlSchema: Record<string, AnyMySqlTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
10
24
|
sqliteSchema: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>> | AnySQLiteTable<{}>>;
|
|
11
25
|
}>;
|
|
26
|
+
export declare const drizzleForPostgres: (connectionConfig: PgConnectionConfig, pgSchema: Record<string, Record<string, AnyPgTable>>, relations: Record<string, Relations>, verbose: boolean) => Promise<Setup>;
|
|
27
|
+
export declare const drizzleForMySQL: (config: MySQLConnectionConfig, mysqlSchema: Record<string, Record<string, AnyMySqlTable>>, relations: Record<string, Relations>, verbose: boolean) => Promise<Setup>;
|
|
28
|
+
export declare const drizzleForSQLite: (config: StudioSQLiteConnectionConfig, sqliteSchema: Record<string, Record<string, AnySQLiteTable>>, relations: Record<string, Relations>, verbose: boolean) => Promise<Setup>;
|
|
12
29
|
export declare const drizzleDb: (drizzleConfig: StudioConfigConnections, models: {
|
|
13
30
|
pgSchema?: Record<string, AnyPgTable | Relations>;
|
|
14
31
|
mysqlSchema?: Record<string, AnyMySqlTable | Relations>;
|
|
15
32
|
sqliteSchema?: Record<string, AnySQLiteTable | Relations>;
|
|
16
|
-
}, logger: boolean
|
|
33
|
+
}, logger: boolean) => Promise<{
|
|
17
34
|
db: import("drizzle-orm/node-postgres").NodePgDatabase<Record<string, never>>;
|
|
18
35
|
type: "pg";
|
|
19
36
|
schema: Record<string, AnyPgTable<{}> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>> | undefined;
|
package/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Dialect } from "./schemaValidator";
|
|
|
2
2
|
import { NamedWithSchema } from "./cli/commands/migrate";
|
|
3
3
|
import { PgDatabase } from "drizzle-orm/pg-core";
|
|
4
4
|
import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
|
|
5
|
-
import {
|
|
5
|
+
import { DbConnection } from ".";
|
|
6
6
|
export declare const assertV1OutFolder: (out: string, dialect: Dialect | "{dialect}") => void;
|
|
7
7
|
export type Journal = {
|
|
8
8
|
version: string;
|
|
@@ -17,7 +17,6 @@ export type Journal = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare const dryJournal: (dialect: Dialect) => Journal;
|
|
19
19
|
export declare const snapshotsPriorV4: (out: string) => string[];
|
|
20
|
-
export declare function defineConfig(config: Config): Config;
|
|
21
20
|
export declare const prepareOutFolder: (out: string, dialect: Dialect) => {
|
|
22
21
|
meta: string;
|
|
23
22
|
snapshots: string[];
|