drizzle-kit 0.20.17-a2979a1 → 0.20.17-ae6e691

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/bin.cjs +34044 -26986
  2. package/index.d.mts +28 -60
  3. package/index.d.ts +28 -60
  4. package/package.json +5 -16
  5. package/payload.d.mts +987 -18
  6. package/payload.d.ts +987 -18
  7. package/payload.js +19096 -16804
  8. package/payload.mjs +19112 -16795
  9. package/utils-studio.js +17 -12
  10. package/utils-studio.mjs +17 -12
  11. package/utils.js +6 -6
  12. package/utils.mjs +6 -6
  13. package/@types/utils.d.ts +0 -12
  14. package/cli/commands/migrate.d.ts +0 -287
  15. package/cli/commands/mysqlIntrospect.d.ts +0 -50
  16. package/cli/commands/mysqlPushUtils.d.ts +0 -14
  17. package/cli/commands/pgIntrospect.d.ts +0 -59
  18. package/cli/commands/pgPushUtils.d.ts +0 -11
  19. package/cli/commands/sqliteIntrospect.d.ts +0 -103
  20. package/cli/commands/sqlitePushUtils.d.ts +0 -15
  21. package/cli/commands/utils.d.ts +0 -58
  22. package/cli/connections.d.ts +0 -13
  23. package/cli/selector-ui.d.ts +0 -13
  24. package/cli/utils.d.ts +0 -13
  25. package/cli/validations/cli.d.ts +0 -169
  26. package/cli/validations/common.d.ts +0 -214
  27. package/cli/validations/mysql.d.ts +0 -29
  28. package/cli/validations/outputs.d.ts +0 -42
  29. package/cli/validations/pg.d.ts +0 -46
  30. package/cli/validations/sqlite.d.ts +0 -22
  31. package/cli/views.d.ts +0 -63
  32. package/global.d.ts +0 -6
  33. package/introspect-sqlite.d.ts +0 -10
  34. package/jsonDiffer.d.ts +0 -61
  35. package/jsonStatements.d.ts +0 -376
  36. package/migrationPreparator.d.ts +0 -35
  37. package/schemaValidator.d.ts +0 -1316
  38. package/serializer/index.d.ts +0 -9
  39. package/serializer/mysqlImports.d.ts +0 -7
  40. package/serializer/mysqlSchema.d.ts +0 -4650
  41. package/serializer/mysqlSerializer.d.ts +0 -7
  42. package/serializer/pgImports.d.ts +0 -11
  43. package/serializer/pgSchema.d.ts +0 -4792
  44. package/serializer/pgSerializer.d.ts +0 -7
  45. package/serializer/schemaToDrizzle.d.ts +0 -7
  46. package/serializer/sqliteImports.d.ts +0 -7
  47. package/serializer/sqliteSchema.d.ts +0 -2801
  48. package/serializer/sqliteSerializer.d.ts +0 -6
  49. package/serializer/studio.d.ts +0 -51
  50. package/snapshotsDiffer.d.ts +0 -3937
  51. package/sqlgenerator.d.ts +0 -33
  52. package/utils/words.d.ts +0 -7
  53. package/utils-studio.d.mts +0 -4
  54. package/utils-studio.d.ts +0 -4
  55. package/utils.d.ts +0 -78
@@ -1,14 +0,0 @@
1
- import { JsonStatement } from "../../jsonStatements";
2
- import { mysqlSchema } from "../../serializer/mysqlSchema";
3
- import { TypeOf } from "zod";
4
- import type { DB } from "../../utils";
5
- export declare const filterStatements: (statements: JsonStatement[], currentSchema: TypeOf<typeof mysqlSchema>, prevSchema: TypeOf<typeof mysqlSchema>) => JsonStatement[];
6
- export declare const logSuggestionsAndReturn: (db: DB, statements: JsonStatement[], json2: TypeOf<typeof mysqlSchema>) => Promise<{
7
- statementsToExecute: string[];
8
- shouldAskForApprove: boolean;
9
- infoToPrint: string[];
10
- columnsToRemove: string[];
11
- schemasToRemove: string[];
12
- tablesToTruncate: string[];
13
- tablesToRemove: string[];
14
- }>;
@@ -1,59 +0,0 @@
1
- import type { DB } from "../../utils";
2
- export declare const pgPushIntrospect: (db: DB, filters: string[], schemaFilters: string[]) => Promise<{
3
- schema: {
4
- tables: Record<string, {
5
- name: string;
6
- columns: Record<string, {
7
- name: string;
8
- type: string;
9
- primaryKey: boolean;
10
- notNull: boolean;
11
- isUnique?: any;
12
- default?: any;
13
- typeSchema?: string | undefined;
14
- uniqueName?: string | undefined;
15
- nullsNotDistinct?: boolean | undefined;
16
- }>;
17
- indexes: Record<string, {
18
- name: string;
19
- columns: string[];
20
- isUnique: boolean;
21
- }>;
22
- foreignKeys: Record<string, {
23
- name: string;
24
- tableFrom: string;
25
- columnsFrom: string[];
26
- tableTo: string;
27
- columnsTo: string[];
28
- onUpdate?: string | undefined;
29
- onDelete?: string | undefined;
30
- schemaTo?: string | undefined;
31
- }>;
32
- schema: string;
33
- compositePrimaryKeys: Record<string, {
34
- name: string;
35
- columns: string[];
36
- }>;
37
- uniqueConstraints: Record<string, {
38
- name: string;
39
- columns: string[];
40
- nullsNotDistinct: boolean;
41
- }>;
42
- }>;
43
- id: string;
44
- prevId: string;
45
- version: "6";
46
- dialect: "pg";
47
- schemas: Record<string, string>;
48
- _meta: {
49
- columns: Record<string, string>;
50
- tables: Record<string, string>;
51
- schemas: Record<string, string>;
52
- };
53
- enums: Record<string, {
54
- name: string;
55
- values: string[];
56
- schema: string;
57
- }>;
58
- };
59
- }>;
@@ -1,11 +0,0 @@
1
- import type { DB } from "../../utils";
2
- import type { JsonStatement } from "../../jsonStatements";
3
- export declare const pgSuggestions: (db: DB, statements: JsonStatement[]) => Promise<{
4
- statementsToExecute: string[];
5
- shouldAskForApprove: boolean;
6
- infoToPrint: string[];
7
- columnsToRemove: string[];
8
- schemasToRemove: string[];
9
- tablesToTruncate: string[];
10
- tablesToRemove: string[];
11
- }>;
@@ -1,103 +0,0 @@
1
- import type { SqliteCredentials } from "../validations/sqlite";
2
- import type { SQLiteDB } from "../../utils";
3
- import { Casing } from "../validations/common";
4
- export declare const sqliteIntrospect: (credentials: SqliteCredentials, filters: string[], casing: Casing) => Promise<{
5
- schema: {
6
- tables: Record<string, {
7
- name: string;
8
- columns: Record<string, {
9
- name: string;
10
- type: string;
11
- primaryKey: boolean;
12
- notNull: boolean;
13
- default?: any;
14
- autoincrement?: boolean | undefined;
15
- }>;
16
- indexes: Record<string, {
17
- name: string;
18
- columns: string[];
19
- isUnique: boolean;
20
- where?: string | undefined;
21
- }>;
22
- foreignKeys: Record<string, {
23
- name: string;
24
- tableFrom: string;
25
- columnsFrom: string[];
26
- tableTo: string;
27
- columnsTo: string[];
28
- onUpdate?: string | undefined;
29
- onDelete?: string | undefined;
30
- }>;
31
- compositePrimaryKeys: Record<string, {
32
- columns: string[];
33
- name?: string | undefined;
34
- }>;
35
- uniqueConstraints: Record<string, {
36
- name: string;
37
- columns: string[];
38
- }>;
39
- }>;
40
- id: string;
41
- prevId: string;
42
- version: "5";
43
- dialect: "sqlite";
44
- _meta: {
45
- columns: Record<string, string>;
46
- tables: Record<string, string>;
47
- };
48
- enums: {};
49
- };
50
- ts: {
51
- file: string;
52
- imports: string;
53
- decalrations: string;
54
- schemaEntry: string;
55
- };
56
- }>;
57
- export declare const sqlitePushIntrospect: (db: SQLiteDB, filters: string[]) => Promise<{
58
- schema: {
59
- tables: Record<string, {
60
- name: string;
61
- columns: Record<string, {
62
- name: string;
63
- type: string;
64
- primaryKey: boolean;
65
- notNull: boolean;
66
- default?: any;
67
- autoincrement?: boolean | undefined;
68
- }>;
69
- indexes: Record<string, {
70
- name: string;
71
- columns: string[];
72
- isUnique: boolean;
73
- where?: string | undefined;
74
- }>;
75
- foreignKeys: Record<string, {
76
- name: string;
77
- tableFrom: string;
78
- columnsFrom: string[];
79
- tableTo: string;
80
- columnsTo: string[];
81
- onUpdate?: string | undefined;
82
- onDelete?: string | undefined;
83
- }>;
84
- compositePrimaryKeys: Record<string, {
85
- columns: string[];
86
- name?: string | undefined;
87
- }>;
88
- uniqueConstraints: Record<string, {
89
- name: string;
90
- columns: string[];
91
- }>;
92
- }>;
93
- id: string;
94
- prevId: string;
95
- version: "5";
96
- dialect: "sqlite";
97
- _meta: {
98
- columns: Record<string, string>;
99
- tables: Record<string, string>;
100
- };
101
- enums: {};
102
- };
103
- }>;
@@ -1,15 +0,0 @@
1
- import { SQLiteSchemaInternal, SQLiteSchemaSquashed } from "../../serializer/sqliteSchema";
2
- import type { JsonStatement } from "../../jsonStatements";
3
- import type { SQLiteDB } from "../../utils";
4
- export declare const _moveDataStatements: (tableName: string, json: SQLiteSchemaSquashed, dataLoss?: boolean) => string[];
5
- export declare const getOldTableName: (tableName: string, meta: SQLiteSchemaInternal["_meta"]) => string;
6
- export declare const getNewTableName: (tableName: string, meta: SQLiteSchemaInternal["_meta"]) => string;
7
- export declare const logSuggestionsAndReturn: (connection: SQLiteDB, statements: JsonStatement[], json1: SQLiteSchemaSquashed, json2: SQLiteSchemaSquashed, meta: SQLiteSchemaInternal["_meta"]) => Promise<{
8
- statementsToExecute: string[];
9
- shouldAskForApprove: boolean;
10
- infoToPrint: string[];
11
- columnsToRemove: string[];
12
- schemasToRemove: string[];
13
- tablesToTruncate: string[];
14
- tablesToRemove: string[];
15
- }>;
@@ -1,58 +0,0 @@
1
- import { MysqlCredentials } from "../validations/mysql";
2
- import { PostgresCredentials } from "../validations/pg";
3
- import { SqliteCredentials } from "../validations/sqlite";
4
- import { Casing, CliConfig } from "../validations/common";
5
- import type { Dialect } from "../../schemaValidator";
6
- import { CliCheckConfig, CliConfigGenerate } from "../validations/cli";
7
- export declare const safeRegister: () => Promise<{
8
- unregister: () => void;
9
- }>;
10
- export type GenerateConfig = {
11
- dialect: Dialect;
12
- schema: string | string[];
13
- out: string;
14
- breakpoints: boolean;
15
- name?: string;
16
- custom: boolean;
17
- bundle: boolean;
18
- };
19
- export declare const prepareGenerateConfig: (options: CliConfigGenerate) => Promise<GenerateConfig>;
20
- export declare const flattenDatabaseCredentials: (config: any) => any;
21
- export declare const preparePushConfig: (options: Record<string, unknown>) => Promise<({
22
- dialect: "mysql";
23
- credentials: MysqlCredentials;
24
- } | {
25
- dialect: "pg";
26
- credentials: PostgresCredentials;
27
- } | {
28
- dialect: "sqlite";
29
- credentials: SqliteCredentials;
30
- }) & {
31
- schemaPath: string | string[];
32
- verbose: boolean;
33
- strict: boolean;
34
- tablesFilter: string[];
35
- schemasFilter: string[];
36
- }>;
37
- export declare const preparePullConfig: (options: Record<string, unknown>) => Promise<({
38
- dialect: "mysql";
39
- credentials: MysqlCredentials;
40
- } | {
41
- dialect: "pg";
42
- credentials: PostgresCredentials;
43
- } | {
44
- dialect: "sqlite";
45
- credentials: SqliteCredentials;
46
- }) & {
47
- out: string;
48
- breakpoints: boolean;
49
- casing: Casing;
50
- tablesFilter: string[];
51
- schemasFilter: string[];
52
- }>;
53
- export declare const assertOutFolder: (it: CliCheckConfig) => Promise<{
54
- out: string;
55
- dialect: Dialect;
56
- }>;
57
- export declare const drizzleConfigFromFile: (configPath?: string) => Promise<CliConfig>;
58
- export declare const readDrizzleConfig: (configPath?: string) => Promise<any>;
@@ -1,13 +0,0 @@
1
- import type { DB, Proxy, SQLiteDB, SqliteProxy } from "../utils";
2
- import type { PostgresCredentials } from "./validations/pg";
3
- import type { MysqlCredentials } from "./validations/mysql";
4
- import { SqliteCredentials } from "./validations/sqlite";
5
- export declare const preparePostgresDB: (credentials: PostgresCredentials) => Promise<DB & {
6
- proxy: Proxy;
7
- }>;
8
- export declare const connectToMySQL: (it: MysqlCredentials) => Promise<{
9
- db: DB;
10
- proxy: Proxy;
11
- database: string;
12
- }>;
13
- export declare const connectToSQLite: (credentials: SqliteCredentials) => Promise<SQLiteDB & SqliteProxy>;
@@ -1,13 +0,0 @@
1
- import { Prompt } from "hanji";
2
- export declare class Select extends Prompt<{
3
- index: number;
4
- value: string;
5
- }> {
6
- private readonly data;
7
- constructor(items: string[]);
8
- render(status: "idle" | "submitted" | "aborted"): string;
9
- result(): {
10
- index: number;
11
- value: string;
12
- };
13
- }
package/cli/utils.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export declare const assertExists: (it?: any) => void;
2
- export declare const assertStudioNodeVersion: () => void;
3
- export declare const checkPackage: (it: string) => Promise<boolean>;
4
- export declare const assertPackages: (...pkgs: string[]) => Promise<void>;
5
- export declare const assertEitherPackage: (...pkgs: string[]) => Promise<string[]>;
6
- export declare const assertOrmCoreVersion: () => Promise<void>;
7
- export declare const ormCoreVersions: () => Promise<{
8
- compatibilityVersion: number;
9
- npmVersion: string;
10
- } | {
11
- compatibilityVersion?: undefined;
12
- npmVersion?: undefined;
13
- }>;
@@ -1,169 +0,0 @@
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
- custom: boolean;
12
- out: string;
13
- breakpoints: boolean;
14
- name?: string | undefined;
15
- schema?: string | string[] | undefined;
16
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
17
- config?: string | undefined;
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 pushParams: import("zod").ZodObject<{
29
- dialect: import("zod").ZodEnum<["pg", "mysql", "sqlite"]>;
30
- schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
31
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
32
- schemaFilters: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>>;
33
- driver: import("zod").ZodString;
34
- connectionString: import("zod").ZodOptional<import("zod").ZodString>;
35
- uri: import("zod").ZodOptional<import("zod").ZodString>;
36
- url: import("zod").ZodOptional<import("zod").ZodString>;
37
- host: import("zod").ZodOptional<import("zod").ZodString>;
38
- port: import("zod").ZodOptional<import("zod").ZodString>;
39
- user: import("zod").ZodOptional<import("zod").ZodString>;
40
- password: import("zod").ZodOptional<import("zod").ZodString>;
41
- database: import("zod").ZodOptional<import("zod").ZodString>;
42
- ssl: import("zod").ZodOptional<import("zod").ZodString>;
43
- authToken: import("zod").ZodOptional<import("zod").ZodString>;
44
- verbose: import("zod").ZodOptional<import("zod").ZodBoolean>;
45
- strict: import("zod").ZodOptional<import("zod").ZodBoolean>;
46
- }, "strip", import("zod").ZodTypeAny, {
47
- dialect: "mysql" | "pg" | "sqlite";
48
- driver: string;
49
- schemaFilters: string | string[];
50
- strict?: boolean | undefined;
51
- schema?: string | string[] | undefined;
52
- url?: string | undefined;
53
- host?: string | undefined;
54
- port?: string | undefined;
55
- user?: string | undefined;
56
- password?: string | undefined;
57
- database?: string | undefined;
58
- uri?: string | undefined;
59
- connectionString?: string | undefined;
60
- ssl?: string | undefined;
61
- authToken?: string | undefined;
62
- tablesFilter?: string | string[] | undefined;
63
- verbose?: boolean | undefined;
64
- }, {
65
- dialect: "mysql" | "pg" | "sqlite";
66
- driver: string;
67
- strict?: boolean | undefined;
68
- schema?: string | string[] | undefined;
69
- url?: string | undefined;
70
- host?: string | undefined;
71
- port?: string | undefined;
72
- user?: string | undefined;
73
- password?: string | undefined;
74
- database?: string | undefined;
75
- uri?: string | undefined;
76
- connectionString?: string | undefined;
77
- ssl?: string | undefined;
78
- authToken?: string | undefined;
79
- tablesFilter?: string | string[] | undefined;
80
- verbose?: boolean | undefined;
81
- schemaFilters?: string | string[] | undefined;
82
- }>;
83
- export type PushParams = TypeOf<typeof pushParams>;
84
- export declare const pullParams: import("zod").ZodObject<{
85
- config: import("zod").ZodOptional<import("zod").ZodString>;
86
- dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
87
- out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
88
- tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
89
- schemaFilter: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>>;
90
- driver: import("zod").ZodOptional<import("zod").ZodString>;
91
- connectionString: import("zod").ZodOptional<import("zod").ZodString>;
92
- uri: import("zod").ZodOptional<import("zod").ZodString>;
93
- host: import("zod").ZodOptional<import("zod").ZodString>;
94
- port: import("zod").ZodOptional<import("zod").ZodString>;
95
- user: import("zod").ZodOptional<import("zod").ZodString>;
96
- password: import("zod").ZodOptional<import("zod").ZodString>;
97
- database: import("zod").ZodOptional<import("zod").ZodString>;
98
- ssl: import("zod").ZodOptional<import("zod").ZodString>;
99
- url: import("zod").ZodOptional<import("zod").ZodString>;
100
- authToken: import("zod").ZodOptional<import("zod").ZodString>;
101
- introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
102
- breakpoints: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
103
- }, "strip", import("zod").ZodTypeAny, {
104
- out: string;
105
- breakpoints: boolean;
106
- schemaFilter: string | string[];
107
- introspectCasing: "camel" | "preserve";
108
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
109
- url?: string | undefined;
110
- host?: string | undefined;
111
- port?: string | undefined;
112
- user?: string | undefined;
113
- password?: string | undefined;
114
- database?: string | undefined;
115
- uri?: string | undefined;
116
- driver?: string | undefined;
117
- connectionString?: string | undefined;
118
- ssl?: string | undefined;
119
- authToken?: string | undefined;
120
- config?: string | undefined;
121
- tablesFilter?: string | string[] | undefined;
122
- }, {
123
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
124
- url?: string | undefined;
125
- host?: string | undefined;
126
- port?: string | undefined;
127
- user?: string | undefined;
128
- password?: string | undefined;
129
- database?: string | undefined;
130
- uri?: string | undefined;
131
- driver?: string | undefined;
132
- connectionString?: string | undefined;
133
- ssl?: string | undefined;
134
- authToken?: string | undefined;
135
- config?: string | undefined;
136
- out?: string | undefined;
137
- breakpoints?: boolean | undefined;
138
- tablesFilter?: string | string[] | undefined;
139
- schemaFilter?: string | string[] | undefined;
140
- introspectCasing?: "camel" | "preserve" | undefined;
141
- }>;
142
- export type PullParams = TypeOf<typeof pullParams>;
143
- export declare const configCheck: import("zod").ZodObject<{
144
- dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
145
- out: import("zod").ZodOptional<import("zod").ZodString>;
146
- }, "strip", import("zod").ZodTypeAny, {
147
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
148
- out?: string | undefined;
149
- }, {
150
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
151
- out?: string | undefined;
152
- }>;
153
- export declare const cliConfigCheck: import("zod").ZodIntersection<import("zod").ZodObject<{
154
- config: import("zod").ZodOptional<import("zod").ZodString>;
155
- }, "strip", import("zod").ZodTypeAny, {
156
- config?: string | undefined;
157
- }, {
158
- config?: string | undefined;
159
- }>, import("zod").ZodObject<{
160
- dialect: import("zod").ZodOptional<import("zod").ZodEnum<["pg", "mysql", "sqlite"]>>;
161
- out: import("zod").ZodOptional<import("zod").ZodString>;
162
- }, "strip", import("zod").ZodTypeAny, {
163
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
164
- out?: string | undefined;
165
- }, {
166
- dialect?: "mysql" | "pg" | "sqlite" | undefined;
167
- out?: string | undefined;
168
- }>>;
169
- export type CliCheckConfig = TypeOf<typeof cliConfigCheck>;