drizzle-kit 0.20.13 → 0.20.14-05603dc

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.
@@ -1120,12 +1120,12 @@ declare const commonSchema: import("zod").ZodUnion<[import("zod").ZodObject<impo
1120
1120
  }>>;
1121
1121
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
1122
1122
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
1123
- name: import("zod").ZodString;
1123
+ name: import("zod").ZodOptional<import("zod").ZodString>;
1124
1124
  }, "strict", import("zod").ZodTypeAny, {
1125
- name: string;
1125
+ name?: string | undefined;
1126
1126
  columns: string[];
1127
1127
  }, {
1128
- name: string;
1128
+ name?: string | undefined;
1129
1129
  columns: string[];
1130
1130
  }>>;
1131
1131
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -1164,7 +1164,7 @@ declare const commonSchema: import("zod").ZodUnion<[import("zod").ZodObject<impo
1164
1164
  columnsTo: string[];
1165
1165
  }>;
1166
1166
  compositePrimaryKeys: Record<string, {
1167
- name: string;
1167
+ name?: string | undefined;
1168
1168
  columns: string[];
1169
1169
  }>;
1170
1170
  uniqueConstraints: Record<string, {
@@ -1201,7 +1201,7 @@ declare const commonSchema: import("zod").ZodUnion<[import("zod").ZodObject<impo
1201
1201
  columnsTo: string[];
1202
1202
  }>;
1203
1203
  compositePrimaryKeys: Record<string, {
1204
- name: string;
1204
+ name?: string | undefined;
1205
1205
  columns: string[];
1206
1206
  }>;
1207
1207
  }>>;
@@ -1250,7 +1250,7 @@ declare const commonSchema: import("zod").ZodUnion<[import("zod").ZodObject<impo
1250
1250
  columnsTo: string[];
1251
1251
  }>;
1252
1252
  compositePrimaryKeys: Record<string, {
1253
- name: string;
1253
+ name?: string | undefined;
1254
1254
  columns: string[];
1255
1255
  }>;
1256
1256
  uniqueConstraints: Record<string, {
@@ -1298,7 +1298,7 @@ declare const commonSchema: import("zod").ZodUnion<[import("zod").ZodObject<impo
1298
1298
  columnsTo: string[];
1299
1299
  }>;
1300
1300
  compositePrimaryKeys: Record<string, {
1301
- name: string;
1301
+ name?: string | undefined;
1302
1302
  columns: string[];
1303
1303
  }>;
1304
1304
  }>;
@@ -1,4 +1,9 @@
1
1
  import { AnyMySqlTable, MySqlSchema } from "drizzle-orm/mysql-core";
2
+ export declare const prepareFromExports: (exports: Record<string, unknown>) => {
3
+ tables: AnyMySqlTable<{}>[];
4
+ enums: any[];
5
+ schemas: MySqlSchema<string>[];
6
+ };
2
7
  export declare const prepareFromMySqlImports: (imports: string[]) => Promise<{
3
8
  tables: AnyMySqlTable<{}>[];
4
9
  enums: any[];
@@ -1,7 +1,7 @@
1
1
  import { AnyMySqlTable, MySqlSchema } from "drizzle-orm/mysql-core";
2
2
  import { MySqlSchemaInternal } from "src/serializer/mysqlSchema";
3
- import { Connection } from "mysql2/promise";
4
3
  import { IntrospectStage, IntrospectStatus } from "src/cli/views";
4
+ import { DrizzleDbClient } from "src/drivers";
5
5
  export declare const indexName: (tableName: string, columns: string[]) => string;
6
6
  export declare const generateMySqlSnapshot: (tables: AnyMySqlTable[], enums: any[], mysqlSchemas: MySqlSchema[]) => MySqlSchemaInternal;
7
- export declare const fromDatabase: (db: Connection, inputSchema: string, tablesFilter?: (table: string) => boolean, progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<MySqlSchemaInternal>;
7
+ export declare const fromDatabase: (db: DrizzleDbClient, inputSchema: string, tablesFilter?: (table: string) => boolean, progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<MySqlSchemaInternal>;
@@ -1,4 +1,8 @@
1
1
  import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
2
+ export declare const prepareFromExports: (exports: Record<string, unknown>) => {
3
+ tables: AnySQLiteTable<{}>[];
4
+ enums: any[];
5
+ };
2
6
  export declare const prepareFromSqliteImports: (imports: string[]) => Promise<{
3
7
  tables: AnySQLiteTable<{}>[];
4
8
  enums: any[];
@@ -42,12 +42,12 @@ declare const fk: import("zod").ZodObject<{
42
42
  }>;
43
43
  declare const compositePK: import("zod").ZodObject<{
44
44
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
45
- name: import("zod").ZodString;
45
+ name: import("zod").ZodOptional<import("zod").ZodString>;
46
46
  }, "strict", import("zod").ZodTypeAny, {
47
- name: string;
47
+ name?: string | undefined;
48
48
  columns: string[];
49
49
  }, {
50
- name: string;
50
+ name?: string | undefined;
51
51
  columns: string[];
52
52
  }>;
53
53
  declare const column: import("zod").ZodObject<{
@@ -149,12 +149,12 @@ declare const table: import("zod").ZodObject<{
149
149
  }>>;
150
150
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
151
151
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
152
- name: import("zod").ZodString;
152
+ name: import("zod").ZodOptional<import("zod").ZodString>;
153
153
  }, "strict", import("zod").ZodTypeAny, {
154
- name: string;
154
+ name?: string | undefined;
155
155
  columns: string[];
156
156
  }, {
157
- name: string;
157
+ name?: string | undefined;
158
158
  columns: string[];
159
159
  }>>;
160
160
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -193,7 +193,7 @@ declare const table: import("zod").ZodObject<{
193
193
  columnsTo: string[];
194
194
  }>;
195
195
  compositePrimaryKeys: Record<string, {
196
- name: string;
196
+ name?: string | undefined;
197
197
  columns: string[];
198
198
  }>;
199
199
  uniqueConstraints: Record<string, {
@@ -230,7 +230,7 @@ declare const table: import("zod").ZodObject<{
230
230
  columnsTo: string[];
231
231
  }>;
232
232
  compositePrimaryKeys: Record<string, {
233
- name: string;
233
+ name?: string | undefined;
234
234
  columns: string[];
235
235
  }>;
236
236
  }>;
@@ -486,12 +486,12 @@ export declare const schemaInternalV4: import("zod").ZodObject<{
486
486
  }>>;
487
487
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
488
488
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
489
- name: import("zod").ZodString;
489
+ name: import("zod").ZodOptional<import("zod").ZodString>;
490
490
  }, "strict", import("zod").ZodTypeAny, {
491
- name: string;
491
+ name?: string | undefined;
492
492
  columns: string[];
493
493
  }, {
494
- name: string;
494
+ name?: string | undefined;
495
495
  columns: string[];
496
496
  }>>;
497
497
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -530,7 +530,7 @@ export declare const schemaInternalV4: import("zod").ZodObject<{
530
530
  columnsTo: string[];
531
531
  }>;
532
532
  compositePrimaryKeys: Record<string, {
533
- name: string;
533
+ name?: string | undefined;
534
534
  columns: string[];
535
535
  }>;
536
536
  uniqueConstraints: Record<string, {
@@ -567,7 +567,7 @@ export declare const schemaInternalV4: import("zod").ZodObject<{
567
567
  columnsTo: string[];
568
568
  }>;
569
569
  compositePrimaryKeys: Record<string, {
570
- name: string;
570
+ name?: string | undefined;
571
571
  columns: string[];
572
572
  }>;
573
573
  }>>;
@@ -601,7 +601,7 @@ export declare const schemaInternalV4: import("zod").ZodObject<{
601
601
  columnsTo: string[];
602
602
  }>;
603
603
  compositePrimaryKeys: Record<string, {
604
- name: string;
604
+ name?: string | undefined;
605
605
  columns: string[];
606
606
  }>;
607
607
  uniqueConstraints: Record<string, {
@@ -643,7 +643,7 @@ export declare const schemaInternalV4: import("zod").ZodObject<{
643
643
  columnsTo: string[];
644
644
  }>;
645
645
  compositePrimaryKeys: Record<string, {
646
- name: string;
646
+ name?: string | undefined;
647
647
  columns: string[];
648
648
  }>;
649
649
  }>;
@@ -719,12 +719,12 @@ export declare const schemaInternal: import("zod").ZodObject<{
719
719
  }>>;
720
720
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
721
721
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
722
- name: import("zod").ZodString;
722
+ name: import("zod").ZodOptional<import("zod").ZodString>;
723
723
  }, "strict", import("zod").ZodTypeAny, {
724
- name: string;
724
+ name?: string | undefined;
725
725
  columns: string[];
726
726
  }, {
727
- name: string;
727
+ name?: string | undefined;
728
728
  columns: string[];
729
729
  }>>;
730
730
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -763,7 +763,7 @@ export declare const schemaInternal: import("zod").ZodObject<{
763
763
  columnsTo: string[];
764
764
  }>;
765
765
  compositePrimaryKeys: Record<string, {
766
- name: string;
766
+ name?: string | undefined;
767
767
  columns: string[];
768
768
  }>;
769
769
  uniqueConstraints: Record<string, {
@@ -800,7 +800,7 @@ export declare const schemaInternal: import("zod").ZodObject<{
800
800
  columnsTo: string[];
801
801
  }>;
802
802
  compositePrimaryKeys: Record<string, {
803
- name: string;
803
+ name?: string | undefined;
804
804
  columns: string[];
805
805
  }>;
806
806
  }>>;
@@ -844,7 +844,7 @@ export declare const schemaInternal: import("zod").ZodObject<{
844
844
  columnsTo: string[];
845
845
  }>;
846
846
  compositePrimaryKeys: Record<string, {
847
- name: string;
847
+ name?: string | undefined;
848
848
  columns: string[];
849
849
  }>;
850
850
  uniqueConstraints: Record<string, {
@@ -890,7 +890,7 @@ export declare const schemaInternal: import("zod").ZodObject<{
890
890
  columnsTo: string[];
891
891
  }>;
892
892
  compositePrimaryKeys: Record<string, {
893
- name: string;
893
+ name?: string | undefined;
894
894
  columns: string[];
895
895
  }>;
896
896
  }>;
@@ -1158,12 +1158,12 @@ export declare const schemaV4: import("zod").ZodObject<import("zod").extendShape
1158
1158
  }>>;
1159
1159
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
1160
1160
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
1161
- name: import("zod").ZodString;
1161
+ name: import("zod").ZodOptional<import("zod").ZodString>;
1162
1162
  }, "strict", import("zod").ZodTypeAny, {
1163
- name: string;
1163
+ name?: string | undefined;
1164
1164
  columns: string[];
1165
1165
  }, {
1166
- name: string;
1166
+ name?: string | undefined;
1167
1167
  columns: string[];
1168
1168
  }>>;
1169
1169
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -1202,7 +1202,7 @@ export declare const schemaV4: import("zod").ZodObject<import("zod").extendShape
1202
1202
  columnsTo: string[];
1203
1203
  }>;
1204
1204
  compositePrimaryKeys: Record<string, {
1205
- name: string;
1205
+ name?: string | undefined;
1206
1206
  columns: string[];
1207
1207
  }>;
1208
1208
  uniqueConstraints: Record<string, {
@@ -1239,7 +1239,7 @@ export declare const schemaV4: import("zod").ZodObject<import("zod").extendShape
1239
1239
  columnsTo: string[];
1240
1240
  }>;
1241
1241
  compositePrimaryKeys: Record<string, {
1242
- name: string;
1242
+ name?: string | undefined;
1243
1243
  columns: string[];
1244
1244
  }>;
1245
1245
  }>>;
@@ -1278,7 +1278,7 @@ export declare const schemaV4: import("zod").ZodObject<import("zod").extendShape
1278
1278
  columnsTo: string[];
1279
1279
  }>;
1280
1280
  compositePrimaryKeys: Record<string, {
1281
- name: string;
1281
+ name?: string | undefined;
1282
1282
  columns: string[];
1283
1283
  }>;
1284
1284
  uniqueConstraints: Record<string, {
@@ -1322,7 +1322,7 @@ export declare const schemaV4: import("zod").ZodObject<import("zod").extendShape
1322
1322
  columnsTo: string[];
1323
1323
  }>;
1324
1324
  compositePrimaryKeys: Record<string, {
1325
- name: string;
1325
+ name?: string | undefined;
1326
1326
  columns: string[];
1327
1327
  }>;
1328
1328
  }>;
@@ -1398,12 +1398,12 @@ export declare const schema: import("zod").ZodObject<import("zod").extendShape<{
1398
1398
  }>>;
1399
1399
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
1400
1400
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
1401
- name: import("zod").ZodString;
1401
+ name: import("zod").ZodOptional<import("zod").ZodString>;
1402
1402
  }, "strict", import("zod").ZodTypeAny, {
1403
- name: string;
1403
+ name?: string | undefined;
1404
1404
  columns: string[];
1405
1405
  }, {
1406
- name: string;
1406
+ name?: string | undefined;
1407
1407
  columns: string[];
1408
1408
  }>>;
1409
1409
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -1442,7 +1442,7 @@ export declare const schema: import("zod").ZodObject<import("zod").extendShape<{
1442
1442
  columnsTo: string[];
1443
1443
  }>;
1444
1444
  compositePrimaryKeys: Record<string, {
1445
- name: string;
1445
+ name?: string | undefined;
1446
1446
  columns: string[];
1447
1447
  }>;
1448
1448
  uniqueConstraints: Record<string, {
@@ -1479,7 +1479,7 @@ export declare const schema: import("zod").ZodObject<import("zod").extendShape<{
1479
1479
  columnsTo: string[];
1480
1480
  }>;
1481
1481
  compositePrimaryKeys: Record<string, {
1482
- name: string;
1482
+ name?: string | undefined;
1483
1483
  columns: string[];
1484
1484
  }>;
1485
1485
  }>>;
@@ -1528,7 +1528,7 @@ export declare const schema: import("zod").ZodObject<import("zod").extendShape<{
1528
1528
  columnsTo: string[];
1529
1529
  }>;
1530
1530
  compositePrimaryKeys: Record<string, {
1531
- name: string;
1531
+ name?: string | undefined;
1532
1532
  columns: string[];
1533
1533
  }>;
1534
1534
  uniqueConstraints: Record<string, {
@@ -1576,7 +1576,7 @@ export declare const schema: import("zod").ZodObject<import("zod").extendShape<{
1576
1576
  columnsTo: string[];
1577
1577
  }>;
1578
1578
  compositePrimaryKeys: Record<string, {
1579
- name: string;
1579
+ name?: string | undefined;
1580
1580
  columns: string[];
1581
1581
  }>;
1582
1582
  }>;
@@ -1740,7 +1740,7 @@ export declare const drySQLite: {
1740
1740
  columnsTo: string[];
1741
1741
  }>;
1742
1742
  compositePrimaryKeys: Record<string, {
1743
- name: string;
1743
+ name?: string | undefined;
1744
1744
  columns: string[];
1745
1745
  }>;
1746
1746
  uniqueConstraints: Record<string, {
@@ -2012,12 +2012,12 @@ export declare const sqliteSchemaV4: import("zod").ZodObject<import("zod").exten
2012
2012
  }>>;
2013
2013
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
2014
2014
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
2015
- name: import("zod").ZodString;
2015
+ name: import("zod").ZodOptional<import("zod").ZodString>;
2016
2016
  }, "strict", import("zod").ZodTypeAny, {
2017
- name: string;
2017
+ name?: string | undefined;
2018
2018
  columns: string[];
2019
2019
  }, {
2020
- name: string;
2020
+ name?: string | undefined;
2021
2021
  columns: string[];
2022
2022
  }>>;
2023
2023
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -2056,7 +2056,7 @@ export declare const sqliteSchemaV4: import("zod").ZodObject<import("zod").exten
2056
2056
  columnsTo: string[];
2057
2057
  }>;
2058
2058
  compositePrimaryKeys: Record<string, {
2059
- name: string;
2059
+ name?: string | undefined;
2060
2060
  columns: string[];
2061
2061
  }>;
2062
2062
  uniqueConstraints: Record<string, {
@@ -2093,7 +2093,7 @@ export declare const sqliteSchemaV4: import("zod").ZodObject<import("zod").exten
2093
2093
  columnsTo: string[];
2094
2094
  }>;
2095
2095
  compositePrimaryKeys: Record<string, {
2096
- name: string;
2096
+ name?: string | undefined;
2097
2097
  columns: string[];
2098
2098
  }>;
2099
2099
  }>>;
@@ -2132,7 +2132,7 @@ export declare const sqliteSchemaV4: import("zod").ZodObject<import("zod").exten
2132
2132
  columnsTo: string[];
2133
2133
  }>;
2134
2134
  compositePrimaryKeys: Record<string, {
2135
- name: string;
2135
+ name?: string | undefined;
2136
2136
  columns: string[];
2137
2137
  }>;
2138
2138
  uniqueConstraints: Record<string, {
@@ -2176,7 +2176,7 @@ export declare const sqliteSchemaV4: import("zod").ZodObject<import("zod").exten
2176
2176
  columnsTo: string[];
2177
2177
  }>;
2178
2178
  compositePrimaryKeys: Record<string, {
2179
- name: string;
2179
+ name?: string | undefined;
2180
2180
  columns: string[];
2181
2181
  }>;
2182
2182
  }>;
@@ -2252,12 +2252,12 @@ export declare const sqliteSchema: import("zod").ZodObject<import("zod").extendS
2252
2252
  }>>;
2253
2253
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
2254
2254
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
2255
- name: import("zod").ZodString;
2255
+ name: import("zod").ZodOptional<import("zod").ZodString>;
2256
2256
  }, "strict", import("zod").ZodTypeAny, {
2257
- name: string;
2257
+ name?: string | undefined;
2258
2258
  columns: string[];
2259
2259
  }, {
2260
- name: string;
2260
+ name?: string | undefined;
2261
2261
  columns: string[];
2262
2262
  }>>;
2263
2263
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -2296,7 +2296,7 @@ export declare const sqliteSchema: import("zod").ZodObject<import("zod").extendS
2296
2296
  columnsTo: string[];
2297
2297
  }>;
2298
2298
  compositePrimaryKeys: Record<string, {
2299
- name: string;
2299
+ name?: string | undefined;
2300
2300
  columns: string[];
2301
2301
  }>;
2302
2302
  uniqueConstraints: Record<string, {
@@ -2333,7 +2333,7 @@ export declare const sqliteSchema: import("zod").ZodObject<import("zod").extendS
2333
2333
  columnsTo: string[];
2334
2334
  }>;
2335
2335
  compositePrimaryKeys: Record<string, {
2336
- name: string;
2336
+ name?: string | undefined;
2337
2337
  columns: string[];
2338
2338
  }>;
2339
2339
  }>>;
@@ -2382,7 +2382,7 @@ export declare const sqliteSchema: import("zod").ZodObject<import("zod").extendS
2382
2382
  columnsTo: string[];
2383
2383
  }>;
2384
2384
  compositePrimaryKeys: Record<string, {
2385
- name: string;
2385
+ name?: string | undefined;
2386
2386
  columns: string[];
2387
2387
  }>;
2388
2388
  uniqueConstraints: Record<string, {
@@ -2430,7 +2430,7 @@ export declare const sqliteSchema: import("zod").ZodObject<import("zod").extendS
2430
2430
  columnsTo: string[];
2431
2431
  }>;
2432
2432
  compositePrimaryKeys: Record<string, {
2433
- name: string;
2433
+ name?: string | undefined;
2434
2434
  columns: string[];
2435
2435
  }>;
2436
2436
  }>;
@@ -2797,12 +2797,12 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
2797
2797
  }>>;
2798
2798
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
2799
2799
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
2800
- name: import("zod").ZodString;
2800
+ name: import("zod").ZodOptional<import("zod").ZodString>;
2801
2801
  }, "strict", import("zod").ZodTypeAny, {
2802
- name: string;
2802
+ name?: string | undefined;
2803
2803
  columns: string[];
2804
2804
  }, {
2805
- name: string;
2805
+ name?: string | undefined;
2806
2806
  columns: string[];
2807
2807
  }>>;
2808
2808
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -2841,7 +2841,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
2841
2841
  columnsTo: string[];
2842
2842
  }>;
2843
2843
  compositePrimaryKeys: Record<string, {
2844
- name: string;
2844
+ name?: string | undefined;
2845
2845
  columns: string[];
2846
2846
  }>;
2847
2847
  uniqueConstraints: Record<string, {
@@ -2878,7 +2878,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
2878
2878
  columnsTo: string[];
2879
2879
  }>;
2880
2880
  compositePrimaryKeys: Record<string, {
2881
- name: string;
2881
+ name?: string | undefined;
2882
2882
  columns: string[];
2883
2883
  }>;
2884
2884
  }>>;
@@ -2917,7 +2917,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
2917
2917
  columnsTo: string[];
2918
2918
  }>;
2919
2919
  compositePrimaryKeys: Record<string, {
2920
- name: string;
2920
+ name?: string | undefined;
2921
2921
  columns: string[];
2922
2922
  }>;
2923
2923
  uniqueConstraints: Record<string, {
@@ -2961,7 +2961,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
2961
2961
  columnsTo: string[];
2962
2962
  }>;
2963
2963
  compositePrimaryKeys: Record<string, {
2964
- name: string;
2964
+ name?: string | undefined;
2965
2965
  columns: string[];
2966
2966
  }>;
2967
2967
  }>;
@@ -3036,12 +3036,12 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
3036
3036
  }>>;
3037
3037
  compositePrimaryKeys: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
3038
3038
  columns: import("zod").ZodArray<import("zod").ZodString, "many">;
3039
- name: import("zod").ZodString;
3039
+ name: import("zod").ZodOptional<import("zod").ZodString>;
3040
3040
  }, "strict", import("zod").ZodTypeAny, {
3041
- name: string;
3041
+ name?: string | undefined;
3042
3042
  columns: string[];
3043
3043
  }, {
3044
- name: string;
3044
+ name?: string | undefined;
3045
3045
  columns: string[];
3046
3046
  }>>;
3047
3047
  uniqueConstraints: import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
@@ -3080,7 +3080,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
3080
3080
  columnsTo: string[];
3081
3081
  }>;
3082
3082
  compositePrimaryKeys: Record<string, {
3083
- name: string;
3083
+ name?: string | undefined;
3084
3084
  columns: string[];
3085
3085
  }>;
3086
3086
  uniqueConstraints: Record<string, {
@@ -3117,7 +3117,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
3117
3117
  columnsTo: string[];
3118
3118
  }>;
3119
3119
  compositePrimaryKeys: Record<string, {
3120
- name: string;
3120
+ name?: string | undefined;
3121
3121
  columns: string[];
3122
3122
  }>;
3123
3123
  }>>;
@@ -3166,7 +3166,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
3166
3166
  columnsTo: string[];
3167
3167
  }>;
3168
3168
  compositePrimaryKeys: Record<string, {
3169
- name: string;
3169
+ name?: string | undefined;
3170
3170
  columns: string[];
3171
3171
  }>;
3172
3172
  uniqueConstraints: Record<string, {
@@ -3214,7 +3214,7 @@ export declare const backwardCompatibleSqliteSchema: import("zod").ZodUnion<[imp
3214
3214
  columnsTo: string[];
3215
3215
  }>;
3216
3216
  compositePrimaryKeys: Record<string, {
3217
- name: string;
3217
+ name?: string | undefined;
3218
3218
  columns: string[];
3219
3219
  }>;
3220
3220
  }>;
package/utils-studio.js CHANGED
@@ -1631,7 +1631,7 @@ var init_pgSerializer = __esm({
1631
1631
  END AS data_type, INFORMATION_SCHEMA.COLUMNS.table_name, INFORMATION_SCHEMA.COLUMNS.column_name, INFORMATION_SCHEMA.COLUMNS.column_default, INFORMATION_SCHEMA.COLUMNS.data_type as additional_dt
1632
1632
  FROM pg_attribute a
1633
1633
  JOIN INFORMATION_SCHEMA.COLUMNS ON INFORMATION_SCHEMA.COLUMNS.column_name = a.attname
1634
- WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}'
1634
+ WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}' and INFORMATION_SCHEMA.COLUMNS.table_schema = '${tableSchema}'
1635
1635
  AND a.attnum > 0
1636
1636
  AND NOT a.attisdropped
1637
1637
  ORDER BY a.attnum;`
package/utils-studio.mjs CHANGED
@@ -1640,7 +1640,7 @@ var init_pgSerializer = __esm({
1640
1640
  END AS data_type, INFORMATION_SCHEMA.COLUMNS.table_name, INFORMATION_SCHEMA.COLUMNS.column_name, INFORMATION_SCHEMA.COLUMNS.column_default, INFORMATION_SCHEMA.COLUMNS.data_type as additional_dt
1641
1641
  FROM pg_attribute a
1642
1642
  JOIN INFORMATION_SCHEMA.COLUMNS ON INFORMATION_SCHEMA.COLUMNS.column_name = a.attname
1643
- WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}'
1643
+ WHERE a.attrelid = '"${tableSchema}"."${tableName}"'::regclass and INFORMATION_SCHEMA.COLUMNS.table_name = '${tableName}' and INFORMATION_SCHEMA.COLUMNS.table_schema = '${tableSchema}'
1644
1644
  AND a.attnum > 0
1645
1645
  AND NOT a.attisdropped
1646
1646
  ORDER BY a.attnum;`
package/utils.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- import { Dialect } from "./schemaValidator";
1
+ import type { Dialect } from "./schemaValidator";
2
2
  import { NamedWithSchema } from "./cli/commands/migrate";
3
- import { PgDatabase } from "drizzle-orm/pg-core";
4
- import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
5
- import { DbConnection } from ".";
6
3
  export declare const assertV1OutFolder: (out: string, dialect: Dialect | "{dialect}") => void;
7
4
  export type Journal = {
8
5
  version: string;
@@ -22,7 +19,6 @@ export declare const prepareOutFolder: (out: string, dialect: Dialect) => {
22
19
  snapshots: string[];
23
20
  journal: any;
24
21
  };
25
- export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
26
22
  export declare const validateWithReport: (snapshots: string[], dialect: Dialect) => {
27
23
  malformed: string[];
28
24
  nonLatest: string[];
@@ -201,13 +197,3 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
201
197
  columns: {};
202
198
  } | undefined;
203
199
  }>;
204
- export type DrizzleSnapshotJSON = PgSchemaKit;
205
- export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
206
- export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
207
- export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
208
- hasDataLoss: boolean;
209
- warnings: string[];
210
- statementsToExecute: string[];
211
- apply: () => Promise<void>;
212
- }>;
213
- export declare const prepareFrom: (connection: DbConnection) => Promise<Record<string, any>>;