drizzle-kit 0.20.16 → 0.20.17-0d9aa5f

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.
Files changed (58) hide show
  1. package/bin.cjs +69120 -38874
  2. package/cli/commands/migrate.d.ts +123 -106
  3. package/cli/commands/mysqlIntrospect.d.ts +2 -71
  4. package/cli/commands/mysqlPushUtils.d.ts +4 -8
  5. package/cli/commands/pgIntrospect.d.ts +6 -70
  6. package/cli/commands/pgPushUtils.d.ts +3 -6
  7. package/cli/commands/sqliteIntrospect.d.ts +13 -17
  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 +16 -408
  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 +28 -51
  27. package/payload.d.mts +5 -5
  28. package/payload.d.ts +5 -5
  29. package/payload.js +16621 -33841
  30. package/payload.mjs +16673 -33904
  31. package/schemaValidator.d.ts +72 -69
  32. package/serializer/mysqlImports.d.ts +3 -7
  33. package/serializer/mysqlSchema.d.ts +1404 -587
  34. package/serializer/mysqlSerializer.d.ts +6 -6
  35. package/serializer/pgImports.d.ts +2 -2
  36. package/serializer/pgSchema.d.ts +1260 -801
  37. package/serializer/pgSerializer.d.ts +2 -2
  38. package/serializer/sqliteImports.d.ts +2 -4
  39. package/serializer/sqliteSchema.d.ts +144 -570
  40. package/serializer/sqliteSerializer.d.ts +4 -4
  41. package/serializer/studio.d.ts +51 -0
  42. package/snapshotsDiffer.d.ts +2334 -1057
  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 +3817 -169
  47. package/utils-studio.mjs +3817 -172
  48. package/utils.d.ts +20 -141
  49. package/utils.js +3899 -7070
  50. package/utils.mjs +3972 -7143
  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,21 +1,85 @@
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<{
21
+ sqlStatements: string[];
22
+ statements: import("../../jsonStatements").JsonStatement[];
23
+ squashedPrev: {
24
+ tables: Record<string, {
25
+ name: string;
26
+ columns: Record<string, {
27
+ isUnique?: any;
28
+ default?: any;
29
+ typeSchema?: string | undefined;
30
+ uniqueName?: string | undefined;
31
+ nullsNotDistinct?: boolean | undefined;
32
+ name: string;
33
+ type: string;
34
+ primaryKey: boolean;
35
+ notNull: boolean;
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
+ isUnique?: any;
57
+ default?: any;
58
+ typeSchema?: string | undefined;
59
+ uniqueName?: string | undefined;
60
+ nullsNotDistinct?: boolean | undefined;
61
+ name: string;
62
+ type: string;
63
+ primaryKey: boolean;
64
+ notNull: boolean;
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<{
19
83
  sqlStatements: string[];
20
84
  statements: import("../../jsonStatements").JsonStatement[];
21
85
  validatedCur: {
@@ -26,12 +90,7 @@ export declare const prepareMySQLPush: (config: {
26
90
  } | undefined>;
27
91
  } | undefined>;
28
92
  } | undefined;
29
- id: string;
30
- prevId: string;
31
- version: "5";
32
- dialect: "mysql";
33
93
  tables: Record<string, {
34
- schema?: string | undefined;
35
94
  name: string;
36
95
  columns: Record<string, {
37
96
  default?: any;
@@ -68,11 +127,13 @@ export declare const prepareMySQLPush: (config: {
68
127
  columns: string[];
69
128
  }>;
70
129
  }>;
71
- schemas: Record<string, string>;
130
+ id: string;
131
+ prevId: string;
132
+ version: "5";
133
+ dialect: "mysql";
72
134
  _meta: {
73
135
  columns: Record<string, string>;
74
136
  tables: Record<string, string>;
75
- schemas: Record<string, string>;
76
137
  };
77
138
  };
78
139
  validatedPrev: {
@@ -83,12 +144,7 @@ export declare const prepareMySQLPush: (config: {
83
144
  } | undefined>;
84
145
  } | undefined>;
85
146
  } | undefined;
86
- id: string;
87
- prevId: string;
88
- version: "5";
89
- dialect: "mysql";
90
147
  tables: Record<string, {
91
- schema?: string | undefined;
92
148
  name: string;
93
149
  columns: Record<string, {
94
150
  default?: any;
@@ -125,23 +181,23 @@ export declare const prepareMySQLPush: (config: {
125
181
  columns: string[];
126
182
  }>;
127
183
  }>;
128
- schemas: Record<string, string>;
184
+ id: string;
185
+ prevId: string;
186
+ version: "5";
187
+ dialect: "mysql";
129
188
  _meta: {
130
189
  columns: Record<string, string>;
131
190
  tables: Record<string, string>;
132
- schemas: Record<string, string>;
133
191
  };
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
200
  enums?: any;
143
- version: "5";
144
- dialect: "sqlite";
145
201
  tables: Record<string, {
146
202
  name: string;
147
203
  columns: Record<string, {
@@ -157,11 +213,11 @@ export declare const prepareSQLitePush: (config: {
157
213
  compositePrimaryKeys: Record<string, string>;
158
214
  uniqueConstraints: Record<string, string>;
159
215
  }>;
216
+ version: "5";
217
+ dialect: "sqlite";
160
218
  };
161
219
  squashedCur: {
162
220
  enums?: any;
163
- version: "5";
164
- dialect: "sqlite";
165
221
  tables: Record<string, {
166
222
  name: string;
167
223
  columns: Record<string, {
@@ -177,94 +233,55 @@ export declare const prepareSQLitePush: (config: {
177
233
  compositePrimaryKeys: Record<string, string>;
178
234
  uniqueConstraints: Record<string, string>;
179
235
  }>;
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
236
  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
- }>;
218
- };
219
- squashedCur: {
220
- version: "5";
221
- dialect: "pg";
222
- tables: Record<string, {
223
- name: string;
224
- columns: Record<string, {
225
- isUnique?: any;
226
- default?: any;
227
- uniqueName?: string | undefined;
228
- nullsNotDistinct?: boolean | undefined;
229
- name: string;
230
- type: string;
231
- primaryKey: boolean;
232
- notNull: boolean;
233
- }>;
234
- indexes: Record<string, string>;
235
- foreignKeys: Record<string, string>;
236
- schema: string;
237
- compositePrimaryKeys: Record<string, string>;
238
- uniqueConstraints: Record<string, string>;
239
- }>;
240
- schemas: Record<string, string>;
241
- enums: Record<string, {
242
- name: string;
243
- values: Record<string, string>;
244
- }>;
237
+ dialect: "sqlite";
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,17 +1,7 @@
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
7
  default?: any;
@@ -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,19 +1,12 @@
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
7
  isUnique?: any;
16
8
  default?: any;
9
+ typeSchema?: string | undefined;
17
10
  uniqueName?: string | undefined;
18
11
  nullsNotDistinct?: boolean | undefined;
19
12
  name: string;
@@ -47,62 +40,10 @@ export declare const pgPushIntrospect: (connection: {
47
40
  nullsNotDistinct: boolean;
48
41
  }>;
49
42
  }>;
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
43
  id: string;
65
44
  prevId: string;
66
- version: "5";
45
+ version: "6";
67
46
  dialect: "pg";
68
- tables: Record<string, {
69
- name: string;
70
- columns: Record<string, {
71
- isUnique?: any;
72
- default?: any;
73
- uniqueName?: string | undefined;
74
- nullsNotDistinct?: boolean | undefined;
75
- name: string;
76
- type: string;
77
- primaryKey: boolean;
78
- notNull: boolean;
79
- }>;
80
- indexes: Record<string, {
81
- name: string;
82
- columns: string[];
83
- isUnique: boolean;
84
- }>;
85
- foreignKeys: Record<string, {
86
- onUpdate?: string | undefined;
87
- onDelete?: string | undefined;
88
- schemaTo?: string | undefined;
89
- name: string;
90
- tableFrom: string;
91
- columnsFrom: string[];
92
- tableTo: string;
93
- columnsTo: string[];
94
- }>;
95
- schema: string;
96
- compositePrimaryKeys: Record<string, {
97
- name: string;
98
- columns: string[];
99
- }>;
100
- uniqueConstraints: Record<string, {
101
- name: string;
102
- columns: string[];
103
- nullsNotDistinct: boolean;
104
- }>;
105
- }>;
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
  }>;
@@ -1,9 +1,6 @@
1
- import { DrizzleDbClient } from "src/drivers";
2
- import { JsonStatement } from "src/jsonStatements";
3
- export declare const pgSuggestions: ({ connection, statements, }: {
4
- statements: JsonStatement[];
5
- connection: DrizzleDbClient;
6
- }) => Promise<{
1
+ import type { DB } from "../../utils";
2
+ import type { JsonStatement } from "../../jsonStatements";
3
+ export declare const pgSuggestions: (db: DB, statements: JsonStatement[]) => Promise<{
7
4
  statementsToExecute: string[];
8
5
  shouldAskForApprove: boolean;
9
6
  infoToPrint: string[];
@@ -1,16 +1,8 @@
1
- import type { SQLiteCliConfig, SQLiteConnectionConfig } from "./sqliteUtils";
2
- import type { DrizzleDbClient } from "../../drivers";
3
- export declare const connectToSQLite: (config: SQLiteConnectionConfig) => Promise<{
4
- client: import("../../drivers").BetterSqlite;
5
- } | {
6
- client?: undefined;
7
- }>;
8
- export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string[]) => Promise<{
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<{
9
5
  schema: {
10
- id: string;
11
- prevId: string;
12
- version: "5";
13
- dialect: "sqlite";
14
6
  tables: Record<string, {
15
7
  name: string;
16
8
  columns: Record<string, {
@@ -45,6 +37,10 @@ export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string
45
37
  columns: string[];
46
38
  }>;
47
39
  }>;
40
+ id: string;
41
+ prevId: string;
42
+ version: "5";
43
+ dialect: "sqlite";
48
44
  _meta: {
49
45
  columns: Record<string, string>;
50
46
  tables: Record<string, string>;
@@ -58,12 +54,8 @@ export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string
58
54
  schemaEntry: string;
59
55
  };
60
56
  }>;
61
- export declare const sqlitePushIntrospect: (client: DrizzleDbClient, filters: string[]) => Promise<{
57
+ export declare const sqlitePushIntrospect: (db: SQLiteDB, filters: string[]) => Promise<{
62
58
  schema: {
63
- id: string;
64
- prevId: string;
65
- version: "5";
66
- dialect: "sqlite";
67
59
  tables: Record<string, {
68
60
  name: string;
69
61
  columns: Record<string, {
@@ -98,6 +90,10 @@ export declare const sqlitePushIntrospect: (client: DrizzleDbClient, filters: st
98
90
  columns: string[];
99
91
  }>;
100
92
  }>;
93
+ id: string;
94
+ prevId: string;
95
+ version: "5";
96
+ dialect: "sqlite";
101
97
  _meta: {
102
98
  columns: Record<string, string>;
103
99
  tables: Record<string, string>;
@@ -1,16 +1,10 @@
1
- import { DrizzleDbClient } from "src/drivers";
2
- import { JsonStatement } from "src/jsonStatements";
3
- import { SQLiteSchemaInternal, SQLiteSchemaSquashed } from "src/serializer/sqliteSchema";
1
+ import { SQLiteSchemaInternal, SQLiteSchemaSquashed } from "../../serializer/sqliteSchema";
2
+ import type { JsonStatement } from "../../jsonStatements";
3
+ import type { SQLiteDB } from "../../utils";
4
4
  export declare const _moveDataStatements: (tableName: string, json: SQLiteSchemaSquashed, dataLoss?: boolean) => string[];
5
5
  export declare const getOldTableName: (tableName: string, meta: SQLiteSchemaInternal["_meta"]) => string;
6
6
  export declare const getNewTableName: (tableName: string, meta: SQLiteSchemaInternal["_meta"]) => string;
7
- export declare const logSuggestionsAndReturn: ({ connection, statements, json1, json2, meta, }: {
8
- statements: JsonStatement[];
9
- connection: DrizzleDbClient;
10
- json1: SQLiteSchemaSquashed;
11
- json2: SQLiteSchemaSquashed;
12
- meta: SQLiteSchemaInternal["_meta"];
13
- }) => Promise<{
7
+ export declare const logSuggestionsAndReturn: (connection: SQLiteDB, statements: JsonStatement[], json1: SQLiteSchemaSquashed, json2: SQLiteSchemaSquashed, meta: SQLiteSchemaInternal["_meta"]) => Promise<{
14
8
  statementsToExecute: string[];
15
9
  shouldAskForApprove: boolean;
16
10
  infoToPrint: string[];