drizzle-kit 0.25.0-b75016b → 0.25.0-bab5208

Sign up to get free protection for your applications and to get access to all the features.
package/api.d.mts 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.mjs';
4
5
  import * as zod from 'zod';
5
6
  import { TypeOf } from 'zod';
6
7
 
@@ -613,28 +614,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
613
614
  columns: string[];
614
615
  nullsNotDistinct: boolean;
615
616
  }>>>;
616
- policies: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
617
- name: zod.ZodString;
618
- as: zod.ZodOptional<zod.ZodEnum<["PERMISSIVE", "RESTRICTIVE"]>>;
619
- for: zod.ZodOptional<zod.ZodEnum<["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]>>;
620
- to: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
621
- using: zod.ZodOptional<zod.ZodString>;
622
- withCheck: zod.ZodOptional<zod.ZodString>;
623
- }, "strict", zod.ZodTypeAny, {
624
- name: string;
625
- using?: string | undefined;
626
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
627
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
628
- to?: string[] | undefined;
629
- withCheck?: string | undefined;
630
- }, {
631
- name: string;
632
- using?: string | undefined;
633
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
634
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
635
- to?: string[] | undefined;
636
- withCheck?: string | undefined;
637
- }>>>;
638
617
  }, "strict", zod.ZodTypeAny, {
639
618
  name: string;
640
619
  columns: Record<string, {
@@ -698,14 +677,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
698
677
  columns: string[];
699
678
  nullsNotDistinct: boolean;
700
679
  }>;
701
- policies: Record<string, {
702
- name: string;
703
- using?: string | undefined;
704
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
705
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
706
- to?: string[] | undefined;
707
- withCheck?: string | undefined;
708
- }>;
709
680
  }, {
710
681
  name: string;
711
682
  columns: Record<string, {
@@ -769,14 +740,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
769
740
  columns: string[];
770
741
  nullsNotDistinct: boolean;
771
742
  }> | undefined;
772
- policies?: Record<string, {
773
- name: string;
774
- using?: string | undefined;
775
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
776
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
777
- to?: string[] | undefined;
778
- withCheck?: string | undefined;
779
- }> | undefined;
780
743
  }>>;
781
744
  enums: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
782
745
  name: zod.ZodString;
@@ -820,22 +783,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
820
783
  cache?: string | undefined;
821
784
  cycle?: boolean | undefined;
822
785
  }>>>;
823
- roles: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
824
- name: zod.ZodString;
825
- createDb: zod.ZodOptional<zod.ZodBoolean>;
826
- createRole: zod.ZodOptional<zod.ZodBoolean>;
827
- inherit: zod.ZodOptional<zod.ZodBoolean>;
828
- }, "strict", zod.ZodTypeAny, {
829
- name: string;
830
- createDb?: boolean | undefined;
831
- createRole?: boolean | undefined;
832
- inherit?: boolean | undefined;
833
- }, {
834
- name: string;
835
- createDb?: boolean | undefined;
836
- createRole?: boolean | undefined;
837
- inherit?: boolean | undefined;
838
- }>>>;
839
786
  _meta: zod.ZodObject<{
840
787
  schemas: zod.ZodRecord<zod.ZodString, zod.ZodString>;
841
788
  tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
@@ -968,14 +915,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
968
915
  columns: string[];
969
916
  nullsNotDistinct: boolean;
970
917
  }>;
971
- policies: Record<string, {
972
- name: string;
973
- using?: string | undefined;
974
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
975
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
976
- to?: string[] | undefined;
977
- withCheck?: string | undefined;
978
- }>;
979
918
  }>;
980
919
  id: string;
981
920
  prevId: string;
@@ -1002,12 +941,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1002
941
  cache?: string | undefined;
1003
942
  cycle?: boolean | undefined;
1004
943
  }>;
1005
- roles: Record<string, {
1006
- name: string;
1007
- createDb?: boolean | undefined;
1008
- createRole?: boolean | undefined;
1009
- inherit?: boolean | undefined;
1010
- }>;
1011
944
  internal?: {
1012
945
  tables: Record<string, {
1013
946
  columns: Record<string, {
@@ -1082,14 +1015,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1082
1015
  columns: string[];
1083
1016
  nullsNotDistinct: boolean;
1084
1017
  }> | undefined;
1085
- policies?: Record<string, {
1086
- name: string;
1087
- using?: string | undefined;
1088
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
1089
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
1090
- to?: string[] | undefined;
1091
- withCheck?: string | undefined;
1092
- }> | undefined;
1093
1018
  }>;
1094
1019
  id: string;
1095
1020
  prevId: string;
@@ -1126,12 +1051,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1126
1051
  cache?: string | undefined;
1127
1052
  cycle?: boolean | undefined;
1128
1053
  }> | undefined;
1129
- roles?: Record<string, {
1130
- name: string;
1131
- createDb?: boolean | undefined;
1132
- createRole?: boolean | undefined;
1133
- inherit?: boolean | undefined;
1134
- }> | undefined;
1135
1054
  }>;
1136
1055
  type PgSchema = TypeOf<typeof pgSchema>;
1137
1056
 
@@ -1477,7 +1396,7 @@ type SQLiteSchema = TypeOf<typeof schema>;
1477
1396
  type DrizzleSnapshotJSON = PgSchema;
1478
1397
  type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
1479
1398
  type DrizzleMySQLSnapshotJSON = MySqlSchema;
1480
- declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[]) => PgSchema;
1399
+ declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
1481
1400
  declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
1482
1401
  declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
1483
1402
  hasDataLoss: boolean;
@@ -1485,7 +1404,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
1485
1404
  statementsToExecute: string[];
1486
1405
  apply: () => Promise<void>;
1487
1406
  }>;
1488
- declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchema>;
1407
+ declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<SQLiteSchema>;
1489
1408
  declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
1490
1409
  declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
1491
1410
  hasDataLoss: boolean;
@@ -1493,7 +1412,7 @@ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstan
1493
1412
  statementsToExecute: string[];
1494
1413
  apply: () => Promise<void>;
1495
1414
  }>;
1496
- declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySqlSchema>;
1415
+ declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<MySqlSchema>;
1497
1416
  declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
1498
1417
  declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
1499
1418
  hasDataLoss: boolean;
@@ -1567,14 +1486,6 @@ declare const upPgSnapshot: (snapshot: Record<string, unknown>) => {
1567
1486
  columns: string[];
1568
1487
  nullsNotDistinct: boolean;
1569
1488
  }>;
1570
- policies: Record<string, {
1571
- name: string;
1572
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
1573
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
1574
- to?: string[] | undefined;
1575
- using?: string | undefined;
1576
- withCheck?: string | undefined;
1577
- }>;
1578
1489
  }>;
1579
1490
  enums: Record<string, {
1580
1491
  values: string[];
@@ -1592,12 +1503,6 @@ declare const upPgSnapshot: (snapshot: Record<string, unknown>) => {
1592
1503
  cache?: string | undefined;
1593
1504
  cycle?: boolean | undefined;
1594
1505
  }>;
1595
- roles: Record<string, {
1596
- name: string;
1597
- createDb?: boolean | undefined;
1598
- createRole?: boolean | undefined;
1599
- inherit?: boolean | undefined;
1600
- }>;
1601
1506
  _meta: {
1602
1507
  tables: Record<string, string>;
1603
1508
  columns: Record<string, string>;
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
 
@@ -613,28 +614,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
613
614
  columns: string[];
614
615
  nullsNotDistinct: boolean;
615
616
  }>>>;
616
- policies: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
617
- name: zod.ZodString;
618
- as: zod.ZodOptional<zod.ZodEnum<["PERMISSIVE", "RESTRICTIVE"]>>;
619
- for: zod.ZodOptional<zod.ZodEnum<["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]>>;
620
- to: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
621
- using: zod.ZodOptional<zod.ZodString>;
622
- withCheck: zod.ZodOptional<zod.ZodString>;
623
- }, "strict", zod.ZodTypeAny, {
624
- name: string;
625
- using?: string | undefined;
626
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
627
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
628
- to?: string[] | undefined;
629
- withCheck?: string | undefined;
630
- }, {
631
- name: string;
632
- using?: string | undefined;
633
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
634
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
635
- to?: string[] | undefined;
636
- withCheck?: string | undefined;
637
- }>>>;
638
617
  }, "strict", zod.ZodTypeAny, {
639
618
  name: string;
640
619
  columns: Record<string, {
@@ -698,14 +677,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
698
677
  columns: string[];
699
678
  nullsNotDistinct: boolean;
700
679
  }>;
701
- policies: Record<string, {
702
- name: string;
703
- using?: string | undefined;
704
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
705
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
706
- to?: string[] | undefined;
707
- withCheck?: string | undefined;
708
- }>;
709
680
  }, {
710
681
  name: string;
711
682
  columns: Record<string, {
@@ -769,14 +740,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
769
740
  columns: string[];
770
741
  nullsNotDistinct: boolean;
771
742
  }> | undefined;
772
- policies?: Record<string, {
773
- name: string;
774
- using?: string | undefined;
775
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
776
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
777
- to?: string[] | undefined;
778
- withCheck?: string | undefined;
779
- }> | undefined;
780
743
  }>>;
781
744
  enums: zod.ZodRecord<zod.ZodString, zod.ZodObject<{
782
745
  name: zod.ZodString;
@@ -820,22 +783,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
820
783
  cache?: string | undefined;
821
784
  cycle?: boolean | undefined;
822
785
  }>>>;
823
- roles: zod.ZodDefault<zod.ZodRecord<zod.ZodString, zod.ZodObject<{
824
- name: zod.ZodString;
825
- createDb: zod.ZodOptional<zod.ZodBoolean>;
826
- createRole: zod.ZodOptional<zod.ZodBoolean>;
827
- inherit: zod.ZodOptional<zod.ZodBoolean>;
828
- }, "strict", zod.ZodTypeAny, {
829
- name: string;
830
- createDb?: boolean | undefined;
831
- createRole?: boolean | undefined;
832
- inherit?: boolean | undefined;
833
- }, {
834
- name: string;
835
- createDb?: boolean | undefined;
836
- createRole?: boolean | undefined;
837
- inherit?: boolean | undefined;
838
- }>>>;
839
786
  _meta: zod.ZodObject<{
840
787
  schemas: zod.ZodRecord<zod.ZodString, zod.ZodString>;
841
788
  tables: zod.ZodRecord<zod.ZodString, zod.ZodString>;
@@ -968,14 +915,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
968
915
  columns: string[];
969
916
  nullsNotDistinct: boolean;
970
917
  }>;
971
- policies: Record<string, {
972
- name: string;
973
- using?: string | undefined;
974
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
975
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
976
- to?: string[] | undefined;
977
- withCheck?: string | undefined;
978
- }>;
979
918
  }>;
980
919
  id: string;
981
920
  prevId: string;
@@ -1002,12 +941,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1002
941
  cache?: string | undefined;
1003
942
  cycle?: boolean | undefined;
1004
943
  }>;
1005
- roles: Record<string, {
1006
- name: string;
1007
- createDb?: boolean | undefined;
1008
- createRole?: boolean | undefined;
1009
- inherit?: boolean | undefined;
1010
- }>;
1011
944
  internal?: {
1012
945
  tables: Record<string, {
1013
946
  columns: Record<string, {
@@ -1082,14 +1015,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1082
1015
  columns: string[];
1083
1016
  nullsNotDistinct: boolean;
1084
1017
  }> | undefined;
1085
- policies?: Record<string, {
1086
- name: string;
1087
- using?: string | undefined;
1088
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
1089
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
1090
- to?: string[] | undefined;
1091
- withCheck?: string | undefined;
1092
- }> | undefined;
1093
1018
  }>;
1094
1019
  id: string;
1095
1020
  prevId: string;
@@ -1126,12 +1051,6 @@ declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
1126
1051
  cache?: string | undefined;
1127
1052
  cycle?: boolean | undefined;
1128
1053
  }> | undefined;
1129
- roles?: Record<string, {
1130
- name: string;
1131
- createDb?: boolean | undefined;
1132
- createRole?: boolean | undefined;
1133
- inherit?: boolean | undefined;
1134
- }> | undefined;
1135
1054
  }>;
1136
1055
  type PgSchema = TypeOf<typeof pgSchema>;
1137
1056
 
@@ -1477,7 +1396,7 @@ type SQLiteSchema = TypeOf<typeof schema>;
1477
1396
  type DrizzleSnapshotJSON = PgSchema;
1478
1397
  type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
1479
1398
  type DrizzleMySQLSnapshotJSON = MySqlSchema;
1480
- declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[]) => PgSchema;
1399
+ declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
1481
1400
  declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
1482
1401
  declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
1483
1402
  hasDataLoss: boolean;
@@ -1485,7 +1404,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
1485
1404
  statementsToExecute: string[];
1486
1405
  apply: () => Promise<void>;
1487
1406
  }>;
1488
- declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchema>;
1407
+ declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<SQLiteSchema>;
1489
1408
  declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
1490
1409
  declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
1491
1410
  hasDataLoss: boolean;
@@ -1493,7 +1412,7 @@ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstan
1493
1412
  statementsToExecute: string[];
1494
1413
  apply: () => Promise<void>;
1495
1414
  }>;
1496
- declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<MySqlSchema>;
1415
+ declare const generateMySQLDrizzleJson: (imports: Record<string, unknown>, prevId?: string, casing?: CasingType) => Promise<MySqlSchema>;
1497
1416
  declare const generateMySQLMigration: (prev: DrizzleMySQLSnapshotJSON, cur: DrizzleMySQLSnapshotJSON) => Promise<string[]>;
1498
1417
  declare const pushMySQLSchema: (imports: Record<string, unknown>, drizzleInstance: MySql2Database<any>, databaseName: string) => Promise<{
1499
1418
  hasDataLoss: boolean;
@@ -1567,14 +1486,6 @@ declare const upPgSnapshot: (snapshot: Record<string, unknown>) => {
1567
1486
  columns: string[];
1568
1487
  nullsNotDistinct: boolean;
1569
1488
  }>;
1570
- policies: Record<string, {
1571
- name: string;
1572
- as?: "PERMISSIVE" | "RESTRICTIVE" | undefined;
1573
- for?: "ALL" | "SELECT" | "INSERT" | "UPDATE" | "DELETE" | undefined;
1574
- to?: string[] | undefined;
1575
- using?: string | undefined;
1576
- withCheck?: string | undefined;
1577
- }>;
1578
1489
  }>;
1579
1490
  enums: Record<string, {
1580
1491
  values: string[];
@@ -1592,12 +1503,6 @@ declare const upPgSnapshot: (snapshot: Record<string, unknown>) => {
1592
1503
  cache?: string | undefined;
1593
1504
  cycle?: boolean | undefined;
1594
1505
  }>;
1595
- roles: Record<string, {
1596
- name: string;
1597
- createDb?: boolean | undefined;
1598
- createRole?: boolean | undefined;
1599
- inherit?: boolean | undefined;
1600
- }>;
1601
1506
  _meta: {
1602
1507
  tables: Record<string, string>;
1603
1508
  columns: Record<string, string>;