drizzle-kit 0.20.17-f62f2f6 → 0.20.17-ff96495

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/bin.cjs +86266 -45488
  2. package/cli/commands/migrate.d.ts +152 -135
  3. package/cli/commands/mysqlIntrospect.d.ts +10 -79
  4. package/cli/commands/mysqlPushUtils.d.ts +4 -8
  5. package/cli/commands/pgIntrospect.d.ts +12 -76
  6. package/cli/commands/pgPushUtils.d.ts +3 -6
  7. package/cli/commands/sqliteIntrospect.d.ts +25 -29
  8. package/cli/commands/sqlitePushUtils.d.ts +4 -10
  9. package/cli/commands/utils.d.ts +39 -255
  10. package/cli/connections.d.ts +13 -0
  11. package/cli/utils.d.ts +13 -0
  12. package/cli/validations/cli.d.ts +169 -0
  13. package/cli/validations/common.d.ts +208 -7
  14. package/cli/validations/mysql.d.ts +6 -342
  15. package/cli/validations/outputs.d.ts +2 -0
  16. package/cli/validations/pg.d.ts +17 -409
  17. package/cli/validations/sqlite.d.ts +22 -0
  18. package/cli/views.d.ts +7 -5
  19. package/global.d.ts +3 -1
  20. package/index.d.mts +25 -17
  21. package/index.d.ts +25 -17
  22. package/index.js +1 -0
  23. package/introspect-sqlite.d.ts +2 -2
  24. package/jsonDiffer.d.ts +14 -29
  25. package/jsonStatements.d.ts +38 -11
  26. package/package.json +29 -51
  27. package/payload.d.mts +5 -5
  28. package/payload.d.ts +5 -5
  29. package/payload.js +15576 -32175
  30. package/payload.mjs +17078 -33688
  31. package/schemaValidator.d.ts +286 -283
  32. package/serializer/mysqlImports.d.ts +3 -7
  33. package/serializer/mysqlSchema.d.ts +2170 -1353
  34. package/serializer/mysqlSerializer.d.ts +6 -6
  35. package/serializer/pgImports.d.ts +2 -2
  36. package/serializer/pgSchema.d.ts +1741 -1282
  37. package/serializer/pgSerializer.d.ts +2 -2
  38. package/serializer/sqliteImports.d.ts +2 -4
  39. package/serializer/sqliteSchema.d.ts +553 -979
  40. package/serializer/sqliteSerializer.d.ts +4 -4
  41. package/serializer/studio.d.ts +51 -0
  42. package/snapshotsDiffer.d.ts +2486 -1209
  43. package/utils/words.d.ts +1 -1
  44. package/utils-studio.d.mts +0 -1
  45. package/utils-studio.d.ts +0 -1
  46. package/utils-studio.js +4557 -803
  47. package/utils-studio.mjs +4533 -782
  48. package/utils.d.ts +20 -141
  49. package/utils.js +4370 -6916
  50. package/utils.mjs +4583 -7129
  51. package/cli/commands/mysqlUp.d.ts +0 -4
  52. package/cli/commands/pgConnect.d.ts +0 -5
  53. package/cli/commands/pgUp.d.ts +0 -4
  54. package/cli/commands/sqliteUtils.d.ts +0 -162
  55. package/cli/commands/upFolders.d.ts +0 -27
  56. package/drivers/index.d.ts +0 -39
  57. package/introspect-mysql.d.ts +0 -9
  58. package/introspect-pg.d.ts +0 -12
@@ -1,63 +1,115 @@
1
- import { CommonSchema, CommonSquashedSchema, Dialect } from "../../schemaValidator";
2
- import { schema } from "../views";
3
- import { PgSchema } from "src/serializer/pgSchema";
4
- import { SQLiteSchema } from "src/serializer/sqliteSchema";
5
- import { MySqlSchema } from "src/serializer/mysqlSchema";
6
- import { Journal } from "src/utils";
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
7
  import { GenerateConfig } from "./utils";
8
8
  export type Named = {
9
9
  name: string;
10
10
  };
11
11
  export type NamedWithSchema = {
12
12
  name: string;
13
- schema?: string;
13
+ schema: string;
14
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>>;
15
19
  export declare const prepareAndMigratePg: (config: GenerateConfig) => Promise<void>;
16
- export declare const prepareMySQLPush: (config: {
17
- schema: string | string[];
18
- }, snapshot: MySqlSchema) => Promise<{
20
+ export declare const preparePgPush: (schemaPath: string | string[], snapshot: PgSchema, schemaFilter: string[]) => Promise<{
19
21
  sqlStatements: string[];
20
22
  statements: import("../../jsonStatements").JsonStatement[];
21
- validatedCur: {
22
- internal?: {
23
- tables: Record<string, {
24
- columns: Record<string, {
25
- isDefaultAnExpression?: boolean | undefined;
26
- } | undefined>;
27
- } | undefined>;
28
- } | undefined;
29
- id: string;
30
- prevId: string;
31
- version: "5";
32
- dialect: "mysql";
23
+ squashedPrev: {
33
24
  tables: Record<string, {
34
- schema?: string | undefined;
35
25
  name: string;
36
26
  columns: Record<string, {
27
+ name: string;
28
+ type: string;
29
+ primaryKey: boolean;
30
+ notNull: boolean;
31
+ isUnique?: any;
37
32
  default?: any;
38
- onUpdate?: any;
39
- autoincrement?: boolean | undefined;
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, {
40
56
  name: string;
41
57
  type: string;
42
58
  primaryKey: boolean;
43
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;
44
96
  }>;
45
97
  indexes: Record<string, {
46
- using?: "btree" | "hash" | undefined;
47
- algorithm?: "default" | "inplace" | "copy" | undefined;
48
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
49
98
  name: string;
50
99
  columns: string[];
51
100
  isUnique: boolean;
101
+ using?: "btree" | "hash" | undefined;
102
+ algorithm?: "default" | "inplace" | "copy" | undefined;
103
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
52
104
  }>;
53
105
  foreignKeys: Record<string, {
54
- onUpdate?: string | undefined;
55
- onDelete?: string | undefined;
56
106
  name: string;
57
107
  tableFrom: string;
58
108
  columnsFrom: string[];
59
109
  tableTo: string;
60
110
  columnsTo: string[];
111
+ onUpdate?: string | undefined;
112
+ onDelete?: string | undefined;
61
113
  }>;
62
114
  compositePrimaryKeys: Record<string, {
63
115
  name: string;
@@ -68,14 +120,14 @@ export declare const prepareMySQLPush: (config: {
68
120
  columns: string[];
69
121
  }>;
70
122
  }>;
71
- schemas: Record<string, string>;
123
+ id: string;
124
+ prevId: string;
125
+ version: "5";
126
+ dialect: "mysql";
72
127
  _meta: {
73
128
  columns: Record<string, string>;
74
129
  tables: Record<string, string>;
75
- schemas: Record<string, string>;
76
130
  };
77
- };
78
- validatedPrev: {
79
131
  internal?: {
80
132
  tables: Record<string, {
81
133
  columns: Record<string, {
@@ -83,38 +135,35 @@ export declare const prepareMySQLPush: (config: {
83
135
  } | undefined>;
84
136
  } | undefined>;
85
137
  } | undefined;
86
- id: string;
87
- prevId: string;
88
- version: "5";
89
- dialect: "mysql";
138
+ };
139
+ validatedPrev: {
90
140
  tables: Record<string, {
91
- schema?: string | undefined;
92
141
  name: string;
93
142
  columns: Record<string, {
94
- default?: any;
95
- onUpdate?: any;
96
- autoincrement?: boolean | undefined;
97
143
  name: string;
98
144
  type: string;
99
145
  primaryKey: boolean;
100
146
  notNull: boolean;
147
+ default?: any;
148
+ onUpdate?: any;
149
+ autoincrement?: boolean | undefined;
101
150
  }>;
102
151
  indexes: Record<string, {
103
- using?: "btree" | "hash" | undefined;
104
- algorithm?: "default" | "inplace" | "copy" | undefined;
105
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
106
152
  name: string;
107
153
  columns: string[];
108
154
  isUnique: boolean;
155
+ using?: "btree" | "hash" | undefined;
156
+ algorithm?: "default" | "inplace" | "copy" | undefined;
157
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
109
158
  }>;
110
159
  foreignKeys: Record<string, {
111
- onUpdate?: string | undefined;
112
- onDelete?: string | undefined;
113
160
  name: string;
114
161
  tableFrom: string;
115
162
  columnsFrom: string[];
116
163
  tableTo: string;
117
164
  columnsTo: string[];
165
+ onUpdate?: string | undefined;
166
+ onDelete?: string | undefined;
118
167
  }>;
119
168
  compositePrimaryKeys: Record<string, {
120
169
  name: string;
@@ -125,146 +174,114 @@ export declare const prepareMySQLPush: (config: {
125
174
  columns: string[];
126
175
  }>;
127
176
  }>;
128
- schemas: Record<string, string>;
177
+ id: string;
178
+ prevId: string;
179
+ version: "5";
180
+ dialect: "mysql";
129
181
  _meta: {
130
182
  columns: Record<string, string>;
131
183
  tables: Record<string, string>;
132
- schemas: Record<string, string>;
133
184
  };
185
+ internal?: {
186
+ tables: Record<string, {
187
+ columns: Record<string, {
188
+ isDefaultAnExpression?: boolean | undefined;
189
+ } | undefined>;
190
+ } | undefined>;
191
+ } | undefined;
134
192
  };
135
- } | undefined>;
136
- export declare const prepareSQLitePush: (config: {
137
- schema: string | string[];
138
- }, snapshot: SQLiteSchema) => Promise<{
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<{
139
197
  sqlStatements: string[];
140
198
  statements: import("../../jsonStatements").JsonStatement[];
141
199
  squashedPrev: {
142
- enums?: any;
143
- version: "5";
144
- dialect: "sqlite";
145
200
  tables: Record<string, {
146
201
  name: string;
147
202
  columns: Record<string, {
148
- default?: any;
149
- autoincrement?: boolean | undefined;
150
203
  name: string;
151
204
  type: string;
152
205
  primaryKey: boolean;
153
206
  notNull: boolean;
154
- }>;
155
- indexes: Record<string, string>;
156
- foreignKeys: Record<string, string>;
157
- compositePrimaryKeys: Record<string, string>;
158
- uniqueConstraints: Record<string, string>;
159
- }>;
160
- };
161
- squashedCur: {
162
- enums?: any;
163
- version: "5";
164
- dialect: "sqlite";
165
- tables: Record<string, {
166
- name: string;
167
- columns: Record<string, {
168
207
  default?: any;
169
208
  autoincrement?: boolean | undefined;
170
- name: string;
171
- type: string;
172
- primaryKey: boolean;
173
- notNull: boolean;
174
209
  }>;
175
210
  indexes: Record<string, string>;
176
211
  foreignKeys: Record<string, string>;
177
212
  compositePrimaryKeys: Record<string, string>;
178
213
  uniqueConstraints: Record<string, string>;
179
214
  }>;
180
- };
181
- meta: {
182
- schemas: {};
183
- tables: {};
184
- columns: {};
185
- } | undefined;
186
- } | undefined>;
187
- export declare const preparePgPush: (config: {
188
- schema: string | string[];
189
- }, snapshot: PgSchema, schemaFilter: string[]) => Promise<{
190
- sqlStatements: string[];
191
- statements: import("../../jsonStatements").JsonStatement[];
192
- squashedPrev: {
193
215
  version: "5";
194
- dialect: "pg";
195
- tables: Record<string, {
196
- name: string;
197
- columns: Record<string, {
198
- isUnique?: any;
199
- default?: any;
200
- uniqueName?: string | undefined;
201
- nullsNotDistinct?: boolean | undefined;
202
- name: string;
203
- type: string;
204
- primaryKey: boolean;
205
- notNull: boolean;
206
- }>;
207
- indexes: Record<string, string>;
208
- foreignKeys: Record<string, string>;
209
- schema: string;
210
- compositePrimaryKeys: Record<string, string>;
211
- uniqueConstraints: Record<string, string>;
212
- }>;
213
- schemas: Record<string, string>;
214
- enums: Record<string, {
215
- name: string;
216
- values: Record<string, string>;
217
- }>;
216
+ dialect: "sqlite";
217
+ enums?: any;
218
218
  };
219
219
  squashedCur: {
220
- version: "5";
221
- dialect: "pg";
222
220
  tables: Record<string, {
223
221
  name: string;
224
222
  columns: Record<string, {
225
- isUnique?: any;
226
- default?: any;
227
- uniqueName?: string | undefined;
228
- nullsNotDistinct?: boolean | undefined;
229
223
  name: string;
230
224
  type: string;
231
225
  primaryKey: boolean;
232
226
  notNull: boolean;
227
+ default?: any;
228
+ autoincrement?: boolean | undefined;
233
229
  }>;
234
230
  indexes: Record<string, string>;
235
231
  foreignKeys: Record<string, string>;
236
- schema: string;
237
232
  compositePrimaryKeys: Record<string, string>;
238
233
  uniqueConstraints: Record<string, string>;
239
234
  }>;
240
- schemas: Record<string, string>;
241
- enums: Record<string, {
242
- name: string;
243
- values: Record<string, string>;
244
- }>;
235
+ version: "5";
236
+ dialect: "sqlite";
237
+ enums?: any;
245
238
  };
246
- } | undefined>;
247
- export declare const prepareAndMigrateMySql: (config: GenerateConfig) => Promise<void>;
248
- export declare const prepareAndMigrateSqlite: (config: GenerateConfig) => Promise<void>;
249
- export declare const prepareSQL: (prev: CommonSquashedSchema, cur: CommonSquashedSchema, dialect: Dialect, prevFull?: any, curFull?: any) => Promise<{
250
- statements: import("../../jsonStatements").JsonStatement[];
251
- sqlStatements: string[];
252
- _meta: {
239
+ meta: {
253
240
  schemas: {};
254
241
  tables: {};
255
242
  columns: {};
256
243
  } | undefined;
257
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
+ }>;
258
274
  export declare const BREAKPOINT = "--> statement-breakpoint\n";
259
- export declare const writeResult: ({ cur, sqlStatements, journal, _meta, outFolder, breakpoints, bundle, type, }: {
275
+ export declare const writeResult: ({ cur, sqlStatements, journal, _meta, outFolder, breakpoints, name, bundle, type, }: {
260
276
  cur: CommonSchema;
261
277
  sqlStatements: string[];
262
278
  journal: Journal;
263
279
  _meta?: any;
264
280
  outFolder: string;
265
281
  breakpoints: boolean;
266
- bundle?: boolean | undefined;
267
- type?: "none" | "custom" | "introspect" | undefined;
282
+ name?: string;
283
+ bundle?: boolean;
284
+ type?: "introspect" | "custom" | "none";
268
285
  }) => void;
269
286
  export declare const embeddedMigrations: (journal: Journal) => string;
270
287
  export declare const prepareSnapshotFolderName: () => string;
@@ -1,43 +1,33 @@
1
- import { MySQLConfigIntrospect, MySQLConnectionConfig } from "../validations/mysql";
2
- import { DrizzleDbClient, MySQL2Client } from "src/drivers";
3
- export declare const connectToMySQL: (config: MySQLConnectionConfig) => Promise<{
4
- client: MySQL2Client;
5
- databaseName: string;
6
- }>;
7
- export declare const mysqlIntrospect: (config: MySQLConfigIntrospect, filters: string[]) => Promise<{
1
+ import type { DB } from "../../utils";
2
+ export declare const mysqlPushIntrospect: (db: DB, databaseName: string, filters: string[]) => Promise<{
8
3
  schema: {
9
- id: string;
10
- prevId: string;
11
- version: "5";
12
- dialect: "mysql";
13
4
  tables: Record<string, {
14
- schema?: string | undefined;
15
5
  name: string;
16
6
  columns: Record<string, {
17
- default?: any;
18
- onUpdate?: any;
19
- autoincrement?: boolean | undefined;
20
7
  name: string;
21
8
  type: string;
22
9
  primaryKey: boolean;
23
10
  notNull: boolean;
11
+ default?: any;
12
+ onUpdate?: any;
13
+ autoincrement?: boolean | undefined;
24
14
  }>;
25
15
  indexes: Record<string, {
26
- using?: "btree" | "hash" | undefined;
27
- algorithm?: "default" | "inplace" | "copy" | undefined;
28
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
29
16
  name: string;
30
17
  columns: string[];
31
18
  isUnique: boolean;
19
+ using?: "btree" | "hash" | undefined;
20
+ algorithm?: "default" | "inplace" | "copy" | undefined;
21
+ lock?: "default" | "none" | "shared" | "exclusive" | undefined;
32
22
  }>;
33
23
  foreignKeys: Record<string, {
34
- onUpdate?: string | undefined;
35
- onDelete?: string | undefined;
36
24
  name: string;
37
25
  tableFrom: string;
38
26
  columnsFrom: string[];
39
27
  tableTo: string;
40
28
  columnsTo: string[];
29
+ onUpdate?: string | undefined;
30
+ onDelete?: string | undefined;
41
31
  }>;
42
32
  compositePrimaryKeys: Record<string, {
43
33
  name: string;
@@ -48,72 +38,13 @@ export declare const mysqlIntrospect: (config: MySQLConfigIntrospect, filters: s
48
38
  columns: string[];
49
39
  }>;
50
40
  }>;
51
- schemas: Record<string, string>;
52
- _meta: {
53
- columns: Record<string, string>;
54
- tables: Record<string, string>;
55
- schemas: Record<string, string>;
56
- };
57
- };
58
- ts: {
59
- file: string;
60
- imports: string;
61
- decalrations: string;
62
- schemaEntry: string;
63
- };
64
- }>;
65
- export declare const mysqlPushIntrospect: (connection: {
66
- client: DrizzleDbClient;
67
- databaseName: string;
68
- }, filters: string[]) => Promise<{
69
- schema: {
70
41
  id: string;
71
42
  prevId: string;
72
43
  version: "5";
73
44
  dialect: "mysql";
74
- tables: Record<string, {
75
- schema?: string | undefined;
76
- name: string;
77
- columns: Record<string, {
78
- default?: any;
79
- onUpdate?: any;
80
- autoincrement?: boolean | undefined;
81
- name: string;
82
- type: string;
83
- primaryKey: boolean;
84
- notNull: boolean;
85
- }>;
86
- indexes: Record<string, {
87
- using?: "btree" | "hash" | undefined;
88
- algorithm?: "default" | "inplace" | "copy" | undefined;
89
- lock?: "default" | "none" | "shared" | "exclusive" | undefined;
90
- name: string;
91
- columns: string[];
92
- isUnique: boolean;
93
- }>;
94
- foreignKeys: Record<string, {
95
- onUpdate?: string | undefined;
96
- onDelete?: string | undefined;
97
- name: string;
98
- tableFrom: string;
99
- columnsFrom: string[];
100
- tableTo: string;
101
- columnsTo: string[];
102
- }>;
103
- compositePrimaryKeys: Record<string, {
104
- name: string;
105
- columns: string[];
106
- }>;
107
- uniqueConstraints: Record<string, {
108
- name: string;
109
- columns: string[];
110
- }>;
111
- }>;
112
- schemas: Record<string, string>;
113
45
  _meta: {
114
46
  columns: Record<string, string>;
115
47
  tables: Record<string, string>;
116
- schemas: Record<string, string>;
117
48
  };
118
49
  };
119
50
  }>;
@@ -1,13 +1,9 @@
1
- import { DrizzleDbClient } from "src/drivers";
2
- import { JsonStatement } from "src/jsonStatements";
3
- import { mysqlSchema } from "src/serializer/mysqlSchema";
1
+ import { JsonStatement } from "../../jsonStatements";
2
+ import { mysqlSchema } from "../../serializer/mysqlSchema";
4
3
  import { TypeOf } from "zod";
4
+ import type { DB } from "../../utils";
5
5
  export declare const filterStatements: (statements: JsonStatement[], currentSchema: TypeOf<typeof mysqlSchema>, prevSchema: TypeOf<typeof mysqlSchema>) => JsonStatement[];
6
- export declare const logSuggestionsAndReturn: ({ connection, statements, json2, }: {
7
- statements: JsonStatement[];
8
- connection: DrizzleDbClient;
9
- json2: TypeOf<typeof mysqlSchema>;
10
- }) => Promise<{
6
+ export declare const logSuggestionsAndReturn: (db: DB, statements: JsonStatement[], json2: TypeOf<typeof mysqlSchema>) => Promise<{
11
7
  statementsToExecute: string[];
12
8
  shouldAskForApprove: boolean;
13
9
  infoToPrint: string[];
@@ -1,81 +1,18 @@
1
- import type { PgConfigIntrospect } from "../validations/pg";
2
- import type { DrizzleDbClient } from "src/drivers";
3
- export declare const pgSchemas: (client: DrizzleDbClient) => Promise<string[]>;
4
- export declare const pgPushIntrospect: (connection: {
5
- client: DrizzleDbClient;
6
- }, filters: string[], schemaFilters: string[]) => Promise<{
1
+ import type { DB } from "../../utils";
2
+ export declare const pgPushIntrospect: (db: DB, filters: string[], schemaFilters: string[]) => Promise<{
7
3
  schema: {
8
- id: string;
9
- prevId: string;
10
- version: "5";
11
- dialect: "pg";
12
4
  tables: Record<string, {
13
5
  name: string;
14
6
  columns: Record<string, {
15
- isUnique?: any;
16
- default?: any;
17
- uniqueName?: string | undefined;
18
- nullsNotDistinct?: boolean | undefined;
19
7
  name: string;
20
8
  type: string;
21
9
  primaryKey: boolean;
22
10
  notNull: boolean;
23
- }>;
24
- indexes: Record<string, {
25
- name: string;
26
- columns: string[];
27
- isUnique: boolean;
28
- }>;
29
- foreignKeys: Record<string, {
30
- onUpdate?: string | undefined;
31
- onDelete?: string | undefined;
32
- schemaTo?: string | undefined;
33
- name: string;
34
- tableFrom: string;
35
- columnsFrom: string[];
36
- tableTo: string;
37
- columnsTo: string[];
38
- }>;
39
- schema: string;
40
- compositePrimaryKeys: Record<string, {
41
- name: string;
42
- columns: string[];
43
- }>;
44
- uniqueConstraints: Record<string, {
45
- name: string;
46
- columns: string[];
47
- nullsNotDistinct: boolean;
48
- }>;
49
- }>;
50
- schemas: Record<string, string>;
51
- _meta: {
52
- columns: Record<string, string>;
53
- tables: Record<string, string>;
54
- schemas: Record<string, string>;
55
- };
56
- enums: Record<string, {
57
- name: string;
58
- values: Record<string, string>;
59
- }>;
60
- };
61
- }>;
62
- export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[], schemaFilters: string[]) => Promise<{
63
- schema: {
64
- id: string;
65
- prevId: string;
66
- version: "5";
67
- dialect: "pg";
68
- tables: Record<string, {
69
- name: string;
70
- columns: Record<string, {
71
11
  isUnique?: any;
72
12
  default?: any;
13
+ typeSchema?: string | undefined;
73
14
  uniqueName?: string | undefined;
74
15
  nullsNotDistinct?: boolean | undefined;
75
- name: string;
76
- type: string;
77
- primaryKey: boolean;
78
- notNull: boolean;
79
16
  }>;
80
17
  indexes: Record<string, {
81
18
  name: string;
@@ -83,14 +20,14 @@ export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[
83
20
  isUnique: boolean;
84
21
  }>;
85
22
  foreignKeys: Record<string, {
86
- onUpdate?: string | undefined;
87
- onDelete?: string | undefined;
88
- schemaTo?: string | undefined;
89
23
  name: string;
90
24
  tableFrom: string;
91
25
  columnsFrom: string[];
92
26
  tableTo: string;
93
27
  columnsTo: string[];
28
+ onUpdate?: string | undefined;
29
+ onDelete?: string | undefined;
30
+ schemaTo?: string | undefined;
94
31
  }>;
95
32
  schema: string;
96
33
  compositePrimaryKeys: Record<string, {
@@ -103,6 +40,10 @@ export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[
103
40
  nullsNotDistinct: boolean;
104
41
  }>;
105
42
  }>;
43
+ id: string;
44
+ prevId: string;
45
+ version: "6";
46
+ dialect: "pg";
106
47
  schemas: Record<string, string>;
107
48
  _meta: {
108
49
  columns: Record<string, string>;
@@ -111,13 +52,8 @@ export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[
111
52
  };
112
53
  enums: Record<string, {
113
54
  name: string;
114
- values: Record<string, string>;
55
+ values: string[];
56
+ schema: string;
115
57
  }>;
116
58
  };
117
- ts: {
118
- file: string;
119
- imports: string;
120
- decalrations: string;
121
- schemaEntry: string;
122
- };
123
59
  }>;