drizzle-kit 0.20.17-8b4d89e → 0.20.17-9053b76

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/bin.cjs +57497 -10916
  2. package/index.d.mts +37 -63
  3. package/index.d.ts +37 -63
  4. package/package.json +15 -20
  5. package/payload.d.mts +987 -18
  6. package/payload.d.ts +987 -18
  7. package/payload.js +20000 -36129
  8. package/payload.mjs +19917 -36021
  9. package/utils-studio.js +193 -2643
  10. package/utils-studio.mjs +193 -2643
  11. package/utils.js +9 -19
  12. package/utils.mjs +9 -19
  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 -55
  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 -104
  20. package/cli/commands/sqlitePushUtils.d.ts +0 -15
  21. package/cli/commands/utils.d.ts +0 -58
  22. package/cli/selector-ui.d.ts +0 -13
  23. package/cli/utils.d.ts +0 -12
  24. package/cli/validations/cli.d.ts +0 -169
  25. package/cli/validations/common.d.ts +0 -214
  26. package/cli/validations/mysql.d.ts +0 -35
  27. package/cli/validations/outputs.d.ts +0 -41
  28. package/cli/validations/pg.d.ts +0 -37
  29. package/cli/validations/sqlite.d.ts +0 -34
  30. package/cli/views.d.ts +0 -63
  31. package/global.d.ts +0 -6
  32. package/introspect-sqlite.d.ts +0 -10
  33. package/jsonDiffer.d.ts +0 -61
  34. package/jsonStatements.d.ts +0 -376
  35. package/migrationPreparator.d.ts +0 -35
  36. package/schemaValidator.d.ts +0 -1316
  37. package/serializer/index.d.ts +0 -9
  38. package/serializer/mysqlImports.d.ts +0 -7
  39. package/serializer/mysqlSchema.d.ts +0 -4964
  40. package/serializer/mysqlSerializer.d.ts +0 -7
  41. package/serializer/pgImports.d.ts +0 -11
  42. package/serializer/pgSchema.d.ts +0 -4792
  43. package/serializer/pgSerializer.d.ts +0 -7
  44. package/serializer/schemaToDrizzle.d.ts +0 -7
  45. package/serializer/sqliteImports.d.ts +0 -7
  46. package/serializer/sqliteSchema.d.ts +0 -2801
  47. package/serializer/sqliteSerializer.d.ts +0 -6
  48. package/snapshotsDiffer.d.ts +0 -3937
  49. package/sqlgenerator.d.ts +0 -33
  50. package/utils/words.d.ts +0 -7
  51. package/utils-studio.d.mts +0 -4
  52. package/utils-studio.d.ts +0 -4
  53. package/utils.d.ts +0 -72
package/utils.js CHANGED
@@ -1079,7 +1079,7 @@ var info = (msg, greyMsg = "") => {
1079
1079
  var originUUID = "00000000-0000-0000-0000-000000000000";
1080
1080
  var snapshotVersion = "6";
1081
1081
 
1082
- // node_modules/.pnpm/zod@3.23.3/node_modules/zod/lib/index.mjs
1082
+ // node_modules/.pnpm/zod@3.23.5/node_modules/zod/lib/index.mjs
1083
1083
  var util;
1084
1084
  (function(util2) {
1085
1085
  util2.assertEqual = (val) => val;
@@ -4937,18 +4937,8 @@ var schemaInternalV5 = objectType({
4937
4937
  }),
4938
4938
  internal: kitInternals
4939
4939
  }).strict();
4940
- var schemaInternalV6 = objectType({
4941
- version: literalType("6"),
4942
- dialect,
4943
- tables: recordType(stringType(), table),
4944
- _meta: objectType({
4945
- tables: recordType(stringType(), stringType()),
4946
- columns: recordType(stringType(), stringType())
4947
- }),
4948
- internal: kitInternals
4949
- }).strict();
4950
4940
  var schemaInternal = objectType({
4951
- version: literalType("6"),
4941
+ version: literalType("5"),
4952
4942
  dialect,
4953
4943
  tables: recordType(stringType(), table),
4954
4944
  _meta: objectType({
@@ -4977,7 +4967,7 @@ var tableSquashed = objectType({
4977
4967
  uniqueConstraints: recordType(stringType(), stringType()).default({})
4978
4968
  }).strict();
4979
4969
  var schemaSquashed = objectType({
4980
- version: literalType("6"),
4970
+ version: literalType("5"),
4981
4971
  dialect,
4982
4972
  tables: recordType(stringType(), tableSquashed)
4983
4973
  }).strict();
@@ -4991,7 +4981,7 @@ var mysqlSchema = schema;
4991
4981
  var mysqlSchemaV5 = schemaV5;
4992
4982
  var backwardCompatibleMysqlSchema = unionType([mysqlSchemaV5, schema]);
4993
4983
  var dryMySql = mysqlSchema.parse({
4994
- version: snapshotVersion,
4984
+ version: "5",
4995
4985
  dialect: "mysql",
4996
4986
  id: originUUID,
4997
4987
  prevId: "",
@@ -5183,7 +5173,7 @@ var pgSchemaExternal = objectType({
5183
5173
  }).strict();
5184
5174
  var pgSchemaInternal = objectType({
5185
5175
  version: literalType("6"),
5186
- dialect: literalType("pg"),
5176
+ dialect: literalType("postgresql"),
5187
5177
  tables: recordType(stringType(), table2),
5188
5178
  enums: recordType(stringType(), enumSchema),
5189
5179
  schemas: recordType(stringType(), stringType()),
@@ -5212,14 +5202,14 @@ var tableSquashedV42 = objectType({
5212
5202
  }).strict();
5213
5203
  var pgSchemaSquashedV4 = objectType({
5214
5204
  version: literalType("4"),
5215
- dialect: enumType(["pg"]),
5205
+ dialect: literalType("pg"),
5216
5206
  tables: recordType(stringType(), tableSquashedV42),
5217
5207
  enums: recordType(stringType(), enumSchemaV1),
5218
5208
  schemas: recordType(stringType(), stringType())
5219
5209
  }).strict();
5220
5210
  var pgSchemaSquashed = objectType({
5221
5211
  version: literalType("6"),
5222
- dialect: enumType(["pg"]),
5212
+ dialect: literalType("postgresql"),
5223
5213
  tables: recordType(stringType(), tableSquashed2),
5224
5214
  enums: recordType(stringType(), enumSchema),
5225
5215
  schemas: recordType(stringType(), stringType())
@@ -5231,7 +5221,7 @@ var pgSchema = pgSchemaInternal.merge(schemaHash2);
5231
5221
  var backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema]);
5232
5222
  var dryPg = pgSchema.parse({
5233
5223
  version: snapshotVersion,
5234
- dialect: "pg",
5224
+ dialect: "postgresql",
5235
5225
  id: originUUID,
5236
5226
  prevId: "",
5237
5227
  tables: {},
@@ -5393,7 +5383,7 @@ var prepareOutFolder = (out, dialect3) => {
5393
5383
  };
5394
5384
  var validatorForDialect = (dialect3) => {
5395
5385
  switch (dialect3) {
5396
- case "pg":
5386
+ case "postgresql":
5397
5387
  return { validator: backwardCompatiblePgSchema, version: 6 };
5398
5388
  case "sqlite":
5399
5389
  return { validator: backwardCompatibleSqliteSchema, version: 5 };
package/utils.mjs CHANGED
@@ -1070,7 +1070,7 @@ var info = (msg, greyMsg = "") => {
1070
1070
  var originUUID = "00000000-0000-0000-0000-000000000000";
1071
1071
  var snapshotVersion = "6";
1072
1072
 
1073
- // node_modules/.pnpm/zod@3.23.3/node_modules/zod/lib/index.mjs
1073
+ // node_modules/.pnpm/zod@3.23.5/node_modules/zod/lib/index.mjs
1074
1074
  var util;
1075
1075
  (function(util2) {
1076
1076
  util2.assertEqual = (val) => val;
@@ -4928,18 +4928,8 @@ var schemaInternalV5 = objectType({
4928
4928
  }),
4929
4929
  internal: kitInternals
4930
4930
  }).strict();
4931
- var schemaInternalV6 = objectType({
4932
- version: literalType("6"),
4933
- dialect,
4934
- tables: recordType(stringType(), table),
4935
- _meta: objectType({
4936
- tables: recordType(stringType(), stringType()),
4937
- columns: recordType(stringType(), stringType())
4938
- }),
4939
- internal: kitInternals
4940
- }).strict();
4941
4931
  var schemaInternal = objectType({
4942
- version: literalType("6"),
4932
+ version: literalType("5"),
4943
4933
  dialect,
4944
4934
  tables: recordType(stringType(), table),
4945
4935
  _meta: objectType({
@@ -4968,7 +4958,7 @@ var tableSquashed = objectType({
4968
4958
  uniqueConstraints: recordType(stringType(), stringType()).default({})
4969
4959
  }).strict();
4970
4960
  var schemaSquashed = objectType({
4971
- version: literalType("6"),
4961
+ version: literalType("5"),
4972
4962
  dialect,
4973
4963
  tables: recordType(stringType(), tableSquashed)
4974
4964
  }).strict();
@@ -4982,7 +4972,7 @@ var mysqlSchema = schema;
4982
4972
  var mysqlSchemaV5 = schemaV5;
4983
4973
  var backwardCompatibleMysqlSchema = unionType([mysqlSchemaV5, schema]);
4984
4974
  var dryMySql = mysqlSchema.parse({
4985
- version: snapshotVersion,
4975
+ version: "5",
4986
4976
  dialect: "mysql",
4987
4977
  id: originUUID,
4988
4978
  prevId: "",
@@ -5174,7 +5164,7 @@ var pgSchemaExternal = objectType({
5174
5164
  }).strict();
5175
5165
  var pgSchemaInternal = objectType({
5176
5166
  version: literalType("6"),
5177
- dialect: literalType("pg"),
5167
+ dialect: literalType("postgresql"),
5178
5168
  tables: recordType(stringType(), table2),
5179
5169
  enums: recordType(stringType(), enumSchema),
5180
5170
  schemas: recordType(stringType(), stringType()),
@@ -5203,14 +5193,14 @@ var tableSquashedV42 = objectType({
5203
5193
  }).strict();
5204
5194
  var pgSchemaSquashedV4 = objectType({
5205
5195
  version: literalType("4"),
5206
- dialect: enumType(["pg"]),
5196
+ dialect: literalType("pg"),
5207
5197
  tables: recordType(stringType(), tableSquashedV42),
5208
5198
  enums: recordType(stringType(), enumSchemaV1),
5209
5199
  schemas: recordType(stringType(), stringType())
5210
5200
  }).strict();
5211
5201
  var pgSchemaSquashed = objectType({
5212
5202
  version: literalType("6"),
5213
- dialect: enumType(["pg"]),
5203
+ dialect: literalType("postgresql"),
5214
5204
  tables: recordType(stringType(), tableSquashed2),
5215
5205
  enums: recordType(stringType(), enumSchema),
5216
5206
  schemas: recordType(stringType(), stringType())
@@ -5222,7 +5212,7 @@ var pgSchema = pgSchemaInternal.merge(schemaHash2);
5222
5212
  var backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema]);
5223
5213
  var dryPg = pgSchema.parse({
5224
5214
  version: snapshotVersion,
5225
- dialect: "pg",
5215
+ dialect: "postgresql",
5226
5216
  id: originUUID,
5227
5217
  prevId: "",
5228
5218
  tables: {},
@@ -5384,7 +5374,7 @@ var prepareOutFolder = (out, dialect3) => {
5384
5374
  };
5385
5375
  var validatorForDialect = (dialect3) => {
5386
5376
  switch (dialect3) {
5387
- case "pg":
5377
+ case "postgresql":
5388
5378
  return { validator: backwardCompatiblePgSchema, version: 6 };
5389
5379
  case "sqlite":
5390
5380
  return { validator: backwardCompatibleSqliteSchema, version: 5 };
package/@types/utils.d.ts DELETED
@@ -1,12 +0,0 @@
1
- declare global {
2
- interface String {
3
- trimChar(char: string): string;
4
- squashSpaces(): string;
5
- camelCase(): string;
6
- concatIf(it: string, condition: boolean): string;
7
- }
8
- interface Array<T> {
9
- random(): T;
10
- }
11
- }
12
- export {};
@@ -1,287 +0,0 @@
1
- import { Column, ColumnsResolverInput, ColumnsResolverOutput, Enum, ResolverInput, ResolverOutput, ResolverOutputWithMoved, Table } from "../../snapshotsDiffer";
2
- import type { CommonSchema } from "../../schemaValidator";
3
- import { PgSchema } from "../../serializer/pgSchema";
4
- import { SQLiteSchema } from "../../serializer/sqliteSchema";
5
- import { MySqlSchema } from "../../serializer/mysqlSchema";
6
- import { Journal } from "../../utils";
7
- import { GenerateConfig } from "./utils";
8
- export type Named = {
9
- name: string;
10
- };
11
- export type NamedWithSchema = {
12
- name: string;
13
- schema: string;
14
- };
15
- export declare const schemasResolver: (input: ResolverInput<Table>) => Promise<ResolverOutput<Table>>;
16
- export declare const tablesResolver: (input: ResolverInput<Table>) => Promise<ResolverOutputWithMoved<Table>>;
17
- export declare const enumsResolver: (input: ResolverInput<Enum>) => Promise<ResolverOutputWithMoved<Enum>>;
18
- export declare const columnsResolver: (input: ColumnsResolverInput<Column>) => Promise<ColumnsResolverOutput<Column>>;
19
- export declare const prepareAndMigratePg: (config: GenerateConfig) => Promise<void>;
20
- export declare const preparePgPush: (schemaPath: string | string[], snapshot: PgSchema, schemaFilter: string[]) => Promise<{
21
- sqlStatements: string[];
22
- statements: import("../../jsonStatements").JsonStatement[];
23
- squashedPrev: {
24
- tables: Record<string, {
25
- name: string;
26
- columns: Record<string, {
27
- name: string;
28
- type: string;
29
- primaryKey: boolean;
30
- notNull: boolean;
31
- isUnique?: any;
32
- default?: any;
33
- typeSchema?: string | undefined;
34
- uniqueName?: string | undefined;
35
- nullsNotDistinct?: boolean | undefined;
36
- }>;
37
- indexes: Record<string, string>;
38
- foreignKeys: Record<string, string>;
39
- schema: string;
40
- compositePrimaryKeys: Record<string, string>;
41
- uniqueConstraints: Record<string, string>;
42
- }>;
43
- version: "6";
44
- dialect: "pg";
45
- schemas: Record<string, string>;
46
- enums: Record<string, {
47
- name: string;
48
- values: string[];
49
- schema: string;
50
- }>;
51
- };
52
- squashedCur: {
53
- tables: Record<string, {
54
- name: string;
55
- columns: Record<string, {
56
- name: string;
57
- type: string;
58
- primaryKey: boolean;
59
- notNull: boolean;
60
- isUnique?: any;
61
- default?: any;
62
- typeSchema?: string | undefined;
63
- uniqueName?: string | undefined;
64
- nullsNotDistinct?: boolean | undefined;
65
- }>;
66
- indexes: Record<string, string>;
67
- foreignKeys: Record<string, string>;
68
- schema: string;
69
- compositePrimaryKeys: Record<string, string>;
70
- uniqueConstraints: Record<string, string>;
71
- }>;
72
- version: "6";
73
- dialect: "pg";
74
- schemas: Record<string, string>;
75
- enums: Record<string, {
76
- name: string;
77
- values: string[];
78
- schema: string;
79
- }>;
80
- };
81
- }>;
82
- export declare const prepareMySQLPush: (schemaPath: string | string[], snapshot: MySqlSchema) => Promise<{
83
- sqlStatements: string[];
84
- statements: import("../../jsonStatements").JsonStatement[];
85
- validatedCur: {
86
- tables: Record<string, {
87
- name: string;
88
- columns: Record<string, {
89
- name: string;
90
- type: string;
91
- primaryKey: boolean;
92
- notNull: boolean;
93
- default?: any;
94
- onUpdate?: any;
95
- autoincrement?: boolean | undefined;
96
- }>;
97
- indexes: Record<string, {
98
- name: string;
99
- columns: string[];
100
- isUnique: boolean;
101
- using?: "btree" | "hash" | undefined;
102
- algorithm?: "default" | "inplace" | "copy" | undefined;
103
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
104
- }>;
105
- foreignKeys: Record<string, {
106
- name: string;
107
- tableFrom: string;
108
- columnsFrom: string[];
109
- tableTo: string;
110
- columnsTo: string[];
111
- onUpdate?: string | undefined;
112
- onDelete?: string | undefined;
113
- }>;
114
- compositePrimaryKeys: Record<string, {
115
- name: string;
116
- columns: string[];
117
- }>;
118
- uniqueConstraints: Record<string, {
119
- name: string;
120
- columns: string[];
121
- }>;
122
- }>;
123
- id: string;
124
- prevId: string;
125
- version: "6";
126
- dialect: "mysql";
127
- _meta: {
128
- columns: Record<string, string>;
129
- tables: Record<string, string>;
130
- };
131
- internal?: {
132
- tables: Record<string, {
133
- columns: Record<string, {
134
- isDefaultAnExpression?: boolean | undefined;
135
- } | undefined>;
136
- } | undefined>;
137
- } | undefined;
138
- };
139
- validatedPrev: {
140
- tables: Record<string, {
141
- name: string;
142
- columns: Record<string, {
143
- name: string;
144
- type: string;
145
- primaryKey: boolean;
146
- notNull: boolean;
147
- default?: any;
148
- onUpdate?: any;
149
- autoincrement?: boolean | undefined;
150
- }>;
151
- indexes: Record<string, {
152
- name: string;
153
- columns: string[];
154
- isUnique: boolean;
155
- using?: "btree" | "hash" | undefined;
156
- algorithm?: "default" | "inplace" | "copy" | undefined;
157
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
158
- }>;
159
- foreignKeys: Record<string, {
160
- name: string;
161
- tableFrom: string;
162
- columnsFrom: string[];
163
- tableTo: string;
164
- columnsTo: string[];
165
- onUpdate?: string | undefined;
166
- onDelete?: string | undefined;
167
- }>;
168
- compositePrimaryKeys: Record<string, {
169
- name: string;
170
- columns: string[];
171
- }>;
172
- uniqueConstraints: Record<string, {
173
- name: string;
174
- columns: string[];
175
- }>;
176
- }>;
177
- id: string;
178
- prevId: string;
179
- version: "6";
180
- dialect: "mysql";
181
- _meta: {
182
- columns: Record<string, string>;
183
- tables: Record<string, string>;
184
- };
185
- internal?: {
186
- tables: Record<string, {
187
- columns: Record<string, {
188
- isDefaultAnExpression?: boolean | undefined;
189
- } | undefined>;
190
- } | undefined>;
191
- } | undefined;
192
- };
193
- }>;
194
- export declare const prepareAndMigrateMysql: (config: GenerateConfig) => Promise<void>;
195
- export declare const prepareAndMigrateSqlite: (config: GenerateConfig) => Promise<void>;
196
- export declare const prepareSQLitePush: (schemaPath: string | string[], snapshot: SQLiteSchema) => Promise<{
197
- sqlStatements: string[];
198
- statements: import("../../jsonStatements").JsonStatement[];
199
- squashedPrev: {
200
- tables: Record<string, {
201
- name: string;
202
- columns: Record<string, {
203
- name: string;
204
- type: string;
205
- primaryKey: boolean;
206
- notNull: boolean;
207
- default?: any;
208
- autoincrement?: boolean | undefined;
209
- }>;
210
- indexes: Record<string, string>;
211
- foreignKeys: Record<string, string>;
212
- compositePrimaryKeys: Record<string, string>;
213
- uniqueConstraints: Record<string, string>;
214
- }>;
215
- version: "5";
216
- dialect: "sqlite";
217
- enums?: any;
218
- };
219
- squashedCur: {
220
- tables: Record<string, {
221
- name: string;
222
- columns: Record<string, {
223
- name: string;
224
- type: string;
225
- primaryKey: boolean;
226
- notNull: boolean;
227
- default?: any;
228
- autoincrement?: boolean | undefined;
229
- }>;
230
- indexes: Record<string, string>;
231
- foreignKeys: Record<string, string>;
232
- compositePrimaryKeys: Record<string, string>;
233
- uniqueConstraints: Record<string, string>;
234
- }>;
235
- version: "5";
236
- dialect: "sqlite";
237
- enums?: any;
238
- };
239
- meta: {
240
- schemas: {};
241
- tables: {};
242
- columns: {};
243
- } | undefined;
244
- }>;
245
- export declare const promptColumnsConflicts: <T extends Named>(tableName: string, newColumns: T[], missingColumns: T[]) => Promise<{
246
- created: T[];
247
- renamed: {
248
- from: T;
249
- to: T;
250
- }[];
251
- deleted: T[];
252
- }>;
253
- export declare const promptNamedWithSchemasConflict: <T extends NamedWithSchema>(newItems: T[], missingItems: T[], entity: "table" | "enum") => Promise<{
254
- created: T[];
255
- renamed: {
256
- from: T;
257
- to: T;
258
- }[];
259
- moved: {
260
- name: string;
261
- schemaFrom: string;
262
- schemaTo: string;
263
- }[];
264
- deleted: T[];
265
- }>;
266
- export declare const promptSchemasConflict: <T extends Named>(newSchemas: T[], missingSchemas: T[]) => Promise<{
267
- created: T[];
268
- renamed: {
269
- from: T;
270
- to: T;
271
- }[];
272
- deleted: T[];
273
- }>;
274
- export declare const BREAKPOINT = "--> statement-breakpoint\n";
275
- export declare const writeResult: ({ cur, sqlStatements, journal, _meta, outFolder, breakpoints, name, bundle, type, }: {
276
- cur: CommonSchema;
277
- sqlStatements: string[];
278
- journal: Journal;
279
- _meta?: any;
280
- outFolder: string;
281
- breakpoints: boolean;
282
- name?: string;
283
- bundle?: boolean;
284
- type?: "introspect" | "custom" | "none";
285
- }) => void;
286
- export declare const embeddedMigrations: (journal: Journal) => string;
287
- export declare const prepareSnapshotFolderName: () => string;
@@ -1,55 +0,0 @@
1
- import type { MysqlCredentials } from "../validations/mysql";
2
- import type { DB } from "../../utils";
3
- export declare const connectToMySQL: (credentials: MysqlCredentials) => Promise<{
4
- db: DB;
5
- database: string;
6
- }>;
7
- export declare const mysqlPushIntrospect: (db: DB, databaseName: string, filters: string[]) => Promise<{
8
- schema: {
9
- tables: Record<string, {
10
- name: string;
11
- columns: Record<string, {
12
- name: string;
13
- type: string;
14
- primaryKey: boolean;
15
- notNull: boolean;
16
- default?: any;
17
- onUpdate?: any;
18
- autoincrement?: boolean | undefined;
19
- }>;
20
- indexes: Record<string, {
21
- name: string;
22
- columns: string[];
23
- isUnique: boolean;
24
- using?: "btree" | "hash" | undefined;
25
- algorithm?: "default" | "inplace" | "copy" | undefined;
26
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
27
- }>;
28
- foreignKeys: Record<string, {
29
- name: string;
30
- tableFrom: string;
31
- columnsFrom: string[];
32
- tableTo: string;
33
- columnsTo: string[];
34
- onUpdate?: string | undefined;
35
- onDelete?: string | undefined;
36
- }>;
37
- compositePrimaryKeys: Record<string, {
38
- name: string;
39
- columns: string[];
40
- }>;
41
- uniqueConstraints: Record<string, {
42
- name: string;
43
- columns: string[];
44
- }>;
45
- }>;
46
- id: string;
47
- prevId: string;
48
- version: "6";
49
- dialect: "mysql";
50
- _meta: {
51
- columns: Record<string, string>;
52
- tables: Record<string, string>;
53
- };
54
- };
55
- }>;
@@ -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
- }>;