drizzle-kit 0.25.0-f5f3e49 → 0.25.0-f9ec555

Sign up to get free protection for your applications and to get access to all the features.
package/api.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { LibSQLDatabase } from 'drizzle-orm/libsql';
2
2
  import { MySql2Database } from 'drizzle-orm/mysql2';
3
3
  import { PgDatabase } from 'drizzle-orm/pg-core';
4
+ import { C as CasingType } from './common-DYjgLS6u.js';
4
5
  import * as zod from 'zod';
5
6
  import { TypeOf } from 'zod';
6
7
 
@@ -200,6 +201,98 @@ declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
200
201
  columns: string[];
201
202
  }> | undefined;
202
203
  }>>;
204
+ views: zod.ZodRecord<zod.ZodString, zod.ZodObject<zod.objectUtil.extendShape<{
205
+ name: zod.ZodString;
206
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
207
+ name: zod.ZodString;
208
+ type: zod.ZodString;
209
+ primaryKey: zod.ZodBoolean;
210
+ notNull: zod.ZodBoolean;
211
+ autoincrement: zod.ZodOptional<zod.ZodBoolean>;
212
+ default: zod.ZodOptional<zod.ZodAny>;
213
+ onUpdate: zod.ZodOptional<zod.ZodAny>;
214
+ generated: zod.ZodOptional<zod.ZodObject<{
215
+ type: zod.ZodEnum<["stored", "virtual"]>;
216
+ as: zod.ZodString;
217
+ }, "strip", zod.ZodTypeAny, {
218
+ type: "stored" | "virtual";
219
+ as: string;
220
+ }, {
221
+ type: "stored" | "virtual";
222
+ as: string;
223
+ }>>;
224
+ }, "strict", zod.ZodTypeAny, {
225
+ name: string;
226
+ type: string;
227
+ primaryKey: boolean;
228
+ notNull: boolean;
229
+ default?: any;
230
+ onUpdate?: any;
231
+ autoincrement?: boolean | undefined;
232
+ generated?: {
233
+ type: "stored" | "virtual";
234
+ as: string;
235
+ } | undefined;
236
+ }, {
237
+ name: string;
238
+ type: string;
239
+ primaryKey: boolean;
240
+ notNull: boolean;
241
+ default?: any;
242
+ onUpdate?: any;
243
+ autoincrement?: boolean | undefined;
244
+ generated?: {
245
+ type: "stored" | "virtual";
246
+ as: string;
247
+ } | undefined;
248
+ }>>;
249
+ definition: zod.ZodOptional<zod.ZodString>;
250
+ isExisting: zod.ZodBoolean;
251
+ }, {
252
+ algorithm: zod.ZodEnum<["undefined", "merge", "temptable"]>;
253
+ sqlSecurity: zod.ZodEnum<["definer", "invoker"]>;
254
+ withCheckOption: zod.ZodOptional<zod.ZodEnum<["local", "cascaded"]>>;
255
+ }>, "strict", zod.ZodTypeAny, {
256
+ name: string;
257
+ columns: Record<string, {
258
+ name: string;
259
+ type: string;
260
+ primaryKey: boolean;
261
+ notNull: boolean;
262
+ default?: any;
263
+ onUpdate?: any;
264
+ autoincrement?: boolean | undefined;
265
+ generated?: {
266
+ type: "stored" | "virtual";
267
+ as: string;
268
+ } | undefined;
269
+ }>;
270
+ algorithm: "undefined" | "merge" | "temptable";
271
+ sqlSecurity: "definer" | "invoker";
272
+ isExisting: boolean;
273
+ withCheckOption?: "local" | "cascaded" | undefined;
274
+ definition?: string | undefined;
275
+ }, {
276
+ name: string;
277
+ columns: Record<string, {
278
+ name: string;
279
+ type: string;
280
+ primaryKey: boolean;
281
+ notNull: boolean;
282
+ default?: any;
283
+ onUpdate?: any;
284
+ autoincrement?: boolean | undefined;
285
+ generated?: {
286
+ type: "stored" | "virtual";
287
+ as: string;
288
+ } | undefined;
289
+ }>;
290
+ algorithm: "undefined" | "merge" | "temptable";
291
+ sqlSecurity: "definer" | "invoker";
292
+ isExisting: boolean;
293
+ withCheckOption?: "local" | "cascaded" | undefined;
294
+ definition?: string | undefined;
295
+ }>>;
203
296
  _meta: zod.ZodObject<{
204
297
  tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
205
298
  columns: zod.ZodRecord<zod.ZodString, zod.ZodString>;
@@ -321,6 +414,27 @@ declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
321
414
  columns: Record<string, string>;
322
415
  tables: Record<string, string>;
323
416
  };
417
+ views: Record<string, {
418
+ name: string;
419
+ columns: Record<string, {
420
+ name: string;
421
+ type: string;
422
+ primaryKey: boolean;
423
+ notNull: boolean;
424
+ default?: any;
425
+ onUpdate?: any;
426
+ autoincrement?: boolean | undefined;
427
+ generated?: {
428
+ type: "stored" | "virtual";
429
+ as: string;
430
+ } | undefined;
431
+ }>;
432
+ algorithm: "undefined" | "merge" | "temptable";
433
+ sqlSecurity: "definer" | "invoker";
434
+ isExisting: boolean;
435
+ withCheckOption?: "local" | "cascaded" | undefined;
436
+ definition?: string | undefined;
437
+ }>;
324
438
  internal?: {
325
439
  indexes?: Record<string, {
326
440
  columns: Record<string, {
@@ -383,6 +497,27 @@ declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
383
497
  columns: Record<string, string>;
384
498
  tables: Record<string, string>;
385
499
  };
500
+ views: Record<string, {
501
+ name: string;
502
+ columns: Record<string, {
503
+ name: string;
504
+ type: string;
505
+ primaryKey: boolean;
506
+ notNull: boolean;
507
+ default?: any;
508
+ onUpdate?: any;
509
+ autoincrement?: boolean | undefined;
510
+ generated?: {
511
+ type: "stored" | "virtual";
512
+ as: string;
513
+ } | undefined;
514
+ }>;
515
+ algorithm: "undefined" | "merge" | "temptable";
516
+ sqlSecurity: "definer" | "invoker";
517
+ isExisting: boolean;
518
+ withCheckOption?: "local" | "cascaded" | undefined;
519
+ definition?: string | undefined;
520
+ }>;
386
521
  internal?: {
387
522
  indexes?: Record<string, {
388
523
  columns: Record<string, {
@@ -963,9 +1098,10 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
963
1098
  } | undefined;
964
1099
  }>;
965
1100
  schema: string;
966
- materialized: boolean;
967
1101
  isExisting: boolean;
1102
+ materialized: boolean;
968
1103
  using?: string | undefined;
1104
+ definition?: string | undefined;
969
1105
  with?: {
970
1106
  checkOption?: "local" | "cascaded" | undefined;
971
1107
  securityBarrier?: boolean | undefined;
@@ -989,7 +1125,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
989
1125
  logAutovacuumMinDuration?: number | undefined;
990
1126
  userCatalogTable?: boolean | undefined;
991
1127
  } | undefined;
992
- definition?: string | undefined;
993
1128
  withNoData?: boolean | undefined;
994
1129
  tablespace?: string | undefined;
995
1130
  }, {
@@ -1021,9 +1156,10 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1021
1156
  } | undefined;
1022
1157
  }>;
1023
1158
  schema: string;
1024
- materialized: boolean;
1025
1159
  isExisting: boolean;
1160
+ materialized: boolean;
1026
1161
  using?: string | undefined;
1162
+ definition?: string | undefined;
1027
1163
  with?: {
1028
1164
  checkOption?: "local" | "cascaded" | undefined;
1029
1165
  securityBarrier?: boolean | undefined;
@@ -1047,7 +1183,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1047
1183
  logAutovacuumMinDuration?: number | undefined;
1048
1184
  userCatalogTable?: boolean | undefined;
1049
1185
  } | undefined;
1050
- definition?: string | undefined;
1051
1186
  withNoData?: boolean | undefined;
1052
1187
  tablespace?: string | undefined;
1053
1188
  }>>>;
@@ -1222,21 +1357,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1222
1357
  tables: Record<string, string>;
1223
1358
  schemas: Record<string, string>;
1224
1359
  };
1225
- enums: Record<string, {
1226
- name: string;
1227
- values: string[];
1228
- schema: string;
1229
- }>;
1230
- sequences: Record<string, {
1231
- name: string;
1232
- schema: string;
1233
- increment?: string | undefined;
1234
- minValue?: string | undefined;
1235
- maxValue?: string | undefined;
1236
- startWith?: string | undefined;
1237
- cache?: string | undefined;
1238
- cycle?: boolean | undefined;
1239
- }>;
1240
1360
  views: Record<string, {
1241
1361
  name: string;
1242
1362
  columns: Record<string, {
@@ -1266,9 +1386,10 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1266
1386
  } | undefined;
1267
1387
  }>;
1268
1388
  schema: string;
1269
- materialized: boolean;
1270
1389
  isExisting: boolean;
1390
+ materialized: boolean;
1271
1391
  using?: string | undefined;
1392
+ definition?: string | undefined;
1272
1393
  with?: {
1273
1394
  checkOption?: "local" | "cascaded" | undefined;
1274
1395
  securityBarrier?: boolean | undefined;
@@ -1292,10 +1413,24 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1292
1413
  logAutovacuumMinDuration?: number | undefined;
1293
1414
  userCatalogTable?: boolean | undefined;
1294
1415
  } | undefined;
1295
- definition?: string | undefined;
1296
1416
  withNoData?: boolean | undefined;
1297
1417
  tablespace?: string | undefined;
1298
1418
  }>;
1419
+ enums: Record<string, {
1420
+ name: string;
1421
+ values: string[];
1422
+ schema: string;
1423
+ }>;
1424
+ sequences: Record<string, {
1425
+ name: string;
1426
+ schema: string;
1427
+ increment?: string | undefined;
1428
+ minValue?: string | undefined;
1429
+ maxValue?: string | undefined;
1430
+ startWith?: string | undefined;
1431
+ cache?: string | undefined;
1432
+ cycle?: boolean | undefined;
1433
+ }>;
1299
1434
  internal?: {
1300
1435
  tables: Record<string, {
1301
1436
  columns: Record<string, {
@@ -1396,16 +1531,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1396
1531
  } | undefined>;
1397
1532
  } | undefined>;
1398
1533
  } | undefined;
1399
- sequences?: Record<string, {
1400
- name: string;
1401
- schema: string;
1402
- increment?: string | undefined;
1403
- minValue?: string | undefined;
1404
- maxValue?: string | undefined;
1405
- startWith?: string | undefined;
1406
- cache?: string | undefined;
1407
- cycle?: boolean | undefined;
1408
- }> | undefined;
1409
1534
  views?: Record<string, {
1410
1535
  name: string;
1411
1536
  columns: Record<string, {
@@ -1435,9 +1560,10 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1435
1560
  } | undefined;
1436
1561
  }>;
1437
1562
  schema: string;
1438
- materialized: boolean;
1439
1563
  isExisting: boolean;
1564
+ materialized: boolean;
1440
1565
  using?: string | undefined;
1566
+ definition?: string | undefined;
1441
1567
  with?: {
1442
1568
  checkOption?: "local" | "cascaded" | undefined;
1443
1569
  securityBarrier?: boolean | undefined;
@@ -1461,10 +1587,19 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1461
1587
  logAutovacuumMinDuration?: number | undefined;
1462
1588
  userCatalogTable?: boolean | undefined;
1463
1589
  } | undefined;
1464
- definition?: string | undefined;
1465
1590
  withNoData?: boolean | undefined;
1466
1591
  tablespace?: string | undefined;
1467
1592
  }> | undefined;
1593
+ sequences?: Record<string, {
1594
+ name: string;
1595
+ schema: string;
1596
+ increment?: string | undefined;
1597
+ minValue?: string | undefined;
1598
+ maxValue?: string | undefined;
1599
+ startWith?: string | undefined;
1600
+ cache?: string | undefined;
1601
+ cycle?: boolean | undefined;
1602
+ }> | undefined;
1468
1603
  }>;
1469
1604
  type PgSchema = TypeOf<typeof pgSchema>;
1470
1605
 
@@ -1649,6 +1784,83 @@ declare const schema: zod.ZodObject<zod.objectUtil.extendShape<{
1649
1784
  columns: string[];
1650
1785
  }> | undefined;
1651
1786
  }>>;
1787
+ views: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
1788
+ name: zod.ZodString;
1789
+ columns: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
1790
+ name: zod.ZodString;
1791
+ type: zod.ZodString;
1792
+ primaryKey: zod.ZodBoolean;
1793
+ notNull: zod.ZodBoolean;
1794
+ autoincrement: zod.ZodOptional<zod.ZodBoolean>;
1795
+ default: zod.ZodOptional<zod.ZodAny>;
1796
+ generated: zod.ZodOptional<zod.ZodObject<{
1797
+ type: zod.ZodEnum<["stored", "virtual"]>;
1798
+ as: zod.ZodString;
1799
+ }, "strip", zod.ZodTypeAny, {
1800
+ type: "stored" | "virtual";
1801
+ as: string;
1802
+ }, {
1803
+ type: "stored" | "virtual";
1804
+ as: string;
1805
+ }>>;
1806
+ }, "strict", zod.ZodTypeAny, {
1807
+ name: string;
1808
+ type: string;
1809
+ primaryKey: boolean;
1810
+ notNull: boolean;
1811
+ default?: any;
1812
+ autoincrement?: boolean | undefined;
1813
+ generated?: {
1814
+ type: "stored" | "virtual";
1815
+ as: string;
1816
+ } | undefined;
1817
+ }, {
1818
+ name: string;
1819
+ type: string;
1820
+ primaryKey: boolean;
1821
+ notNull: boolean;
1822
+ default?: any;
1823
+ autoincrement?: boolean | undefined;
1824
+ generated?: {
1825
+ type: "stored" | "virtual";
1826
+ as: string;
1827
+ } | undefined;
1828
+ }>>;
1829
+ definition: zod.ZodOptional<zod.ZodString>;
1830
+ isExisting: zod.ZodBoolean;
1831
+ }, "strict", zod.ZodTypeAny, {
1832
+ name: string;
1833
+ columns: Record<string, {
1834
+ name: string;
1835
+ type: string;
1836
+ primaryKey: boolean;
1837
+ notNull: boolean;
1838
+ default?: any;
1839
+ autoincrement?: boolean | undefined;
1840
+ generated?: {
1841
+ type: "stored" | "virtual";
1842
+ as: string;
1843
+ } | undefined;
1844
+ }>;
1845
+ isExisting: boolean;
1846
+ definition?: string | undefined;
1847
+ }, {
1848
+ name: string;
1849
+ columns: Record<string, {
1850
+ name: string;
1851
+ type: string;
1852
+ primaryKey: boolean;
1853
+ notNull: boolean;
1854
+ default?: any;
1855
+ autoincrement?: boolean | undefined;
1856
+ generated?: {
1857
+ type: "stored" | "virtual";
1858
+ as: string;
1859
+ } | undefined;
1860
+ }>;
1861
+ isExisting: boolean;
1862
+ definition?: string | undefined;
1863
+ }>>;
1652
1864
  enums: zod.ZodObject<{}, "strip", zod.ZodTypeAny, {}, {}>;
1653
1865
  _meta: zod.ZodObject<{
1654
1866
  tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
@@ -1741,6 +1953,23 @@ declare const schema: zod.ZodObject<zod.objectUtil.extendShape<{
1741
1953
  columns: Record<string, string>;
1742
1954
  tables: Record<string, string>;
1743
1955
  };
1956
+ views: Record<string, {
1957
+ name: string;
1958
+ columns: Record<string, {
1959
+ name: string;
1960
+ type: string;
1961
+ primaryKey: boolean;
1962
+ notNull: boolean;
1963
+ default?: any;
1964
+ autoincrement?: boolean | undefined;
1965
+ generated?: {
1966
+ type: "stored" | "virtual";
1967
+ as: string;
1968
+ } | undefined;
1969
+ }>;
1970
+ isExisting: boolean;
1971
+ definition?: string | undefined;
1972
+ }>;
1744
1973
  enums: {};
1745
1974
  internal?: {
1746
1975
  indexes?: Record<string, {
@@ -1796,6 +2025,23 @@ declare const schema: zod.ZodObject<zod.objectUtil.extendShape<{
1796
2025
  columns: Record<string, string>;
1797
2026
  tables: Record<string, string>;
1798
2027
  };
2028
+ views: Record<string, {
2029
+ name: string;
2030
+ columns: Record<string, {
2031
+ name: string;
2032
+ type: string;
2033
+ primaryKey: boolean;
2034
+ notNull: boolean;
2035
+ default?: any;
2036
+ autoincrement?: boolean | undefined;
2037
+ generated?: {
2038
+ type: "stored" | "virtual";
2039
+ as: string;
2040
+ } | undefined;
2041
+ }>;
2042
+ isExisting: boolean;
2043
+ definition?: string | undefined;
2044
+ }>;
1799
2045
  enums: {};
1800
2046
  internal?: {
1801
2047
  indexes?: Record<string, {
@@ -1810,7 +2056,7 @@ type SQLiteSchema = TypeOf<typeof schema>;
1810
2056
  type DrizzleSnapshotJSON = PgSchema;
1811
2057
  type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
1812
2058
  type DrizzleMySQLSnapshotJSON = MySqlSchema;
1813
- declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[]) => PgSchema;
2059
+ declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
1814
2060
  declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
1815
2061
  declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
1816
2062
  hasDataLoss: boolean;
@@ -1818,7 +2064,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
1818
2064
  statementsToExecute: string[];
1819
2065
  apply: () => Promise<void>;
1820
2066
  }>;
1821
- declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchema>;
2067
+ declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<SQLiteSchema>;
1822
2068
  declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
1823
2069
  declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
1824
2070
  hasDataLoss: boolean;
@@ -1826,7 +2072,7 @@ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstan
1826
2072
  statementsToExecute: string[];
1827
2073
  apply: () => Promise<void>;
1828
2074
  }>;
1829
- declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySqlSchema>;
2075
+ declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<MySqlSchema>;
1830
2076
  declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
1831
2077
  declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
1832
2078
  hasDataLoss: boolean;