drizzle-kit 0.20.18-d190692 → 0.20.18
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/bin.cjs +55769 -103683
- package/cli/commands/migrate.d.ts +270 -0
- package/cli/commands/mysqlIntrospect.d.ts +119 -0
- package/cli/commands/mysqlPushUtils.d.ts +18 -0
- package/cli/commands/mysqlUp.d.ts +4 -0
- package/cli/commands/pgConnect.d.ts +5 -0
- package/cli/commands/pgIntrospect.d.ts +123 -0
- package/cli/commands/pgPushUtils.d.ts +14 -0
- package/cli/commands/pgUp.d.ts +4 -0
- package/cli/commands/sqliteIntrospect.d.ts +107 -0
- package/cli/commands/sqlitePushUtils.d.ts +21 -0
- package/cli/commands/sqliteUtils.d.ts +162 -0
- package/cli/commands/upFolders.d.ts +27 -0
- package/cli/commands/utils.d.ts +274 -0
- package/cli/selector-ui.d.ts +13 -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/views.d.ts +61 -0
- package/drivers/index.d.ts +39 -0
- package/global.d.ts +4 -0
- package/index.d.mts +68 -46
- package/index.d.ts +68 -46
- package/index.js +0 -1
- package/introspect-mysql.d.ts +9 -0
- package/introspect-pg.d.ts +12 -0
- package/introspect-sqlite.d.ts +10 -0
- package/jsonDiffer.d.ts +76 -0
- package/jsonStatements.d.ts +349 -0
- package/migrationPreparator.d.ts +35 -0
- package/package.json +64 -31
- package/payload.d.mts +18 -1052
- package/payload.d.ts +18 -1052
- package/payload.js +33563 -19279
- package/payload.mjs +33457 -19180
- package/schemaValidator.d.ts +1313 -0
- package/serializer/index.d.ts +9 -0
- package/serializer/mysqlImports.d.ts +11 -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 +4333 -0
- package/serializer/pgSerializer.d.ts +7 -0
- package/serializer/schemaToDrizzle.d.ts +7 -0
- package/serializer/sqliteImports.d.ts +9 -0
- package/serializer/sqliteSchema.d.ts +3227 -0
- package/serializer/sqliteSerializer.d.ts +6 -0
- package/snapshotsDiffer.d.ts +2660 -0
- package/sqlgenerator.d.ts +33 -0
- package/utils/words.d.ts +7 -0
- package/utils-studio.d.mts +5 -0
- package/utils-studio.d.ts +5 -0
- package/utils-studio.js +809 -4584
- package/utils-studio.mjs +793 -4565
- package/utils.d.ts +199 -0
- package/utils.js +7165 -4635
- package/utils.mjs +7125 -4595
package/index.d.mts
CHANGED
@@ -1,44 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { TypeOf } from 'zod';
|
4
|
-
|
5
|
-
declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
|
6
|
-
type Driver = TypeOf<typeof driver>;
|
7
|
-
|
8
|
-
declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
9
|
-
type Dialect = TypeOf<typeof dialect>;
|
10
|
-
|
11
|
-
type Verify<T, U extends T> = U;
|
12
|
-
type Config = {
|
13
|
-
dialect: Dialect;
|
14
|
-
out?: string;
|
15
|
-
breakpoints?: boolean;
|
16
|
-
tablesFilter?: string | string[];
|
17
|
-
schemaFilter?: string | string[];
|
18
|
-
schema?: string | string[];
|
19
|
-
verbose?: boolean;
|
20
|
-
strict?: boolean;
|
21
|
-
migrations?: {
|
22
|
-
table?: string;
|
23
|
-
schema?: string;
|
24
|
-
};
|
25
|
-
introspect?: {
|
26
|
-
casing: "camel" | "preserve";
|
27
|
-
};
|
28
|
-
} & ({
|
29
|
-
dialect: Verify<Dialect, "sqlite">;
|
30
|
-
driver: Verify<Driver, "turso">;
|
1
|
+
export type DbConnection = {
|
2
|
+
driver: "turso";
|
31
3
|
dbCredentials: {
|
32
4
|
url: string;
|
33
5
|
authToken?: string;
|
34
6
|
};
|
35
7
|
} | {
|
36
|
-
|
8
|
+
driver: "better-sqlite";
|
37
9
|
dbCredentials: {
|
38
10
|
url: string;
|
39
11
|
};
|
40
12
|
} | {
|
41
|
-
|
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";
|
42
25
|
dbCredentials: {
|
43
26
|
host: string;
|
44
27
|
port?: number;
|
@@ -47,39 +30,78 @@ type Config = {
|
|
47
30
|
database: string;
|
48
31
|
ssl?: boolean;
|
49
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: {
|
50
68
|
url: string;
|
51
69
|
};
|
52
70
|
} | {
|
53
|
-
|
54
|
-
driver: Verify<Driver, "aws-data-api">;
|
71
|
+
driver: "libsql";
|
55
72
|
dbCredentials: {
|
73
|
+
url: string;
|
74
|
+
};
|
75
|
+
} | {
|
76
|
+
driver: "pg";
|
77
|
+
dbCredentials: {
|
78
|
+
host: string;
|
79
|
+
port?: number;
|
80
|
+
user?: string;
|
81
|
+
password?: string;
|
56
82
|
database: string;
|
57
|
-
|
58
|
-
|
83
|
+
ssl?: boolean;
|
84
|
+
} | {
|
85
|
+
connectionString: string;
|
59
86
|
};
|
60
87
|
} | {
|
61
|
-
|
88
|
+
driver: "mysql2";
|
62
89
|
dbCredentials: {
|
63
90
|
host: string;
|
64
91
|
port?: number;
|
65
92
|
user?: string;
|
66
93
|
password?: string;
|
67
94
|
database: string;
|
68
|
-
ssl?: string | SslOptions;
|
69
95
|
} | {
|
70
|
-
|
96
|
+
uri: string;
|
71
97
|
};
|
72
98
|
} | {
|
73
|
-
|
74
|
-
driver: Verify<Driver, "d1">;
|
99
|
+
driver: "d1";
|
75
100
|
dbCredentials: {
|
76
101
|
wranglerConfigPath: string;
|
77
102
|
dbName: string;
|
78
103
|
};
|
79
104
|
} | {
|
80
|
-
|
81
|
-
driver: Verify<Driver, "expo">;
|
105
|
+
driver: "expo";
|
82
106
|
} | {});
|
83
|
-
declare function defineConfig(config: Config): Config;
|
84
|
-
|
85
|
-
export { type Config, defineConfig };
|
107
|
+
export declare function defineConfig(config: Config): Config;
|
package/index.d.ts
CHANGED
@@ -1,44 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { TypeOf } from 'zod';
|
4
|
-
|
5
|
-
declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
|
6
|
-
type Driver = TypeOf<typeof driver>;
|
7
|
-
|
8
|
-
declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
9
|
-
type Dialect = TypeOf<typeof dialect>;
|
10
|
-
|
11
|
-
type Verify<T, U extends T> = U;
|
12
|
-
type Config = {
|
13
|
-
dialect: Dialect;
|
14
|
-
out?: string;
|
15
|
-
breakpoints?: boolean;
|
16
|
-
tablesFilter?: string | string[];
|
17
|
-
schemaFilter?: string | string[];
|
18
|
-
schema?: string | string[];
|
19
|
-
verbose?: boolean;
|
20
|
-
strict?: boolean;
|
21
|
-
migrations?: {
|
22
|
-
table?: string;
|
23
|
-
schema?: string;
|
24
|
-
};
|
25
|
-
introspect?: {
|
26
|
-
casing: "camel" | "preserve";
|
27
|
-
};
|
28
|
-
} & ({
|
29
|
-
dialect: Verify<Dialect, "sqlite">;
|
30
|
-
driver: Verify<Driver, "turso">;
|
1
|
+
export type DbConnection = {
|
2
|
+
driver: "turso";
|
31
3
|
dbCredentials: {
|
32
4
|
url: string;
|
33
5
|
authToken?: string;
|
34
6
|
};
|
35
7
|
} | {
|
36
|
-
|
8
|
+
driver: "better-sqlite";
|
37
9
|
dbCredentials: {
|
38
10
|
url: string;
|
39
11
|
};
|
40
12
|
} | {
|
41
|
-
|
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";
|
42
25
|
dbCredentials: {
|
43
26
|
host: string;
|
44
27
|
port?: number;
|
@@ -47,39 +30,78 @@ type Config = {
|
|
47
30
|
database: string;
|
48
31
|
ssl?: boolean;
|
49
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: {
|
50
68
|
url: string;
|
51
69
|
};
|
52
70
|
} | {
|
53
|
-
|
54
|
-
driver: Verify<Driver, "aws-data-api">;
|
71
|
+
driver: "libsql";
|
55
72
|
dbCredentials: {
|
73
|
+
url: string;
|
74
|
+
};
|
75
|
+
} | {
|
76
|
+
driver: "pg";
|
77
|
+
dbCredentials: {
|
78
|
+
host: string;
|
79
|
+
port?: number;
|
80
|
+
user?: string;
|
81
|
+
password?: string;
|
56
82
|
database: string;
|
57
|
-
|
58
|
-
|
83
|
+
ssl?: boolean;
|
84
|
+
} | {
|
85
|
+
connectionString: string;
|
59
86
|
};
|
60
87
|
} | {
|
61
|
-
|
88
|
+
driver: "mysql2";
|
62
89
|
dbCredentials: {
|
63
90
|
host: string;
|
64
91
|
port?: number;
|
65
92
|
user?: string;
|
66
93
|
password?: string;
|
67
94
|
database: string;
|
68
|
-
ssl?: string | SslOptions;
|
69
95
|
} | {
|
70
|
-
|
96
|
+
uri: string;
|
71
97
|
};
|
72
98
|
} | {
|
73
|
-
|
74
|
-
driver: Verify<Driver, "d1">;
|
99
|
+
driver: "d1";
|
75
100
|
dbCredentials: {
|
76
101
|
wranglerConfigPath: string;
|
77
102
|
dbName: string;
|
78
103
|
};
|
79
104
|
} | {
|
80
|
-
|
81
|
-
driver: Verify<Driver, "expo">;
|
105
|
+
driver: "expo";
|
82
106
|
} | {});
|
83
|
-
declare function defineConfig(config: Config): Config;
|
84
|
-
|
85
|
-
export { type Config, defineConfig };
|
107
|
+
export declare function defineConfig(config: Config): Config;
|
package/index.js
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
import "./@types/utils";
|
2
|
+
import { ConfigIntrospectCasing } from "./cli/commands/utils";
|
3
|
+
import { MySqlSchemaInternal } from "./serializer/mysqlSchema";
|
4
|
+
export declare const schemaToTypeScript: (schema: MySqlSchemaInternal, casing: ConfigIntrospectCasing["casing"]) => {
|
5
|
+
file: string;
|
6
|
+
imports: string;
|
7
|
+
decalrations: string;
|
8
|
+
schemaEntry: string;
|
9
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { AnyPgTable } from "drizzle-orm/pg-core";
|
2
|
+
import { Relation, Relations } from "drizzle-orm/relations";
|
3
|
+
import "./@types/utils";
|
4
|
+
import { ConfigIntrospectCasing } from "./cli/commands/utils";
|
5
|
+
import { PgSchemaInternal } from "./serializer/pgSchema";
|
6
|
+
export declare const relationsToTypeScript: (schema: Record<string, Record<string, AnyPgTable<{}>>>, relations: Record<string, Relations<string, Record<string, Relation<string>>>>) => string;
|
7
|
+
export declare const schemaToTypeScript: (schema: PgSchemaInternal, casing: ConfigIntrospectCasing) => {
|
8
|
+
file: string;
|
9
|
+
imports: string;
|
10
|
+
decalrations: string;
|
11
|
+
schemaEntry: string;
|
12
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import "./@types/utils";
|
2
|
+
import type { ConfigIntrospectCasing } from "./cli/commands/utils";
|
3
|
+
import type { SQLiteSchemaInternal } from "./serializer/sqliteSchema";
|
4
|
+
export declare const indexName: (tableName: string, columns: string[]) => string;
|
5
|
+
export declare const schemaToTypeScript: (schema: SQLiteSchemaInternal, casing: ConfigIntrospectCasing["casing"]) => {
|
6
|
+
file: string;
|
7
|
+
imports: string;
|
8
|
+
decalrations: string;
|
9
|
+
schemaEntry: string;
|
10
|
+
};
|
package/jsonDiffer.d.ts
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
export function diffForRenamedTables(pairs: any): any;
|
2
|
+
export function diffForRenamedColumn(t1: any, t2: any): any;
|
3
|
+
export function applyJsonDiff(json1: any, json2: any): {
|
4
|
+
addedTables?: undefined;
|
5
|
+
deletedTables?: undefined;
|
6
|
+
alteredTablesWithColumns?: undefined;
|
7
|
+
addedEnums?: undefined;
|
8
|
+
deletedEnums?: undefined;
|
9
|
+
alteredEnums?: undefined;
|
10
|
+
addedSchemas?: undefined;
|
11
|
+
deletedSchemas?: undefined;
|
12
|
+
} | {
|
13
|
+
addedTables: any[];
|
14
|
+
deletedTables: any[];
|
15
|
+
alteredTablesWithColumns: {
|
16
|
+
name: any;
|
17
|
+
schema: {
|
18
|
+
type: string;
|
19
|
+
value: any;
|
20
|
+
};
|
21
|
+
deleted: any[];
|
22
|
+
added: any[];
|
23
|
+
altered: any[];
|
24
|
+
addedIndexes: {
|
25
|
+
[k: string]: any;
|
26
|
+
};
|
27
|
+
deletedIndexes: {
|
28
|
+
[k: string]: any;
|
29
|
+
};
|
30
|
+
alteredIndexes: {
|
31
|
+
[k: string]: any;
|
32
|
+
};
|
33
|
+
addedForeignKeys: {
|
34
|
+
[k: string]: any;
|
35
|
+
};
|
36
|
+
deletedForeignKeys: {
|
37
|
+
[k: string]: any;
|
38
|
+
};
|
39
|
+
alteredForeignKeys: {
|
40
|
+
[k: string]: any;
|
41
|
+
};
|
42
|
+
addedCompositePKs: {
|
43
|
+
[k: string]: any;
|
44
|
+
};
|
45
|
+
deletedCompositePKs: {
|
46
|
+
[k: string]: any;
|
47
|
+
};
|
48
|
+
alteredCompositePKs: {
|
49
|
+
[k: string]: any;
|
50
|
+
};
|
51
|
+
addedUniqueConstraints: {
|
52
|
+
[k: string]: any;
|
53
|
+
};
|
54
|
+
deletedUniqueConstraints: {
|
55
|
+
[k: string]: any;
|
56
|
+
};
|
57
|
+
alteredUniqueConstraints: {
|
58
|
+
[k: string]: any;
|
59
|
+
};
|
60
|
+
}[];
|
61
|
+
addedEnums: {
|
62
|
+
name: any;
|
63
|
+
values: any[];
|
64
|
+
}[];
|
65
|
+
deletedEnums: {
|
66
|
+
name: any;
|
67
|
+
values: any[];
|
68
|
+
}[];
|
69
|
+
alteredEnums: {
|
70
|
+
name: string;
|
71
|
+
addedValues: any[];
|
72
|
+
deletedValues: any[];
|
73
|
+
}[];
|
74
|
+
addedSchemas: any[];
|
75
|
+
deletedSchemas: any[];
|
76
|
+
};
|