drizzle-kit 0.25.0-858435e → 0.25.0-8cac5d2

Sign up to get free protection for your applications and to get access to all the features.
package/api.js CHANGED
@@ -549,6 +549,184 @@ var init_source = __esm({
549
549
  }
550
550
  });
551
551
 
552
+ // ../drizzle-orm/dist/entity.js
553
+ function is(value, type) {
554
+ if (!value || typeof value !== "object") {
555
+ return false;
556
+ }
557
+ if (value instanceof type) {
558
+ return true;
559
+ }
560
+ if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
561
+ throw new Error(
562
+ `Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`
563
+ );
564
+ }
565
+ let cls = value.constructor;
566
+ if (cls) {
567
+ while (cls) {
568
+ if (entityKind in cls && cls[entityKind] === type[entityKind]) {
569
+ return true;
570
+ }
571
+ cls = Object.getPrototypeOf(cls);
572
+ }
573
+ }
574
+ return false;
575
+ }
576
+ var entityKind, hasOwnEntityKind;
577
+ var init_entity = __esm({
578
+ "../drizzle-orm/dist/entity.js"() {
579
+ "use strict";
580
+ entityKind = Symbol.for("drizzle:entityKind");
581
+ hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
582
+ }
583
+ });
584
+
585
+ // ../drizzle-orm/dist/table.utils.js
586
+ var TableName;
587
+ var init_table_utils = __esm({
588
+ "../drizzle-orm/dist/table.utils.js"() {
589
+ "use strict";
590
+ TableName = Symbol.for("drizzle:Name");
591
+ }
592
+ });
593
+
594
+ // ../drizzle-orm/dist/table.js
595
+ function isTable(table4) {
596
+ return typeof table4 === "object" && table4 !== null && IsDrizzleTable in table4;
597
+ }
598
+ function getTableName(table4) {
599
+ return table4[TableName];
600
+ }
601
+ function getTableUniqueName(table4) {
602
+ return `${table4[Schema] ?? "public"}.${table4[TableName]}`;
603
+ }
604
+ var Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, Table;
605
+ var init_table = __esm({
606
+ "../drizzle-orm/dist/table.js"() {
607
+ "use strict";
608
+ init_entity();
609
+ init_table_utils();
610
+ Schema = Symbol.for("drizzle:Schema");
611
+ Columns = Symbol.for("drizzle:Columns");
612
+ ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
613
+ OriginalName = Symbol.for("drizzle:OriginalName");
614
+ BaseName = Symbol.for("drizzle:BaseName");
615
+ IsAlias = Symbol.for("drizzle:IsAlias");
616
+ ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
617
+ IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
618
+ _j = entityKind, _i = TableName, _h = OriginalName, _g = Schema, _f = Columns, _e = ExtraConfigColumns, _d = BaseName, _c = IsAlias, _b = IsDrizzleTable, _a = ExtraConfigBuilder;
619
+ Table = class {
620
+ constructor(name2, schema4, baseName) {
621
+ /**
622
+ * @internal
623
+ * Can be changed if the table is aliased.
624
+ */
625
+ __publicField(this, _i);
626
+ /**
627
+ * @internal
628
+ * Used to store the original name of the table, before any aliasing.
629
+ */
630
+ __publicField(this, _h);
631
+ /** @internal */
632
+ __publicField(this, _g);
633
+ /** @internal */
634
+ __publicField(this, _f);
635
+ /** @internal */
636
+ __publicField(this, _e);
637
+ /**
638
+ * @internal
639
+ * Used to store the table name before the transformation via the `tableCreator` functions.
640
+ */
641
+ __publicField(this, _d);
642
+ /** @internal */
643
+ __publicField(this, _c, false);
644
+ /** @internal */
645
+ __publicField(this, _b, true);
646
+ /** @internal */
647
+ __publicField(this, _a);
648
+ this[TableName] = this[OriginalName] = name2;
649
+ this[Schema] = schema4;
650
+ this[BaseName] = baseName;
651
+ }
652
+ };
653
+ __publicField(Table, _j, "Table");
654
+ /** @internal */
655
+ __publicField(Table, "Symbol", {
656
+ Name: TableName,
657
+ Schema,
658
+ OriginalName,
659
+ Columns,
660
+ ExtraConfigColumns,
661
+ BaseName,
662
+ IsAlias,
663
+ ExtraConfigBuilder
664
+ });
665
+ }
666
+ });
667
+
668
+ // ../drizzle-orm/dist/casing.js
669
+ function toSnakeCase(input) {
670
+ const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
671
+ return words.map((word) => word.toLowerCase()).join("_");
672
+ }
673
+ function toCamelCase(input) {
674
+ const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
675
+ return words.reduce((acc, word, i) => {
676
+ const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;
677
+ return acc + formattedWord;
678
+ }, "");
679
+ }
680
+ function noopCase(input) {
681
+ return input;
682
+ }
683
+ var _a2, CasingCache;
684
+ var init_casing = __esm({
685
+ "../drizzle-orm/dist/casing.js"() {
686
+ "use strict";
687
+ init_entity();
688
+ init_table();
689
+ _a2 = entityKind;
690
+ CasingCache = class {
691
+ constructor(casing2) {
692
+ /** @internal */
693
+ __publicField(this, "cache", {});
694
+ __publicField(this, "cachedTables", {});
695
+ __publicField(this, "convert");
696
+ this.convert = casing2 === "snake_case" ? toSnakeCase : casing2 === "camelCase" ? toCamelCase : noopCase;
697
+ }
698
+ getColumnCasing(column4) {
699
+ if (!column4.keyAsName)
700
+ return column4.name;
701
+ const schema4 = column4.table[Table.Symbol.Schema] ?? "public";
702
+ const tableName = column4.table[Table.Symbol.OriginalName];
703
+ const key = `${schema4}.${tableName}.${column4.name}`;
704
+ if (!this.cache[key]) {
705
+ this.cacheTable(column4.table);
706
+ }
707
+ return this.cache[key];
708
+ }
709
+ cacheTable(table4) {
710
+ const schema4 = table4[Table.Symbol.Schema] ?? "public";
711
+ const tableName = table4[Table.Symbol.OriginalName];
712
+ const tableKey2 = `${schema4}.${tableName}`;
713
+ if (!this.cachedTables[tableKey2]) {
714
+ for (const column4 of Object.values(table4[Table.Symbol.Columns])) {
715
+ const columnKey = `${tableKey2}.${column4.name}`;
716
+ this.cache[columnKey] = this.convert(column4.name);
717
+ }
718
+ this.cachedTables[tableKey2] = true;
719
+ }
720
+ }
721
+ clearCache() {
722
+ this.cache = {};
723
+ this.cachedTables = {};
724
+ }
725
+ };
726
+ __publicField(CasingCache, _a2, "CasingCache");
727
+ }
728
+ });
729
+
552
730
  // ../node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js
553
731
  var require_old = __commonJS({
554
732
  "../node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports2) {
@@ -8368,10 +8546,15 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
8368
8546
  const removedColumns = columnNames1.filter((it) => !set2.has(it));
8369
8547
  return { addedColumns, removedColumns };
8370
8548
  }
8549
+ function getColumnCasing(column4, casing2) {
8550
+ if (!column4.name) return "";
8551
+ return !column4.keyAsName || casing2 === void 0 ? column4.name : casing2 === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
8552
+ }
8371
8553
  var copy, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey;
8372
8554
  var init_utils = __esm({
8373
8555
  "src/utils.ts"() {
8374
8556
  "use strict";
8557
+ init_casing();
8375
8558
  init_views();
8376
8559
  init_global();
8377
8560
  init_mysqlSchema();
@@ -8620,9 +8803,10 @@ var glob, sqlToStr;
8620
8803
  var init_serializer = __esm({
8621
8804
  "src/serializer/index.ts"() {
8622
8805
  "use strict";
8806
+ init_casing();
8623
8807
  glob = __toESM(require_glob());
8624
8808
  init_views();
8625
- sqlToStr = (sql2) => {
8809
+ sqlToStr = (sql2, casing2) => {
8626
8810
  return sql2.toQuery({
8627
8811
  escapeName: () => {
8628
8812
  throw new Error("we don't support params for `sql` default values");
@@ -8632,7 +8816,8 @@ var init_serializer = __esm({
8632
8816
  },
8633
8817
  escapeString: () => {
8634
8818
  throw new Error("we don't support params for `sql` default values");
8635
- }
8819
+ },
8820
+ casing: new CasingCache(casing2)
8636
8821
  }).sql;
8637
8822
  };
8638
8823
  }
@@ -11477,10 +11662,10 @@ var init_jsonDiffer = __esm({
11477
11662
  });
11478
11663
 
11479
11664
  // src/sqlgenerator.ts
11480
- function fromJson(statements, dialect7, action, json22) {
11665
+ function fromJson(statements, dialect4, action, json22) {
11481
11666
  const result = statements.flatMap((statement) => {
11482
11667
  const filtered = convertors.filter((it) => {
11483
- return it.can(statement, dialect7);
11668
+ return it.can(statement, dialect4);
11484
11669
  });
11485
11670
  const convertor = filtered.length === 1 ? filtered[0] : void 0;
11486
11671
  if (!convertor) {
@@ -11547,8 +11732,8 @@ var init_sqlgenerator = __esm({
11547
11732
  Convertor = class {
11548
11733
  };
11549
11734
  PgCreateTableConvertor = class extends Convertor {
11550
- can(statement, dialect7) {
11551
- return statement.type === "create_table" && dialect7 === "postgresql";
11735
+ can(statement, dialect4) {
11736
+ return statement.type === "create_table" && dialect4 === "postgresql";
11552
11737
  }
11553
11738
  convert(st) {
11554
11739
  const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
@@ -11592,8 +11777,8 @@ var init_sqlgenerator = __esm({
11592
11777
  }
11593
11778
  };
11594
11779
  MySqlCreateTableConvertor = class extends Convertor {
11595
- can(statement, dialect7) {
11596
- return statement.type === "create_table" && dialect7 === "mysql";
11780
+ can(statement, dialect4) {
11781
+ return statement.type === "create_table" && dialect4 === "mysql";
11597
11782
  }
11598
11783
  convert(st) {
11599
11784
  const {
@@ -11641,8 +11826,8 @@ var init_sqlgenerator = __esm({
11641
11826
  }
11642
11827
  };
11643
11828
  SQLiteCreateTableConvertor = class extends Convertor {
11644
- can(statement, dialect7) {
11645
- return statement.type === "sqlite_create_table" && (dialect7 === "sqlite" || dialect7 === "turso");
11829
+ can(statement, dialect4) {
11830
+ return statement.type === "sqlite_create_table" && (dialect4 === "sqlite" || dialect4 === "turso");
11646
11831
  }
11647
11832
  convert(st) {
11648
11833
  const {
@@ -11704,8 +11889,8 @@ var init_sqlgenerator = __esm({
11704
11889
  }
11705
11890
  };
11706
11891
  PgAlterTableAlterColumnSetGenerated = class extends Convertor {
11707
- can(statement, dialect7) {
11708
- return statement.type === "alter_table_alter_column_set_identity" && dialect7 === "postgresql";
11892
+ can(statement, dialect4) {
11893
+ return statement.type === "alter_table_alter_column_set_identity" && dialect4 === "postgresql";
11709
11894
  }
11710
11895
  convert(statement) {
11711
11896
  const { identity, tableName, columnName, schema: schema4 } = statement;
@@ -11717,8 +11902,8 @@ var init_sqlgenerator = __esm({
11717
11902
  }
11718
11903
  };
11719
11904
  PgAlterTableAlterColumnDropGenerated = class extends Convertor {
11720
- can(statement, dialect7) {
11721
- return statement.type === "alter_table_alter_column_drop_identity" && dialect7 === "postgresql";
11905
+ can(statement, dialect4) {
11906
+ return statement.type === "alter_table_alter_column_drop_identity" && dialect4 === "postgresql";
11722
11907
  }
11723
11908
  convert(statement) {
11724
11909
  const { tableName, columnName, schema: schema4 } = statement;
@@ -11727,8 +11912,8 @@ var init_sqlgenerator = __esm({
11727
11912
  }
11728
11913
  };
11729
11914
  PgAlterTableAlterColumnAlterGenerated = class extends Convertor {
11730
- can(statement, dialect7) {
11731
- return statement.type === "alter_table_alter_column_change_identity" && dialect7 === "postgresql";
11915
+ can(statement, dialect4) {
11916
+ return statement.type === "alter_table_alter_column_change_identity" && dialect4 === "postgresql";
11732
11917
  }
11733
11918
  convert(statement) {
11734
11919
  const { identity, oldIdentity, tableName, columnName, schema: schema4 } = statement;
@@ -11775,8 +11960,8 @@ var init_sqlgenerator = __esm({
11775
11960
  }
11776
11961
  };
11777
11962
  PgAlterTableAddUniqueConstraintConvertor = class extends Convertor {
11778
- can(statement, dialect7) {
11779
- return statement.type === "create_unique_constraint" && dialect7 === "postgresql";
11963
+ can(statement, dialect4) {
11964
+ return statement.type === "create_unique_constraint" && dialect4 === "postgresql";
11780
11965
  }
11781
11966
  convert(statement) {
11782
11967
  const unsquashed = PgSquasher.unsquashUnique(statement.data);
@@ -11785,8 +11970,8 @@ var init_sqlgenerator = __esm({
11785
11970
  }
11786
11971
  };
11787
11972
  PgAlterTableDropUniqueConstraintConvertor = class extends Convertor {
11788
- can(statement, dialect7) {
11789
- return statement.type === "delete_unique_constraint" && dialect7 === "postgresql";
11973
+ can(statement, dialect4) {
11974
+ return statement.type === "delete_unique_constraint" && dialect4 === "postgresql";
11790
11975
  }
11791
11976
  convert(statement) {
11792
11977
  const unsquashed = PgSquasher.unsquashUnique(statement.data);
@@ -11795,8 +11980,8 @@ var init_sqlgenerator = __esm({
11795
11980
  }
11796
11981
  };
11797
11982
  MySQLAlterTableAddUniqueConstraintConvertor = class extends Convertor {
11798
- can(statement, dialect7) {
11799
- return statement.type === "create_unique_constraint" && dialect7 === "mysql";
11983
+ can(statement, dialect4) {
11984
+ return statement.type === "create_unique_constraint" && dialect4 === "mysql";
11800
11985
  }
11801
11986
  convert(statement) {
11802
11987
  const unsquashed = MySqlSquasher.unsquashUnique(statement.data);
@@ -11804,8 +11989,8 @@ var init_sqlgenerator = __esm({
11804
11989
  }
11805
11990
  };
11806
11991
  MySQLAlterTableDropUniqueConstraintConvertor = class extends Convertor {
11807
- can(statement, dialect7) {
11808
- return statement.type === "delete_unique_constraint" && dialect7 === "mysql";
11992
+ can(statement, dialect4) {
11993
+ return statement.type === "delete_unique_constraint" && dialect4 === "mysql";
11809
11994
  }
11810
11995
  convert(statement) {
11811
11996
  const unsquashed = MySqlSquasher.unsquashUnique(statement.data);
@@ -11813,8 +11998,8 @@ var init_sqlgenerator = __esm({
11813
11998
  }
11814
11999
  };
11815
12000
  CreatePgSequenceConvertor = class extends Convertor {
11816
- can(statement, dialect7) {
11817
- return statement.type === "create_sequence" && dialect7 === "postgresql";
12001
+ can(statement, dialect4) {
12002
+ return statement.type === "create_sequence" && dialect4 === "postgresql";
11818
12003
  }
11819
12004
  convert(st) {
11820
12005
  const { name: name2, values, schema: schema4 } = st;
@@ -11823,8 +12008,8 @@ var init_sqlgenerator = __esm({
11823
12008
  }
11824
12009
  };
11825
12010
  DropPgSequenceConvertor = class extends Convertor {
11826
- can(statement, dialect7) {
11827
- return statement.type === "drop_sequence" && dialect7 === "postgresql";
12011
+ can(statement, dialect4) {
12012
+ return statement.type === "drop_sequence" && dialect4 === "postgresql";
11828
12013
  }
11829
12014
  convert(st) {
11830
12015
  const { name: name2, schema: schema4 } = st;
@@ -11833,8 +12018,8 @@ var init_sqlgenerator = __esm({
11833
12018
  }
11834
12019
  };
11835
12020
  RenamePgSequenceConvertor = class extends Convertor {
11836
- can(statement, dialect7) {
11837
- return statement.type === "rename_sequence" && dialect7 === "postgresql";
12021
+ can(statement, dialect4) {
12022
+ return statement.type === "rename_sequence" && dialect4 === "postgresql";
11838
12023
  }
11839
12024
  convert(st) {
11840
12025
  const { nameFrom, nameTo, schema: schema4 } = st;
@@ -11844,8 +12029,8 @@ var init_sqlgenerator = __esm({
11844
12029
  }
11845
12030
  };
11846
12031
  MovePgSequenceConvertor = class extends Convertor {
11847
- can(statement, dialect7) {
11848
- return statement.type === "move_sequence" && dialect7 === "postgresql";
12032
+ can(statement, dialect4) {
12033
+ return statement.type === "move_sequence" && dialect4 === "postgresql";
11849
12034
  }
11850
12035
  convert(st) {
11851
12036
  const { schemaFrom, schemaTo, name: name2 } = st;
@@ -11855,8 +12040,8 @@ var init_sqlgenerator = __esm({
11855
12040
  }
11856
12041
  };
11857
12042
  AlterPgSequenceConvertor = class extends Convertor {
11858
- can(statement, dialect7) {
11859
- return statement.type === "alter_sequence" && dialect7 === "postgresql";
12043
+ can(statement, dialect4) {
12044
+ return statement.type === "alter_sequence" && dialect4 === "postgresql";
11860
12045
  }
11861
12046
  convert(st) {
11862
12047
  const { name: name2, schema: schema4, values } = st;
@@ -11899,8 +12084,8 @@ var init_sqlgenerator = __esm({
11899
12084
  }
11900
12085
  };
11901
12086
  PgDropTableConvertor = class extends Convertor {
11902
- can(statement, dialect7) {
11903
- return statement.type === "drop_table" && dialect7 === "postgresql";
12087
+ can(statement, dialect4) {
12088
+ return statement.type === "drop_table" && dialect4 === "postgresql";
11904
12089
  }
11905
12090
  convert(statement) {
11906
12091
  const { tableName, schema: schema4 } = statement;
@@ -11909,8 +12094,8 @@ var init_sqlgenerator = __esm({
11909
12094
  }
11910
12095
  };
11911
12096
  MySQLDropTableConvertor = class extends Convertor {
11912
- can(statement, dialect7) {
11913
- return statement.type === "drop_table" && dialect7 === "mysql";
12097
+ can(statement, dialect4) {
12098
+ return statement.type === "drop_table" && dialect4 === "mysql";
11914
12099
  }
11915
12100
  convert(statement) {
11916
12101
  const { tableName } = statement;
@@ -11918,8 +12103,8 @@ var init_sqlgenerator = __esm({
11918
12103
  }
11919
12104
  };
11920
12105
  SQLiteDropTableConvertor = class extends Convertor {
11921
- can(statement, dialect7) {
11922
- return statement.type === "drop_table" && (dialect7 === "sqlite" || dialect7 === "turso");
12106
+ can(statement, dialect4) {
12107
+ return statement.type === "drop_table" && (dialect4 === "sqlite" || dialect4 === "turso");
11923
12108
  }
11924
12109
  convert(statement) {
11925
12110
  const { tableName } = statement;
@@ -11927,8 +12112,8 @@ var init_sqlgenerator = __esm({
11927
12112
  }
11928
12113
  };
11929
12114
  PgRenameTableConvertor = class extends Convertor {
11930
- can(statement, dialect7) {
11931
- return statement.type === "rename_table" && dialect7 === "postgresql";
12115
+ can(statement, dialect4) {
12116
+ return statement.type === "rename_table" && dialect4 === "postgresql";
11932
12117
  }
11933
12118
  convert(statement) {
11934
12119
  const { tableNameFrom, tableNameTo, toSchema, fromSchema } = statement;
@@ -11938,8 +12123,8 @@ var init_sqlgenerator = __esm({
11938
12123
  }
11939
12124
  };
11940
12125
  SqliteRenameTableConvertor = class extends Convertor {
11941
- can(statement, dialect7) {
11942
- return statement.type === "rename_table" && (dialect7 === "sqlite" || dialect7 === "turso");
12126
+ can(statement, dialect4) {
12127
+ return statement.type === "rename_table" && (dialect4 === "sqlite" || dialect4 === "turso");
11943
12128
  }
11944
12129
  convert(statement) {
11945
12130
  const { tableNameFrom, tableNameTo } = statement;
@@ -11947,8 +12132,8 @@ var init_sqlgenerator = __esm({
11947
12132
  }
11948
12133
  };
11949
12134
  MySqlRenameTableConvertor = class extends Convertor {
11950
- can(statement, dialect7) {
11951
- return statement.type === "rename_table" && dialect7 === "mysql";
12135
+ can(statement, dialect4) {
12136
+ return statement.type === "rename_table" && dialect4 === "mysql";
11952
12137
  }
11953
12138
  convert(statement) {
11954
12139
  const { tableNameFrom, tableNameTo } = statement;
@@ -11956,8 +12141,8 @@ var init_sqlgenerator = __esm({
11956
12141
  }
11957
12142
  };
11958
12143
  PgAlterTableRenameColumnConvertor = class extends Convertor {
11959
- can(statement, dialect7) {
11960
- return statement.type === "alter_table_rename_column" && dialect7 === "postgresql";
12144
+ can(statement, dialect4) {
12145
+ return statement.type === "alter_table_rename_column" && dialect4 === "postgresql";
11961
12146
  }
11962
12147
  convert(statement) {
11963
12148
  const { tableName, oldColumnName, newColumnName, schema: schema4 } = statement;
@@ -11966,8 +12151,8 @@ var init_sqlgenerator = __esm({
11966
12151
  }
11967
12152
  };
11968
12153
  MySqlAlterTableRenameColumnConvertor = class extends Convertor {
11969
- can(statement, dialect7) {
11970
- return statement.type === "alter_table_rename_column" && dialect7 === "mysql";
12154
+ can(statement, dialect4) {
12155
+ return statement.type === "alter_table_rename_column" && dialect4 === "mysql";
11971
12156
  }
11972
12157
  convert(statement) {
11973
12158
  const { tableName, oldColumnName, newColumnName } = statement;
@@ -11975,8 +12160,8 @@ var init_sqlgenerator = __esm({
11975
12160
  }
11976
12161
  };
11977
12162
  SQLiteAlterTableRenameColumnConvertor = class extends Convertor {
11978
- can(statement, dialect7) {
11979
- return statement.type === "alter_table_rename_column" && (dialect7 === "sqlite" || dialect7 === "turso");
12163
+ can(statement, dialect4) {
12164
+ return statement.type === "alter_table_rename_column" && (dialect4 === "sqlite" || dialect4 === "turso");
11980
12165
  }
11981
12166
  convert(statement) {
11982
12167
  const { tableName, oldColumnName, newColumnName } = statement;
@@ -11984,8 +12169,8 @@ var init_sqlgenerator = __esm({
11984
12169
  }
11985
12170
  };
11986
12171
  PgAlterTableDropColumnConvertor = class extends Convertor {
11987
- can(statement, dialect7) {
11988
- return statement.type === "alter_table_drop_column" && dialect7 === "postgresql";
12172
+ can(statement, dialect4) {
12173
+ return statement.type === "alter_table_drop_column" && dialect4 === "postgresql";
11989
12174
  }
11990
12175
  convert(statement) {
11991
12176
  const { tableName, columnName, schema: schema4 } = statement;
@@ -11994,8 +12179,8 @@ var init_sqlgenerator = __esm({
11994
12179
  }
11995
12180
  };
11996
12181
  MySqlAlterTableDropColumnConvertor = class extends Convertor {
11997
- can(statement, dialect7) {
11998
- return statement.type === "alter_table_drop_column" && dialect7 === "mysql";
12182
+ can(statement, dialect4) {
12183
+ return statement.type === "alter_table_drop_column" && dialect4 === "mysql";
11999
12184
  }
12000
12185
  convert(statement) {
12001
12186
  const { tableName, columnName } = statement;
@@ -12003,8 +12188,8 @@ var init_sqlgenerator = __esm({
12003
12188
  }
12004
12189
  };
12005
12190
  SQLiteAlterTableDropColumnConvertor = class extends Convertor {
12006
- can(statement, dialect7) {
12007
- return statement.type === "alter_table_drop_column" && (dialect7 === "sqlite" || dialect7 === "turso");
12191
+ can(statement, dialect4) {
12192
+ return statement.type === "alter_table_drop_column" && (dialect4 === "sqlite" || dialect4 === "turso");
12008
12193
  }
12009
12194
  convert(statement) {
12010
12195
  const { tableName, columnName } = statement;
@@ -12012,8 +12197,8 @@ var init_sqlgenerator = __esm({
12012
12197
  }
12013
12198
  };
12014
12199
  PgAlterTableAddColumnConvertor = class extends Convertor {
12015
- can(statement, dialect7) {
12016
- return statement.type === "alter_table_add_column" && dialect7 === "postgresql";
12200
+ can(statement, dialect4) {
12201
+ return statement.type === "alter_table_add_column" && dialect4 === "postgresql";
12017
12202
  }
12018
12203
  convert(statement) {
12019
12204
  const { tableName, column: column4, schema: schema4 } = statement;
@@ -12032,8 +12217,8 @@ var init_sqlgenerator = __esm({
12032
12217
  }
12033
12218
  };
12034
12219
  MySqlAlterTableAddColumnConvertor = class extends Convertor {
12035
- can(statement, dialect7) {
12036
- return statement.type === "alter_table_add_column" && dialect7 === "mysql";
12220
+ can(statement, dialect4) {
12221
+ return statement.type === "alter_table_add_column" && dialect4 === "mysql";
12037
12222
  }
12038
12223
  convert(statement) {
12039
12224
  const { tableName, column: column4 } = statement;
@@ -12056,8 +12241,8 @@ var init_sqlgenerator = __esm({
12056
12241
  }
12057
12242
  };
12058
12243
  SQLiteAlterTableAddColumnConvertor = class extends Convertor {
12059
- can(statement, dialect7) {
12060
- return statement.type === "sqlite_alter_table_add_column" && (dialect7 === "sqlite" || dialect7 === "turso");
12244
+ can(statement, dialect4) {
12245
+ return statement.type === "sqlite_alter_table_add_column" && (dialect4 === "sqlite" || dialect4 === "turso");
12061
12246
  }
12062
12247
  convert(statement) {
12063
12248
  const { tableName, column: column4, referenceData } = statement;
@@ -12072,8 +12257,8 @@ var init_sqlgenerator = __esm({
12072
12257
  }
12073
12258
  };
12074
12259
  PgAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
12075
- can(statement, dialect7) {
12076
- return statement.type === "alter_table_alter_column_set_type" && dialect7 === "postgresql";
12260
+ can(statement, dialect4) {
12261
+ return statement.type === "alter_table_alter_column_set_type" && dialect4 === "postgresql";
12077
12262
  }
12078
12263
  convert(statement) {
12079
12264
  const { tableName, columnName, newDataType, schema: schema4 } = statement;
@@ -12082,8 +12267,8 @@ var init_sqlgenerator = __esm({
12082
12267
  }
12083
12268
  };
12084
12269
  PgAlterTableAlterColumnSetDefaultConvertor = class extends Convertor {
12085
- can(statement, dialect7) {
12086
- return statement.type === "alter_table_alter_column_set_default" && dialect7 === "postgresql";
12270
+ can(statement, dialect4) {
12271
+ return statement.type === "alter_table_alter_column_set_default" && dialect4 === "postgresql";
12087
12272
  }
12088
12273
  convert(statement) {
12089
12274
  const { tableName, columnName, schema: schema4 } = statement;
@@ -12092,8 +12277,8 @@ var init_sqlgenerator = __esm({
12092
12277
  }
12093
12278
  };
12094
12279
  PgAlterTableAlterColumnDropDefaultConvertor = class extends Convertor {
12095
- can(statement, dialect7) {
12096
- return statement.type === "alter_table_alter_column_drop_default" && dialect7 === "postgresql";
12280
+ can(statement, dialect4) {
12281
+ return statement.type === "alter_table_alter_column_drop_default" && dialect4 === "postgresql";
12097
12282
  }
12098
12283
  convert(statement) {
12099
12284
  const { tableName, columnName, schema: schema4 } = statement;
@@ -12102,8 +12287,8 @@ var init_sqlgenerator = __esm({
12102
12287
  }
12103
12288
  };
12104
12289
  PgAlterTableAlterColumnDropGeneratedConvertor = class extends Convertor {
12105
- can(statement, dialect7) {
12106
- return statement.type === "alter_table_alter_column_drop_generated" && dialect7 === "postgresql";
12290
+ can(statement, dialect4) {
12291
+ return statement.type === "alter_table_alter_column_drop_generated" && dialect4 === "postgresql";
12107
12292
  }
12108
12293
  convert(statement) {
12109
12294
  const { tableName, columnName, schema: schema4 } = statement;
@@ -12112,8 +12297,8 @@ var init_sqlgenerator = __esm({
12112
12297
  }
12113
12298
  };
12114
12299
  PgAlterTableAlterColumnSetExpressionConvertor = class extends Convertor {
12115
- can(statement, dialect7) {
12116
- return statement.type === "alter_table_alter_column_set_generated" && dialect7 === "postgresql";
12300
+ can(statement, dialect4) {
12301
+ return statement.type === "alter_table_alter_column_set_generated" && dialect4 === "postgresql";
12117
12302
  }
12118
12303
  convert(statement) {
12119
12304
  const {
@@ -12150,8 +12335,8 @@ var init_sqlgenerator = __esm({
12150
12335
  }
12151
12336
  };
12152
12337
  PgAlterTableAlterColumnAlterrGeneratedConvertor = class extends Convertor {
12153
- can(statement, dialect7) {
12154
- return statement.type === "alter_table_alter_column_alter_generated" && dialect7 === "postgresql";
12338
+ can(statement, dialect4) {
12339
+ return statement.type === "alter_table_alter_column_alter_generated" && dialect4 === "postgresql";
12155
12340
  }
12156
12341
  convert(statement) {
12157
12342
  const {
@@ -12188,8 +12373,8 @@ var init_sqlgenerator = __esm({
12188
12373
  }
12189
12374
  };
12190
12375
  SqliteAlterTableAlterColumnDropGeneratedConvertor = class extends Convertor {
12191
- can(statement, dialect7) {
12192
- return statement.type === "alter_table_alter_column_drop_generated" && (dialect7 === "sqlite" || dialect7 === "turso");
12376
+ can(statement, dialect4) {
12377
+ return statement.type === "alter_table_alter_column_drop_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
12193
12378
  }
12194
12379
  convert(statement) {
12195
12380
  const {
@@ -12229,8 +12414,8 @@ var init_sqlgenerator = __esm({
12229
12414
  }
12230
12415
  };
12231
12416
  SqliteAlterTableAlterColumnSetExpressionConvertor = class extends Convertor {
12232
- can(statement, dialect7) {
12233
- return statement.type === "alter_table_alter_column_set_generated" && (dialect7 === "sqlite" || dialect7 === "turso");
12417
+ can(statement, dialect4) {
12418
+ return statement.type === "alter_table_alter_column_set_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
12234
12419
  }
12235
12420
  convert(statement) {
12236
12421
  const {
@@ -12270,8 +12455,8 @@ var init_sqlgenerator = __esm({
12270
12455
  }
12271
12456
  };
12272
12457
  SqliteAlterTableAlterColumnAlterGeneratedConvertor = class extends Convertor {
12273
- can(statement, dialect7) {
12274
- return statement.type === "alter_table_alter_column_alter_generated" && (dialect7 === "sqlite" || dialect7 === "turso");
12458
+ can(statement, dialect4) {
12459
+ return statement.type === "alter_table_alter_column_alter_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
12275
12460
  }
12276
12461
  convert(statement) {
12277
12462
  const {
@@ -12311,8 +12496,8 @@ var init_sqlgenerator = __esm({
12311
12496
  }
12312
12497
  };
12313
12498
  MySqlAlterTableAlterColumnAlterrGeneratedConvertor = class extends Convertor {
12314
- can(statement, dialect7) {
12315
- return statement.type === "alter_table_alter_column_alter_generated" && dialect7 === "mysql";
12499
+ can(statement, dialect4) {
12500
+ return statement.type === "alter_table_alter_column_alter_generated" && dialect4 === "mysql";
12316
12501
  }
12317
12502
  convert(statement) {
12318
12503
  const {
@@ -12349,24 +12534,24 @@ var init_sqlgenerator = __esm({
12349
12534
  }
12350
12535
  };
12351
12536
  MySqlAlterTableAddPk = class extends Convertor {
12352
- can(statement, dialect7) {
12353
- return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "mysql";
12537
+ can(statement, dialect4) {
12538
+ return statement.type === "alter_table_alter_column_set_pk" && dialect4 === "mysql";
12354
12539
  }
12355
12540
  convert(statement) {
12356
12541
  return `ALTER TABLE \`${statement.tableName}\` ADD PRIMARY KEY (\`${statement.columnName}\`);`;
12357
12542
  }
12358
12543
  };
12359
12544
  MySqlAlterTableDropPk = class extends Convertor {
12360
- can(statement, dialect7) {
12361
- return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "mysql";
12545
+ can(statement, dialect4) {
12546
+ return statement.type === "alter_table_alter_column_drop_pk" && dialect4 === "mysql";
12362
12547
  }
12363
12548
  convert(statement) {
12364
12549
  return `ALTER TABLE \`${statement.tableName}\` DROP PRIMARY KEY`;
12365
12550
  }
12366
12551
  };
12367
12552
  LibSQLModifyColumn = class extends Convertor {
12368
- can(statement, dialect7) {
12369
- return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default") && dialect7 === "turso";
12553
+ can(statement, dialect4) {
12554
+ return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default") && dialect4 === "turso";
12370
12555
  }
12371
12556
  convert(statement, json22) {
12372
12557
  const { tableName, columnName } = statement;
@@ -12426,8 +12611,8 @@ var init_sqlgenerator = __esm({
12426
12611
  }
12427
12612
  };
12428
12613
  MySqlModifyColumn = class extends Convertor {
12429
- can(statement, dialect7) {
12430
- return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_on_update" || statement.type === "alter_table_alter_column_set_on_update" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_generated" || statement.type === "alter_table_alter_column_drop_generated") && dialect7 === "mysql";
12614
+ can(statement, dialect4) {
12615
+ return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_on_update" || statement.type === "alter_table_alter_column_set_on_update" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_generated" || statement.type === "alter_table_alter_column_drop_generated") && dialect4 === "mysql";
12431
12616
  }
12432
12617
  convert(statement) {
12433
12618
  const { tableName, columnName } = statement;
@@ -12563,8 +12748,8 @@ var init_sqlgenerator = __esm({
12563
12748
  }
12564
12749
  };
12565
12750
  PgAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
12566
- can(statement, dialect7) {
12567
- return statement.type === "create_composite_pk" && dialect7 === "postgresql";
12751
+ can(statement, dialect4) {
12752
+ return statement.type === "create_composite_pk" && dialect4 === "postgresql";
12568
12753
  }
12569
12754
  convert(statement) {
12570
12755
  const { name: name2, columns } = PgSquasher.unsquashPK(statement.data);
@@ -12573,8 +12758,8 @@ var init_sqlgenerator = __esm({
12573
12758
  }
12574
12759
  };
12575
12760
  PgAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
12576
- can(statement, dialect7) {
12577
- return statement.type === "delete_composite_pk" && dialect7 === "postgresql";
12761
+ can(statement, dialect4) {
12762
+ return statement.type === "delete_composite_pk" && dialect4 === "postgresql";
12578
12763
  }
12579
12764
  convert(statement) {
12580
12765
  const { name: name2, columns } = PgSquasher.unsquashPK(statement.data);
@@ -12583,8 +12768,8 @@ var init_sqlgenerator = __esm({
12583
12768
  }
12584
12769
  };
12585
12770
  PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
12586
- can(statement, dialect7) {
12587
- return statement.type === "alter_composite_pk" && dialect7 === "postgresql";
12771
+ can(statement, dialect4) {
12772
+ return statement.type === "alter_composite_pk" && dialect4 === "postgresql";
12588
12773
  }
12589
12774
  convert(statement) {
12590
12775
  const { name: name2, columns } = PgSquasher.unsquashPK(statement.old);
@@ -12597,8 +12782,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12597
12782
  }
12598
12783
  };
12599
12784
  MySqlAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
12600
- can(statement, dialect7) {
12601
- return statement.type === "create_composite_pk" && dialect7 === "mysql";
12785
+ can(statement, dialect4) {
12786
+ return statement.type === "create_composite_pk" && dialect4 === "mysql";
12602
12787
  }
12603
12788
  convert(statement) {
12604
12789
  const { name: name2, columns } = MySqlSquasher.unsquashPK(statement.data);
@@ -12606,8 +12791,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12606
12791
  }
12607
12792
  };
12608
12793
  MySqlAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
12609
- can(statement, dialect7) {
12610
- return statement.type === "delete_composite_pk" && dialect7 === "mysql";
12794
+ can(statement, dialect4) {
12795
+ return statement.type === "delete_composite_pk" && dialect4 === "mysql";
12611
12796
  }
12612
12797
  convert(statement) {
12613
12798
  const { name: name2, columns } = MySqlSquasher.unsquashPK(statement.data);
@@ -12615,8 +12800,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12615
12800
  }
12616
12801
  };
12617
12802
  MySqlAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
12618
- can(statement, dialect7) {
12619
- return statement.type === "alter_composite_pk" && dialect7 === "mysql";
12803
+ can(statement, dialect4) {
12804
+ return statement.type === "alter_composite_pk" && dialect4 === "mysql";
12620
12805
  }
12621
12806
  convert(statement) {
12622
12807
  const { name: name2, columns } = MySqlSquasher.unsquashPK(statement.old);
@@ -12627,8 +12812,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12627
12812
  }
12628
12813
  };
12629
12814
  PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
12630
- can(statement, dialect7) {
12631
- return statement.type === "alter_table_alter_column_set_pk" && dialect7 === "postgresql";
12815
+ can(statement, dialect4) {
12816
+ return statement.type === "alter_table_alter_column_set_pk" && dialect4 === "postgresql";
12632
12817
  }
12633
12818
  convert(statement) {
12634
12819
  const { tableName, columnName } = statement;
@@ -12637,8 +12822,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12637
12822
  }
12638
12823
  };
12639
12824
  PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
12640
- can(statement, dialect7) {
12641
- return statement.type === "alter_table_alter_column_drop_pk" && dialect7 === "postgresql";
12825
+ can(statement, dialect4) {
12826
+ return statement.type === "alter_table_alter_column_drop_pk" && dialect4 === "postgresql";
12642
12827
  }
12643
12828
  convert(statement) {
12644
12829
  const { tableName, columnName, schema: schema4 } = statement;
@@ -12661,8 +12846,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12661
12846
  }
12662
12847
  };
12663
12848
  PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
12664
- can(statement, dialect7) {
12665
- return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "postgresql";
12849
+ can(statement, dialect4) {
12850
+ return statement.type === "alter_table_alter_column_set_notnull" && dialect4 === "postgresql";
12666
12851
  }
12667
12852
  convert(statement) {
12668
12853
  const { tableName, columnName } = statement;
@@ -12671,8 +12856,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12671
12856
  }
12672
12857
  };
12673
12858
  PgAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
12674
- can(statement, dialect7) {
12675
- return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "postgresql";
12859
+ can(statement, dialect4) {
12860
+ return statement.type === "alter_table_alter_column_drop_notnull" && dialect4 === "postgresql";
12676
12861
  }
12677
12862
  convert(statement) {
12678
12863
  const { tableName, columnName } = statement;
@@ -12681,8 +12866,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12681
12866
  }
12682
12867
  };
12683
12868
  PgCreateForeignKeyConvertor = class extends Convertor {
12684
- can(statement, dialect7) {
12685
- return statement.type === "create_reference" && dialect7 === "postgresql";
12869
+ can(statement, dialect4) {
12870
+ return statement.type === "create_reference" && dialect4 === "postgresql";
12686
12871
  }
12687
12872
  convert(statement) {
12688
12873
  const {
@@ -12711,8 +12896,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12711
12896
  }
12712
12897
  };
12713
12898
  LibSQLCreateForeignKeyConvertor = class extends Convertor {
12714
- can(statement, dialect7) {
12715
- return statement.type === "create_reference" && dialect7 === "turso";
12899
+ can(statement, dialect4) {
12900
+ return statement.type === "create_reference" && dialect4 === "turso";
12716
12901
  }
12717
12902
  convert(statement, json22, action) {
12718
12903
  const { columnsFrom, columnsTo, tableFrom, onDelete, onUpdate, tableTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
@@ -12728,8 +12913,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12728
12913
  }
12729
12914
  };
12730
12915
  MySqlCreateForeignKeyConvertor = class extends Convertor {
12731
- can(statement, dialect7) {
12732
- return statement.type === "create_reference" && dialect7 === "mysql";
12916
+ can(statement, dialect4) {
12917
+ return statement.type === "create_reference" && dialect4 === "mysql";
12733
12918
  }
12734
12919
  convert(statement) {
12735
12920
  const {
@@ -12749,8 +12934,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12749
12934
  }
12750
12935
  };
12751
12936
  PgAlterForeignKeyConvertor = class extends Convertor {
12752
- can(statement, dialect7) {
12753
- return statement.type === "alter_reference" && dialect7 === "postgresql";
12937
+ can(statement, dialect4) {
12938
+ return statement.type === "alter_reference" && dialect4 === "postgresql";
12754
12939
  }
12755
12940
  convert(statement) {
12756
12941
  const newFk = PgSquasher.unsquashFK(statement.data);
@@ -12774,8 +12959,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12774
12959
  }
12775
12960
  };
12776
12961
  PgDeleteForeignKeyConvertor = class extends Convertor {
12777
- can(statement, dialect7) {
12778
- return statement.type === "delete_reference" && dialect7 === "postgresql";
12962
+ can(statement, dialect4) {
12963
+ return statement.type === "delete_reference" && dialect4 === "postgresql";
12779
12964
  }
12780
12965
  convert(statement) {
12781
12966
  const tableFrom = statement.tableName;
@@ -12786,8 +12971,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12786
12971
  }
12787
12972
  };
12788
12973
  MySqlDeleteForeignKeyConvertor = class extends Convertor {
12789
- can(statement, dialect7) {
12790
- return statement.type === "delete_reference" && dialect7 === "mysql";
12974
+ can(statement, dialect4) {
12975
+ return statement.type === "delete_reference" && dialect4 === "mysql";
12791
12976
  }
12792
12977
  convert(statement) {
12793
12978
  const tableFrom = statement.tableName;
@@ -12797,8 +12982,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12797
12982
  }
12798
12983
  };
12799
12984
  CreatePgIndexConvertor = class extends Convertor {
12800
- can(statement, dialect7) {
12801
- return statement.type === "create_index_pg" && dialect7 === "postgresql";
12985
+ can(statement, dialect4) {
12986
+ return statement.type === "create_index_pg" && dialect4 === "postgresql";
12802
12987
  }
12803
12988
  convert(statement) {
12804
12989
  const {
@@ -12829,8 +13014,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12829
13014
  }
12830
13015
  };
12831
13016
  CreateMySqlIndexConvertor = class extends Convertor {
12832
- can(statement, dialect7) {
12833
- return statement.type === "create_index" && dialect7 === "mysql";
13017
+ can(statement, dialect4) {
13018
+ return statement.type === "create_index" && dialect4 === "mysql";
12834
13019
  }
12835
13020
  convert(statement) {
12836
13021
  const { name: name2, columns, isUnique } = MySqlSquasher.unsquashIdx(
@@ -12844,8 +13029,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12844
13029
  }
12845
13030
  };
12846
13031
  CreateSqliteIndexConvertor = class extends Convertor {
12847
- can(statement, dialect7) {
12848
- return statement.type === "create_index" && (dialect7 === "sqlite" || dialect7 === "turso");
13032
+ can(statement, dialect4) {
13033
+ return statement.type === "create_index" && (dialect4 === "sqlite" || dialect4 === "turso");
12849
13034
  }
12850
13035
  convert(statement) {
12851
13036
  const { name: name2, columns, isUnique, where } = SQLiteSquasher.unsquashIdx(
@@ -12860,8 +13045,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12860
13045
  }
12861
13046
  };
12862
13047
  PgDropIndexConvertor = class extends Convertor {
12863
- can(statement, dialect7) {
12864
- return statement.type === "drop_index" && dialect7 === "postgresql";
13048
+ can(statement, dialect4) {
13049
+ return statement.type === "drop_index" && dialect4 === "postgresql";
12865
13050
  }
12866
13051
  convert(statement) {
12867
13052
  const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
@@ -12869,8 +13054,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12869
13054
  }
12870
13055
  };
12871
13056
  PgCreateSchemaConvertor = class extends Convertor {
12872
- can(statement, dialect7) {
12873
- return statement.type === "create_schema" && dialect7 === "postgresql";
13057
+ can(statement, dialect4) {
13058
+ return statement.type === "create_schema" && dialect4 === "postgresql";
12874
13059
  }
12875
13060
  convert(statement) {
12876
13061
  const { name: name2 } = statement;
@@ -12879,8 +13064,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12879
13064
  }
12880
13065
  };
12881
13066
  PgRenameSchemaConvertor = class extends Convertor {
12882
- can(statement, dialect7) {
12883
- return statement.type === "rename_schema" && dialect7 === "postgresql";
13067
+ can(statement, dialect4) {
13068
+ return statement.type === "rename_schema" && dialect4 === "postgresql";
12884
13069
  }
12885
13070
  convert(statement) {
12886
13071
  const { from, to } = statement;
@@ -12889,8 +13074,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12889
13074
  }
12890
13075
  };
12891
13076
  PgDropSchemaConvertor = class extends Convertor {
12892
- can(statement, dialect7) {
12893
- return statement.type === "drop_schema" && dialect7 === "postgresql";
13077
+ can(statement, dialect4) {
13078
+ return statement.type === "drop_schema" && dialect4 === "postgresql";
12894
13079
  }
12895
13080
  convert(statement) {
12896
13081
  const { name: name2 } = statement;
@@ -12899,8 +13084,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12899
13084
  }
12900
13085
  };
12901
13086
  PgAlterTableSetSchemaConvertor = class extends Convertor {
12902
- can(statement, dialect7) {
12903
- return statement.type === "alter_table_set_schema" && dialect7 === "postgresql";
13087
+ can(statement, dialect4) {
13088
+ return statement.type === "alter_table_set_schema" && dialect4 === "postgresql";
12904
13089
  }
12905
13090
  convert(statement) {
12906
13091
  const { tableName, schemaFrom, schemaTo } = statement;
@@ -12909,8 +13094,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12909
13094
  }
12910
13095
  };
12911
13096
  PgAlterTableSetNewSchemaConvertor = class extends Convertor {
12912
- can(statement, dialect7) {
12913
- return statement.type === "alter_table_set_new_schema" && dialect7 === "postgresql";
13097
+ can(statement, dialect4) {
13098
+ return statement.type === "alter_table_set_new_schema" && dialect4 === "postgresql";
12914
13099
  }
12915
13100
  convert(statement) {
12916
13101
  const { tableName, to, from } = statement;
@@ -12920,8 +13105,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12920
13105
  }
12921
13106
  };
12922
13107
  PgAlterTableRemoveFromSchemaConvertor = class extends Convertor {
12923
- can(statement, dialect7) {
12924
- return statement.type === "alter_table_remove_from_schema" && dialect7 === "postgresql";
13108
+ can(statement, dialect4) {
13109
+ return statement.type === "alter_table_remove_from_schema" && dialect4 === "postgresql";
12925
13110
  }
12926
13111
  convert(statement) {
12927
13112
  const { tableName, schema: schema4 } = statement;
@@ -12931,8 +13116,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12931
13116
  }
12932
13117
  };
12933
13118
  SqliteDropIndexConvertor = class extends Convertor {
12934
- can(statement, dialect7) {
12935
- return statement.type === "drop_index" && (dialect7 === "sqlite" || dialect7 === "turso");
13119
+ can(statement, dialect4) {
13120
+ return statement.type === "drop_index" && (dialect4 === "sqlite" || dialect4 === "turso");
12936
13121
  }
12937
13122
  convert(statement) {
12938
13123
  const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
@@ -12940,8 +13125,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12940
13125
  }
12941
13126
  };
12942
13127
  MySqlDropIndexConvertor = class extends Convertor {
12943
- can(statement, dialect7) {
12944
- return statement.type === "drop_index" && dialect7 === "mysql";
13128
+ can(statement, dialect4) {
13129
+ return statement.type === "drop_index" && dialect4 === "mysql";
12945
13130
  }
12946
13131
  convert(statement) {
12947
13132
  const { name: name2 } = MySqlSquasher.unsquashIdx(statement.data);
@@ -12949,8 +13134,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12949
13134
  }
12950
13135
  };
12951
13136
  SQLiteRecreateTableConvertor = class extends Convertor {
12952
- can(statement, dialect7) {
12953
- return statement.type === "recreate_table" && dialect7 === "sqlite";
13137
+ can(statement, dialect4) {
13138
+ return statement.type === "recreate_table" && dialect4 === "sqlite";
12954
13139
  }
12955
13140
  convert(statement) {
12956
13141
  const { tableName, columns, compositePKs, referenceData } = statement;
@@ -12991,8 +13176,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
12991
13176
  }
12992
13177
  };
12993
13178
  LibSQLRecreateTableConvertor = class extends Convertor {
12994
- can(statement, dialect7) {
12995
- return statement.type === "recreate_table" && dialect7 === "turso";
13179
+ can(statement, dialect4) {
13180
+ return statement.type === "recreate_table" && dialect4 === "turso";
12996
13181
  }
12997
13182
  convert(statement) {
12998
13183
  const { tableName, columns, compositePKs, referenceData } = statement;
@@ -16702,7 +16887,7 @@ var init_schemaValidator = __esm({
16702
16887
  });
16703
16888
 
16704
16889
  // src/cli/validations/common.ts
16705
- var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
16890
+ var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, casingTypes, casingType, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
16706
16891
  var init_common = __esm({
16707
16892
  "src/cli/validations/common.ts"() {
16708
16893
  "use strict";
@@ -16728,6 +16913,8 @@ var init_common = __esm({
16728
16913
  {
16729
16914
  const _2 = "";
16730
16915
  }
16916
+ casingTypes = ["snake_case", "camelCase"];
16917
+ casingType = enumType(casingTypes);
16731
16918
  sqliteDriver = unionType(sqliteDriversLiterals);
16732
16919
  postgresDriver = unionType(postgresqlDriversLiterals);
16733
16920
  driver = unionType([sqliteDriver, postgresDriver]);
@@ -16746,7 +16933,8 @@ var init_common = __esm({
16746
16933
  tablesFilter: unionType([stringType(), stringType().array()]).optional(),
16747
16934
  schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
16748
16935
  migrations: configMigrations,
16749
- dbCredentials: anyType().optional()
16936
+ dbCredentials: anyType().optional(),
16937
+ casing: casingType.optional()
16750
16938
  }).passthrough();
16751
16939
  casing = unionType([literalType("camel"), literalType("preserve")]).default(
16752
16940
  "camel"
@@ -18135,51 +18323,17 @@ var init_mjs = __esm({
18135
18323
  }
18136
18324
  });
18137
18325
 
18138
- // ../drizzle-orm/dist/entity.js
18139
- function is(value, type) {
18140
- if (!value || typeof value !== "object") {
18141
- return false;
18142
- }
18143
- if (value instanceof type) {
18144
- return true;
18145
- }
18146
- if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
18147
- throw new Error(
18148
- `Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`
18149
- );
18150
- }
18151
- let cls = value.constructor;
18152
- if (cls) {
18153
- while (cls) {
18154
- if (entityKind in cls && cls[entityKind] === type[entityKind]) {
18155
- return true;
18156
- }
18157
- cls = Object.getPrototypeOf(cls);
18158
- }
18159
- }
18160
- return false;
18161
- }
18162
- var entityKind, hasOwnEntityKind;
18163
- var init_entity = __esm({
18164
- "../drizzle-orm/dist/entity.js"() {
18165
- "use strict";
18166
- entityKind = Symbol.for("drizzle:entityKind");
18167
- hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
18168
- }
18169
- });
18170
-
18171
18326
  // ../drizzle-orm/dist/column.js
18172
- var _a, Column2;
18327
+ var _a3, Column2;
18173
18328
  var init_column = __esm({
18174
18329
  "../drizzle-orm/dist/column.js"() {
18175
18330
  "use strict";
18176
18331
  init_entity();
18177
- _a = entityKind;
18332
+ _a3 = entityKind;
18178
18333
  Column2 = class {
18179
18334
  constructor(table4, config) {
18180
- /** @internal */
18181
- __publicField(this, "keyAsName");
18182
18335
  __publicField(this, "name");
18336
+ __publicField(this, "keyAsName");
18183
18337
  __publicField(this, "primary");
18184
18338
  __publicField(this, "notNull");
18185
18339
  __publicField(this, "default");
@@ -18224,17 +18378,17 @@ var init_column = __esm({
18224
18378
  return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
18225
18379
  }
18226
18380
  };
18227
- __publicField(Column2, _a, "Column");
18381
+ __publicField(Column2, _a3, "Column");
18228
18382
  }
18229
18383
  });
18230
18384
 
18231
18385
  // ../drizzle-orm/dist/column-builder.js
18232
- var _a2, ColumnBuilder;
18386
+ var _a4, ColumnBuilder;
18233
18387
  var init_column_builder = __esm({
18234
18388
  "../drizzle-orm/dist/column-builder.js"() {
18235
18389
  "use strict";
18236
18390
  init_entity();
18237
- _a2 = entityKind;
18391
+ _a4 = entityKind;
18238
18392
  ColumnBuilder = class {
18239
18393
  constructor(name2, dataType, columnType) {
18240
18394
  __publicField(this, "config");
@@ -18336,27 +18490,18 @@ var init_column_builder = __esm({
18336
18490
  this.config.name = name2;
18337
18491
  }
18338
18492
  };
18339
- __publicField(ColumnBuilder, _a2, "ColumnBuilder");
18340
- }
18341
- });
18342
-
18343
- // ../drizzle-orm/dist/table.utils.js
18344
- var TableName;
18345
- var init_table_utils = __esm({
18346
- "../drizzle-orm/dist/table.utils.js"() {
18347
- "use strict";
18348
- TableName = Symbol.for("drizzle:Name");
18493
+ __publicField(ColumnBuilder, _a4, "ColumnBuilder");
18349
18494
  }
18350
18495
  });
18351
18496
 
18352
18497
  // ../drizzle-orm/dist/pg-core/foreign-keys.js
18353
- var _a3, ForeignKeyBuilder, _a4, ForeignKey;
18498
+ var _a5, ForeignKeyBuilder, _a6, ForeignKey;
18354
18499
  var init_foreign_keys = __esm({
18355
18500
  "../drizzle-orm/dist/pg-core/foreign-keys.js"() {
18356
18501
  "use strict";
18357
18502
  init_entity();
18358
18503
  init_table_utils();
18359
- _a3 = entityKind;
18504
+ _a5 = entityKind;
18360
18505
  ForeignKeyBuilder = class {
18361
18506
  constructor(config, actions) {
18362
18507
  /** @internal */
@@ -18387,8 +18532,8 @@ var init_foreign_keys = __esm({
18387
18532
  return new ForeignKey(table4, this);
18388
18533
  }
18389
18534
  };
18390
- __publicField(ForeignKeyBuilder, _a3, "PgForeignKeyBuilder");
18391
- _a4 = entityKind;
18535
+ __publicField(ForeignKeyBuilder, _a5, "PgForeignKeyBuilder");
18536
+ _a6 = entityKind;
18392
18537
  ForeignKey = class {
18393
18538
  constructor(table4, builder) {
18394
18539
  __publicField(this, "reference");
@@ -18412,7 +18557,7 @@ var init_foreign_keys = __esm({
18412
18557
  return name2 ?? `${chunks.join("_")}_fk`;
18413
18558
  }
18414
18559
  };
18415
- __publicField(ForeignKey, _a4, "PgForeignKey");
18560
+ __publicField(ForeignKey, _a6, "PgForeignKey");
18416
18561
  }
18417
18562
  });
18418
18563
 
@@ -18430,13 +18575,13 @@ var init_tracing_utils = __esm({
18430
18575
  function uniqueKeyName(table4, columns) {
18431
18576
  return `${table4[TableName]}_${columns.join("_")}_unique`;
18432
18577
  }
18433
- var _a5, UniqueConstraintBuilder, _a6, UniqueOnConstraintBuilder, _a7, UniqueConstraint;
18578
+ var _a7, UniqueConstraintBuilder, _a8, UniqueOnConstraintBuilder, _a9, UniqueConstraint;
18434
18579
  var init_unique_constraint = __esm({
18435
18580
  "../drizzle-orm/dist/pg-core/unique-constraint.js"() {
18436
18581
  "use strict";
18437
18582
  init_entity();
18438
18583
  init_table_utils();
18439
- _a5 = entityKind;
18584
+ _a7 = entityKind;
18440
18585
  UniqueConstraintBuilder = class {
18441
18586
  constructor(columns, name2) {
18442
18587
  /** @internal */
@@ -18455,8 +18600,8 @@ var init_unique_constraint = __esm({
18455
18600
  return new UniqueConstraint(table4, this.columns, this.nullsNotDistinctConfig, this.name);
18456
18601
  }
18457
18602
  };
18458
- __publicField(UniqueConstraintBuilder, _a5, "PgUniqueConstraintBuilder");
18459
- _a6 = entityKind;
18603
+ __publicField(UniqueConstraintBuilder, _a7, "PgUniqueConstraintBuilder");
18604
+ _a8 = entityKind;
18460
18605
  UniqueOnConstraintBuilder = class {
18461
18606
  constructor(name2) {
18462
18607
  /** @internal */
@@ -18467,8 +18612,8 @@ var init_unique_constraint = __esm({
18467
18612
  return new UniqueConstraintBuilder(columns, this.name);
18468
18613
  }
18469
18614
  };
18470
- __publicField(UniqueOnConstraintBuilder, _a6, "PgUniqueOnConstraintBuilder");
18471
- _a7 = entityKind;
18615
+ __publicField(UniqueOnConstraintBuilder, _a8, "PgUniqueOnConstraintBuilder");
18616
+ _a9 = entityKind;
18472
18617
  UniqueConstraint = class {
18473
18618
  constructor(table4, columns, nullsNotDistinct, name2) {
18474
18619
  __publicField(this, "columns");
@@ -18483,7 +18628,7 @@ var init_unique_constraint = __esm({
18483
18628
  return this.name;
18484
18629
  }
18485
18630
  };
18486
- __publicField(UniqueConstraint, _a7, "PgUniqueConstraint");
18631
+ __publicField(UniqueConstraint, _a9, "PgUniqueConstraint");
18487
18632
  }
18488
18633
  });
18489
18634
 
@@ -18569,7 +18714,7 @@ var init_array = __esm({
18569
18714
  });
18570
18715
 
18571
18716
  // ../drizzle-orm/dist/pg-core/columns/common.js
18572
- var _a8, _b, PgColumnBuilder, _a9, _b2, PgColumn, _a10, _b3, ExtraConfigColumn, _a11, IndexedColumn, _a12, _b4, PgArrayBuilder, _a13, _b5, _PgArray, PgArray;
18717
+ var _a10, _b2, PgColumnBuilder, _a11, _b3, PgColumn, _a12, _b4, ExtraConfigColumn, _a13, IndexedColumn, _a14, _b5, PgArrayBuilder, _a15, _b6, _PgArray, PgArray;
18573
18718
  var init_common2 = __esm({
18574
18719
  "../drizzle-orm/dist/pg-core/columns/common.js"() {
18575
18720
  "use strict";
@@ -18580,7 +18725,7 @@ var init_common2 = __esm({
18580
18725
  init_tracing_utils();
18581
18726
  init_unique_constraint();
18582
18727
  init_array();
18583
- PgColumnBuilder = class extends (_b = ColumnBuilder, _a8 = entityKind, _b) {
18728
+ PgColumnBuilder = class extends (_b2 = ColumnBuilder, _a10 = entityKind, _b2) {
18584
18729
  constructor() {
18585
18730
  super(...arguments);
18586
18731
  __publicField(this, "foreignKeyConfigs", []);
@@ -18633,8 +18778,8 @@ var init_common2 = __esm({
18633
18778
  return new ExtraConfigColumn(table4, this.config);
18634
18779
  }
18635
18780
  };
18636
- __publicField(PgColumnBuilder, _a8, "PgColumnBuilder");
18637
- PgColumn = class extends (_b2 = Column2, _a9 = entityKind, _b2) {
18781
+ __publicField(PgColumnBuilder, _a10, "PgColumnBuilder");
18782
+ PgColumn = class extends (_b3 = Column2, _a11 = entityKind, _b3) {
18638
18783
  constructor(table4, config) {
18639
18784
  if (!config.uniqueName) {
18640
18785
  config.uniqueName = uniqueKeyName(table4, [config.name]);
@@ -18643,8 +18788,8 @@ var init_common2 = __esm({
18643
18788
  this.table = table4;
18644
18789
  }
18645
18790
  };
18646
- __publicField(PgColumn, _a9, "PgColumn");
18647
- ExtraConfigColumn = class extends (_b3 = PgColumn, _a10 = entityKind, _b3) {
18791
+ __publicField(PgColumn, _a11, "PgColumn");
18792
+ ExtraConfigColumn = class extends (_b4 = PgColumn, _a12 = entityKind, _b4) {
18648
18793
  constructor() {
18649
18794
  super(...arguments);
18650
18795
  __publicField(this, "indexConfig", {
@@ -18711,20 +18856,22 @@ var init_common2 = __esm({
18711
18856
  return this;
18712
18857
  }
18713
18858
  };
18714
- __publicField(ExtraConfigColumn, _a10, "ExtraConfigColumn");
18715
- _a11 = entityKind;
18859
+ __publicField(ExtraConfigColumn, _a12, "ExtraConfigColumn");
18860
+ _a13 = entityKind;
18716
18861
  IndexedColumn = class {
18717
- constructor(name2, type, indexConfig) {
18862
+ constructor(name2, keyAsName, type, indexConfig) {
18718
18863
  __publicField(this, "name");
18864
+ __publicField(this, "keyAsName");
18719
18865
  __publicField(this, "type");
18720
18866
  __publicField(this, "indexConfig");
18721
18867
  this.name = name2;
18868
+ this.keyAsName = keyAsName;
18722
18869
  this.type = type;
18723
18870
  this.indexConfig = indexConfig;
18724
18871
  }
18725
18872
  };
18726
- __publicField(IndexedColumn, _a11, "IndexedColumn");
18727
- PgArrayBuilder = class extends (_b4 = PgColumnBuilder, _a12 = entityKind, _b4) {
18873
+ __publicField(IndexedColumn, _a13, "IndexedColumn");
18874
+ PgArrayBuilder = class extends (_b5 = PgColumnBuilder, _a14 = entityKind, _b5) {
18728
18875
  constructor(name2, baseBuilder, size) {
18729
18876
  super(name2, "array", "PgArray");
18730
18877
  this.config.baseBuilder = baseBuilder;
@@ -18740,8 +18887,8 @@ var init_common2 = __esm({
18740
18887
  );
18741
18888
  }
18742
18889
  };
18743
- __publicField(PgArrayBuilder, _a12, "PgArrayBuilder");
18744
- _PgArray = class _PgArray extends (_b5 = PgColumn, _a13 = entityKind, _b5) {
18890
+ __publicField(PgArrayBuilder, _a14, "PgArrayBuilder");
18891
+ _PgArray = class _PgArray extends (_b6 = PgColumn, _a15 = entityKind, _b6) {
18745
18892
  constructor(table4, config, baseColumn, range) {
18746
18893
  super(table4, config);
18747
18894
  __publicField(this, "size");
@@ -18767,7 +18914,7 @@ var init_common2 = __esm({
18767
18914
  return makePgArray(a);
18768
18915
  }
18769
18916
  };
18770
- __publicField(_PgArray, _a13, "PgArray");
18917
+ __publicField(_PgArray, _a15, "PgArray");
18771
18918
  PgArray = _PgArray;
18772
18919
  }
18773
18920
  });
@@ -18788,14 +18935,14 @@ function pgEnumWithSchema(enumName, values, schema4) {
18788
18935
  );
18789
18936
  return enumInstance;
18790
18937
  }
18791
- var isPgEnumSym, _a14, _b6, PgEnumColumnBuilder, _a15, _b7, PgEnumColumn;
18938
+ var isPgEnumSym, _a16, _b7, PgEnumColumnBuilder, _a17, _b8, PgEnumColumn;
18792
18939
  var init_enum = __esm({
18793
18940
  "../drizzle-orm/dist/pg-core/columns/enum.js"() {
18794
18941
  "use strict";
18795
18942
  init_entity();
18796
18943
  init_common2();
18797
18944
  isPgEnumSym = Symbol.for("drizzle:isPgEnum");
18798
- PgEnumColumnBuilder = class extends (_b6 = PgColumnBuilder, _a14 = entityKind, _b6) {
18945
+ PgEnumColumnBuilder = class extends (_b7 = PgColumnBuilder, _a16 = entityKind, _b7) {
18799
18946
  constructor(name2, enumInstance) {
18800
18947
  super(name2, "string", "PgEnumColumn");
18801
18948
  this.config.enum = enumInstance;
@@ -18808,8 +18955,8 @@ var init_enum = __esm({
18808
18955
  );
18809
18956
  }
18810
18957
  };
18811
- __publicField(PgEnumColumnBuilder, _a14, "PgEnumColumnBuilder");
18812
- PgEnumColumn = class extends (_b7 = PgColumn, _a15 = entityKind, _b7) {
18958
+ __publicField(PgEnumColumnBuilder, _a16, "PgEnumColumnBuilder");
18959
+ PgEnumColumn = class extends (_b8 = PgColumn, _a17 = entityKind, _b8) {
18813
18960
  constructor(table4, config) {
18814
18961
  super(table4, config);
18815
18962
  __publicField(this, "enum", this.config.enum);
@@ -18820,17 +18967,17 @@ var init_enum = __esm({
18820
18967
  return this.enum.enumName;
18821
18968
  }
18822
18969
  };
18823
- __publicField(PgEnumColumn, _a15, "PgEnumColumn");
18970
+ __publicField(PgEnumColumn, _a17, "PgEnumColumn");
18824
18971
  }
18825
18972
  });
18826
18973
 
18827
18974
  // ../drizzle-orm/dist/subquery.js
18828
- var _a16, Subquery, _a17, _b8, WithSubquery;
18975
+ var _a18, Subquery, _a19, _b9, WithSubquery;
18829
18976
  var init_subquery = __esm({
18830
18977
  "../drizzle-orm/dist/subquery.js"() {
18831
18978
  "use strict";
18832
18979
  init_entity();
18833
- _a16 = entityKind;
18980
+ _a18 = entityKind;
18834
18981
  Subquery = class {
18835
18982
  constructor(sql2, selection, alias, isWith = false) {
18836
18983
  this._ = {
@@ -18845,10 +18992,10 @@ var init_subquery = __esm({
18845
18992
  // return new SQL([this]);
18846
18993
  // }
18847
18994
  };
18848
- __publicField(Subquery, _a16, "Subquery");
18849
- WithSubquery = class extends (_b8 = Subquery, _a17 = entityKind, _b8) {
18995
+ __publicField(Subquery, _a18, "Subquery");
18996
+ WithSubquery = class extends (_b9 = Subquery, _a19 = entityKind, _b9) {
18850
18997
  };
18851
- __publicField(WithSubquery, _a17, "WithSubquery");
18998
+ __publicField(WithSubquery, _a19, "WithSubquery");
18852
18999
  }
18853
19000
  });
18854
19001
 
@@ -18857,7 +19004,7 @@ var version;
18857
19004
  var init_version = __esm({
18858
19005
  "../drizzle-orm/dist/version.js"() {
18859
19006
  "use strict";
18860
- version = "0.34.0";
19007
+ version = "0.34.1";
18861
19008
  }
18862
19009
  });
18863
19010
 
@@ -18911,80 +19058,6 @@ var init_view_common = __esm({
18911
19058
  }
18912
19059
  });
18913
19060
 
18914
- // ../drizzle-orm/dist/table.js
18915
- function isTable(table4) {
18916
- return typeof table4 === "object" && table4 !== null && IsDrizzleTable in table4;
18917
- }
18918
- function getTableName(table4) {
18919
- return table4[TableName];
18920
- }
18921
- function getTableUniqueName(table4) {
18922
- return `${table4[Schema] ?? "public"}.${table4[TableName]}`;
18923
- }
18924
- var Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a18, _b9, _c, _d, _e, _f, _g, _h, _i, _j, Table2;
18925
- var init_table = __esm({
18926
- "../drizzle-orm/dist/table.js"() {
18927
- "use strict";
18928
- init_entity();
18929
- init_table_utils();
18930
- Schema = Symbol.for("drizzle:Schema");
18931
- Columns = Symbol.for("drizzle:Columns");
18932
- ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
18933
- OriginalName = Symbol.for("drizzle:OriginalName");
18934
- BaseName = Symbol.for("drizzle:BaseName");
18935
- IsAlias = Symbol.for("drizzle:IsAlias");
18936
- ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
18937
- IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
18938
- _j = entityKind, _i = TableName, _h = OriginalName, _g = Schema, _f = Columns, _e = ExtraConfigColumns, _d = BaseName, _c = IsAlias, _b9 = IsDrizzleTable, _a18 = ExtraConfigBuilder;
18939
- Table2 = class {
18940
- constructor(name2, schema4, baseName) {
18941
- /**
18942
- * @internal
18943
- * Can be changed if the table is aliased.
18944
- */
18945
- __publicField(this, _i);
18946
- /**
18947
- * @internal
18948
- * Used to store the original name of the table, before any aliasing.
18949
- */
18950
- __publicField(this, _h);
18951
- /** @internal */
18952
- __publicField(this, _g);
18953
- /** @internal */
18954
- __publicField(this, _f);
18955
- /** @internal */
18956
- __publicField(this, _e);
18957
- /**
18958
- * @internal
18959
- * Used to store the table name before the transformation via the `tableCreator` functions.
18960
- */
18961
- __publicField(this, _d);
18962
- /** @internal */
18963
- __publicField(this, _c, false);
18964
- /** @internal */
18965
- __publicField(this, _b9, true);
18966
- /** @internal */
18967
- __publicField(this, _a18);
18968
- this[TableName] = this[OriginalName] = name2;
18969
- this[Schema] = schema4;
18970
- this[BaseName] = baseName;
18971
- }
18972
- };
18973
- __publicField(Table2, _j, "Table");
18974
- /** @internal */
18975
- __publicField(Table2, "Symbol", {
18976
- Name: TableName,
18977
- Schema,
18978
- OriginalName,
18979
- Columns,
18980
- ExtraConfigColumns,
18981
- BaseName,
18982
- IsAlias,
18983
- ExtraConfigBuilder
18984
- });
18985
- }
18986
- });
18987
-
18988
19061
  // ../drizzle-orm/dist/sql/sql.js
18989
19062
  function isSQLWrapper(value) {
18990
19063
  return value !== null && value !== void 0 && typeof value.getSQL === "function";
@@ -19042,7 +19115,7 @@ function fillPlaceholders(params, values) {
19042
19115
  return p;
19043
19116
  });
19044
19117
  }
19045
- var _a19, FakePrimitiveParam, _a20, StringChunk, _a21, _SQL, SQL, _a22, Name, noopDecoder, noopEncoder, noopMapper, _a23, Param, _a24, Placeholder, _a25, _b10, View;
19118
+ var _a20, FakePrimitiveParam, _a21, StringChunk, _a22, _SQL, SQL, _a23, Name, noopDecoder, noopEncoder, noopMapper, _a24, Param, _a25, Placeholder, _a26, _b10, View;
19046
19119
  var init_sql = __esm({
19047
19120
  "../drizzle-orm/dist/sql/sql.js"() {
19048
19121
  "use strict";
@@ -19053,11 +19126,11 @@ var init_sql = __esm({
19053
19126
  init_view_common();
19054
19127
  init_column();
19055
19128
  init_table();
19056
- _a19 = entityKind;
19129
+ _a20 = entityKind;
19057
19130
  FakePrimitiveParam = class {
19058
19131
  };
19059
- __publicField(FakePrimitiveParam, _a19, "FakePrimitiveParam");
19060
- _a20 = entityKind;
19132
+ __publicField(FakePrimitiveParam, _a20, "FakePrimitiveParam");
19133
+ _a21 = entityKind;
19061
19134
  StringChunk = class {
19062
19135
  constructor(value) {
19063
19136
  __publicField(this, "value");
@@ -19067,8 +19140,8 @@ var init_sql = __esm({
19067
19140
  return new SQL([this]);
19068
19141
  }
19069
19142
  };
19070
- __publicField(StringChunk, _a20, "StringChunk");
19071
- _a21 = entityKind;
19143
+ __publicField(StringChunk, _a21, "StringChunk");
19144
+ _a22 = entityKind;
19072
19145
  _SQL = class _SQL {
19073
19146
  constructor(queryChunks) {
19074
19147
  /** @internal */
@@ -19130,9 +19203,9 @@ var init_sql = __esm({
19130
19203
  inlineParams: inlineParams || chunk.shouldInlineParams
19131
19204
  });
19132
19205
  }
19133
- if (is(chunk, Table2)) {
19134
- const schemaName = chunk[Table2.Symbol.Schema];
19135
- const tableName = chunk[Table2.Symbol.Name];
19206
+ if (is(chunk, Table)) {
19207
+ const schemaName = chunk[Table.Symbol.Schema];
19208
+ const tableName = chunk[Table.Symbol.Name];
19136
19209
  return {
19137
19210
  sql: schemaName === void 0 ? escapeName(tableName) : escapeName(schemaName) + "." + escapeName(tableName),
19138
19211
  params: []
@@ -19143,7 +19216,7 @@ var init_sql = __esm({
19143
19216
  if (_config.invokeSource === "indexes") {
19144
19217
  return { sql: escapeName(columnName), params: [] };
19145
19218
  }
19146
- return { sql: escapeName(chunk.table[Table2.Symbol.Name]) + "." + escapeName(columnName), params: [] };
19219
+ return { sql: escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName), params: [] };
19147
19220
  }
19148
19221
  if (is(chunk, View)) {
19149
19222
  const schemaName = chunk[ViewBaseConfig].schema;
@@ -19255,9 +19328,9 @@ var init_sql = __esm({
19255
19328
  return condition ? this : void 0;
19256
19329
  }
19257
19330
  };
19258
- __publicField(_SQL, _a21, "SQL");
19331
+ __publicField(_SQL, _a22, "SQL");
19259
19332
  SQL = _SQL;
19260
- _a22 = entityKind;
19333
+ _a23 = entityKind;
19261
19334
  Name = class {
19262
19335
  constructor(value) {
19263
19336
  __publicField(this, "brand");
@@ -19267,7 +19340,7 @@ var init_sql = __esm({
19267
19340
  return new SQL([this]);
19268
19341
  }
19269
19342
  };
19270
- __publicField(Name, _a22, "Name");
19343
+ __publicField(Name, _a23, "Name");
19271
19344
  noopDecoder = {
19272
19345
  mapFromDriverValue: (value) => value
19273
19346
  };
@@ -19278,7 +19351,7 @@ var init_sql = __esm({
19278
19351
  ...noopDecoder,
19279
19352
  ...noopEncoder
19280
19353
  };
19281
- _a23 = entityKind;
19354
+ _a24 = entityKind;
19282
19355
  Param = class {
19283
19356
  /**
19284
19357
  * @param value - Parameter value
@@ -19293,7 +19366,7 @@ var init_sql = __esm({
19293
19366
  return new SQL([this]);
19294
19367
  }
19295
19368
  };
19296
- __publicField(Param, _a23, "Param");
19369
+ __publicField(Param, _a24, "Param");
19297
19370
  ((sql2) => {
19298
19371
  function empty() {
19299
19372
  return new SQL([]);
@@ -19353,7 +19426,7 @@ var init_sql = __esm({
19353
19426
  let Aliased = _Aliased;
19354
19427
  SQL2.Aliased = Aliased;
19355
19428
  })(SQL || (SQL = {}));
19356
- _a24 = entityKind;
19429
+ _a25 = entityKind;
19357
19430
  Placeholder = class {
19358
19431
  constructor(name2) {
19359
19432
  this.name = name2;
@@ -19362,12 +19435,12 @@ var init_sql = __esm({
19362
19435
  return new SQL([this]);
19363
19436
  }
19364
19437
  };
19365
- __publicField(Placeholder, _a24, "Placeholder");
19366
- _b10 = entityKind, _a25 = ViewBaseConfig;
19438
+ __publicField(Placeholder, _a25, "Placeholder");
19439
+ _b10 = entityKind, _a26 = ViewBaseConfig;
19367
19440
  View = class {
19368
19441
  constructor({ name: name2, schema: schema4, selectedFields, query }) {
19369
19442
  /** @internal */
19370
- __publicField(this, _a25);
19443
+ __publicField(this, _a26);
19371
19444
  this[ViewBaseConfig] = {
19372
19445
  name: name2,
19373
19446
  originalName: name2,
@@ -19386,7 +19459,7 @@ var init_sql = __esm({
19386
19459
  Column2.prototype.getSQL = function() {
19387
19460
  return new SQL([this]);
19388
19461
  };
19389
- Table2.prototype.getSQL = function() {
19462
+ Table.prototype.getSQL = function() {
19390
19463
  return new SQL([this]);
19391
19464
  };
19392
19465
  Subquery.prototype.getSQL = function() {
@@ -19425,7 +19498,7 @@ function mapColumnsInSQLToAlias(query, alias) {
19425
19498
  return c;
19426
19499
  }));
19427
19500
  }
19428
- var _a26, ColumnAliasProxyHandler, _a27, TableAliasProxyHandler, _a28, RelationTableAliasProxyHandler;
19501
+ var _a27, ColumnAliasProxyHandler, _a28, TableAliasProxyHandler, _a29, RelationTableAliasProxyHandler;
19429
19502
  var init_alias = __esm({
19430
19503
  "../drizzle-orm/dist/alias.js"() {
19431
19504
  "use strict";
@@ -19434,7 +19507,7 @@ var init_alias = __esm({
19434
19507
  init_sql();
19435
19508
  init_table();
19436
19509
  init_view_common();
19437
- _a26 = entityKind;
19510
+ _a27 = entityKind;
19438
19511
  ColumnAliasProxyHandler = class {
19439
19512
  constructor(table4) {
19440
19513
  this.table = table4;
@@ -19446,21 +19519,21 @@ var init_alias = __esm({
19446
19519
  return columnObj[prop];
19447
19520
  }
19448
19521
  };
19449
- __publicField(ColumnAliasProxyHandler, _a26, "ColumnAliasProxyHandler");
19450
- _a27 = entityKind;
19522
+ __publicField(ColumnAliasProxyHandler, _a27, "ColumnAliasProxyHandler");
19523
+ _a28 = entityKind;
19451
19524
  TableAliasProxyHandler = class {
19452
19525
  constructor(alias, replaceOriginalName) {
19453
19526
  this.alias = alias;
19454
19527
  this.replaceOriginalName = replaceOriginalName;
19455
19528
  }
19456
19529
  get(target, prop) {
19457
- if (prop === Table2.Symbol.IsAlias) {
19530
+ if (prop === Table.Symbol.IsAlias) {
19458
19531
  return true;
19459
19532
  }
19460
- if (prop === Table2.Symbol.Name) {
19533
+ if (prop === Table.Symbol.Name) {
19461
19534
  return this.alias;
19462
19535
  }
19463
- if (this.replaceOriginalName && prop === Table2.Symbol.OriginalName) {
19536
+ if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) {
19464
19537
  return this.alias;
19465
19538
  }
19466
19539
  if (prop === ViewBaseConfig) {
@@ -19470,8 +19543,8 @@ var init_alias = __esm({
19470
19543
  isAlias: true
19471
19544
  };
19472
19545
  }
19473
- if (prop === Table2.Symbol.Columns) {
19474
- const columns = target[Table2.Symbol.Columns];
19546
+ if (prop === Table.Symbol.Columns) {
19547
+ const columns = target[Table.Symbol.Columns];
19475
19548
  if (!columns) {
19476
19549
  return columns;
19477
19550
  }
@@ -19491,8 +19564,8 @@ var init_alias = __esm({
19491
19564
  return value;
19492
19565
  }
19493
19566
  };
19494
- __publicField(TableAliasProxyHandler, _a27, "TableAliasProxyHandler");
19495
- _a28 = entityKind;
19567
+ __publicField(TableAliasProxyHandler, _a28, "TableAliasProxyHandler");
19568
+ _a29 = entityKind;
19496
19569
  RelationTableAliasProxyHandler = class {
19497
19570
  constructor(alias) {
19498
19571
  this.alias = alias;
@@ -19504,36 +19577,36 @@ var init_alias = __esm({
19504
19577
  return target[prop];
19505
19578
  }
19506
19579
  };
19507
- __publicField(RelationTableAliasProxyHandler, _a28, "RelationTableAliasProxyHandler");
19580
+ __publicField(RelationTableAliasProxyHandler, _a29, "RelationTableAliasProxyHandler");
19508
19581
  }
19509
19582
  });
19510
19583
 
19511
19584
  // ../drizzle-orm/dist/errors.js
19512
- var _a29, _b11, DrizzleError, _a30, _b12, TransactionRollbackError;
19585
+ var _a30, _b11, DrizzleError, _a31, _b12, TransactionRollbackError;
19513
19586
  var init_errors = __esm({
19514
19587
  "../drizzle-orm/dist/errors.js"() {
19515
19588
  "use strict";
19516
19589
  init_entity();
19517
- DrizzleError = class extends (_b11 = Error, _a29 = entityKind, _b11) {
19590
+ DrizzleError = class extends (_b11 = Error, _a30 = entityKind, _b11) {
19518
19591
  constructor({ message, cause }) {
19519
19592
  super(message);
19520
19593
  this.name = "DrizzleError";
19521
19594
  this.cause = cause;
19522
19595
  }
19523
19596
  };
19524
- __publicField(DrizzleError, _a29, "DrizzleError");
19525
- TransactionRollbackError = class extends (_b12 = DrizzleError, _a30 = entityKind, _b12) {
19597
+ __publicField(DrizzleError, _a30, "DrizzleError");
19598
+ TransactionRollbackError = class extends (_b12 = DrizzleError, _a31 = entityKind, _b12) {
19526
19599
  constructor() {
19527
19600
  super({ message: "Rollback" });
19528
19601
  }
19529
19602
  };
19530
- __publicField(TransactionRollbackError, _a30, "TransactionRollbackError");
19603
+ __publicField(TransactionRollbackError, _a31, "TransactionRollbackError");
19531
19604
  }
19532
19605
  });
19533
19606
 
19534
19607
  // ../drizzle-orm/dist/sql/expressions/conditions.js
19535
19608
  function bindIfParam(value, column4) {
19536
- if (isDriverValueEncoder(column4) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column2) && !is(value, Table2) && !is(value, View)) {
19609
+ if (isDriverValueEncoder(column4) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column2) && !is(value, Table) && !is(value, View)) {
19537
19610
  return new Param(value, column4);
19538
19611
  }
19539
19612
  return value;
@@ -19718,19 +19791,19 @@ var init_expressions2 = __esm({
19718
19791
  });
19719
19792
 
19720
19793
  // ../drizzle-orm/dist/logger.js
19721
- var _a31, ConsoleLogWriter, _a32, DefaultLogger, _a33, NoopLogger;
19794
+ var _a32, ConsoleLogWriter, _a33, DefaultLogger, _a34, NoopLogger;
19722
19795
  var init_logger = __esm({
19723
19796
  "../drizzle-orm/dist/logger.js"() {
19724
19797
  "use strict";
19725
19798
  init_entity();
19726
- _a31 = entityKind;
19799
+ _a32 = entityKind;
19727
19800
  ConsoleLogWriter = class {
19728
19801
  write(message) {
19729
19802
  console.log(message);
19730
19803
  }
19731
19804
  };
19732
- __publicField(ConsoleLogWriter, _a31, "ConsoleLogWriter");
19733
- _a32 = entityKind;
19805
+ __publicField(ConsoleLogWriter, _a32, "ConsoleLogWriter");
19806
+ _a33 = entityKind;
19734
19807
  DefaultLogger = class {
19735
19808
  constructor(config) {
19736
19809
  __publicField(this, "writer");
@@ -19748,13 +19821,13 @@ var init_logger = __esm({
19748
19821
  this.writer.write(`Query: ${query}${paramsStr}`);
19749
19822
  }
19750
19823
  };
19751
- __publicField(DefaultLogger, _a32, "DefaultLogger");
19752
- _a33 = entityKind;
19824
+ __publicField(DefaultLogger, _a33, "DefaultLogger");
19825
+ _a34 = entityKind;
19753
19826
  NoopLogger = class {
19754
19827
  logQuery() {
19755
19828
  }
19756
19829
  };
19757
- __publicField(NoopLogger, _a33, "NoopLogger");
19830
+ __publicField(NoopLogger, _a34, "NoopLogger");
19758
19831
  }
19759
19832
  });
19760
19833
 
@@ -19766,15 +19839,15 @@ var init_operations = __esm({
19766
19839
  });
19767
19840
 
19768
19841
  // ../drizzle-orm/dist/query-promise.js
19769
- var _a34, _b13, QueryPromise;
19842
+ var _a35, _b13, QueryPromise;
19770
19843
  var init_query_promise = __esm({
19771
19844
  "../drizzle-orm/dist/query-promise.js"() {
19772
19845
  "use strict";
19773
19846
  init_entity();
19774
- _b13 = entityKind, _a34 = Symbol.toStringTag;
19847
+ _b13 = entityKind, _a35 = Symbol.toStringTag;
19775
19848
  QueryPromise = class {
19776
19849
  constructor() {
19777
- __publicField(this, _a34, "QueryPromise");
19850
+ __publicField(this, _a35, "QueryPromise");
19778
19851
  }
19779
19852
  catch(onRejected) {
19780
19853
  return this.then(void 0, onRejected);
@@ -19853,8 +19926,8 @@ function orderSelectedFields(fields, pathPrefix) {
19853
19926
  const newPath = pathPrefix ? [...pathPrefix, name2] : [name2];
19854
19927
  if (is(field, Column2) || is(field, SQL) || is(field, SQL.Aliased)) {
19855
19928
  result.push({ path: newPath, field });
19856
- } else if (is(field, Table2)) {
19857
- result.push(...orderSelectedFields(field[Table2.Symbol.Columns], newPath));
19929
+ } else if (is(field, Table)) {
19930
+ result.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));
19858
19931
  } else {
19859
19932
  result.push(...orderSelectedFields(field, newPath));
19860
19933
  }
@@ -19879,7 +19952,7 @@ function mapUpdateSet(table4, values) {
19879
19952
  if (is(value, SQL)) {
19880
19953
  return [key, value];
19881
19954
  } else {
19882
- return [key, new Param(value, table4[Table2.Symbol.Columns][key])];
19955
+ return [key, new Param(value, table4[Table.Symbol.Columns][key])];
19883
19956
  }
19884
19957
  });
19885
19958
  if (entries.length === 0) {
@@ -19901,10 +19974,10 @@ function applyMixins(baseClass, extendedClasses) {
19901
19974
  }
19902
19975
  }
19903
19976
  function getTableColumns(table4) {
19904
- return table4[Table2.Symbol.Columns];
19977
+ return table4[Table.Symbol.Columns];
19905
19978
  }
19906
19979
  function getTableLikeName(table4) {
19907
- return is(table4, Subquery) ? table4._.alias : is(table4, View) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : table4[Table2.Symbol.IsAlias] ? table4[Table2.Symbol.Name] : table4[Table2.Symbol.BaseName];
19980
+ return is(table4, Subquery) ? table4._.alias : is(table4, View) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : table4[Table.Symbol.IsAlias] ? table4[Table.Symbol.Name] : table4[Table.Symbol.BaseName];
19908
19981
  }
19909
19982
  function getColumnNameAndConfig(a, b) {
19910
19983
  return {
@@ -19925,13 +19998,13 @@ var init_utils2 = __esm({
19925
19998
  });
19926
19999
 
19927
20000
  // ../drizzle-orm/dist/pg-core/columns/int.common.js
19928
- var _a35, _b14, PgIntColumnBaseBuilder;
20001
+ var _a36, _b14, PgIntColumnBaseBuilder;
19929
20002
  var init_int_common = __esm({
19930
20003
  "../drizzle-orm/dist/pg-core/columns/int.common.js"() {
19931
20004
  "use strict";
19932
20005
  init_entity();
19933
20006
  init_common2();
19934
- PgIntColumnBaseBuilder = class extends (_b14 = PgColumnBuilder, _a35 = entityKind, _b14) {
20007
+ PgIntColumnBaseBuilder = class extends (_b14 = PgColumnBuilder, _a36 = entityKind, _b14) {
19935
20008
  generatedAlwaysAsIdentity(sequence) {
19936
20009
  if (sequence) {
19937
20010
  const { name: name2, ...options } = sequence;
@@ -19967,7 +20040,7 @@ var init_int_common = __esm({
19967
20040
  return this;
19968
20041
  }
19969
20042
  };
19970
- __publicField(PgIntColumnBaseBuilder, _a35, "PgIntColumnBaseBuilder");
20043
+ __publicField(PgIntColumnBaseBuilder, _a36, "PgIntColumnBaseBuilder");
19971
20044
  }
19972
20045
  });
19973
20046
 
@@ -19979,7 +20052,7 @@ function bigint(a, b) {
19979
20052
  }
19980
20053
  return new PgBigInt64Builder(name2);
19981
20054
  }
19982
- var _a36, _b15, PgBigInt53Builder, _a37, _b16, PgBigInt53, _a38, _b17, PgBigInt64Builder, _a39, _b18, PgBigInt64;
20055
+ var _a37, _b15, PgBigInt53Builder, _a38, _b16, PgBigInt53, _a39, _b17, PgBigInt64Builder, _a40, _b18, PgBigInt64;
19983
20056
  var init_bigint = __esm({
19984
20057
  "../drizzle-orm/dist/pg-core/columns/bigint.js"() {
19985
20058
  "use strict";
@@ -19987,7 +20060,7 @@ var init_bigint = __esm({
19987
20060
  init_utils2();
19988
20061
  init_common2();
19989
20062
  init_int_common();
19990
- PgBigInt53Builder = class extends (_b15 = PgIntColumnBaseBuilder, _a36 = entityKind, _b15) {
20063
+ PgBigInt53Builder = class extends (_b15 = PgIntColumnBaseBuilder, _a37 = entityKind, _b15) {
19991
20064
  constructor(name2) {
19992
20065
  super(name2, "number", "PgBigInt53");
19993
20066
  }
@@ -19996,8 +20069,8 @@ var init_bigint = __esm({
19996
20069
  return new PgBigInt53(table4, this.config);
19997
20070
  }
19998
20071
  };
19999
- __publicField(PgBigInt53Builder, _a36, "PgBigInt53Builder");
20000
- PgBigInt53 = class extends (_b16 = PgColumn, _a37 = entityKind, _b16) {
20072
+ __publicField(PgBigInt53Builder, _a37, "PgBigInt53Builder");
20073
+ PgBigInt53 = class extends (_b16 = PgColumn, _a38 = entityKind, _b16) {
20001
20074
  getSQLType() {
20002
20075
  return "bigint";
20003
20076
  }
@@ -20008,8 +20081,8 @@ var init_bigint = __esm({
20008
20081
  return Number(value);
20009
20082
  }
20010
20083
  };
20011
- __publicField(PgBigInt53, _a37, "PgBigInt53");
20012
- PgBigInt64Builder = class extends (_b17 = PgIntColumnBaseBuilder, _a38 = entityKind, _b17) {
20084
+ __publicField(PgBigInt53, _a38, "PgBigInt53");
20085
+ PgBigInt64Builder = class extends (_b17 = PgIntColumnBaseBuilder, _a39 = entityKind, _b17) {
20013
20086
  constructor(name2) {
20014
20087
  super(name2, "bigint", "PgBigInt64");
20015
20088
  }
@@ -20021,8 +20094,8 @@ var init_bigint = __esm({
20021
20094
  );
20022
20095
  }
20023
20096
  };
20024
- __publicField(PgBigInt64Builder, _a38, "PgBigInt64Builder");
20025
- PgBigInt64 = class extends (_b18 = PgColumn, _a39 = entityKind, _b18) {
20097
+ __publicField(PgBigInt64Builder, _a39, "PgBigInt64Builder");
20098
+ PgBigInt64 = class extends (_b18 = PgColumn, _a40 = entityKind, _b18) {
20026
20099
  getSQLType() {
20027
20100
  return "bigint";
20028
20101
  }
@@ -20031,7 +20104,7 @@ var init_bigint = __esm({
20031
20104
  return BigInt(value);
20032
20105
  }
20033
20106
  };
20034
- __publicField(PgBigInt64, _a39, "PgBigInt64");
20107
+ __publicField(PgBigInt64, _a40, "PgBigInt64");
20035
20108
  }
20036
20109
  });
20037
20110
 
@@ -20043,14 +20116,14 @@ function bigserial(a, b) {
20043
20116
  }
20044
20117
  return new PgBigSerial64Builder(name2);
20045
20118
  }
20046
- var _a40, _b19, PgBigSerial53Builder, _a41, _b20, PgBigSerial53, _a42, _b21, PgBigSerial64Builder, _a43, _b22, PgBigSerial64;
20119
+ var _a41, _b19, PgBigSerial53Builder, _a42, _b20, PgBigSerial53, _a43, _b21, PgBigSerial64Builder, _a44, _b22, PgBigSerial64;
20047
20120
  var init_bigserial = __esm({
20048
20121
  "../drizzle-orm/dist/pg-core/columns/bigserial.js"() {
20049
20122
  "use strict";
20050
20123
  init_entity();
20051
20124
  init_utils2();
20052
20125
  init_common2();
20053
- PgBigSerial53Builder = class extends (_b19 = PgColumnBuilder, _a40 = entityKind, _b19) {
20126
+ PgBigSerial53Builder = class extends (_b19 = PgColumnBuilder, _a41 = entityKind, _b19) {
20054
20127
  constructor(name2) {
20055
20128
  super(name2, "number", "PgBigSerial53");
20056
20129
  this.config.hasDefault = true;
@@ -20064,8 +20137,8 @@ var init_bigserial = __esm({
20064
20137
  );
20065
20138
  }
20066
20139
  };
20067
- __publicField(PgBigSerial53Builder, _a40, "PgBigSerial53Builder");
20068
- PgBigSerial53 = class extends (_b20 = PgColumn, _a41 = entityKind, _b20) {
20140
+ __publicField(PgBigSerial53Builder, _a41, "PgBigSerial53Builder");
20141
+ PgBigSerial53 = class extends (_b20 = PgColumn, _a42 = entityKind, _b20) {
20069
20142
  getSQLType() {
20070
20143
  return "bigserial";
20071
20144
  }
@@ -20076,8 +20149,8 @@ var init_bigserial = __esm({
20076
20149
  return Number(value);
20077
20150
  }
20078
20151
  };
20079
- __publicField(PgBigSerial53, _a41, "PgBigSerial53");
20080
- PgBigSerial64Builder = class extends (_b21 = PgColumnBuilder, _a42 = entityKind, _b21) {
20152
+ __publicField(PgBigSerial53, _a42, "PgBigSerial53");
20153
+ PgBigSerial64Builder = class extends (_b21 = PgColumnBuilder, _a43 = entityKind, _b21) {
20081
20154
  constructor(name2) {
20082
20155
  super(name2, "bigint", "PgBigSerial64");
20083
20156
  this.config.hasDefault = true;
@@ -20090,8 +20163,8 @@ var init_bigserial = __esm({
20090
20163
  );
20091
20164
  }
20092
20165
  };
20093
- __publicField(PgBigSerial64Builder, _a42, "PgBigSerial64Builder");
20094
- PgBigSerial64 = class extends (_b22 = PgColumn, _a43 = entityKind, _b22) {
20166
+ __publicField(PgBigSerial64Builder, _a43, "PgBigSerial64Builder");
20167
+ PgBigSerial64 = class extends (_b22 = PgColumn, _a44 = entityKind, _b22) {
20095
20168
  getSQLType() {
20096
20169
  return "bigserial";
20097
20170
  }
@@ -20100,7 +20173,7 @@ var init_bigserial = __esm({
20100
20173
  return BigInt(value);
20101
20174
  }
20102
20175
  };
20103
- __publicField(PgBigSerial64, _a43, "PgBigSerial64");
20176
+ __publicField(PgBigSerial64, _a44, "PgBigSerial64");
20104
20177
  }
20105
20178
  });
20106
20179
 
@@ -20108,13 +20181,13 @@ var init_bigserial = __esm({
20108
20181
  function boolean(name2) {
20109
20182
  return new PgBooleanBuilder(name2 ?? "");
20110
20183
  }
20111
- var _a44, _b23, PgBooleanBuilder, _a45, _b24, PgBoolean;
20184
+ var _a45, _b23, PgBooleanBuilder, _a46, _b24, PgBoolean;
20112
20185
  var init_boolean = __esm({
20113
20186
  "../drizzle-orm/dist/pg-core/columns/boolean.js"() {
20114
20187
  "use strict";
20115
20188
  init_entity();
20116
20189
  init_common2();
20117
- PgBooleanBuilder = class extends (_b23 = PgColumnBuilder, _a44 = entityKind, _b23) {
20190
+ PgBooleanBuilder = class extends (_b23 = PgColumnBuilder, _a45 = entityKind, _b23) {
20118
20191
  constructor(name2) {
20119
20192
  super(name2, "boolean", "PgBoolean");
20120
20193
  }
@@ -20123,13 +20196,13 @@ var init_boolean = __esm({
20123
20196
  return new PgBoolean(table4, this.config);
20124
20197
  }
20125
20198
  };
20126
- __publicField(PgBooleanBuilder, _a44, "PgBooleanBuilder");
20127
- PgBoolean = class extends (_b24 = PgColumn, _a45 = entityKind, _b24) {
20199
+ __publicField(PgBooleanBuilder, _a45, "PgBooleanBuilder");
20200
+ PgBoolean = class extends (_b24 = PgColumn, _a46 = entityKind, _b24) {
20128
20201
  getSQLType() {
20129
20202
  return "boolean";
20130
20203
  }
20131
20204
  };
20132
- __publicField(PgBoolean, _a45, "PgBoolean");
20205
+ __publicField(PgBoolean, _a46, "PgBoolean");
20133
20206
  }
20134
20207
  });
20135
20208
 
@@ -20138,14 +20211,14 @@ function char(a, b = {}) {
20138
20211
  const { name: name2, config } = getColumnNameAndConfig(a, b);
20139
20212
  return new PgCharBuilder(name2, config);
20140
20213
  }
20141
- var _a46, _b25, PgCharBuilder, _a47, _b26, PgChar;
20214
+ var _a47, _b25, PgCharBuilder, _a48, _b26, PgChar;
20142
20215
  var init_char = __esm({
20143
20216
  "../drizzle-orm/dist/pg-core/columns/char.js"() {
20144
20217
  "use strict";
20145
20218
  init_entity();
20146
20219
  init_utils2();
20147
20220
  init_common2();
20148
- PgCharBuilder = class extends (_b25 = PgColumnBuilder, _a46 = entityKind, _b25) {
20221
+ PgCharBuilder = class extends (_b25 = PgColumnBuilder, _a47 = entityKind, _b25) {
20149
20222
  constructor(name2, config) {
20150
20223
  super(name2, "string", "PgChar");
20151
20224
  this.config.length = config.length;
@@ -20156,8 +20229,8 @@ var init_char = __esm({
20156
20229
  return new PgChar(table4, this.config);
20157
20230
  }
20158
20231
  };
20159
- __publicField(PgCharBuilder, _a46, "PgCharBuilder");
20160
- PgChar = class extends (_b26 = PgColumn, _a47 = entityKind, _b26) {
20232
+ __publicField(PgCharBuilder, _a47, "PgCharBuilder");
20233
+ PgChar = class extends (_b26 = PgColumn, _a48 = entityKind, _b26) {
20161
20234
  constructor() {
20162
20235
  super(...arguments);
20163
20236
  __publicField(this, "length", this.config.length);
@@ -20167,7 +20240,7 @@ var init_char = __esm({
20167
20240
  return this.length === void 0 ? `char` : `char(${this.length})`;
20168
20241
  }
20169
20242
  };
20170
- __publicField(PgChar, _a47, "PgChar");
20243
+ __publicField(PgChar, _a48, "PgChar");
20171
20244
  }
20172
20245
  });
20173
20246
 
@@ -20175,13 +20248,13 @@ var init_char = __esm({
20175
20248
  function cidr(name2) {
20176
20249
  return new PgCidrBuilder(name2 ?? "");
20177
20250
  }
20178
- var _a48, _b27, PgCidrBuilder, _a49, _b28, PgCidr;
20251
+ var _a49, _b27, PgCidrBuilder, _a50, _b28, PgCidr;
20179
20252
  var init_cidr = __esm({
20180
20253
  "../drizzle-orm/dist/pg-core/columns/cidr.js"() {
20181
20254
  "use strict";
20182
20255
  init_entity();
20183
20256
  init_common2();
20184
- PgCidrBuilder = class extends (_b27 = PgColumnBuilder, _a48 = entityKind, _b27) {
20257
+ PgCidrBuilder = class extends (_b27 = PgColumnBuilder, _a49 = entityKind, _b27) {
20185
20258
  constructor(name2) {
20186
20259
  super(name2, "string", "PgCidr");
20187
20260
  }
@@ -20190,13 +20263,13 @@ var init_cidr = __esm({
20190
20263
  return new PgCidr(table4, this.config);
20191
20264
  }
20192
20265
  };
20193
- __publicField(PgCidrBuilder, _a48, "PgCidrBuilder");
20194
- PgCidr = class extends (_b28 = PgColumn, _a49 = entityKind, _b28) {
20266
+ __publicField(PgCidrBuilder, _a49, "PgCidrBuilder");
20267
+ PgCidr = class extends (_b28 = PgColumn, _a50 = entityKind, _b28) {
20195
20268
  getSQLType() {
20196
20269
  return "cidr";
20197
20270
  }
20198
20271
  };
20199
- __publicField(PgCidr, _a49, "PgCidr");
20272
+ __publicField(PgCidr, _a50, "PgCidr");
20200
20273
  }
20201
20274
  });
20202
20275
 
@@ -20207,14 +20280,14 @@ function customType(customTypeParams) {
20207
20280
  return new PgCustomColumnBuilder(name2, config, customTypeParams);
20208
20281
  };
20209
20282
  }
20210
- var _a50, _b29, PgCustomColumnBuilder, _a51, _b30, PgCustomColumn;
20283
+ var _a51, _b29, PgCustomColumnBuilder, _a52, _b30, PgCustomColumn;
20211
20284
  var init_custom = __esm({
20212
20285
  "../drizzle-orm/dist/pg-core/columns/custom.js"() {
20213
20286
  "use strict";
20214
20287
  init_entity();
20215
20288
  init_utils2();
20216
20289
  init_common2();
20217
- PgCustomColumnBuilder = class extends (_b29 = PgColumnBuilder, _a50 = entityKind, _b29) {
20290
+ PgCustomColumnBuilder = class extends (_b29 = PgColumnBuilder, _a51 = entityKind, _b29) {
20218
20291
  constructor(name2, fieldConfig, customTypeParams) {
20219
20292
  super(name2, "custom", "PgCustomColumn");
20220
20293
  this.config.fieldConfig = fieldConfig;
@@ -20228,8 +20301,8 @@ var init_custom = __esm({
20228
20301
  );
20229
20302
  }
20230
20303
  };
20231
- __publicField(PgCustomColumnBuilder, _a50, "PgCustomColumnBuilder");
20232
- PgCustomColumn = class extends (_b30 = PgColumn, _a51 = entityKind, _b30) {
20304
+ __publicField(PgCustomColumnBuilder, _a51, "PgCustomColumnBuilder");
20305
+ PgCustomColumn = class extends (_b30 = PgColumn, _a52 = entityKind, _b30) {
20233
20306
  constructor(table4, config) {
20234
20307
  super(table4, config);
20235
20308
  __publicField(this, "sqlName");
@@ -20249,24 +20322,24 @@ var init_custom = __esm({
20249
20322
  return typeof this.mapTo === "function" ? this.mapTo(value) : value;
20250
20323
  }
20251
20324
  };
20252
- __publicField(PgCustomColumn, _a51, "PgCustomColumn");
20325
+ __publicField(PgCustomColumn, _a52, "PgCustomColumn");
20253
20326
  }
20254
20327
  });
20255
20328
 
20256
20329
  // ../drizzle-orm/dist/pg-core/columns/date.common.js
20257
- var _a52, _b31, PgDateColumnBaseBuilder;
20330
+ var _a53, _b31, PgDateColumnBaseBuilder;
20258
20331
  var init_date_common = __esm({
20259
20332
  "../drizzle-orm/dist/pg-core/columns/date.common.js"() {
20260
20333
  "use strict";
20261
20334
  init_entity();
20262
20335
  init_sql();
20263
20336
  init_common2();
20264
- PgDateColumnBaseBuilder = class extends (_b31 = PgColumnBuilder, _a52 = entityKind, _b31) {
20337
+ PgDateColumnBaseBuilder = class extends (_b31 = PgColumnBuilder, _a53 = entityKind, _b31) {
20265
20338
  defaultNow() {
20266
20339
  return this.default(sql`now()`);
20267
20340
  }
20268
20341
  };
20269
- __publicField(PgDateColumnBaseBuilder, _a52, "PgDateColumnBaseBuilder");
20342
+ __publicField(PgDateColumnBaseBuilder, _a53, "PgDateColumnBaseBuilder");
20270
20343
  }
20271
20344
  });
20272
20345
 
@@ -20278,7 +20351,7 @@ function date(a, b) {
20278
20351
  }
20279
20352
  return new PgDateStringBuilder(name2);
20280
20353
  }
20281
- var _a53, _b32, PgDateBuilder, _a54, _b33, PgDate, _a55, _b34, PgDateStringBuilder, _a56, _b35, PgDateString;
20354
+ var _a54, _b32, PgDateBuilder, _a55, _b33, PgDate, _a56, _b34, PgDateStringBuilder, _a57, _b35, PgDateString;
20282
20355
  var init_date = __esm({
20283
20356
  "../drizzle-orm/dist/pg-core/columns/date.js"() {
20284
20357
  "use strict";
@@ -20286,7 +20359,7 @@ var init_date = __esm({
20286
20359
  init_utils2();
20287
20360
  init_common2();
20288
20361
  init_date_common();
20289
- PgDateBuilder = class extends (_b32 = PgDateColumnBaseBuilder, _a53 = entityKind, _b32) {
20362
+ PgDateBuilder = class extends (_b32 = PgDateColumnBaseBuilder, _a54 = entityKind, _b32) {
20290
20363
  constructor(name2) {
20291
20364
  super(name2, "date", "PgDate");
20292
20365
  }
@@ -20295,8 +20368,8 @@ var init_date = __esm({
20295
20368
  return new PgDate(table4, this.config);
20296
20369
  }
20297
20370
  };
20298
- __publicField(PgDateBuilder, _a53, "PgDateBuilder");
20299
- PgDate = class extends (_b33 = PgColumn, _a54 = entityKind, _b33) {
20371
+ __publicField(PgDateBuilder, _a54, "PgDateBuilder");
20372
+ PgDate = class extends (_b33 = PgColumn, _a55 = entityKind, _b33) {
20300
20373
  getSQLType() {
20301
20374
  return "date";
20302
20375
  }
@@ -20307,8 +20380,8 @@ var init_date = __esm({
20307
20380
  return value.toISOString();
20308
20381
  }
20309
20382
  };
20310
- __publicField(PgDate, _a54, "PgDate");
20311
- PgDateStringBuilder = class extends (_b34 = PgDateColumnBaseBuilder, _a55 = entityKind, _b34) {
20383
+ __publicField(PgDate, _a55, "PgDate");
20384
+ PgDateStringBuilder = class extends (_b34 = PgDateColumnBaseBuilder, _a56 = entityKind, _b34) {
20312
20385
  constructor(name2) {
20313
20386
  super(name2, "string", "PgDateString");
20314
20387
  }
@@ -20320,13 +20393,13 @@ var init_date = __esm({
20320
20393
  );
20321
20394
  }
20322
20395
  };
20323
- __publicField(PgDateStringBuilder, _a55, "PgDateStringBuilder");
20324
- PgDateString = class extends (_b35 = PgColumn, _a56 = entityKind, _b35) {
20396
+ __publicField(PgDateStringBuilder, _a56, "PgDateStringBuilder");
20397
+ PgDateString = class extends (_b35 = PgColumn, _a57 = entityKind, _b35) {
20325
20398
  getSQLType() {
20326
20399
  return "date";
20327
20400
  }
20328
20401
  };
20329
- __publicField(PgDateString, _a56, "PgDateString");
20402
+ __publicField(PgDateString, _a57, "PgDateString");
20330
20403
  }
20331
20404
  });
20332
20405
 
@@ -20334,13 +20407,13 @@ var init_date = __esm({
20334
20407
  function doublePrecision(name2) {
20335
20408
  return new PgDoublePrecisionBuilder(name2 ?? "");
20336
20409
  }
20337
- var _a57, _b36, PgDoublePrecisionBuilder, _a58, _b37, PgDoublePrecision;
20410
+ var _a58, _b36, PgDoublePrecisionBuilder, _a59, _b37, PgDoublePrecision;
20338
20411
  var init_double_precision = __esm({
20339
20412
  "../drizzle-orm/dist/pg-core/columns/double-precision.js"() {
20340
20413
  "use strict";
20341
20414
  init_entity();
20342
20415
  init_common2();
20343
- PgDoublePrecisionBuilder = class extends (_b36 = PgColumnBuilder, _a57 = entityKind, _b36) {
20416
+ PgDoublePrecisionBuilder = class extends (_b36 = PgColumnBuilder, _a58 = entityKind, _b36) {
20344
20417
  constructor(name2) {
20345
20418
  super(name2, "number", "PgDoublePrecision");
20346
20419
  }
@@ -20352,8 +20425,8 @@ var init_double_precision = __esm({
20352
20425
  );
20353
20426
  }
20354
20427
  };
20355
- __publicField(PgDoublePrecisionBuilder, _a57, "PgDoublePrecisionBuilder");
20356
- PgDoublePrecision = class extends (_b37 = PgColumn, _a58 = entityKind, _b37) {
20428
+ __publicField(PgDoublePrecisionBuilder, _a58, "PgDoublePrecisionBuilder");
20429
+ PgDoublePrecision = class extends (_b37 = PgColumn, _a59 = entityKind, _b37) {
20357
20430
  getSQLType() {
20358
20431
  return "double precision";
20359
20432
  }
@@ -20364,7 +20437,7 @@ var init_double_precision = __esm({
20364
20437
  return value;
20365
20438
  }
20366
20439
  };
20367
- __publicField(PgDoublePrecision, _a58, "PgDoublePrecision");
20440
+ __publicField(PgDoublePrecision, _a59, "PgDoublePrecision");
20368
20441
  }
20369
20442
  });
20370
20443
 
@@ -20372,13 +20445,13 @@ var init_double_precision = __esm({
20372
20445
  function inet(name2) {
20373
20446
  return new PgInetBuilder(name2 ?? "");
20374
20447
  }
20375
- var _a59, _b38, PgInetBuilder, _a60, _b39, PgInet;
20448
+ var _a60, _b38, PgInetBuilder, _a61, _b39, PgInet;
20376
20449
  var init_inet = __esm({
20377
20450
  "../drizzle-orm/dist/pg-core/columns/inet.js"() {
20378
20451
  "use strict";
20379
20452
  init_entity();
20380
20453
  init_common2();
20381
- PgInetBuilder = class extends (_b38 = PgColumnBuilder, _a59 = entityKind, _b38) {
20454
+ PgInetBuilder = class extends (_b38 = PgColumnBuilder, _a60 = entityKind, _b38) {
20382
20455
  constructor(name2) {
20383
20456
  super(name2, "string", "PgInet");
20384
20457
  }
@@ -20387,13 +20460,13 @@ var init_inet = __esm({
20387
20460
  return new PgInet(table4, this.config);
20388
20461
  }
20389
20462
  };
20390
- __publicField(PgInetBuilder, _a59, "PgInetBuilder");
20391
- PgInet = class extends (_b39 = PgColumn, _a60 = entityKind, _b39) {
20463
+ __publicField(PgInetBuilder, _a60, "PgInetBuilder");
20464
+ PgInet = class extends (_b39 = PgColumn, _a61 = entityKind, _b39) {
20392
20465
  getSQLType() {
20393
20466
  return "inet";
20394
20467
  }
20395
20468
  };
20396
- __publicField(PgInet, _a60, "PgInet");
20469
+ __publicField(PgInet, _a61, "PgInet");
20397
20470
  }
20398
20471
  });
20399
20472
 
@@ -20401,14 +20474,14 @@ var init_inet = __esm({
20401
20474
  function integer(name2) {
20402
20475
  return new PgIntegerBuilder(name2 ?? "");
20403
20476
  }
20404
- var _a61, _b40, PgIntegerBuilder, _a62, _b41, PgInteger;
20477
+ var _a62, _b40, PgIntegerBuilder, _a63, _b41, PgInteger;
20405
20478
  var init_integer = __esm({
20406
20479
  "../drizzle-orm/dist/pg-core/columns/integer.js"() {
20407
20480
  "use strict";
20408
20481
  init_entity();
20409
20482
  init_common2();
20410
20483
  init_int_common();
20411
- PgIntegerBuilder = class extends (_b40 = PgIntColumnBaseBuilder, _a61 = entityKind, _b40) {
20484
+ PgIntegerBuilder = class extends (_b40 = PgIntColumnBaseBuilder, _a62 = entityKind, _b40) {
20412
20485
  constructor(name2) {
20413
20486
  super(name2, "number", "PgInteger");
20414
20487
  }
@@ -20417,8 +20490,8 @@ var init_integer = __esm({
20417
20490
  return new PgInteger(table4, this.config);
20418
20491
  }
20419
20492
  };
20420
- __publicField(PgIntegerBuilder, _a61, "PgIntegerBuilder");
20421
- PgInteger = class extends (_b41 = PgColumn, _a62 = entityKind, _b41) {
20493
+ __publicField(PgIntegerBuilder, _a62, "PgIntegerBuilder");
20494
+ PgInteger = class extends (_b41 = PgColumn, _a63 = entityKind, _b41) {
20422
20495
  getSQLType() {
20423
20496
  return "integer";
20424
20497
  }
@@ -20429,7 +20502,7 @@ var init_integer = __esm({
20429
20502
  return value;
20430
20503
  }
20431
20504
  };
20432
- __publicField(PgInteger, _a62, "PgInteger");
20505
+ __publicField(PgInteger, _a63, "PgInteger");
20433
20506
  }
20434
20507
  });
20435
20508
 
@@ -20438,14 +20511,14 @@ function interval(a, b = {}) {
20438
20511
  const { name: name2, config } = getColumnNameAndConfig(a, b);
20439
20512
  return new PgIntervalBuilder(name2, config);
20440
20513
  }
20441
- var _a63, _b42, PgIntervalBuilder, _a64, _b43, PgInterval;
20514
+ var _a64, _b42, PgIntervalBuilder, _a65, _b43, PgInterval;
20442
20515
  var init_interval = __esm({
20443
20516
  "../drizzle-orm/dist/pg-core/columns/interval.js"() {
20444
20517
  "use strict";
20445
20518
  init_entity();
20446
20519
  init_utils2();
20447
20520
  init_common2();
20448
- PgIntervalBuilder = class extends (_b42 = PgColumnBuilder, _a63 = entityKind, _b42) {
20521
+ PgIntervalBuilder = class extends (_b42 = PgColumnBuilder, _a64 = entityKind, _b42) {
20449
20522
  constructor(name2, intervalConfig) {
20450
20523
  super(name2, "string", "PgInterval");
20451
20524
  this.config.intervalConfig = intervalConfig;
@@ -20455,8 +20528,8 @@ var init_interval = __esm({
20455
20528
  return new PgInterval(table4, this.config);
20456
20529
  }
20457
20530
  };
20458
- __publicField(PgIntervalBuilder, _a63, "PgIntervalBuilder");
20459
- PgInterval = class extends (_b43 = PgColumn, _a64 = entityKind, _b43) {
20531
+ __publicField(PgIntervalBuilder, _a64, "PgIntervalBuilder");
20532
+ PgInterval = class extends (_b43 = PgColumn, _a65 = entityKind, _b43) {
20460
20533
  constructor() {
20461
20534
  super(...arguments);
20462
20535
  __publicField(this, "fields", this.config.intervalConfig.fields);
@@ -20468,7 +20541,7 @@ var init_interval = __esm({
20468
20541
  return `interval${fields}${precision}`;
20469
20542
  }
20470
20543
  };
20471
- __publicField(PgInterval, _a64, "PgInterval");
20544
+ __publicField(PgInterval, _a65, "PgInterval");
20472
20545
  }
20473
20546
  });
20474
20547
 
@@ -20476,13 +20549,13 @@ var init_interval = __esm({
20476
20549
  function json(name2) {
20477
20550
  return new PgJsonBuilder(name2 ?? "");
20478
20551
  }
20479
- var _a65, _b44, PgJsonBuilder, _a66, _b45, PgJson;
20552
+ var _a66, _b44, PgJsonBuilder, _a67, _b45, PgJson;
20480
20553
  var init_json = __esm({
20481
20554
  "../drizzle-orm/dist/pg-core/columns/json.js"() {
20482
20555
  "use strict";
20483
20556
  init_entity();
20484
20557
  init_common2();
20485
- PgJsonBuilder = class extends (_b44 = PgColumnBuilder, _a65 = entityKind, _b44) {
20558
+ PgJsonBuilder = class extends (_b44 = PgColumnBuilder, _a66 = entityKind, _b44) {
20486
20559
  constructor(name2) {
20487
20560
  super(name2, "json", "PgJson");
20488
20561
  }
@@ -20491,8 +20564,8 @@ var init_json = __esm({
20491
20564
  return new PgJson(table4, this.config);
20492
20565
  }
20493
20566
  };
20494
- __publicField(PgJsonBuilder, _a65, "PgJsonBuilder");
20495
- PgJson = class extends (_b45 = PgColumn, _a66 = entityKind, _b45) {
20567
+ __publicField(PgJsonBuilder, _a66, "PgJsonBuilder");
20568
+ PgJson = class extends (_b45 = PgColumn, _a67 = entityKind, _b45) {
20496
20569
  constructor(table4, config) {
20497
20570
  super(table4, config);
20498
20571
  }
@@ -20513,7 +20586,7 @@ var init_json = __esm({
20513
20586
  return value;
20514
20587
  }
20515
20588
  };
20516
- __publicField(PgJson, _a66, "PgJson");
20589
+ __publicField(PgJson, _a67, "PgJson");
20517
20590
  }
20518
20591
  });
20519
20592
 
@@ -20521,13 +20594,13 @@ var init_json = __esm({
20521
20594
  function jsonb(name2) {
20522
20595
  return new PgJsonbBuilder(name2 ?? "");
20523
20596
  }
20524
- var _a67, _b46, PgJsonbBuilder, _a68, _b47, PgJsonb;
20597
+ var _a68, _b46, PgJsonbBuilder, _a69, _b47, PgJsonb;
20525
20598
  var init_jsonb = __esm({
20526
20599
  "../drizzle-orm/dist/pg-core/columns/jsonb.js"() {
20527
20600
  "use strict";
20528
20601
  init_entity();
20529
20602
  init_common2();
20530
- PgJsonbBuilder = class extends (_b46 = PgColumnBuilder, _a67 = entityKind, _b46) {
20603
+ PgJsonbBuilder = class extends (_b46 = PgColumnBuilder, _a68 = entityKind, _b46) {
20531
20604
  constructor(name2) {
20532
20605
  super(name2, "json", "PgJsonb");
20533
20606
  }
@@ -20536,8 +20609,8 @@ var init_jsonb = __esm({
20536
20609
  return new PgJsonb(table4, this.config);
20537
20610
  }
20538
20611
  };
20539
- __publicField(PgJsonbBuilder, _a67, "PgJsonbBuilder");
20540
- PgJsonb = class extends (_b47 = PgColumn, _a68 = entityKind, _b47) {
20612
+ __publicField(PgJsonbBuilder, _a68, "PgJsonbBuilder");
20613
+ PgJsonb = class extends (_b47 = PgColumn, _a69 = entityKind, _b47) {
20541
20614
  constructor(table4, config) {
20542
20615
  super(table4, config);
20543
20616
  }
@@ -20558,7 +20631,7 @@ var init_jsonb = __esm({
20558
20631
  return value;
20559
20632
  }
20560
20633
  };
20561
- __publicField(PgJsonb, _a68, "PgJsonb");
20634
+ __publicField(PgJsonb, _a69, "PgJsonb");
20562
20635
  }
20563
20636
  });
20564
20637
 
@@ -20570,14 +20643,14 @@ function line(a, b) {
20570
20643
  }
20571
20644
  return new PgLineABCBuilder(name2);
20572
20645
  }
20573
- var _a69, _b48, PgLineBuilder, _a70, _b49, PgLineTuple, _a71, _b50, PgLineABCBuilder, _a72, _b51, PgLineABC;
20646
+ var _a70, _b48, PgLineBuilder, _a71, _b49, PgLineTuple, _a72, _b50, PgLineABCBuilder, _a73, _b51, PgLineABC;
20574
20647
  var init_line = __esm({
20575
20648
  "../drizzle-orm/dist/pg-core/columns/line.js"() {
20576
20649
  "use strict";
20577
20650
  init_entity();
20578
20651
  init_utils2();
20579
20652
  init_common2();
20580
- PgLineBuilder = class extends (_b48 = PgColumnBuilder, _a69 = entityKind, _b48) {
20653
+ PgLineBuilder = class extends (_b48 = PgColumnBuilder, _a70 = entityKind, _b48) {
20581
20654
  constructor(name2) {
20582
20655
  super(name2, "array", "PgLine");
20583
20656
  }
@@ -20589,8 +20662,8 @@ var init_line = __esm({
20589
20662
  );
20590
20663
  }
20591
20664
  };
20592
- __publicField(PgLineBuilder, _a69, "PgLineBuilder");
20593
- PgLineTuple = class extends (_b49 = PgColumn, _a70 = entityKind, _b49) {
20665
+ __publicField(PgLineBuilder, _a70, "PgLineBuilder");
20666
+ PgLineTuple = class extends (_b49 = PgColumn, _a71 = entityKind, _b49) {
20594
20667
  getSQLType() {
20595
20668
  return "line";
20596
20669
  }
@@ -20602,8 +20675,8 @@ var init_line = __esm({
20602
20675
  return `{${value[0]},${value[1]},${value[2]}}`;
20603
20676
  }
20604
20677
  };
20605
- __publicField(PgLineTuple, _a70, "PgLine");
20606
- PgLineABCBuilder = class extends (_b50 = PgColumnBuilder, _a71 = entityKind, _b50) {
20678
+ __publicField(PgLineTuple, _a71, "PgLine");
20679
+ PgLineABCBuilder = class extends (_b50 = PgColumnBuilder, _a72 = entityKind, _b50) {
20607
20680
  constructor(name2) {
20608
20681
  super(name2, "json", "PgLineABC");
20609
20682
  }
@@ -20615,8 +20688,8 @@ var init_line = __esm({
20615
20688
  );
20616
20689
  }
20617
20690
  };
20618
- __publicField(PgLineABCBuilder, _a71, "PgLineABCBuilder");
20619
- PgLineABC = class extends (_b51 = PgColumn, _a72 = entityKind, _b51) {
20691
+ __publicField(PgLineABCBuilder, _a72, "PgLineABCBuilder");
20692
+ PgLineABC = class extends (_b51 = PgColumn, _a73 = entityKind, _b51) {
20620
20693
  getSQLType() {
20621
20694
  return "line";
20622
20695
  }
@@ -20628,7 +20701,7 @@ var init_line = __esm({
20628
20701
  return `{${value.a},${value.b},${value.c}}`;
20629
20702
  }
20630
20703
  };
20631
- __publicField(PgLineABC, _a72, "PgLineABC");
20704
+ __publicField(PgLineABC, _a73, "PgLineABC");
20632
20705
  }
20633
20706
  });
20634
20707
 
@@ -20636,13 +20709,13 @@ var init_line = __esm({
20636
20709
  function macaddr(name2) {
20637
20710
  return new PgMacaddrBuilder(name2 ?? "");
20638
20711
  }
20639
- var _a73, _b52, PgMacaddrBuilder, _a74, _b53, PgMacaddr;
20712
+ var _a74, _b52, PgMacaddrBuilder, _a75, _b53, PgMacaddr;
20640
20713
  var init_macaddr = __esm({
20641
20714
  "../drizzle-orm/dist/pg-core/columns/macaddr.js"() {
20642
20715
  "use strict";
20643
20716
  init_entity();
20644
20717
  init_common2();
20645
- PgMacaddrBuilder = class extends (_b52 = PgColumnBuilder, _a73 = entityKind, _b52) {
20718
+ PgMacaddrBuilder = class extends (_b52 = PgColumnBuilder, _a74 = entityKind, _b52) {
20646
20719
  constructor(name2) {
20647
20720
  super(name2, "string", "PgMacaddr");
20648
20721
  }
@@ -20651,13 +20724,13 @@ var init_macaddr = __esm({
20651
20724
  return new PgMacaddr(table4, this.config);
20652
20725
  }
20653
20726
  };
20654
- __publicField(PgMacaddrBuilder, _a73, "PgMacaddrBuilder");
20655
- PgMacaddr = class extends (_b53 = PgColumn, _a74 = entityKind, _b53) {
20727
+ __publicField(PgMacaddrBuilder, _a74, "PgMacaddrBuilder");
20728
+ PgMacaddr = class extends (_b53 = PgColumn, _a75 = entityKind, _b53) {
20656
20729
  getSQLType() {
20657
20730
  return "macaddr";
20658
20731
  }
20659
20732
  };
20660
- __publicField(PgMacaddr, _a74, "PgMacaddr");
20733
+ __publicField(PgMacaddr, _a75, "PgMacaddr");
20661
20734
  }
20662
20735
  });
20663
20736
 
@@ -20665,13 +20738,13 @@ var init_macaddr = __esm({
20665
20738
  function macaddr8(name2) {
20666
20739
  return new PgMacaddr8Builder(name2 ?? "");
20667
20740
  }
20668
- var _a75, _b54, PgMacaddr8Builder, _a76, _b55, PgMacaddr8;
20741
+ var _a76, _b54, PgMacaddr8Builder, _a77, _b55, PgMacaddr8;
20669
20742
  var init_macaddr8 = __esm({
20670
20743
  "../drizzle-orm/dist/pg-core/columns/macaddr8.js"() {
20671
20744
  "use strict";
20672
20745
  init_entity();
20673
20746
  init_common2();
20674
- PgMacaddr8Builder = class extends (_b54 = PgColumnBuilder, _a75 = entityKind, _b54) {
20747
+ PgMacaddr8Builder = class extends (_b54 = PgColumnBuilder, _a76 = entityKind, _b54) {
20675
20748
  constructor(name2) {
20676
20749
  super(name2, "string", "PgMacaddr8");
20677
20750
  }
@@ -20680,13 +20753,13 @@ var init_macaddr8 = __esm({
20680
20753
  return new PgMacaddr8(table4, this.config);
20681
20754
  }
20682
20755
  };
20683
- __publicField(PgMacaddr8Builder, _a75, "PgMacaddr8Builder");
20684
- PgMacaddr8 = class extends (_b55 = PgColumn, _a76 = entityKind, _b55) {
20756
+ __publicField(PgMacaddr8Builder, _a76, "PgMacaddr8Builder");
20757
+ PgMacaddr8 = class extends (_b55 = PgColumn, _a77 = entityKind, _b55) {
20685
20758
  getSQLType() {
20686
20759
  return "macaddr8";
20687
20760
  }
20688
20761
  };
20689
- __publicField(PgMacaddr8, _a76, "PgMacaddr8");
20762
+ __publicField(PgMacaddr8, _a77, "PgMacaddr8");
20690
20763
  }
20691
20764
  });
20692
20765
 
@@ -20695,14 +20768,14 @@ function numeric(a, b) {
20695
20768
  const { name: name2, config } = getColumnNameAndConfig(a, b);
20696
20769
  return new PgNumericBuilder(name2, config?.precision, config?.scale);
20697
20770
  }
20698
- var _a77, _b56, PgNumericBuilder, _a78, _b57, PgNumeric;
20771
+ var _a78, _b56, PgNumericBuilder, _a79, _b57, PgNumeric;
20699
20772
  var init_numeric = __esm({
20700
20773
  "../drizzle-orm/dist/pg-core/columns/numeric.js"() {
20701
20774
  "use strict";
20702
20775
  init_entity();
20703
20776
  init_utils2();
20704
20777
  init_common2();
20705
- PgNumericBuilder = class extends (_b56 = PgColumnBuilder, _a77 = entityKind, _b56) {
20778
+ PgNumericBuilder = class extends (_b56 = PgColumnBuilder, _a78 = entityKind, _b56) {
20706
20779
  constructor(name2, precision, scale) {
20707
20780
  super(name2, "string", "PgNumeric");
20708
20781
  this.config.precision = precision;
@@ -20713,8 +20786,8 @@ var init_numeric = __esm({
20713
20786
  return new PgNumeric(table4, this.config);
20714
20787
  }
20715
20788
  };
20716
- __publicField(PgNumericBuilder, _a77, "PgNumericBuilder");
20717
- PgNumeric = class extends (_b57 = PgColumn, _a78 = entityKind, _b57) {
20789
+ __publicField(PgNumericBuilder, _a78, "PgNumericBuilder");
20790
+ PgNumeric = class extends (_b57 = PgColumn, _a79 = entityKind, _b57) {
20718
20791
  constructor(table4, config) {
20719
20792
  super(table4, config);
20720
20793
  __publicField(this, "precision");
@@ -20732,7 +20805,7 @@ var init_numeric = __esm({
20732
20805
  }
20733
20806
  }
20734
20807
  };
20735
- __publicField(PgNumeric, _a78, "PgNumeric");
20808
+ __publicField(PgNumeric, _a79, "PgNumeric");
20736
20809
  }
20737
20810
  });
20738
20811
 
@@ -20744,14 +20817,14 @@ function point(a, b) {
20744
20817
  }
20745
20818
  return new PgPointObjectBuilder(name2);
20746
20819
  }
20747
- var _a79, _b58, PgPointTupleBuilder, _a80, _b59, PgPointTuple, _a81, _b60, PgPointObjectBuilder, _a82, _b61, PgPointObject;
20820
+ var _a80, _b58, PgPointTupleBuilder, _a81, _b59, PgPointTuple, _a82, _b60, PgPointObjectBuilder, _a83, _b61, PgPointObject;
20748
20821
  var init_point = __esm({
20749
20822
  "../drizzle-orm/dist/pg-core/columns/point.js"() {
20750
20823
  "use strict";
20751
20824
  init_entity();
20752
20825
  init_utils2();
20753
20826
  init_common2();
20754
- PgPointTupleBuilder = class extends (_b58 = PgColumnBuilder, _a79 = entityKind, _b58) {
20827
+ PgPointTupleBuilder = class extends (_b58 = PgColumnBuilder, _a80 = entityKind, _b58) {
20755
20828
  constructor(name2) {
20756
20829
  super(name2, "array", "PgPointTuple");
20757
20830
  }
@@ -20763,8 +20836,8 @@ var init_point = __esm({
20763
20836
  );
20764
20837
  }
20765
20838
  };
20766
- __publicField(PgPointTupleBuilder, _a79, "PgPointTupleBuilder");
20767
- PgPointTuple = class extends (_b59 = PgColumn, _a80 = entityKind, _b59) {
20839
+ __publicField(PgPointTupleBuilder, _a80, "PgPointTupleBuilder");
20840
+ PgPointTuple = class extends (_b59 = PgColumn, _a81 = entityKind, _b59) {
20768
20841
  getSQLType() {
20769
20842
  return "point";
20770
20843
  }
@@ -20779,8 +20852,8 @@ var init_point = __esm({
20779
20852
  return `(${value[0]},${value[1]})`;
20780
20853
  }
20781
20854
  };
20782
- __publicField(PgPointTuple, _a80, "PgPointTuple");
20783
- PgPointObjectBuilder = class extends (_b60 = PgColumnBuilder, _a81 = entityKind, _b60) {
20855
+ __publicField(PgPointTuple, _a81, "PgPointTuple");
20856
+ PgPointObjectBuilder = class extends (_b60 = PgColumnBuilder, _a82 = entityKind, _b60) {
20784
20857
  constructor(name2) {
20785
20858
  super(name2, "json", "PgPointObject");
20786
20859
  }
@@ -20792,8 +20865,8 @@ var init_point = __esm({
20792
20865
  );
20793
20866
  }
20794
20867
  };
20795
- __publicField(PgPointObjectBuilder, _a81, "PgPointObjectBuilder");
20796
- PgPointObject = class extends (_b61 = PgColumn, _a82 = entityKind, _b61) {
20868
+ __publicField(PgPointObjectBuilder, _a82, "PgPointObjectBuilder");
20869
+ PgPointObject = class extends (_b61 = PgColumn, _a83 = entityKind, _b61) {
20797
20870
  getSQLType() {
20798
20871
  return "point";
20799
20872
  }
@@ -20808,7 +20881,7 @@ var init_point = __esm({
20808
20881
  return `(${value.x},${value.y})`;
20809
20882
  }
20810
20883
  };
20811
- __publicField(PgPointObject, _a82, "PgPointObject");
20884
+ __publicField(PgPointObject, _a83, "PgPointObject");
20812
20885
  }
20813
20886
  });
20814
20887
 
@@ -20864,7 +20937,7 @@ function geometry(a, b) {
20864
20937
  }
20865
20938
  return new PgGeometryObjectBuilder(name2);
20866
20939
  }
20867
- var _a83, _b62, PgGeometryBuilder, _a84, _b63, PgGeometry, _a85, _b64, PgGeometryObjectBuilder, _a86, _b65, PgGeometryObject;
20940
+ var _a84, _b62, PgGeometryBuilder, _a85, _b63, PgGeometry, _a86, _b64, PgGeometryObjectBuilder, _a87, _b65, PgGeometryObject;
20868
20941
  var init_geometry = __esm({
20869
20942
  "../drizzle-orm/dist/pg-core/columns/postgis_extension/geometry.js"() {
20870
20943
  "use strict";
@@ -20872,7 +20945,7 @@ var init_geometry = __esm({
20872
20945
  init_utils2();
20873
20946
  init_common2();
20874
20947
  init_utils3();
20875
- PgGeometryBuilder = class extends (_b62 = PgColumnBuilder, _a83 = entityKind, _b62) {
20948
+ PgGeometryBuilder = class extends (_b62 = PgColumnBuilder, _a84 = entityKind, _b62) {
20876
20949
  constructor(name2) {
20877
20950
  super(name2, "array", "PgGeometry");
20878
20951
  }
@@ -20884,8 +20957,8 @@ var init_geometry = __esm({
20884
20957
  );
20885
20958
  }
20886
20959
  };
20887
- __publicField(PgGeometryBuilder, _a83, "PgGeometryBuilder");
20888
- PgGeometry = class extends (_b63 = PgColumn, _a84 = entityKind, _b63) {
20960
+ __publicField(PgGeometryBuilder, _a84, "PgGeometryBuilder");
20961
+ PgGeometry = class extends (_b63 = PgColumn, _a85 = entityKind, _b63) {
20889
20962
  getSQLType() {
20890
20963
  return "geometry(point)";
20891
20964
  }
@@ -20896,8 +20969,8 @@ var init_geometry = __esm({
20896
20969
  return `point(${value[0]} ${value[1]})`;
20897
20970
  }
20898
20971
  };
20899
- __publicField(PgGeometry, _a84, "PgGeometry");
20900
- PgGeometryObjectBuilder = class extends (_b64 = PgColumnBuilder, _a85 = entityKind, _b64) {
20972
+ __publicField(PgGeometry, _a85, "PgGeometry");
20973
+ PgGeometryObjectBuilder = class extends (_b64 = PgColumnBuilder, _a86 = entityKind, _b64) {
20901
20974
  constructor(name2) {
20902
20975
  super(name2, "json", "PgGeometryObject");
20903
20976
  }
@@ -20909,8 +20982,8 @@ var init_geometry = __esm({
20909
20982
  );
20910
20983
  }
20911
20984
  };
20912
- __publicField(PgGeometryObjectBuilder, _a85, "PgGeometryObjectBuilder");
20913
- PgGeometryObject = class extends (_b65 = PgColumn, _a86 = entityKind, _b65) {
20985
+ __publicField(PgGeometryObjectBuilder, _a86, "PgGeometryObjectBuilder");
20986
+ PgGeometryObject = class extends (_b65 = PgColumn, _a87 = entityKind, _b65) {
20914
20987
  getSQLType() {
20915
20988
  return "geometry(point)";
20916
20989
  }
@@ -20922,7 +20995,7 @@ var init_geometry = __esm({
20922
20995
  return `point(${value.x} ${value.y})`;
20923
20996
  }
20924
20997
  };
20925
- __publicField(PgGeometryObject, _a86, "PgGeometryObject");
20998
+ __publicField(PgGeometryObject, _a87, "PgGeometryObject");
20926
20999
  }
20927
21000
  });
20928
21001
 
@@ -20930,13 +21003,13 @@ var init_geometry = __esm({
20930
21003
  function real(name2) {
20931
21004
  return new PgRealBuilder(name2 ?? "");
20932
21005
  }
20933
- var _a87, _b66, PgRealBuilder, _a88, _b67, PgReal;
21006
+ var _a88, _b66, PgRealBuilder, _a89, _b67, PgReal;
20934
21007
  var init_real = __esm({
20935
21008
  "../drizzle-orm/dist/pg-core/columns/real.js"() {
20936
21009
  "use strict";
20937
21010
  init_entity();
20938
21011
  init_common2();
20939
- PgRealBuilder = class extends (_b66 = PgColumnBuilder, _a87 = entityKind, _b66) {
21012
+ PgRealBuilder = class extends (_b66 = PgColumnBuilder, _a88 = entityKind, _b66) {
20940
21013
  constructor(name2, length) {
20941
21014
  super(name2, "number", "PgReal");
20942
21015
  this.config.length = length;
@@ -20946,8 +21019,8 @@ var init_real = __esm({
20946
21019
  return new PgReal(table4, this.config);
20947
21020
  }
20948
21021
  };
20949
- __publicField(PgRealBuilder, _a87, "PgRealBuilder");
20950
- PgReal = class extends (_b67 = PgColumn, _a88 = entityKind, _b67) {
21022
+ __publicField(PgRealBuilder, _a88, "PgRealBuilder");
21023
+ PgReal = class extends (_b67 = PgColumn, _a89 = entityKind, _b67) {
20951
21024
  constructor(table4, config) {
20952
21025
  super(table4, config);
20953
21026
  __publicField(this, "mapFromDriverValue", (value) => {
@@ -20961,7 +21034,7 @@ var init_real = __esm({
20961
21034
  return "real";
20962
21035
  }
20963
21036
  };
20964
- __publicField(PgReal, _a88, "PgReal");
21037
+ __publicField(PgReal, _a89, "PgReal");
20965
21038
  }
20966
21039
  });
20967
21040
 
@@ -20969,13 +21042,13 @@ var init_real = __esm({
20969
21042
  function serial(name2) {
20970
21043
  return new PgSerialBuilder(name2 ?? "");
20971
21044
  }
20972
- var _a89, _b68, PgSerialBuilder, _a90, _b69, PgSerial;
21045
+ var _a90, _b68, PgSerialBuilder, _a91, _b69, PgSerial;
20973
21046
  var init_serial = __esm({
20974
21047
  "../drizzle-orm/dist/pg-core/columns/serial.js"() {
20975
21048
  "use strict";
20976
21049
  init_entity();
20977
21050
  init_common2();
20978
- PgSerialBuilder = class extends (_b68 = PgColumnBuilder, _a89 = entityKind, _b68) {
21051
+ PgSerialBuilder = class extends (_b68 = PgColumnBuilder, _a90 = entityKind, _b68) {
20979
21052
  constructor(name2) {
20980
21053
  super(name2, "number", "PgSerial");
20981
21054
  this.config.hasDefault = true;
@@ -20986,13 +21059,13 @@ var init_serial = __esm({
20986
21059
  return new PgSerial(table4, this.config);
20987
21060
  }
20988
21061
  };
20989
- __publicField(PgSerialBuilder, _a89, "PgSerialBuilder");
20990
- PgSerial = class extends (_b69 = PgColumn, _a90 = entityKind, _b69) {
21062
+ __publicField(PgSerialBuilder, _a90, "PgSerialBuilder");
21063
+ PgSerial = class extends (_b69 = PgColumn, _a91 = entityKind, _b69) {
20991
21064
  getSQLType() {
20992
21065
  return "serial";
20993
21066
  }
20994
21067
  };
20995
- __publicField(PgSerial, _a90, "PgSerial");
21068
+ __publicField(PgSerial, _a91, "PgSerial");
20996
21069
  }
20997
21070
  });
20998
21071
 
@@ -21000,14 +21073,14 @@ var init_serial = __esm({
21000
21073
  function smallint(name2) {
21001
21074
  return new PgSmallIntBuilder(name2 ?? "");
21002
21075
  }
21003
- var _a91, _b70, PgSmallIntBuilder, _a92, _b71, PgSmallInt;
21076
+ var _a92, _b70, PgSmallIntBuilder, _a93, _b71, PgSmallInt;
21004
21077
  var init_smallint = __esm({
21005
21078
  "../drizzle-orm/dist/pg-core/columns/smallint.js"() {
21006
21079
  "use strict";
21007
21080
  init_entity();
21008
21081
  init_common2();
21009
21082
  init_int_common();
21010
- PgSmallIntBuilder = class extends (_b70 = PgIntColumnBaseBuilder, _a91 = entityKind, _b70) {
21083
+ PgSmallIntBuilder = class extends (_b70 = PgIntColumnBaseBuilder, _a92 = entityKind, _b70) {
21011
21084
  constructor(name2) {
21012
21085
  super(name2, "number", "PgSmallInt");
21013
21086
  }
@@ -21016,8 +21089,8 @@ var init_smallint = __esm({
21016
21089
  return new PgSmallInt(table4, this.config);
21017
21090
  }
21018
21091
  };
21019
- __publicField(PgSmallIntBuilder, _a91, "PgSmallIntBuilder");
21020
- PgSmallInt = class extends (_b71 = PgColumn, _a92 = entityKind, _b71) {
21092
+ __publicField(PgSmallIntBuilder, _a92, "PgSmallIntBuilder");
21093
+ PgSmallInt = class extends (_b71 = PgColumn, _a93 = entityKind, _b71) {
21021
21094
  constructor() {
21022
21095
  super(...arguments);
21023
21096
  __publicField(this, "mapFromDriverValue", (value) => {
@@ -21031,7 +21104,7 @@ var init_smallint = __esm({
21031
21104
  return "smallint";
21032
21105
  }
21033
21106
  };
21034
- __publicField(PgSmallInt, _a92, "PgSmallInt");
21107
+ __publicField(PgSmallInt, _a93, "PgSmallInt");
21035
21108
  }
21036
21109
  });
21037
21110
 
@@ -21039,13 +21112,13 @@ var init_smallint = __esm({
21039
21112
  function smallserial(name2) {
21040
21113
  return new PgSmallSerialBuilder(name2 ?? "");
21041
21114
  }
21042
- var _a93, _b72, PgSmallSerialBuilder, _a94, _b73, PgSmallSerial;
21115
+ var _a94, _b72, PgSmallSerialBuilder, _a95, _b73, PgSmallSerial;
21043
21116
  var init_smallserial = __esm({
21044
21117
  "../drizzle-orm/dist/pg-core/columns/smallserial.js"() {
21045
21118
  "use strict";
21046
21119
  init_entity();
21047
21120
  init_common2();
21048
- PgSmallSerialBuilder = class extends (_b72 = PgColumnBuilder, _a93 = entityKind, _b72) {
21121
+ PgSmallSerialBuilder = class extends (_b72 = PgColumnBuilder, _a94 = entityKind, _b72) {
21049
21122
  constructor(name2) {
21050
21123
  super(name2, "number", "PgSmallSerial");
21051
21124
  this.config.hasDefault = true;
@@ -21059,13 +21132,13 @@ var init_smallserial = __esm({
21059
21132
  );
21060
21133
  }
21061
21134
  };
21062
- __publicField(PgSmallSerialBuilder, _a93, "PgSmallSerialBuilder");
21063
- PgSmallSerial = class extends (_b73 = PgColumn, _a94 = entityKind, _b73) {
21135
+ __publicField(PgSmallSerialBuilder, _a94, "PgSmallSerialBuilder");
21136
+ PgSmallSerial = class extends (_b73 = PgColumn, _a95 = entityKind, _b73) {
21064
21137
  getSQLType() {
21065
21138
  return "smallserial";
21066
21139
  }
21067
21140
  };
21068
- __publicField(PgSmallSerial, _a94, "PgSmallSerial");
21141
+ __publicField(PgSmallSerial, _a95, "PgSmallSerial");
21069
21142
  }
21070
21143
  });
21071
21144
 
@@ -21074,14 +21147,14 @@ function text(a, b = {}) {
21074
21147
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21075
21148
  return new PgTextBuilder(name2, config);
21076
21149
  }
21077
- var _a95, _b74, PgTextBuilder, _a96, _b75, PgText;
21150
+ var _a96, _b74, PgTextBuilder, _a97, _b75, PgText;
21078
21151
  var init_text = __esm({
21079
21152
  "../drizzle-orm/dist/pg-core/columns/text.js"() {
21080
21153
  "use strict";
21081
21154
  init_entity();
21082
21155
  init_utils2();
21083
21156
  init_common2();
21084
- PgTextBuilder = class extends (_b74 = PgColumnBuilder, _a95 = entityKind, _b74) {
21157
+ PgTextBuilder = class extends (_b74 = PgColumnBuilder, _a96 = entityKind, _b74) {
21085
21158
  constructor(name2, config) {
21086
21159
  super(name2, "string", "PgText");
21087
21160
  this.config.enumValues = config.enum;
@@ -21091,8 +21164,8 @@ var init_text = __esm({
21091
21164
  return new PgText(table4, this.config);
21092
21165
  }
21093
21166
  };
21094
- __publicField(PgTextBuilder, _a95, "PgTextBuilder");
21095
- PgText = class extends (_b75 = PgColumn, _a96 = entityKind, _b75) {
21167
+ __publicField(PgTextBuilder, _a96, "PgTextBuilder");
21168
+ PgText = class extends (_b75 = PgColumn, _a97 = entityKind, _b75) {
21096
21169
  constructor() {
21097
21170
  super(...arguments);
21098
21171
  __publicField(this, "enumValues", this.config.enumValues);
@@ -21101,7 +21174,7 @@ var init_text = __esm({
21101
21174
  return "text";
21102
21175
  }
21103
21176
  };
21104
- __publicField(PgText, _a96, "PgText");
21177
+ __publicField(PgText, _a97, "PgText");
21105
21178
  }
21106
21179
  });
21107
21180
 
@@ -21110,7 +21183,7 @@ function time(a, b = {}) {
21110
21183
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21111
21184
  return new PgTimeBuilder(name2, config.withTimezone ?? false, config.precision);
21112
21185
  }
21113
- var _a97, _b76, PgTimeBuilder, _a98, _b77, PgTime;
21186
+ var _a98, _b76, PgTimeBuilder, _a99, _b77, PgTime;
21114
21187
  var init_time = __esm({
21115
21188
  "../drizzle-orm/dist/pg-core/columns/time.js"() {
21116
21189
  "use strict";
@@ -21118,7 +21191,7 @@ var init_time = __esm({
21118
21191
  init_utils2();
21119
21192
  init_common2();
21120
21193
  init_date_common();
21121
- PgTimeBuilder = class extends (_b76 = PgDateColumnBaseBuilder, _a97 = entityKind, _b76) {
21194
+ PgTimeBuilder = class extends (_b76 = PgDateColumnBaseBuilder, _a98 = entityKind, _b76) {
21122
21195
  constructor(name2, withTimezone, precision) {
21123
21196
  super(name2, "string", "PgTime");
21124
21197
  this.withTimezone = withTimezone;
@@ -21131,8 +21204,8 @@ var init_time = __esm({
21131
21204
  return new PgTime(table4, this.config);
21132
21205
  }
21133
21206
  };
21134
- __publicField(PgTimeBuilder, _a97, "PgTimeBuilder");
21135
- PgTime = class extends (_b77 = PgColumn, _a98 = entityKind, _b77) {
21207
+ __publicField(PgTimeBuilder, _a98, "PgTimeBuilder");
21208
+ PgTime = class extends (_b77 = PgColumn, _a99 = entityKind, _b77) {
21136
21209
  constructor(table4, config) {
21137
21210
  super(table4, config);
21138
21211
  __publicField(this, "withTimezone");
@@ -21145,7 +21218,7 @@ var init_time = __esm({
21145
21218
  return `time${precision}${this.withTimezone ? " with time zone" : ""}`;
21146
21219
  }
21147
21220
  };
21148
- __publicField(PgTime, _a98, "PgTime");
21221
+ __publicField(PgTime, _a99, "PgTime");
21149
21222
  }
21150
21223
  });
21151
21224
 
@@ -21157,7 +21230,7 @@ function timestamp(a, b = {}) {
21157
21230
  }
21158
21231
  return new PgTimestampBuilder(name2, config?.withTimezone ?? false, config?.precision);
21159
21232
  }
21160
- var _a99, _b78, PgTimestampBuilder, _a100, _b79, PgTimestamp, _a101, _b80, PgTimestampStringBuilder, _a102, _b81, PgTimestampString;
21233
+ var _a100, _b78, PgTimestampBuilder, _a101, _b79, PgTimestamp, _a102, _b80, PgTimestampStringBuilder, _a103, _b81, PgTimestampString;
21161
21234
  var init_timestamp = __esm({
21162
21235
  "../drizzle-orm/dist/pg-core/columns/timestamp.js"() {
21163
21236
  "use strict";
@@ -21165,7 +21238,7 @@ var init_timestamp = __esm({
21165
21238
  init_utils2();
21166
21239
  init_common2();
21167
21240
  init_date_common();
21168
- PgTimestampBuilder = class extends (_b78 = PgDateColumnBaseBuilder, _a99 = entityKind, _b78) {
21241
+ PgTimestampBuilder = class extends (_b78 = PgDateColumnBaseBuilder, _a100 = entityKind, _b78) {
21169
21242
  constructor(name2, withTimezone, precision) {
21170
21243
  super(name2, "date", "PgTimestamp");
21171
21244
  this.config.withTimezone = withTimezone;
@@ -21176,8 +21249,8 @@ var init_timestamp = __esm({
21176
21249
  return new PgTimestamp(table4, this.config);
21177
21250
  }
21178
21251
  };
21179
- __publicField(PgTimestampBuilder, _a99, "PgTimestampBuilder");
21180
- PgTimestamp = class extends (_b79 = PgColumn, _a100 = entityKind, _b79) {
21252
+ __publicField(PgTimestampBuilder, _a100, "PgTimestampBuilder");
21253
+ PgTimestamp = class extends (_b79 = PgColumn, _a101 = entityKind, _b79) {
21181
21254
  constructor(table4, config) {
21182
21255
  super(table4, config);
21183
21256
  __publicField(this, "withTimezone");
@@ -21196,8 +21269,8 @@ var init_timestamp = __esm({
21196
21269
  return `timestamp${precision}${this.withTimezone ? " with time zone" : ""}`;
21197
21270
  }
21198
21271
  };
21199
- __publicField(PgTimestamp, _a100, "PgTimestamp");
21200
- PgTimestampStringBuilder = class extends (_b80 = PgDateColumnBaseBuilder, _a101 = entityKind, _b80) {
21272
+ __publicField(PgTimestamp, _a101, "PgTimestamp");
21273
+ PgTimestampStringBuilder = class extends (_b80 = PgDateColumnBaseBuilder, _a102 = entityKind, _b80) {
21201
21274
  constructor(name2, withTimezone, precision) {
21202
21275
  super(name2, "string", "PgTimestampString");
21203
21276
  this.config.withTimezone = withTimezone;
@@ -21211,8 +21284,8 @@ var init_timestamp = __esm({
21211
21284
  );
21212
21285
  }
21213
21286
  };
21214
- __publicField(PgTimestampStringBuilder, _a101, "PgTimestampStringBuilder");
21215
- PgTimestampString = class extends (_b81 = PgColumn, _a102 = entityKind, _b81) {
21287
+ __publicField(PgTimestampStringBuilder, _a102, "PgTimestampStringBuilder");
21288
+ PgTimestampString = class extends (_b81 = PgColumn, _a103 = entityKind, _b81) {
21216
21289
  constructor(table4, config) {
21217
21290
  super(table4, config);
21218
21291
  __publicField(this, "withTimezone");
@@ -21225,7 +21298,7 @@ var init_timestamp = __esm({
21225
21298
  return `timestamp${precision}${this.withTimezone ? " with time zone" : ""}`;
21226
21299
  }
21227
21300
  };
21228
- __publicField(PgTimestampString, _a102, "PgTimestampString");
21301
+ __publicField(PgTimestampString, _a103, "PgTimestampString");
21229
21302
  }
21230
21303
  });
21231
21304
 
@@ -21233,14 +21306,14 @@ var init_timestamp = __esm({
21233
21306
  function uuid(name2) {
21234
21307
  return new PgUUIDBuilder(name2 ?? "");
21235
21308
  }
21236
- var _a103, _b82, PgUUIDBuilder, _a104, _b83, PgUUID;
21309
+ var _a104, _b82, PgUUIDBuilder, _a105, _b83, PgUUID;
21237
21310
  var init_uuid = __esm({
21238
21311
  "../drizzle-orm/dist/pg-core/columns/uuid.js"() {
21239
21312
  "use strict";
21240
21313
  init_entity();
21241
21314
  init_sql();
21242
21315
  init_common2();
21243
- PgUUIDBuilder = class extends (_b82 = PgColumnBuilder, _a103 = entityKind, _b82) {
21316
+ PgUUIDBuilder = class extends (_b82 = PgColumnBuilder, _a104 = entityKind, _b82) {
21244
21317
  constructor(name2) {
21245
21318
  super(name2, "string", "PgUUID");
21246
21319
  }
@@ -21255,13 +21328,13 @@ var init_uuid = __esm({
21255
21328
  return new PgUUID(table4, this.config);
21256
21329
  }
21257
21330
  };
21258
- __publicField(PgUUIDBuilder, _a103, "PgUUIDBuilder");
21259
- PgUUID = class extends (_b83 = PgColumn, _a104 = entityKind, _b83) {
21331
+ __publicField(PgUUIDBuilder, _a104, "PgUUIDBuilder");
21332
+ PgUUID = class extends (_b83 = PgColumn, _a105 = entityKind, _b83) {
21260
21333
  getSQLType() {
21261
21334
  return "uuid";
21262
21335
  }
21263
21336
  };
21264
- __publicField(PgUUID, _a104, "PgUUID");
21337
+ __publicField(PgUUID, _a105, "PgUUID");
21265
21338
  }
21266
21339
  });
21267
21340
 
@@ -21270,14 +21343,14 @@ function varchar(a, b = {}) {
21270
21343
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21271
21344
  return new PgVarcharBuilder(name2, config);
21272
21345
  }
21273
- var _a105, _b84, PgVarcharBuilder, _a106, _b85, PgVarchar;
21346
+ var _a106, _b84, PgVarcharBuilder, _a107, _b85, PgVarchar;
21274
21347
  var init_varchar = __esm({
21275
21348
  "../drizzle-orm/dist/pg-core/columns/varchar.js"() {
21276
21349
  "use strict";
21277
21350
  init_entity();
21278
21351
  init_utils2();
21279
21352
  init_common2();
21280
- PgVarcharBuilder = class extends (_b84 = PgColumnBuilder, _a105 = entityKind, _b84) {
21353
+ PgVarcharBuilder = class extends (_b84 = PgColumnBuilder, _a106 = entityKind, _b84) {
21281
21354
  constructor(name2, config) {
21282
21355
  super(name2, "string", "PgVarchar");
21283
21356
  this.config.length = config.length;
@@ -21288,8 +21361,8 @@ var init_varchar = __esm({
21288
21361
  return new PgVarchar(table4, this.config);
21289
21362
  }
21290
21363
  };
21291
- __publicField(PgVarcharBuilder, _a105, "PgVarcharBuilder");
21292
- PgVarchar = class extends (_b85 = PgColumn, _a106 = entityKind, _b85) {
21364
+ __publicField(PgVarcharBuilder, _a106, "PgVarcharBuilder");
21365
+ PgVarchar = class extends (_b85 = PgColumn, _a107 = entityKind, _b85) {
21293
21366
  constructor() {
21294
21367
  super(...arguments);
21295
21368
  __publicField(this, "length", this.config.length);
@@ -21299,7 +21372,7 @@ var init_varchar = __esm({
21299
21372
  return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
21300
21373
  }
21301
21374
  };
21302
- __publicField(PgVarchar, _a106, "PgVarchar");
21375
+ __publicField(PgVarchar, _a107, "PgVarchar");
21303
21376
  }
21304
21377
  });
21305
21378
 
@@ -21308,14 +21381,14 @@ function bit(a, b) {
21308
21381
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21309
21382
  return new PgBinaryVectorBuilder(name2, config);
21310
21383
  }
21311
- var _a107, _b86, PgBinaryVectorBuilder, _a108, _b87, PgBinaryVector;
21384
+ var _a108, _b86, PgBinaryVectorBuilder, _a109, _b87, PgBinaryVector;
21312
21385
  var init_bit = __esm({
21313
21386
  "../drizzle-orm/dist/pg-core/columns/vector_extension/bit.js"() {
21314
21387
  "use strict";
21315
21388
  init_entity();
21316
21389
  init_utils2();
21317
21390
  init_common2();
21318
- PgBinaryVectorBuilder = class extends (_b86 = PgColumnBuilder, _a107 = entityKind, _b86) {
21391
+ PgBinaryVectorBuilder = class extends (_b86 = PgColumnBuilder, _a108 = entityKind, _b86) {
21319
21392
  constructor(name2, config) {
21320
21393
  super(name2, "string", "PgBinaryVector");
21321
21394
  this.config.dimensions = config.dimensions;
@@ -21328,8 +21401,8 @@ var init_bit = __esm({
21328
21401
  );
21329
21402
  }
21330
21403
  };
21331
- __publicField(PgBinaryVectorBuilder, _a107, "PgBinaryVectorBuilder");
21332
- PgBinaryVector = class extends (_b87 = PgColumn, _a108 = entityKind, _b87) {
21404
+ __publicField(PgBinaryVectorBuilder, _a108, "PgBinaryVectorBuilder");
21405
+ PgBinaryVector = class extends (_b87 = PgColumn, _a109 = entityKind, _b87) {
21333
21406
  constructor() {
21334
21407
  super(...arguments);
21335
21408
  __publicField(this, "dimensions", this.config.dimensions);
@@ -21338,7 +21411,7 @@ var init_bit = __esm({
21338
21411
  return `bit(${this.dimensions})`;
21339
21412
  }
21340
21413
  };
21341
- __publicField(PgBinaryVector, _a108, "PgBinaryVector");
21414
+ __publicField(PgBinaryVector, _a109, "PgBinaryVector");
21342
21415
  }
21343
21416
  });
21344
21417
 
@@ -21347,14 +21420,14 @@ function halfvec(a, b) {
21347
21420
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21348
21421
  return new PgHalfVectorBuilder(name2, config);
21349
21422
  }
21350
- var _a109, _b88, PgHalfVectorBuilder, _a110, _b89, PgHalfVector;
21423
+ var _a110, _b88, PgHalfVectorBuilder, _a111, _b89, PgHalfVector;
21351
21424
  var init_halfvec = __esm({
21352
21425
  "../drizzle-orm/dist/pg-core/columns/vector_extension/halfvec.js"() {
21353
21426
  "use strict";
21354
21427
  init_entity();
21355
21428
  init_utils2();
21356
21429
  init_common2();
21357
- PgHalfVectorBuilder = class extends (_b88 = PgColumnBuilder, _a109 = entityKind, _b88) {
21430
+ PgHalfVectorBuilder = class extends (_b88 = PgColumnBuilder, _a110 = entityKind, _b88) {
21358
21431
  constructor(name2, config) {
21359
21432
  super(name2, "array", "PgHalfVector");
21360
21433
  this.config.dimensions = config.dimensions;
@@ -21367,8 +21440,8 @@ var init_halfvec = __esm({
21367
21440
  );
21368
21441
  }
21369
21442
  };
21370
- __publicField(PgHalfVectorBuilder, _a109, "PgHalfVectorBuilder");
21371
- PgHalfVector = class extends (_b89 = PgColumn, _a110 = entityKind, _b89) {
21443
+ __publicField(PgHalfVectorBuilder, _a110, "PgHalfVectorBuilder");
21444
+ PgHalfVector = class extends (_b89 = PgColumn, _a111 = entityKind, _b89) {
21372
21445
  constructor() {
21373
21446
  super(...arguments);
21374
21447
  __publicField(this, "dimensions", this.config.dimensions);
@@ -21383,7 +21456,7 @@ var init_halfvec = __esm({
21383
21456
  return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
21384
21457
  }
21385
21458
  };
21386
- __publicField(PgHalfVector, _a110, "PgHalfVector");
21459
+ __publicField(PgHalfVector, _a111, "PgHalfVector");
21387
21460
  }
21388
21461
  });
21389
21462
 
@@ -21392,14 +21465,14 @@ function sparsevec(a, b) {
21392
21465
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21393
21466
  return new PgSparseVectorBuilder(name2, config);
21394
21467
  }
21395
- var _a111, _b90, PgSparseVectorBuilder, _a112, _b91, PgSparseVector;
21468
+ var _a112, _b90, PgSparseVectorBuilder, _a113, _b91, PgSparseVector;
21396
21469
  var init_sparsevec = __esm({
21397
21470
  "../drizzle-orm/dist/pg-core/columns/vector_extension/sparsevec.js"() {
21398
21471
  "use strict";
21399
21472
  init_entity();
21400
21473
  init_utils2();
21401
21474
  init_common2();
21402
- PgSparseVectorBuilder = class extends (_b90 = PgColumnBuilder, _a111 = entityKind, _b90) {
21475
+ PgSparseVectorBuilder = class extends (_b90 = PgColumnBuilder, _a112 = entityKind, _b90) {
21403
21476
  constructor(name2, config) {
21404
21477
  super(name2, "string", "PgSparseVector");
21405
21478
  this.config.dimensions = config.dimensions;
@@ -21412,8 +21485,8 @@ var init_sparsevec = __esm({
21412
21485
  );
21413
21486
  }
21414
21487
  };
21415
- __publicField(PgSparseVectorBuilder, _a111, "PgSparseVectorBuilder");
21416
- PgSparseVector = class extends (_b91 = PgColumn, _a112 = entityKind, _b91) {
21488
+ __publicField(PgSparseVectorBuilder, _a112, "PgSparseVectorBuilder");
21489
+ PgSparseVector = class extends (_b91 = PgColumn, _a113 = entityKind, _b91) {
21417
21490
  constructor() {
21418
21491
  super(...arguments);
21419
21492
  __publicField(this, "dimensions", this.config.dimensions);
@@ -21422,7 +21495,7 @@ var init_sparsevec = __esm({
21422
21495
  return `sparsevec(${this.dimensions})`;
21423
21496
  }
21424
21497
  };
21425
- __publicField(PgSparseVector, _a112, "PgSparseVector");
21498
+ __publicField(PgSparseVector, _a113, "PgSparseVector");
21426
21499
  }
21427
21500
  });
21428
21501
 
@@ -21431,14 +21504,14 @@ function vector(a, b) {
21431
21504
  const { name: name2, config } = getColumnNameAndConfig(a, b);
21432
21505
  return new PgVectorBuilder(name2, config);
21433
21506
  }
21434
- var _a113, _b92, PgVectorBuilder, _a114, _b93, PgVector;
21507
+ var _a114, _b92, PgVectorBuilder, _a115, _b93, PgVector;
21435
21508
  var init_vector2 = __esm({
21436
21509
  "../drizzle-orm/dist/pg-core/columns/vector_extension/vector.js"() {
21437
21510
  "use strict";
21438
21511
  init_entity();
21439
21512
  init_utils2();
21440
21513
  init_common2();
21441
- PgVectorBuilder = class extends (_b92 = PgColumnBuilder, _a113 = entityKind, _b92) {
21514
+ PgVectorBuilder = class extends (_b92 = PgColumnBuilder, _a114 = entityKind, _b92) {
21442
21515
  constructor(name2, config) {
21443
21516
  super(name2, "array", "PgVector");
21444
21517
  this.config.dimensions = config.dimensions;
@@ -21448,8 +21521,8 @@ var init_vector2 = __esm({
21448
21521
  return new PgVector(table4, this.config);
21449
21522
  }
21450
21523
  };
21451
- __publicField(PgVectorBuilder, _a113, "PgVectorBuilder");
21452
- PgVector = class extends (_b93 = PgColumn, _a114 = entityKind, _b93) {
21524
+ __publicField(PgVectorBuilder, _a114, "PgVectorBuilder");
21525
+ PgVector = class extends (_b93 = PgColumn, _a115 = entityKind, _b93) {
21453
21526
  constructor() {
21454
21527
  super(...arguments);
21455
21528
  __publicField(this, "dimensions", this.config.dimensions);
@@ -21464,7 +21537,7 @@ var init_vector2 = __esm({
21464
21537
  return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
21465
21538
  }
21466
21539
  };
21467
- __publicField(PgVector, _a114, "PgVector");
21540
+ __publicField(PgVector, _a115, "PgVector");
21468
21541
  }
21469
21542
  });
21470
21543
 
@@ -21565,14 +21638,14 @@ function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name
21565
21638
  })
21566
21639
  );
21567
21640
  const table4 = Object.assign(rawTable, builtColumns);
21568
- table4[Table2.Symbol.Columns] = builtColumns;
21569
- table4[Table2.Symbol.ExtraConfigColumns] = builtColumnsForExtraConfig;
21641
+ table4[Table.Symbol.Columns] = builtColumns;
21642
+ table4[Table.Symbol.ExtraConfigColumns] = builtColumnsForExtraConfig;
21570
21643
  if (extraConfig) {
21571
21644
  table4[PgTable.Symbol.ExtraConfigBuilder] = extraConfig;
21572
21645
  }
21573
21646
  return table4;
21574
21647
  }
21575
- var InlineForeignKeys, _a115, _b94, _c2, _d2, PgTable, pgTable;
21648
+ var InlineForeignKeys, _a116, _b94, _c2, _d2, PgTable, pgTable;
21576
21649
  var init_table2 = __esm({
21577
21650
  "../drizzle-orm/dist/pg-core/table.js"() {
21578
21651
  "use strict";
@@ -21580,18 +21653,18 @@ var init_table2 = __esm({
21580
21653
  init_table();
21581
21654
  init_all();
21582
21655
  InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
21583
- PgTable = class extends (_d2 = Table2, _c2 = entityKind, _b94 = InlineForeignKeys, _a115 = Table2.Symbol.ExtraConfigBuilder, _d2) {
21656
+ PgTable = class extends (_d2 = Table, _c2 = entityKind, _b94 = InlineForeignKeys, _a116 = Table.Symbol.ExtraConfigBuilder, _d2) {
21584
21657
  constructor() {
21585
21658
  super(...arguments);
21586
21659
  /**@internal */
21587
21660
  __publicField(this, _b94, []);
21588
21661
  /** @internal */
21589
- __publicField(this, _a115);
21662
+ __publicField(this, _a116);
21590
21663
  }
21591
21664
  };
21592
21665
  __publicField(PgTable, _c2, "PgTable");
21593
21666
  /** @internal */
21594
- __publicField(PgTable, "Symbol", Object.assign({}, Table2.Symbol, {
21667
+ __publicField(PgTable, "Symbol", Object.assign({}, Table.Symbol, {
21595
21668
  InlineForeignKeys
21596
21669
  }));
21597
21670
  pgTable = (name2, columns, extraConfig) => {
@@ -21601,13 +21674,13 @@ var init_table2 = __esm({
21601
21674
  });
21602
21675
 
21603
21676
  // ../drizzle-orm/dist/pg-core/primary-keys.js
21604
- var _a116, PrimaryKeyBuilder, _a117, PrimaryKey;
21677
+ var _a117, PrimaryKeyBuilder, _a118, PrimaryKey;
21605
21678
  var init_primary_keys = __esm({
21606
21679
  "../drizzle-orm/dist/pg-core/primary-keys.js"() {
21607
21680
  "use strict";
21608
21681
  init_entity();
21609
21682
  init_table2();
21610
- _a116 = entityKind;
21683
+ _a117 = entityKind;
21611
21684
  PrimaryKeyBuilder = class {
21612
21685
  constructor(columns, name2) {
21613
21686
  /** @internal */
@@ -21622,8 +21695,8 @@ var init_primary_keys = __esm({
21622
21695
  return new PrimaryKey(table4, this.columns, this.name);
21623
21696
  }
21624
21697
  };
21625
- __publicField(PrimaryKeyBuilder, _a116, "PgPrimaryKeyBuilder");
21626
- _a117 = entityKind;
21698
+ __publicField(PrimaryKeyBuilder, _a117, "PgPrimaryKeyBuilder");
21699
+ _a118 = entityKind;
21627
21700
  PrimaryKey = class {
21628
21701
  constructor(table4, columns, name2) {
21629
21702
  __publicField(this, "columns");
@@ -21636,7 +21709,7 @@ var init_primary_keys = __esm({
21636
21709
  return this.name ?? `${this.table[PgTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
21637
21710
  }
21638
21711
  };
21639
- __publicField(PrimaryKey, _a117, "PgPrimaryKey");
21712
+ __publicField(PrimaryKey, _a118, "PgPrimaryKey");
21640
21713
  }
21641
21714
  });
21642
21715
 
@@ -21675,33 +21748,33 @@ function getOrderByOperators() {
21675
21748
  };
21676
21749
  }
21677
21750
  function extractTablesRelationalConfig(schema4, configHelpers) {
21678
- if (Object.keys(schema4).length === 1 && "default" in schema4 && !is(schema4["default"], Table2)) {
21751
+ if (Object.keys(schema4).length === 1 && "default" in schema4 && !is(schema4["default"], Table)) {
21679
21752
  schema4 = schema4["default"];
21680
21753
  }
21681
21754
  const tableNamesMap = {};
21682
21755
  const relationsBuffer = {};
21683
21756
  const tablesConfig = {};
21684
21757
  for (const [key, value] of Object.entries(schema4)) {
21685
- if (is(value, Table2)) {
21758
+ if (is(value, Table)) {
21686
21759
  const dbName = getTableUniqueName(value);
21687
21760
  const bufferedRelations = relationsBuffer[dbName];
21688
21761
  tableNamesMap[dbName] = key;
21689
21762
  tablesConfig[key] = {
21690
21763
  tsName: key,
21691
- dbName: value[Table2.Symbol.Name],
21692
- schema: value[Table2.Symbol.Schema],
21693
- columns: value[Table2.Symbol.Columns],
21764
+ dbName: value[Table.Symbol.Name],
21765
+ schema: value[Table.Symbol.Schema],
21766
+ columns: value[Table.Symbol.Columns],
21694
21767
  relations: bufferedRelations?.relations ?? {},
21695
21768
  primaryKey: bufferedRelations?.primaryKey ?? []
21696
21769
  };
21697
21770
  for (const column4 of Object.values(
21698
- value[Table2.Symbol.Columns]
21771
+ value[Table.Symbol.Columns]
21699
21772
  )) {
21700
21773
  if (column4.primary) {
21701
21774
  tablesConfig[key].primaryKey.push(column4);
21702
21775
  }
21703
21776
  }
21704
- const extraConfig = value[Table2.Symbol.ExtraConfigBuilder]?.(value[Table2.Symbol.ExtraConfigColumns]);
21777
+ const extraConfig = value[Table.Symbol.ExtraConfigBuilder]?.(value[Table.Symbol.ExtraConfigColumns]);
21705
21778
  if (extraConfig) {
21706
21779
  for (const configEntry of Object.values(extraConfig)) {
21707
21780
  if (is(configEntry, PrimaryKeyBuilder)) {
@@ -21773,7 +21846,7 @@ function normalizeRelation(schema4, tableNamesMap, relation) {
21773
21846
  const referencedTableTsName = tableNamesMap[getTableUniqueName(relation.referencedTable)];
21774
21847
  if (!referencedTableTsName) {
21775
21848
  throw new Error(
21776
- `Table "${relation.referencedTable[Table2.Symbol.Name]}" not found in schema`
21849
+ `Table "${relation.referencedTable[Table.Symbol.Name]}" not found in schema`
21777
21850
  );
21778
21851
  }
21779
21852
  const referencedTableConfig = schema4[referencedTableTsName];
@@ -21784,7 +21857,7 @@ function normalizeRelation(schema4, tableNamesMap, relation) {
21784
21857
  const sourceTableTsName = tableNamesMap[getTableUniqueName(sourceTable)];
21785
21858
  if (!sourceTableTsName) {
21786
21859
  throw new Error(
21787
- `Table "${sourceTable[Table2.Symbol.Name]}" not found in schema`
21860
+ `Table "${sourceTable[Table.Symbol.Name]}" not found in schema`
21788
21861
  );
21789
21862
  }
21790
21863
  const reverseRelations = [];
@@ -21799,7 +21872,7 @@ function normalizeRelation(schema4, tableNamesMap, relation) {
21799
21872
  throw relation.relationName ? new Error(
21800
21873
  `There are multiple relations with name "${relation.relationName}" in table "${referencedTableTsName}"`
21801
21874
  ) : new Error(
21802
- `There are multiple relations between "${referencedTableTsName}" and "${relation.sourceTable[Table2.Symbol.Name]}". Please specify relation name`
21875
+ `There are multiple relations between "${referencedTableTsName}" and "${relation.sourceTable[Table.Symbol.Name]}". Please specify relation name`
21803
21876
  );
21804
21877
  }
21805
21878
  if (reverseRelations[0] && is(reverseRelations[0], One) && reverseRelations[0].config) {
@@ -21859,7 +21932,7 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
21859
21932
  }
21860
21933
  return result;
21861
21934
  }
21862
- var _a118, Relation, _a119, Relations, _a120, _b95, _One, One, _a121, _b96, _Many, Many;
21935
+ var _a119, Relation, _a120, Relations, _a121, _b95, _One, One, _a122, _b96, _Many, Many;
21863
21936
  var init_relations = __esm({
21864
21937
  "../drizzle-orm/dist/relations.js"() {
21865
21938
  "use strict";
@@ -21869,7 +21942,7 @@ var init_relations = __esm({
21869
21942
  init_primary_keys();
21870
21943
  init_expressions();
21871
21944
  init_sql();
21872
- _a118 = entityKind;
21945
+ _a119 = entityKind;
21873
21946
  Relation = class {
21874
21947
  constructor(sourceTable, referencedTable, relationName) {
21875
21948
  __publicField(this, "referencedTableName");
@@ -21877,19 +21950,19 @@ var init_relations = __esm({
21877
21950
  this.sourceTable = sourceTable;
21878
21951
  this.referencedTable = referencedTable;
21879
21952
  this.relationName = relationName;
21880
- this.referencedTableName = referencedTable[Table2.Symbol.Name];
21953
+ this.referencedTableName = referencedTable[Table.Symbol.Name];
21881
21954
  }
21882
21955
  };
21883
- __publicField(Relation, _a118, "Relation");
21884
- _a119 = entityKind;
21956
+ __publicField(Relation, _a119, "Relation");
21957
+ _a120 = entityKind;
21885
21958
  Relations = class {
21886
21959
  constructor(table4, config) {
21887
21960
  this.table = table4;
21888
21961
  this.config = config;
21889
21962
  }
21890
21963
  };
21891
- __publicField(Relations, _a119, "Relations");
21892
- _One = class _One extends (_b95 = Relation, _a120 = entityKind, _b95) {
21964
+ __publicField(Relations, _a120, "Relations");
21965
+ _One = class _One extends (_b95 = Relation, _a121 = entityKind, _b95) {
21893
21966
  constructor(sourceTable, referencedTable, config, isNullable) {
21894
21967
  super(sourceTable, referencedTable, config?.relationName);
21895
21968
  this.config = config;
@@ -21906,9 +21979,9 @@ var init_relations = __esm({
21906
21979
  return relation;
21907
21980
  }
21908
21981
  };
21909
- __publicField(_One, _a120, "One");
21982
+ __publicField(_One, _a121, "One");
21910
21983
  One = _One;
21911
- _Many = class _Many extends (_b96 = Relation, _a121 = entityKind, _b96) {
21984
+ _Many = class _Many extends (_b96 = Relation, _a122 = entityKind, _b96) {
21912
21985
  constructor(sourceTable, referencedTable, config) {
21913
21986
  super(sourceTable, referencedTable, config?.relationName);
21914
21987
  this.config = config;
@@ -21923,7 +21996,7 @@ var init_relations = __esm({
21923
21996
  return relation;
21924
21997
  }
21925
21998
  };
21926
- __publicField(_Many, _a121, "Many");
21999
+ __publicField(_Many, _a122, "Many");
21927
22000
  Many = _Many;
21928
22001
  }
21929
22002
  });
@@ -22058,7 +22131,7 @@ __export(dist_exports, {
22058
22131
  Schema: () => Schema,
22059
22132
  StringChunk: () => StringChunk,
22060
22133
  Subquery: () => Subquery,
22061
- Table: () => Table2,
22134
+ Table: () => Table,
22062
22135
  TableAliasProxyHandler: () => TableAliasProxyHandler,
22063
22136
  TransactionRollbackError: () => TransactionRollbackError,
22064
22137
  View: () => View,
@@ -22173,12 +22246,12 @@ var init_alias2 = __esm({
22173
22246
  });
22174
22247
 
22175
22248
  // ../drizzle-orm/dist/pg-core/checks.js
22176
- var _a122, CheckBuilder, _a123, Check;
22249
+ var _a123, CheckBuilder, _a124, Check;
22177
22250
  var init_checks = __esm({
22178
22251
  "../drizzle-orm/dist/pg-core/checks.js"() {
22179
22252
  "use strict";
22180
22253
  init_entity();
22181
- _a122 = entityKind;
22254
+ _a123 = entityKind;
22182
22255
  CheckBuilder = class {
22183
22256
  constructor(name2, value) {
22184
22257
  __publicField(this, "brand");
@@ -22190,8 +22263,8 @@ var init_checks = __esm({
22190
22263
  return new Check(table4, this);
22191
22264
  }
22192
22265
  };
22193
- __publicField(CheckBuilder, _a122, "PgCheckBuilder");
22194
- _a123 = entityKind;
22266
+ __publicField(CheckBuilder, _a123, "PgCheckBuilder");
22267
+ _a124 = entityKind;
22195
22268
  Check = class {
22196
22269
  constructor(table4, builder) {
22197
22270
  __publicField(this, "name");
@@ -22201,7 +22274,7 @@ var init_checks = __esm({
22201
22274
  this.value = builder.value;
22202
22275
  }
22203
22276
  };
22204
- __publicField(Check, _a123, "PgCheck");
22277
+ __publicField(Check, _a124, "PgCheck");
22205
22278
  }
22206
22279
  });
22207
22280
 
@@ -22248,7 +22321,7 @@ var init_columns = __esm({
22248
22321
  });
22249
22322
 
22250
22323
  // ../drizzle-orm/dist/pg-core/query-builders/delete.js
22251
- var _a124, _b97, PgDeleteBase;
22324
+ var _a125, _b97, PgDeleteBase;
22252
22325
  var init_delete = __esm({
22253
22326
  "../drizzle-orm/dist/pg-core/query-builders/delete.js"() {
22254
22327
  "use strict";
@@ -22257,8 +22330,8 @@ var init_delete = __esm({
22257
22330
  init_table();
22258
22331
  init_tracing();
22259
22332
  init_utils2();
22260
- PgDeleteBase = class extends (_b97 = QueryPromise, _a124 = entityKind, _b97) {
22261
- constructor(table4, session, dialect7, withList) {
22333
+ PgDeleteBase = class extends (_b97 = QueryPromise, _a125 = entityKind, _b97) {
22334
+ constructor(table4, session, dialect4, withList) {
22262
22335
  super();
22263
22336
  __publicField(this, "config");
22264
22337
  __publicField(this, "execute", (placeholderValues) => {
@@ -22267,7 +22340,7 @@ var init_delete = __esm({
22267
22340
  });
22268
22341
  });
22269
22342
  this.session = session;
22270
- this.dialect = dialect7;
22343
+ this.dialect = dialect4;
22271
22344
  this.config = { table: table4, withList };
22272
22345
  }
22273
22346
  /**
@@ -22303,7 +22376,7 @@ var init_delete = __esm({
22303
22376
  this.config.where = where;
22304
22377
  return this;
22305
22378
  }
22306
- returning(fields = this.config.table[Table2.Symbol.Columns]) {
22379
+ returning(fields = this.config.table[Table.Symbol.Columns]) {
22307
22380
  this.config.returning = orderSelectedFields(fields);
22308
22381
  return this;
22309
22382
  }
@@ -22328,12 +22401,12 @@ var init_delete = __esm({
22328
22401
  return this;
22329
22402
  }
22330
22403
  };
22331
- __publicField(PgDeleteBase, _a124, "PgDelete");
22404
+ __publicField(PgDeleteBase, _a125, "PgDelete");
22332
22405
  }
22333
22406
  });
22334
22407
 
22335
22408
  // ../drizzle-orm/dist/pg-core/query-builders/insert.js
22336
- var _a125, PgInsertBuilder, _a126, _b98, PgInsertBase;
22409
+ var _a126, PgInsertBuilder, _a127, _b98, PgInsertBase;
22337
22410
  var init_insert = __esm({
22338
22411
  "../drizzle-orm/dist/pg-core/query-builders/insert.js"() {
22339
22412
  "use strict";
@@ -22343,12 +22416,12 @@ var init_insert = __esm({
22343
22416
  init_table();
22344
22417
  init_tracing();
22345
22418
  init_utils2();
22346
- _a125 = entityKind;
22419
+ _a126 = entityKind;
22347
22420
  PgInsertBuilder = class {
22348
- constructor(table4, session, dialect7, withList) {
22421
+ constructor(table4, session, dialect4, withList) {
22349
22422
  this.table = table4;
22350
22423
  this.session = session;
22351
- this.dialect = dialect7;
22424
+ this.dialect = dialect4;
22352
22425
  this.withList = withList;
22353
22426
  }
22354
22427
  values(values) {
@@ -22358,7 +22431,7 @@ var init_insert = __esm({
22358
22431
  }
22359
22432
  const mappedValues = values.map((entry) => {
22360
22433
  const result = {};
22361
- const cols = this.table[Table2.Symbol.Columns];
22434
+ const cols = this.table[Table.Symbol.Columns];
22362
22435
  for (const colKey of Object.keys(entry)) {
22363
22436
  const colValue = entry[colKey];
22364
22437
  result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
@@ -22368,9 +22441,9 @@ var init_insert = __esm({
22368
22441
  return new PgInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList);
22369
22442
  }
22370
22443
  };
22371
- __publicField(PgInsertBuilder, _a125, "PgInsertBuilder");
22372
- PgInsertBase = class extends (_b98 = QueryPromise, _a126 = entityKind, _b98) {
22373
- constructor(table4, values, session, dialect7, withList) {
22444
+ __publicField(PgInsertBuilder, _a126, "PgInsertBuilder");
22445
+ PgInsertBase = class extends (_b98 = QueryPromise, _a127 = entityKind, _b98) {
22446
+ constructor(table4, values, session, dialect4, withList) {
22374
22447
  super();
22375
22448
  __publicField(this, "config");
22376
22449
  __publicField(this, "execute", (placeholderValues) => {
@@ -22379,10 +22452,10 @@ var init_insert = __esm({
22379
22452
  });
22380
22453
  });
22381
22454
  this.session = session;
22382
- this.dialect = dialect7;
22455
+ this.dialect = dialect4;
22383
22456
  this.config = { table: table4, values, withList };
22384
22457
  }
22385
- returning(fields = this.config.table[Table2.Symbol.Columns]) {
22458
+ returning(fields = this.config.table[Table.Symbol.Columns]) {
22386
22459
  this.config.returning = orderSelectedFields(fields);
22387
22460
  return this;
22388
22461
  }
@@ -22484,69 +22557,7 @@ var init_insert = __esm({
22484
22557
  return this;
22485
22558
  }
22486
22559
  };
22487
- __publicField(PgInsertBase, _a126, "PgInsert");
22488
- }
22489
- });
22490
-
22491
- // ../drizzle-orm/dist/casing.js
22492
- function toSnakeCase(input) {
22493
- const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
22494
- return words.map((word) => word.toLowerCase()).join("_");
22495
- }
22496
- function toCamelCase(input) {
22497
- const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
22498
- return words.reduce((acc, word, i) => {
22499
- const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;
22500
- return acc + formattedWord;
22501
- }, "");
22502
- }
22503
- function noopCase(input) {
22504
- return input;
22505
- }
22506
- var _a127, CasingCache;
22507
- var init_casing = __esm({
22508
- "../drizzle-orm/dist/casing.js"() {
22509
- "use strict";
22510
- init_entity();
22511
- init_table();
22512
- _a127 = entityKind;
22513
- CasingCache = class {
22514
- constructor(casing2) {
22515
- /** @internal */
22516
- __publicField(this, "cache", {});
22517
- __publicField(this, "cachedTables", {});
22518
- __publicField(this, "convert");
22519
- this.convert = casing2 === "snake_case" ? toSnakeCase : casing2 === "camelCase" ? toCamelCase : noopCase;
22520
- }
22521
- getColumnCasing(column4) {
22522
- if (!column4.keyAsName)
22523
- return column4.name;
22524
- const schema4 = column4.table[Table2.Symbol.Schema] ?? "public";
22525
- const tableName = column4.table[Table2.Symbol.OriginalName];
22526
- const key = `${schema4}.${tableName}.${column4.name}`;
22527
- if (!this.cache[key]) {
22528
- this.cacheTable(column4.table);
22529
- }
22530
- return this.cache[key];
22531
- }
22532
- cacheTable(table4) {
22533
- const schema4 = table4[Table2.Symbol.Schema] ?? "public";
22534
- const tableName = table4[Table2.Symbol.OriginalName];
22535
- const tableKey2 = `${schema4}.${tableName}`;
22536
- if (!this.cachedTables[tableKey2]) {
22537
- for (const column4 of Object.values(table4[Table2.Symbol.Columns])) {
22538
- const columnKey = `${tableKey2}.${column4.name}`;
22539
- this.cache[columnKey] = this.convert(column4.name);
22540
- }
22541
- this.cachedTables[tableKey2] = true;
22542
- }
22543
- }
22544
- clearCache() {
22545
- this.cache = {};
22546
- this.cachedTables = {};
22547
- }
22548
- };
22549
- __publicField(CasingCache, _a127, "CasingCache");
22560
+ __publicField(PgInsertBase, _a127, "PgInsert");
22550
22561
  }
22551
22562
  });
22552
22563
 
@@ -22648,7 +22659,7 @@ var init_dialect = __esm({
22648
22659
  return sql`${withSql}delete from ${table4}${whereSql}${returningSql}`;
22649
22660
  }
22650
22661
  buildUpdateSet(table4, set) {
22651
- const tableColumns = table4[Table2.Symbol.Columns];
22662
+ const tableColumns = table4[Table.Symbol.Columns];
22652
22663
  const columnNames = Object.keys(tableColumns).filter(
22653
22664
  (colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
22654
22665
  );
@@ -22739,7 +22750,7 @@ var init_dialect = __esm({
22739
22750
  const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
22740
22751
  for (const f of fieldsList) {
22741
22752
  if (is(f.field, Column2) && getTableName(f.field.table) !== (is(table4, Subquery) ? table4._.alias : is(table4, PgViewBase) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : getTableName(table4)) && !((table22) => joins?.some(
22742
- ({ alias }) => alias === (table22[Table2.Symbol.IsAlias] ? getTableName(table22) : table22[Table2.Symbol.BaseName])
22753
+ ({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName])
22743
22754
  ))(f.field.table)) {
22744
22755
  const tableName = getTableName(f.field.table);
22745
22756
  throw new Error(
@@ -22755,12 +22766,12 @@ var init_dialect = __esm({
22755
22766
  }
22756
22767
  const selection = this.buildSelection(fieldsList, { isSingleTable });
22757
22768
  const tableSql = (() => {
22758
- if (is(table4, Table2) && table4[Table2.Symbol.OriginalName] !== table4[Table2.Symbol.Name]) {
22759
- let fullName = sql`${sql.identifier(table4[Table2.Symbol.OriginalName])}`;
22760
- if (table4[Table2.Symbol.Schema]) {
22761
- fullName = sql`${sql.identifier(table4[Table2.Symbol.Schema])}.${fullName}`;
22769
+ if (is(table4, Table) && table4[Table.Symbol.OriginalName] !== table4[Table.Symbol.Name]) {
22770
+ let fullName = sql`${sql.identifier(table4[Table.Symbol.OriginalName])}`;
22771
+ if (table4[Table.Symbol.Schema]) {
22772
+ fullName = sql`${sql.identifier(table4[Table.Symbol.Schema])}.${fullName}`;
22762
22773
  }
22763
- return sql`${fullName} ${sql.identifier(table4[Table2.Symbol.Name])}`;
22774
+ return sql`${fullName} ${sql.identifier(table4[Table.Symbol.Name])}`;
22764
22775
  }
22765
22776
  return table4;
22766
22777
  })();
@@ -22881,7 +22892,7 @@ var init_dialect = __esm({
22881
22892
  }
22882
22893
  buildInsertQuery({ table: table4, values, onConflict, returning, withList }) {
22883
22894
  const valuesSqlList = [];
22884
- const columns = table4[Table2.Symbol.Columns];
22895
+ const columns = table4[Table.Symbol.Columns];
22885
22896
  const colEntries = Object.entries(columns).filter(([_2, col]) => !col.shouldDisableInsert());
22886
22897
  const insertOrder = colEntries.map(
22887
22898
  ([, column4]) => sql.identifier(this.casing.getColumnCasing(column4))
@@ -23839,7 +23850,7 @@ var init_select2 = __esm({
23839
23850
  };
23840
23851
  __publicField(PgSelectBuilder, _a132, "PgSelectBuilder");
23841
23852
  PgSelectQueryBuilderBase = class extends (_b100 = TypedQueryBuilder, _a133 = entityKind, _b100) {
23842
- constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect7, withList, distinct }) {
23853
+ constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
23843
23854
  super();
23844
23855
  __publicField(this, "_");
23845
23856
  __publicField(this, "config");
@@ -24155,7 +24166,7 @@ var init_select2 = __esm({
24155
24166
  };
24156
24167
  this.isPartialSelect = isPartialSelect;
24157
24168
  this.session = session;
24158
- this.dialect = dialect7;
24169
+ this.dialect = dialect4;
24159
24170
  this._ = {
24160
24171
  selectedFields: fields
24161
24172
  };
@@ -24176,7 +24187,7 @@ var init_select2 = __esm({
24176
24187
  };
24177
24188
  }
24178
24189
  if (typeof tableName === "string" && !is(table4, SQL)) {
24179
- const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table2.Symbol.Columns];
24190
+ const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table.Symbol.Columns];
24180
24191
  this.config.fields[tableName] = selection;
24181
24192
  }
24182
24193
  }
@@ -24450,13 +24461,13 @@ var init_select2 = __esm({
24450
24461
  }
24451
24462
  /** @internal */
24452
24463
  _prepare(name2) {
24453
- const { session, config, dialect: dialect7, joinsNotNullableMap } = this;
24464
+ const { session, config, dialect: dialect4, joinsNotNullableMap } = this;
24454
24465
  if (!session) {
24455
24466
  throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");
24456
24467
  }
24457
24468
  return tracer.startActiveSpan("drizzle.prepareQuery", () => {
24458
24469
  const fieldsList = orderSelectedFields(config.fields);
24459
- const query = session.prepareQuery(dialect7.sqlToQuery(this.getSQL()), fieldsList, name2, true);
24470
+ const query = session.prepareQuery(dialect4.sqlToQuery(this.getSQL()), fieldsList, name2, true);
24460
24471
  query.joinsNotNullableMap = joinsNotNullableMap;
24461
24472
  return query;
24462
24473
  });
@@ -24503,11 +24514,11 @@ var init_query_builder2 = __esm({
24503
24514
  init_select2();
24504
24515
  _a135 = entityKind;
24505
24516
  QueryBuilder = class {
24506
- constructor(dialect7) {
24517
+ constructor(dialect4) {
24507
24518
  __publicField(this, "dialect");
24508
24519
  __publicField(this, "dialectConfig");
24509
- this.dialect = is(dialect7, PgDialect) ? dialect7 : void 0;
24510
- this.dialectConfig = is(dialect7, PgDialect) ? void 0 : dialect7;
24520
+ this.dialect = is(dialect4, PgDialect) ? dialect4 : void 0;
24521
+ this.dialectConfig = is(dialect4, PgDialect) ? void 0 : dialect4;
24511
24522
  }
24512
24523
  $with(alias) {
24513
24524
  const queryBuilder = this;
@@ -24595,7 +24606,7 @@ var init_refresh_materialized_view = __esm({
24595
24606
  init_query_promise();
24596
24607
  init_tracing();
24597
24608
  PgRefreshMaterializedView = class extends (_b102 = QueryPromise, _a136 = entityKind, _b102) {
24598
- constructor(view, session, dialect7) {
24609
+ constructor(view, session, dialect4) {
24599
24610
  super();
24600
24611
  __publicField(this, "config");
24601
24612
  __publicField(this, "execute", (placeholderValues) => {
@@ -24604,7 +24615,7 @@ var init_refresh_materialized_view = __esm({
24604
24615
  });
24605
24616
  });
24606
24617
  this.session = session;
24607
- this.dialect = dialect7;
24618
+ this.dialect = dialect4;
24608
24619
  this.config = { view };
24609
24620
  }
24610
24621
  concurrently() {
@@ -24661,10 +24672,10 @@ var init_update = __esm({
24661
24672
  init_utils2();
24662
24673
  _a137 = entityKind;
24663
24674
  PgUpdateBuilder = class {
24664
- constructor(table4, session, dialect7, withList) {
24675
+ constructor(table4, session, dialect4, withList) {
24665
24676
  this.table = table4;
24666
24677
  this.session = session;
24667
- this.dialect = dialect7;
24678
+ this.dialect = dialect4;
24668
24679
  this.withList = withList;
24669
24680
  }
24670
24681
  set(values) {
@@ -24679,14 +24690,14 @@ var init_update = __esm({
24679
24690
  };
24680
24691
  __publicField(PgUpdateBuilder, _a137, "PgUpdateBuilder");
24681
24692
  PgUpdateBase = class extends (_b103 = QueryPromise, _a138 = entityKind, _b103) {
24682
- constructor(table4, set, session, dialect7, withList) {
24693
+ constructor(table4, set, session, dialect4, withList) {
24683
24694
  super();
24684
24695
  __publicField(this, "config");
24685
24696
  __publicField(this, "execute", (placeholderValues) => {
24686
24697
  return this._prepare().execute(placeholderValues);
24687
24698
  });
24688
24699
  this.session = session;
24689
- this.dialect = dialect7;
24700
+ this.dialect = dialect4;
24690
24701
  this.config = { set, table: table4, withList };
24691
24702
  }
24692
24703
  /**
@@ -24726,7 +24737,7 @@ var init_update = __esm({
24726
24737
  this.config.where = where;
24727
24738
  return this;
24728
24739
  }
24729
- returning(fields = this.config.table[Table2.Symbol.Columns]) {
24740
+ returning(fields = this.config.table[Table.Symbol.Columns]) {
24730
24741
  this.config.returning = orderSelectedFields(fields);
24731
24742
  return this;
24732
24743
  }
@@ -24832,13 +24843,13 @@ var init_query = __esm({
24832
24843
  init_tracing();
24833
24844
  _a140 = entityKind;
24834
24845
  RelationalQueryBuilder = class {
24835
- constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect7, session) {
24846
+ constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
24836
24847
  this.fullSchema = fullSchema;
24837
24848
  this.schema = schema4;
24838
24849
  this.tableNamesMap = tableNamesMap;
24839
24850
  this.table = table4;
24840
24851
  this.tableConfig = tableConfig;
24841
- this.dialect = dialect7;
24852
+ this.dialect = dialect4;
24842
24853
  this.session = session;
24843
24854
  }
24844
24855
  findMany(config) {
@@ -24870,14 +24881,14 @@ var init_query = __esm({
24870
24881
  };
24871
24882
  __publicField(RelationalQueryBuilder, _a140, "PgRelationalQueryBuilder");
24872
24883
  PgRelationalQuery = class extends (_b105 = QueryPromise, _a141 = entityKind, _b105) {
24873
- constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect7, session, config, mode) {
24884
+ constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
24874
24885
  super();
24875
24886
  this.fullSchema = fullSchema;
24876
24887
  this.schema = schema4;
24877
24888
  this.tableNamesMap = tableNamesMap;
24878
24889
  this.table = table4;
24879
24890
  this.tableConfig = tableConfig;
24880
- this.dialect = dialect7;
24891
+ this.dialect = dialect4;
24881
24892
  this.session = session;
24882
24893
  this.config = config;
24883
24894
  this.mode = mode;
@@ -24992,9 +25003,9 @@ var init_db = __esm({
24992
25003
  init_refresh_materialized_view();
24993
25004
  _a143 = entityKind;
24994
25005
  PgDatabase = class {
24995
- constructor(dialect7, session, schema4) {
25006
+ constructor(dialect4, session, schema4) {
24996
25007
  __publicField(this, "query");
24997
- this.dialect = dialect7;
25008
+ this.dialect = dialect4;
24998
25009
  this.session = session;
24999
25010
  this._ = schema4 ? {
25000
25011
  schema: schema4.schema,
@@ -25016,7 +25027,7 @@ var init_db = __esm({
25016
25027
  this._.tableNamesMap,
25017
25028
  schema4.fullSchema[tableName],
25018
25029
  columns,
25019
- dialect7,
25030
+ dialect4,
25020
25031
  session
25021
25032
  );
25022
25033
  }
@@ -25284,7 +25295,7 @@ var init_indexes = __esm({
25284
25295
  return it;
25285
25296
  }
25286
25297
  it = it;
25287
- const clonedIndexedColumn = new IndexedColumn(it.name, it.columnType, it.indexConfig);
25298
+ const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
25288
25299
  it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
25289
25300
  return clonedIndexedColumn;
25290
25301
  }),
@@ -25300,7 +25311,7 @@ var init_indexes = __esm({
25300
25311
  return it;
25301
25312
  }
25302
25313
  it = it;
25303
- const clonedIndexedColumn = new IndexedColumn(it.name, it.columnType, it.indexConfig);
25314
+ const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
25304
25315
  it.indexConfig = it.defaultConfig;
25305
25316
  return clonedIndexedColumn;
25306
25317
  }),
@@ -25327,7 +25338,7 @@ var init_indexes = __esm({
25327
25338
  return it;
25328
25339
  }
25329
25340
  it = it;
25330
- const clonedIndexedColumn = new IndexedColumn(it.name, it.columnType, it.indexConfig);
25341
+ const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
25331
25342
  it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
25332
25343
  return clonedIndexedColumn;
25333
25344
  }),
@@ -25725,8 +25736,8 @@ var init_session = __esm({
25725
25736
  __publicField(PgPreparedQuery, _a157, "PgPreparedQuery");
25726
25737
  _a158 = entityKind;
25727
25738
  PgSession = class {
25728
- constructor(dialect7) {
25729
- this.dialect = dialect7;
25739
+ constructor(dialect4) {
25740
+ this.dialect = dialect4;
25730
25741
  }
25731
25742
  execute(query) {
25732
25743
  return tracer.startActiveSpan("drizzle.operation", () => {
@@ -25758,8 +25769,8 @@ var init_session = __esm({
25758
25769
  };
25759
25770
  __publicField(PgSession, _a158, "PgSession");
25760
25771
  PgTransaction = class extends (_b113 = PgDatabase, _a159 = entityKind, _b113) {
25761
- constructor(dialect7, session, schema4, nestedIndex = 0) {
25762
- super(dialect7, session, schema4);
25772
+ constructor(dialect4, session, schema4, nestedIndex = 0) {
25773
+ super(dialect4, session, schema4);
25763
25774
  this.schema = schema4;
25764
25775
  this.nestedIndex = nestedIndex;
25765
25776
  }
@@ -25797,17 +25808,17 @@ var init_subquery2 = __esm({
25797
25808
 
25798
25809
  // ../drizzle-orm/dist/pg-core/utils.js
25799
25810
  function getTableConfig(table4) {
25800
- const columns = Object.values(table4[Table2.Symbol.Columns]);
25811
+ const columns = Object.values(table4[Table.Symbol.Columns]);
25801
25812
  const indexes = [];
25802
25813
  const checks = [];
25803
25814
  const primaryKeys = [];
25804
25815
  const foreignKeys = Object.values(table4[PgTable.Symbol.InlineForeignKeys]);
25805
25816
  const uniqueConstraints = [];
25806
- const name2 = table4[Table2.Symbol.Name];
25807
- const schema4 = table4[Table2.Symbol.Schema];
25817
+ const name2 = table4[Table.Symbol.Name];
25818
+ const schema4 = table4[Table.Symbol.Schema];
25808
25819
  const extraConfigBuilder = table4[PgTable.Symbol.ExtraConfigBuilder];
25809
25820
  if (extraConfigBuilder !== void 0) {
25810
- const extraConfig = extraConfigBuilder(table4[Table2.Symbol.ExtraConfigColumns]);
25821
+ const extraConfig = extraConfigBuilder(table4[Table.Symbol.ExtraConfigColumns]);
25811
25822
  for (const builder of Object.values(extraConfig)) {
25812
25823
  if (is(builder, IndexBuilder)) {
25813
25824
  indexes.push(builder.build(table4));
@@ -25918,7 +25929,7 @@ function buildArrayString(array, sqlType) {
25918
25929
  }).join(",");
25919
25930
  return `{${values}}`;
25920
25931
  }
25921
- var dialect4, indexName, generatePgSnapshot, trimChar, fromDatabase, defaultForColumn;
25932
+ var indexName, generatePgSnapshot, trimChar, fromDatabase, defaultForColumn;
25922
25933
  var init_pgSerializer = __esm({
25923
25934
  "src/serializer/pgSerializer.ts"() {
25924
25935
  "use strict";
@@ -25930,11 +25941,11 @@ var init_pgSerializer = __esm({
25930
25941
  init_outputs();
25931
25942
  init_utils();
25932
25943
  init_serializer();
25933
- dialect4 = new PgDialect();
25934
25944
  indexName = (tableName, columns) => {
25935
25945
  return `${tableName}_${columns.join("_")}_index`;
25936
25946
  };
25937
- generatePgSnapshot = (tables, enums, schemas, sequences, schemaFilter) => {
25947
+ generatePgSnapshot = (tables, enums, schemas, sequences, casing2, schemaFilter) => {
25948
+ const dialect4 = new PgDialect({ casing: casing2 });
25938
25949
  const result = {};
25939
25950
  const sequencesToReturn = {};
25940
25951
  const indexesInSchema = {};
@@ -25958,6 +25969,7 @@ var init_pgSerializer = __esm({
25958
25969
  const primaryKeysObject = {};
25959
25970
  const uniqueConstraintObject = {};
25960
25971
  columns.forEach((column4) => {
25972
+ const name2 = getColumnCasing(column4, casing2);
25961
25973
  const notNull = column4.notNull;
25962
25974
  const primaryKey = column4.primary;
25963
25975
  const sqlTypeLowered = column4.getSQLType().toLowerCase();
@@ -25970,7 +25982,7 @@ var init_pgSerializer = __esm({
25970
25982
  const startWith = stringFromIdentityProperty(identity?.sequenceOptions?.startWith) ?? (parseFloat(increment) < 0 ? maxValue : minValue);
25971
25983
  const cache = stringFromIdentityProperty(identity?.sequenceOptions?.cache) ?? "1";
25972
25984
  const columnToSet = {
25973
- name: column4.name,
25985
+ name: name2,
25974
25986
  type: column4.getSQLType(),
25975
25987
  typeSchema,
25976
25988
  primaryKey,
@@ -25981,7 +25993,7 @@ var init_pgSerializer = __esm({
25981
25993
  } : void 0,
25982
25994
  identity: identity ? {
25983
25995
  type: identity.type,
25984
- name: identity.sequenceName ?? `${tableName}_${column4.name}_seq`,
25996
+ name: identity.sequenceName ?? `${tableName}_${name2}_seq`,
25985
25997
  schema: schema4 ?? "public",
25986
25998
  increment,
25987
25999
  startWith,
@@ -26002,7 +26014,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
26002
26014
  The unique constraint ${source_default.underline.blue(
26003
26015
  column4.uniqueName
26004
26016
  )} on the ${source_default.underline.blue(
26005
- column4.name
26017
+ name2
26006
26018
  )} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
26007
26019
  existingUnique.columns.join(",")
26008
26020
  )} columns
@@ -26018,7 +26030,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
26018
26030
  }
26019
26031
  if (column4.default !== void 0) {
26020
26032
  if (is(column4.default, SQL)) {
26021
- columnToSet.default = sqlToStr(column4.default);
26033
+ columnToSet.default = sqlToStr(column4.default, casing2);
26022
26034
  } else {
26023
26035
  if (typeof column4.default === "string") {
26024
26036
  columnToSet.default = `'${column4.default}'`;
@@ -26046,17 +26058,24 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
26046
26058
  }
26047
26059
  }
26048
26060
  }
26049
- columnsObject[column4.name] = columnToSet;
26061
+ columnsObject[name2] = columnToSet;
26050
26062
  });
26051
26063
  primaryKeys.map((pk) => {
26052
- const columnNames = pk.columns.map((c) => c.name);
26053
- primaryKeysObject[pk.getName()] = {
26054
- name: pk.getName(),
26064
+ const originalColumnNames = pk.columns.map((c) => c.name);
26065
+ const columnNames = pk.columns.map((c) => getColumnCasing(c, casing2));
26066
+ let name2 = pk.getName();
26067
+ if (casing2 !== void 0) {
26068
+ for (let i = 0; i < originalColumnNames.length; i++) {
26069
+ name2 = name2.replace(originalColumnNames[i], columnNames[i]);
26070
+ }
26071
+ }
26072
+ primaryKeysObject[name2] = {
26073
+ name: name2,
26055
26074
  columns: columnNames
26056
26075
  };
26057
26076
  });
26058
26077
  uniqueConstraints?.map((unq) => {
26059
- const columnNames = unq.columns.map((c) => c.name);
26078
+ const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
26060
26079
  const name2 = unq.name ?? uniqueKeyName(table4, columnNames);
26061
26080
  const existingUnique = uniqueConstraintObject[name2];
26062
26081
  if (typeof existingUnique !== "undefined") {
@@ -26083,15 +26102,25 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
26083
26102
  };
26084
26103
  });
26085
26104
  const fks = foreignKeys.map((fk4) => {
26086
- const name2 = fk4.getName();
26087
26105
  const tableFrom = tableName;
26088
26106
  const onDelete = fk4.onDelete;
26089
26107
  const onUpdate = fk4.onUpdate;
26090
26108
  const reference = fk4.reference();
26091
26109
  const tableTo = getTableName(reference.foreignTable);
26092
26110
  const schemaTo = getTableConfig(reference.foreignTable).schema;
26093
- const columnsFrom = reference.columns.map((it) => it.name);
26094
- const columnsTo = reference.foreignColumns.map((it) => it.name);
26111
+ const originalColumnsFrom = reference.columns.map((it) => it.name);
26112
+ const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
26113
+ const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
26114
+ const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
26115
+ let name2 = fk4.getName();
26116
+ if (casing2 !== void 0) {
26117
+ for (let i = 0; i < originalColumnsFrom.length; i++) {
26118
+ name2 = name2.replace(originalColumnsFrom[i], columnsFrom[i]);
26119
+ }
26120
+ for (let i = 0; i < originalColumnsTo.length; i++) {
26121
+ name2 = name2.replace(originalColumnsTo[i], columnsTo[i]);
26122
+ }
26123
+ }
26095
26124
  return {
26096
26125
  name: name2,
26097
26126
  tableFrom,
@@ -26124,12 +26153,13 @@ ${withStyle.errorWarning(
26124
26153
  }
26125
26154
  }
26126
26155
  it = it;
26156
+ const name3 = getColumnCasing(it, casing2);
26127
26157
  if (!is(it, SQL) && it.type === "PgVector" && typeof it.indexConfig.opClass === "undefined") {
26128
26158
  console.log(
26129
26159
  `
26130
26160
  ${withStyle.errorWarning(
26131
26161
  `You are specifying an index on the ${source_default.blueBright(
26132
- it.name
26162
+ name3
26133
26163
  )} column inside the ${source_default.blueBright(
26134
26164
  tableName
26135
26165
  )} table with the ${source_default.blueBright(
@@ -26139,7 +26169,7 @@ ${withStyle.errorWarning(
26139
26169
  )}].
26140
26170
 
26141
26171
  You can specify it using current syntax: ${source_default.underline(
26142
- `index("${value.config.name}").using("${value.config.method}", table.${it.name}.op("${vectorOps[0]}"))`
26172
+ `index("${value.config.name}").using("${value.config.method}", table.${name3}.op("${vectorOps[0]}"))`
26143
26173
  )}
26144
26174
 
26145
26175
  You can check the "pg_vector" docs for more info: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing
@@ -26148,7 +26178,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
26148
26178
  );
26149
26179
  process.exit(1);
26150
26180
  }
26151
- indexColumnNames.push(it.name);
26181
+ indexColumnNames.push(name3);
26152
26182
  });
26153
26183
  const name2 = value.config.name ? value.config.name : indexName(tableName, indexColumnNames);
26154
26184
  let indexColumns = columns2.map(
@@ -26163,7 +26193,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
26163
26193
  } else {
26164
26194
  it = it;
26165
26195
  return {
26166
- expression: it.name,
26196
+ expression: getColumnCasing(it, casing2),
26167
26197
  isExpression: false,
26168
26198
  asc: it.indexConfig?.order === "asc",
26169
26199
  nulls: it.indexConfig?.nulls ? it.indexConfig?.nulls : it.indexConfig?.order === "desc" ? "first" : "last",
@@ -26628,7 +26658,7 @@ ${withStyle.errorWarning(
26628
26658
  schema: tableSchema
26629
26659
  } : void 0
26630
26660
  };
26631
- if (identityName) {
26661
+ if (identityName && typeof identityName === "string") {
26632
26662
  delete sequencesToReturn[`${tableSchema}.${identityName.startsWith('"') && identityName.endsWith('"') ? identityName.slice(1, -1) : identityName}`];
26633
26663
  delete sequencesToReturn[identityName];
26634
26664
  }
@@ -27559,8 +27589,8 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
27559
27589
  })
27560
27590
  );
27561
27591
  const table4 = Object.assign(rawTable, builtColumns);
27562
- table4[Table2.Symbol.Columns] = builtColumns;
27563
- table4[Table2.Symbol.ExtraConfigColumns] = builtColumns;
27592
+ table4[Table.Symbol.Columns] = builtColumns;
27593
+ table4[Table.Symbol.ExtraConfigColumns] = builtColumns;
27564
27594
  if (extraConfig) {
27565
27595
  table4[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig;
27566
27596
  }
@@ -27574,7 +27604,7 @@ var init_table3 = __esm({
27574
27604
  init_table();
27575
27605
  init_all2();
27576
27606
  InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
27577
- SQLiteTable = class extends (_e2 = Table2, _d3 = entityKind, _c6 = Table2.Symbol.Columns, _b140 = InlineForeignKeys2, _a193 = Table2.Symbol.ExtraConfigBuilder, _e2) {
27607
+ SQLiteTable = class extends (_e2 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a193 = Table.Symbol.ExtraConfigBuilder, _e2) {
27578
27608
  constructor() {
27579
27609
  super(...arguments);
27580
27610
  /** @internal */
@@ -27587,7 +27617,7 @@ var init_table3 = __esm({
27587
27617
  };
27588
27618
  __publicField(SQLiteTable, _d3, "SQLiteTable");
27589
27619
  /** @internal */
27590
- __publicField(SQLiteTable, "Symbol", Object.assign({}, Table2.Symbol, {
27620
+ __publicField(SQLiteTable, "Symbol", Object.assign({}, Table.Symbol, {
27591
27621
  InlineForeignKeys: InlineForeignKeys2
27592
27622
  }));
27593
27623
  sqliteTable = (name2, columns, extraConfig) => {
@@ -27606,7 +27636,7 @@ var init_delete2 = __esm({
27606
27636
  init_table3();
27607
27637
  init_utils2();
27608
27638
  SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a194 = entityKind, _b141) {
27609
- constructor(table4, session, dialect7, withList) {
27639
+ constructor(table4, session, dialect4, withList) {
27610
27640
  super();
27611
27641
  /** @internal */
27612
27642
  __publicField(this, "config");
@@ -27624,7 +27654,7 @@ var init_delete2 = __esm({
27624
27654
  });
27625
27655
  this.table = table4;
27626
27656
  this.session = session;
27627
- this.dialect = dialect7;
27657
+ this.dialect = dialect4;
27628
27658
  this.config = { table: table4, withList };
27629
27659
  }
27630
27660
  /**
@@ -27708,10 +27738,10 @@ var init_insert2 = __esm({
27708
27738
  init_utils2();
27709
27739
  _a195 = entityKind;
27710
27740
  SQLiteInsertBuilder = class {
27711
- constructor(table4, session, dialect7, withList) {
27741
+ constructor(table4, session, dialect4, withList) {
27712
27742
  this.table = table4;
27713
27743
  this.session = session;
27714
- this.dialect = dialect7;
27744
+ this.dialect = dialect4;
27715
27745
  this.withList = withList;
27716
27746
  }
27717
27747
  values(values) {
@@ -27721,7 +27751,7 @@ var init_insert2 = __esm({
27721
27751
  }
27722
27752
  const mappedValues = values.map((entry) => {
27723
27753
  const result = {};
27724
- const cols = this.table[Table2.Symbol.Columns];
27754
+ const cols = this.table[Table.Symbol.Columns];
27725
27755
  for (const colKey of Object.keys(entry)) {
27726
27756
  const colValue = entry[colKey];
27727
27757
  result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
@@ -27733,7 +27763,7 @@ var init_insert2 = __esm({
27733
27763
  };
27734
27764
  __publicField(SQLiteInsertBuilder, _a195, "SQLiteInsertBuilder");
27735
27765
  SQLiteInsertBase = class extends (_b142 = QueryPromise, _a196 = entityKind, _b142) {
27736
- constructor(table4, values, session, dialect7, withList) {
27766
+ constructor(table4, values, session, dialect4, withList) {
27737
27767
  super();
27738
27768
  /** @internal */
27739
27769
  __publicField(this, "config");
@@ -27750,7 +27780,7 @@ var init_insert2 = __esm({
27750
27780
  return this._prepare().values(placeholderValues);
27751
27781
  });
27752
27782
  this.session = session;
27753
- this.dialect = dialect7;
27783
+ this.dialect = dialect4;
27754
27784
  this.config = { table: table4, values, withList };
27755
27785
  }
27756
27786
  returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) {
@@ -27932,7 +27962,7 @@ var init_dialect2 = __esm({
27932
27962
  return sql`${withSql}delete from ${table4}${whereSql}${returningSql}`;
27933
27963
  }
27934
27964
  buildUpdateSet(table4, set) {
27935
- const tableColumns = table4[Table2.Symbol.Columns];
27965
+ const tableColumns = table4[Table.Symbol.Columns];
27936
27966
  const columnNames = Object.keys(tableColumns).filter(
27937
27967
  (colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
27938
27968
  );
@@ -27991,7 +28021,7 @@ var init_dialect2 = __esm({
27991
28021
  chunk.push(sql` as ${sql.identifier(field.fieldAlias)}`);
27992
28022
  }
27993
28023
  } else if (is(field, Column2)) {
27994
- const tableName = field.table[Table2.Symbol.Name];
28024
+ const tableName = field.table[Table.Symbol.Name];
27995
28025
  if (isSingleTable) {
27996
28026
  chunk.push(sql.identifier(this.casing.getColumnCasing(field)));
27997
28027
  } else {
@@ -28023,7 +28053,7 @@ var init_dialect2 = __esm({
28023
28053
  const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
28024
28054
  for (const f of fieldsList) {
28025
28055
  if (is(f.field, Column2) && getTableName(f.field.table) !== (is(table4, Subquery) ? table4._.alias : is(table4, SQLiteViewBase) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : getTableName(table4)) && !((table22) => joins?.some(
28026
- ({ alias }) => alias === (table22[Table2.Symbol.IsAlias] ? getTableName(table22) : table22[Table2.Symbol.BaseName])
28056
+ ({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName])
28027
28057
  ))(f.field.table)) {
28028
28058
  const tableName = getTableName(f.field.table);
28029
28059
  throw new Error(
@@ -28036,8 +28066,8 @@ var init_dialect2 = __esm({
28036
28066
  const distinctSql = distinct ? sql` distinct` : void 0;
28037
28067
  const selection = this.buildSelection(fieldsList, { isSingleTable });
28038
28068
  const tableSql = (() => {
28039
- if (is(table4, Table2) && table4[Table2.Symbol.OriginalName] !== table4[Table2.Symbol.Name]) {
28040
- return sql`${sql.identifier(table4[Table2.Symbol.OriginalName])} ${sql.identifier(table4[Table2.Symbol.Name])}`;
28069
+ if (is(table4, Table) && table4[Table.Symbol.OriginalName] !== table4[Table.Symbol.Name]) {
28070
+ return sql`${sql.identifier(table4[Table.Symbol.OriginalName])} ${sql.identifier(table4[Table.Symbol.Name])}`;
28041
28071
  }
28042
28072
  return table4;
28043
28073
  })();
@@ -28143,7 +28173,7 @@ var init_dialect2 = __esm({
28143
28173
  }
28144
28174
  buildInsertQuery({ table: table4, values, onConflict, returning, withList }) {
28145
28175
  const valuesSqlList = [];
28146
- const columns = table4[Table2.Symbol.Columns];
28176
+ const columns = table4[Table.Symbol.Columns];
28147
28177
  const colEntries = Object.entries(columns).filter(
28148
28178
  ([_2, col]) => !col.shouldDisableInsert()
28149
28179
  );
@@ -28552,7 +28582,7 @@ var init_select3 = __esm({
28552
28582
  };
28553
28583
  __publicField(SQLiteSelectBuilder, _a201, "SQLiteSelectBuilder");
28554
28584
  SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a202 = entityKind, _b146) {
28555
- constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect7, withList, distinct }) {
28585
+ constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
28556
28586
  super();
28557
28587
  __publicField(this, "_");
28558
28588
  /** @internal */
@@ -28787,7 +28817,7 @@ var init_select3 = __esm({
28787
28817
  };
28788
28818
  this.isPartialSelect = isPartialSelect;
28789
28819
  this.session = session;
28790
- this.dialect = dialect7;
28820
+ this.dialect = dialect4;
28791
28821
  this._ = {
28792
28822
  selectedFields: fields
28793
28823
  };
@@ -28808,7 +28838,7 @@ var init_select3 = __esm({
28808
28838
  };
28809
28839
  }
28810
28840
  if (typeof tableName === "string" && !is(table4, SQL)) {
28811
- const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table2.Symbol.Columns];
28841
+ const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table.Symbol.Columns];
28812
28842
  this.config.fields[tableName] = selection;
28813
28843
  }
28814
28844
  }
@@ -29122,11 +29152,11 @@ var init_query_builder3 = __esm({
29122
29152
  init_select3();
29123
29153
  _a204 = entityKind;
29124
29154
  QueryBuilder2 = class {
29125
- constructor(dialect7) {
29155
+ constructor(dialect4) {
29126
29156
  __publicField(this, "dialect");
29127
29157
  __publicField(this, "dialectConfig");
29128
- this.dialect = is(dialect7, SQLiteDialect) ? dialect7 : void 0;
29129
- this.dialectConfig = is(dialect7, SQLiteDialect) ? void 0 : dialect7;
29158
+ this.dialect = is(dialect4, SQLiteDialect) ? dialect4 : void 0;
29159
+ this.dialectConfig = is(dialect4, SQLiteDialect) ? void 0 : dialect4;
29130
29160
  }
29131
29161
  $with(alias) {
29132
29162
  const queryBuilder = this;
@@ -29204,10 +29234,10 @@ var init_update2 = __esm({
29204
29234
  init_utils2();
29205
29235
  _a205 = entityKind;
29206
29236
  SQLiteUpdateBuilder = class {
29207
- constructor(table4, session, dialect7, withList) {
29237
+ constructor(table4, session, dialect4, withList) {
29208
29238
  this.table = table4;
29209
29239
  this.session = session;
29210
- this.dialect = dialect7;
29240
+ this.dialect = dialect4;
29211
29241
  this.withList = withList;
29212
29242
  }
29213
29243
  set(values) {
@@ -29222,7 +29252,7 @@ var init_update2 = __esm({
29222
29252
  };
29223
29253
  __publicField(SQLiteUpdateBuilder, _a205, "SQLiteUpdateBuilder");
29224
29254
  SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a206 = entityKind, _b148) {
29225
- constructor(table4, set, session, dialect7, withList) {
29255
+ constructor(table4, set, session, dialect4, withList) {
29226
29256
  super();
29227
29257
  /** @internal */
29228
29258
  __publicField(this, "config");
@@ -29239,7 +29269,7 @@ var init_update2 = __esm({
29239
29269
  return this._prepare().values(placeholderValues);
29240
29270
  });
29241
29271
  this.session = session;
29242
- this.dialect = dialect7;
29272
+ this.dialect = dialect4;
29243
29273
  this.config = { set, table: table4, withList };
29244
29274
  }
29245
29275
  /**
@@ -29390,14 +29420,14 @@ var init_query2 = __esm({
29390
29420
  init_relations();
29391
29421
  _a208 = entityKind;
29392
29422
  RelationalQueryBuilder2 = class {
29393
- constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect7, session) {
29423
+ constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
29394
29424
  this.mode = mode;
29395
29425
  this.fullSchema = fullSchema;
29396
29426
  this.schema = schema4;
29397
29427
  this.tableNamesMap = tableNamesMap;
29398
29428
  this.table = table4;
29399
29429
  this.tableConfig = tableConfig;
29400
- this.dialect = dialect7;
29430
+ this.dialect = dialect4;
29401
29431
  this.session = session;
29402
29432
  }
29403
29433
  findMany(config) {
@@ -29449,7 +29479,7 @@ var init_query2 = __esm({
29449
29479
  };
29450
29480
  __publicField(RelationalQueryBuilder2, _a208, "SQLiteAsyncRelationalQueryBuilder");
29451
29481
  SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a209 = entityKind, _b150) {
29452
- constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect7, session, config, mode) {
29482
+ constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
29453
29483
  super();
29454
29484
  /** @internal */
29455
29485
  __publicField(this, "mode");
@@ -29458,7 +29488,7 @@ var init_query2 = __esm({
29458
29488
  this.tableNamesMap = tableNamesMap;
29459
29489
  this.table = table4;
29460
29490
  this.tableConfig = tableConfig;
29461
- this.dialect = dialect7;
29491
+ this.dialect = dialect4;
29462
29492
  this.session = session;
29463
29493
  this.config = config;
29464
29494
  this.mode = mode;
@@ -29542,13 +29572,13 @@ var init_raw2 = __esm({
29542
29572
  init_entity();
29543
29573
  init_query_promise();
29544
29574
  SQLiteRaw = class extends (_b152 = QueryPromise, _a211 = entityKind, _b152) {
29545
- constructor(execute, getSQL, action, dialect7, mapBatchResult) {
29575
+ constructor(execute, getSQL, action, dialect4, mapBatchResult) {
29546
29576
  super();
29547
29577
  /** @internal */
29548
29578
  __publicField(this, "config");
29549
29579
  this.execute = execute;
29550
29580
  this.getSQL = getSQL;
29551
- this.dialect = dialect7;
29581
+ this.dialect = dialect4;
29552
29582
  this.mapBatchResult = mapBatchResult;
29553
29583
  this.config = { action };
29554
29584
  }
@@ -29585,10 +29615,10 @@ var init_db2 = __esm({
29585
29615
  init_raw2();
29586
29616
  _a212 = entityKind;
29587
29617
  BaseSQLiteDatabase = class {
29588
- constructor(resultKind, dialect7, session, schema4) {
29618
+ constructor(resultKind, dialect4, session, schema4) {
29589
29619
  __publicField(this, "query");
29590
29620
  this.resultKind = resultKind;
29591
- this.dialect = dialect7;
29621
+ this.dialect = dialect4;
29592
29622
  this.session = session;
29593
29623
  this._ = schema4 ? {
29594
29624
  schema: schema4.schema,
@@ -29610,7 +29640,7 @@ var init_db2 = __esm({
29610
29640
  this._.tableNamesMap,
29611
29641
  schema4.fullSchema[tableName],
29612
29642
  columns,
29613
- dialect7,
29643
+ dialect4,
29614
29644
  session
29615
29645
  );
29616
29646
  }
@@ -30028,8 +30058,8 @@ var init_session2 = __esm({
30028
30058
  __publicField(SQLitePreparedQuery, _a219, "PreparedQuery");
30029
30059
  _a220 = entityKind;
30030
30060
  SQLiteSession = class {
30031
- constructor(dialect7) {
30032
- this.dialect = dialect7;
30061
+ constructor(dialect4) {
30062
+ this.dialect = dialect4;
30033
30063
  }
30034
30064
  prepareOneTimeQuery(query, fields, executeMethod, isResponseInArrayMode) {
30035
30065
  return this.prepareQuery(query, fields, executeMethod, isResponseInArrayMode);
@@ -30074,8 +30104,8 @@ var init_session2 = __esm({
30074
30104
  };
30075
30105
  __publicField(SQLiteSession, _a220, "SQLiteSession");
30076
30106
  SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a221 = entityKind, _b154) {
30077
- constructor(resultType, dialect7, session, schema4, nestedIndex = 0) {
30078
- super(resultType, dialect7, session, schema4);
30107
+ constructor(resultType, dialect4, session, schema4, nestedIndex = 0) {
30108
+ super(resultType, dialect4, session, schema4);
30079
30109
  this.schema = schema4;
30080
30110
  this.nestedIndex = nestedIndex;
30081
30111
  }
@@ -30111,7 +30141,7 @@ function getTableConfig2(table4) {
30111
30141
  const primaryKeys = [];
30112
30142
  const uniqueConstraints = [];
30113
30143
  const foreignKeys = Object.values(table4[SQLiteTable.Symbol.InlineForeignKeys]);
30114
- const name2 = table4[Table2.Symbol.Name];
30144
+ const name2 = table4[Table.Symbol.Name];
30115
30145
  const extraConfigBuilder = table4[SQLiteTable.Symbol.ExtraConfigBuilder];
30116
30146
  if (extraConfigBuilder !== void 0) {
30117
30147
  const extraConfig = extraConfigBuilder(table4[SQLiteTable.Symbol.Columns]);
@@ -30342,7 +30372,7 @@ function extractGeneratedColumns(input) {
30342
30372
  }
30343
30373
  return columns;
30344
30374
  }
30345
- var dialect5, generateSqliteSnapshot, fromDatabase2;
30375
+ var generateSqliteSnapshot, fromDatabase2;
30346
30376
  var init_sqliteSerializer = __esm({
30347
30377
  "src/serializer/sqliteSerializer.ts"() {
30348
30378
  "use strict";
@@ -30350,9 +30380,10 @@ var init_sqliteSerializer = __esm({
30350
30380
  init_dist();
30351
30381
  init_sqlite_core();
30352
30382
  init_outputs();
30383
+ init_utils();
30353
30384
  init_serializer();
30354
- dialect5 = new SQLiteSyncDialect();
30355
- generateSqliteSnapshot = (tables) => {
30385
+ generateSqliteSnapshot = (tables, casing2) => {
30386
+ const dialect4 = new SQLiteSyncDialect({ casing: casing2 });
30356
30387
  const result = {};
30357
30388
  const internal = { indexes: {} };
30358
30389
  for (const table4 of tables) {
@@ -30370,28 +30401,29 @@ var init_sqliteSerializer = __esm({
30370
30401
  uniqueConstraints
30371
30402
  } = getTableConfig2(table4);
30372
30403
  columns.forEach((column4) => {
30404
+ const name2 = getColumnCasing(column4, casing2);
30373
30405
  const notNull = column4.notNull;
30374
30406
  const primaryKey = column4.primary;
30375
30407
  const generated = column4.generated;
30376
30408
  const columnToSet = {
30377
- name: column4.name,
30409
+ name: name2,
30378
30410
  type: column4.getSQLType(),
30379
30411
  primaryKey,
30380
30412
  notNull,
30381
30413
  autoincrement: is(column4, SQLiteBaseInteger) ? column4.autoIncrement : false,
30382
30414
  generated: generated ? {
30383
- as: is(generated.as, SQL) ? `(${dialect5.sqlToQuery(generated.as, "indexes").sql})` : typeof generated.as === "function" ? `(${dialect5.sqlToQuery(generated.as(), "indexes").sql})` : `(${generated.as})`,
30415
+ as: is(generated.as, SQL) ? `(${dialect4.sqlToQuery(generated.as, "indexes").sql})` : typeof generated.as === "function" ? `(${dialect4.sqlToQuery(generated.as(), "indexes").sql})` : `(${generated.as})`,
30384
30416
  type: generated.mode ?? "virtual"
30385
30417
  } : void 0
30386
30418
  };
30387
30419
  if (column4.default !== void 0) {
30388
30420
  if (is(column4.default, SQL)) {
30389
- columnToSet.default = sqlToStr(column4.default);
30421
+ columnToSet.default = sqlToStr(column4.default, casing2);
30390
30422
  } else {
30391
30423
  columnToSet.default = typeof column4.default === "string" ? `'${column4.default}'` : typeof column4.default === "object" || Array.isArray(column4.default) ? `'${JSON.stringify(column4.default)}'` : column4.default;
30392
30424
  }
30393
30425
  }
30394
- columnsObject[column4.name] = columnToSet;
30426
+ columnsObject[name2] = columnToSet;
30395
30427
  if (column4.isUnique) {
30396
30428
  const existingUnique = indexesObject[column4.uniqueName];
30397
30429
  if (typeof existingUnique !== "undefined") {
@@ -30403,7 +30435,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
30403
30435
  The unique constraint ${source_default.underline.blue(
30404
30436
  column4.uniqueName
30405
30437
  )} on the ${source_default.underline.blue(
30406
- column4.name
30438
+ name2
30407
30439
  )} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
30408
30440
  existingUnique.columns.join(",")
30409
30441
  )} columns
@@ -30419,15 +30451,25 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
30419
30451
  }
30420
30452
  });
30421
30453
  const foreignKeys = tableForeignKeys.map((fk4) => {
30422
- const name2 = fk4.getName();
30423
30454
  const tableFrom = tableName;
30424
30455
  const onDelete = fk4.onDelete ?? "no action";
30425
30456
  const onUpdate = fk4.onUpdate ?? "no action";
30426
30457
  const reference = fk4.reference();
30427
30458
  const referenceFT = reference.foreignTable;
30428
30459
  const tableTo = getTableName(referenceFT);
30429
- const columnsFrom = reference.columns.map((it) => it.name);
30430
- const columnsTo = reference.foreignColumns.map((it) => it.name);
30460
+ const originalColumnsFrom = reference.columns.map((it) => it.name);
30461
+ const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
30462
+ const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
30463
+ const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
30464
+ let name2 = fk4.getName();
30465
+ if (casing2 !== void 0) {
30466
+ for (let i = 0; i < originalColumnsFrom.length; i++) {
30467
+ name2 = name2.replace(originalColumnsFrom[i], columnsFrom[i]);
30468
+ }
30469
+ for (let i = 0; i < originalColumnsTo.length; i++) {
30470
+ name2 = name2.replace(originalColumnsTo[i], columnsTo[i]);
30471
+ }
30472
+ }
30431
30473
  return {
30432
30474
  name: name2,
30433
30475
  tableFrom,
@@ -30446,7 +30488,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
30446
30488
  const name2 = value.config.name;
30447
30489
  let indexColumns = columns2.map((it) => {
30448
30490
  if (is(it, SQL)) {
30449
- const sql2 = dialect5.sqlToQuery(it, "indexes").sql;
30491
+ const sql2 = dialect4.sqlToQuery(it, "indexes").sql;
30450
30492
  if (typeof internal.indexes[name2] === "undefined") {
30451
30493
  internal.indexes[name2] = {
30452
30494
  columns: {
@@ -30466,13 +30508,13 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
30466
30508
  }
30467
30509
  return sql2;
30468
30510
  } else {
30469
- return it.name;
30511
+ return getColumnCasing(it, casing2);
30470
30512
  }
30471
30513
  });
30472
30514
  let where = void 0;
30473
30515
  if (value.config.where !== void 0) {
30474
30516
  if (is(value.config.where, SQL)) {
30475
- where = dialect5.sqlToQuery(value.config.where).sql;
30517
+ where = dialect4.sqlToQuery(value.config.where).sql;
30476
30518
  }
30477
30519
  }
30478
30520
  indexesObject[name2] = {
@@ -30483,7 +30525,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
30483
30525
  };
30484
30526
  });
30485
30527
  uniqueConstraints?.map((unq) => {
30486
- const columnNames = unq.columns.map((c) => c.name);
30528
+ const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
30487
30529
  const name2 = unq.name ?? uniqueKeyName2(table4, columnNames);
30488
30530
  const existingUnique = indexesObject[name2];
30489
30531
  if (typeof existingUnique !== "undefined") {
@@ -30513,12 +30555,20 @@ The unique constraint ${source_default.underline.blue(
30513
30555
  });
30514
30556
  primaryKeys.forEach((it) => {
30515
30557
  if (it.columns.length > 1) {
30516
- primaryKeysObject[it.getName()] = {
30517
- columns: it.columns.map((it2) => it2.name),
30518
- name: it.getName()
30558
+ const originalColumnNames = it.columns.map((c) => c.name);
30559
+ const columnNames = it.columns.map((c) => getColumnCasing(c, casing2));
30560
+ let name2 = it.getName();
30561
+ if (casing2 !== void 0) {
30562
+ for (let i = 0; i < originalColumnNames.length; i++) {
30563
+ name2 = name2.replace(originalColumnNames[i], columnNames[i]);
30564
+ }
30565
+ }
30566
+ primaryKeysObject[name2] = {
30567
+ columns: columnNames,
30568
+ name: name2
30519
30569
  };
30520
30570
  } else {
30521
- columnsObject[it.columns[0].name].primaryKey = true;
30571
+ columnsObject[getColumnCasing(it.columns[0], casing2)].primaryKey = true;
30522
30572
  }
30523
30573
  });
30524
30574
  result[tableName] = {
@@ -32198,7 +32248,7 @@ var init_delete3 = __esm({
32198
32248
  init_entity();
32199
32249
  init_query_promise();
32200
32250
  MySqlDeleteBase = class extends (_b221 = QueryPromise, _a296 = entityKind, _b221) {
32201
- constructor(table4, session, dialect7, withList) {
32251
+ constructor(table4, session, dialect4, withList) {
32202
32252
  super();
32203
32253
  __publicField(this, "config");
32204
32254
  __publicField(this, "execute", (placeholderValues) => {
@@ -32213,7 +32263,7 @@ var init_delete3 = __esm({
32213
32263
  __publicField(this, "iterator", this.createIterator());
32214
32264
  this.table = table4;
32215
32265
  this.session = session;
32216
- this.dialect = dialect7;
32266
+ this.dialect = dialect4;
32217
32267
  this.config = { table: table4, withList };
32218
32268
  }
32219
32269
  /**
@@ -32283,11 +32333,11 @@ var init_insert3 = __esm({
32283
32333
  init_utils2();
32284
32334
  _a297 = entityKind;
32285
32335
  MySqlInsertBuilder = class {
32286
- constructor(table4, session, dialect7) {
32336
+ constructor(table4, session, dialect4) {
32287
32337
  __publicField(this, "shouldIgnore", false);
32288
32338
  this.table = table4;
32289
32339
  this.session = session;
32290
- this.dialect = dialect7;
32340
+ this.dialect = dialect4;
32291
32341
  }
32292
32342
  ignore() {
32293
32343
  this.shouldIgnore = true;
@@ -32300,7 +32350,7 @@ var init_insert3 = __esm({
32300
32350
  }
32301
32351
  const mappedValues = values.map((entry) => {
32302
32352
  const result = {};
32303
- const cols = this.table[Table2.Symbol.Columns];
32353
+ const cols = this.table[Table.Symbol.Columns];
32304
32354
  for (const colKey of Object.keys(entry)) {
32305
32355
  const colValue = entry[colKey];
32306
32356
  result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
@@ -32312,7 +32362,7 @@ var init_insert3 = __esm({
32312
32362
  };
32313
32363
  __publicField(MySqlInsertBuilder, _a297, "MySqlInsertBuilder");
32314
32364
  MySqlInsertBase = class extends (_b222 = QueryPromise, _a298 = entityKind, _b222) {
32315
- constructor(table4, values, ignore, session, dialect7) {
32365
+ constructor(table4, values, ignore, session, dialect4) {
32316
32366
  super();
32317
32367
  __publicField(this, "config");
32318
32368
  __publicField(this, "execute", (placeholderValues) => {
@@ -32326,7 +32376,7 @@ var init_insert3 = __esm({
32326
32376
  });
32327
32377
  __publicField(this, "iterator", this.createIterator());
32328
32378
  this.session = session;
32329
- this.dialect = dialect7;
32379
+ this.dialect = dialect4;
32330
32380
  this.config = { table: table4, values, ignore };
32331
32381
  }
32332
32382
  /**
@@ -32362,12 +32412,12 @@ var init_insert3 = __esm({
32362
32412
  }
32363
32413
  $returningId() {
32364
32414
  const returning = [];
32365
- for (const [key, value] of Object.entries(this.config.table[Table2.Symbol.Columns])) {
32415
+ for (const [key, value] of Object.entries(this.config.table[Table.Symbol.Columns])) {
32366
32416
  if (value.primary) {
32367
32417
  returning.push({ field: value, path: [key] });
32368
32418
  }
32369
32419
  }
32370
- this.config.returning = orderSelectedFields(this.config.table[Table2.Symbol.Columns]);
32420
+ this.config.returning = orderSelectedFields(this.config.table[Table.Symbol.Columns]);
32371
32421
  return this;
32372
32422
  }
32373
32423
  /** @internal */
@@ -32469,8 +32519,8 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
32469
32519
  })
32470
32520
  );
32471
32521
  const table4 = Object.assign(rawTable, builtColumns);
32472
- table4[Table2.Symbol.Columns] = builtColumns;
32473
- table4[Table2.Symbol.ExtraConfigColumns] = builtColumns;
32522
+ table4[Table.Symbol.Columns] = builtColumns;
32523
+ table4[Table.Symbol.ExtraConfigColumns] = builtColumns;
32474
32524
  if (extraConfig) {
32475
32525
  table4[MySqlTable.Symbol.ExtraConfigBuilder] = extraConfig;
32476
32526
  }
@@ -32484,7 +32534,7 @@ var init_table4 = __esm({
32484
32534
  init_table();
32485
32535
  init_all3();
32486
32536
  InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
32487
- MySqlTable = class extends (_e3 = Table2, _d4 = entityKind, _c10 = Table2.Symbol.Columns, _b223 = InlineForeignKeys3, _a299 = Table2.Symbol.ExtraConfigBuilder, _e3) {
32537
+ MySqlTable = class extends (_e3 = Table, _d4 = entityKind, _c10 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a299 = Table.Symbol.ExtraConfigBuilder, _e3) {
32488
32538
  constructor() {
32489
32539
  super(...arguments);
32490
32540
  /** @internal */
@@ -32497,7 +32547,7 @@ var init_table4 = __esm({
32497
32547
  };
32498
32548
  __publicField(MySqlTable, _d4, "MySqlTable");
32499
32549
  /** @internal */
32500
- __publicField(MySqlTable, "Symbol", Object.assign({}, Table2.Symbol, {
32550
+ __publicField(MySqlTable, "Symbol", Object.assign({}, Table.Symbol, {
32501
32551
  InlineForeignKeys: InlineForeignKeys3
32502
32552
  }));
32503
32553
  mysqlTable = (name2, columns, extraConfig) => {
@@ -32602,7 +32652,7 @@ var init_dialect3 = __esm({
32602
32652
  return sql`${withSql}delete from ${table4}${whereSql}${returningSql}`;
32603
32653
  }
32604
32654
  buildUpdateSet(table4, set) {
32605
- const tableColumns = table4[Table2.Symbol.Columns];
32655
+ const tableColumns = table4[Table.Symbol.Columns];
32606
32656
  const columnNames = Object.keys(tableColumns).filter(
32607
32657
  (colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
32608
32658
  );
@@ -32693,7 +32743,7 @@ var init_dialect3 = __esm({
32693
32743
  const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
32694
32744
  for (const f of fieldsList) {
32695
32745
  if (is(f.field, Column2) && getTableName(f.field.table) !== (is(table4, Subquery) ? table4._.alias : is(table4, MySqlViewBase) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : getTableName(table4)) && !((table22) => joins?.some(
32696
- ({ alias }) => alias === (table22[Table2.Symbol.IsAlias] ? getTableName(table22) : table22[Table2.Symbol.BaseName])
32746
+ ({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName])
32697
32747
  ))(f.field.table)) {
32698
32748
  const tableName = getTableName(f.field.table);
32699
32749
  throw new Error(
@@ -32706,8 +32756,8 @@ var init_dialect3 = __esm({
32706
32756
  const distinctSql = distinct ? sql` distinct` : void 0;
32707
32757
  const selection = this.buildSelection(fieldsList, { isSingleTable });
32708
32758
  const tableSql = (() => {
32709
- if (is(table4, Table2) && table4[Table2.Symbol.OriginalName] !== table4[Table2.Symbol.Name]) {
32710
- return sql`${sql.identifier(table4[Table2.Symbol.OriginalName])} ${sql.identifier(table4[Table2.Symbol.Name])}`;
32759
+ if (is(table4, Table) && table4[Table.Symbol.OriginalName] !== table4[Table.Symbol.Name]) {
32760
+ return sql`${sql.identifier(table4[Table.Symbol.OriginalName])} ${sql.identifier(table4[Table.Symbol.Name])}`;
32711
32761
  }
32712
32762
  return table4;
32713
32763
  })();
@@ -32820,7 +32870,7 @@ var init_dialect3 = __esm({
32820
32870
  }
32821
32871
  buildInsertQuery({ table: table4, values, ignore, onConflict }) {
32822
32872
  const valuesSqlList = [];
32823
- const columns = table4[Table2.Symbol.Columns];
32873
+ const columns = table4[Table.Symbol.Columns];
32824
32874
  const colEntries = Object.entries(columns).filter(
32825
32875
  ([_2, col]) => !col.shouldDisableInsert()
32826
32876
  );
@@ -33405,7 +33455,7 @@ var init_select4 = __esm({
33405
33455
  };
33406
33456
  __publicField(MySqlSelectBuilder, _a302, "MySqlSelectBuilder");
33407
33457
  MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a303 = entityKind, _b225) {
33408
- constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect7, withList, distinct }) {
33458
+ constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
33409
33459
  super();
33410
33460
  __publicField(this, "_");
33411
33461
  __publicField(this, "config");
@@ -33722,7 +33772,7 @@ var init_select4 = __esm({
33722
33772
  };
33723
33773
  this.isPartialSelect = isPartialSelect;
33724
33774
  this.session = session;
33725
- this.dialect = dialect7;
33775
+ this.dialect = dialect4;
33726
33776
  this._ = {
33727
33777
  selectedFields: fields
33728
33778
  };
@@ -33743,7 +33793,7 @@ var init_select4 = __esm({
33743
33793
  };
33744
33794
  }
33745
33795
  if (typeof tableName === "string" && !is(table4, SQL)) {
33746
- const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table2.Symbol.Columns];
33796
+ const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table.Symbol.Columns];
33747
33797
  this.config.fields[tableName] = selection;
33748
33798
  }
33749
33799
  }
@@ -34061,11 +34111,11 @@ var init_query_builder4 = __esm({
34061
34111
  init_select4();
34062
34112
  _a305 = entityKind;
34063
34113
  QueryBuilder3 = class {
34064
- constructor(dialect7) {
34114
+ constructor(dialect4) {
34065
34115
  __publicField(this, "dialect");
34066
34116
  __publicField(this, "dialectConfig");
34067
- this.dialect = is(dialect7, MySqlDialect) ? dialect7 : void 0;
34068
- this.dialectConfig = is(dialect7, MySqlDialect) ? void 0 : dialect7;
34117
+ this.dialect = is(dialect4, MySqlDialect) ? dialect4 : void 0;
34118
+ this.dialectConfig = is(dialect4, MySqlDialect) ? void 0 : dialect4;
34069
34119
  }
34070
34120
  $with(alias) {
34071
34121
  const queryBuilder = this;
@@ -34142,10 +34192,10 @@ var init_update3 = __esm({
34142
34192
  init_utils2();
34143
34193
  _a306 = entityKind;
34144
34194
  MySqlUpdateBuilder = class {
34145
- constructor(table4, session, dialect7, withList) {
34195
+ constructor(table4, session, dialect4, withList) {
34146
34196
  this.table = table4;
34147
34197
  this.session = session;
34148
- this.dialect = dialect7;
34198
+ this.dialect = dialect4;
34149
34199
  this.withList = withList;
34150
34200
  }
34151
34201
  set(values) {
@@ -34154,7 +34204,7 @@ var init_update3 = __esm({
34154
34204
  };
34155
34205
  __publicField(MySqlUpdateBuilder, _a306, "MySqlUpdateBuilder");
34156
34206
  MySqlUpdateBase = class extends (_b227 = QueryPromise, _a307 = entityKind, _b227) {
34157
- constructor(table4, set, session, dialect7, withList) {
34207
+ constructor(table4, set, session, dialect4, withList) {
34158
34208
  super();
34159
34209
  __publicField(this, "config");
34160
34210
  __publicField(this, "execute", (placeholderValues) => {
@@ -34168,7 +34218,7 @@ var init_update3 = __esm({
34168
34218
  });
34169
34219
  __publicField(this, "iterator", this.createIterator());
34170
34220
  this.session = session;
34171
- this.dialect = dialect7;
34221
+ this.dialect = dialect4;
34172
34222
  this.config = { set, table: table4, withList };
34173
34223
  }
34174
34224
  /**
@@ -34253,13 +34303,13 @@ var init_query3 = __esm({
34253
34303
  init_relations();
34254
34304
  _a308 = entityKind;
34255
34305
  RelationalQueryBuilder3 = class {
34256
- constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect7, session, mode) {
34306
+ constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, mode) {
34257
34307
  this.fullSchema = fullSchema;
34258
34308
  this.schema = schema4;
34259
34309
  this.tableNamesMap = tableNamesMap;
34260
34310
  this.table = table4;
34261
34311
  this.tableConfig = tableConfig;
34262
- this.dialect = dialect7;
34312
+ this.dialect = dialect4;
34263
34313
  this.session = session;
34264
34314
  this.mode = mode;
34265
34315
  }
@@ -34294,14 +34344,14 @@ var init_query3 = __esm({
34294
34344
  };
34295
34345
  __publicField(RelationalQueryBuilder3, _a308, "MySqlRelationalQueryBuilder");
34296
34346
  MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a309 = entityKind, _b228) {
34297
- constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect7, session, config, queryMode, mode) {
34347
+ constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, queryMode, mode) {
34298
34348
  super();
34299
34349
  this.fullSchema = fullSchema;
34300
34350
  this.schema = schema4;
34301
34351
  this.tableNamesMap = tableNamesMap;
34302
34352
  this.table = table4;
34303
34353
  this.tableConfig = tableConfig;
34304
- this.dialect = dialect7;
34354
+ this.dialect = dialect4;
34305
34355
  this.session = session;
34306
34356
  this.config = config;
34307
34357
  this.queryMode = queryMode;
@@ -34375,9 +34425,9 @@ var init_db3 = __esm({
34375
34425
  init_query3();
34376
34426
  _a310 = entityKind;
34377
34427
  MySqlDatabase = class {
34378
- constructor(dialect7, session, schema4, mode) {
34428
+ constructor(dialect4, session, schema4, mode) {
34379
34429
  __publicField(this, "query");
34380
- this.dialect = dialect7;
34430
+ this.dialect = dialect4;
34381
34431
  this.session = session;
34382
34432
  this.mode = mode;
34383
34433
  this._ = schema4 ? {
@@ -34398,7 +34448,7 @@ var init_db3 = __esm({
34398
34448
  this._.tableNamesMap,
34399
34449
  schema4.fullSchema[tableName],
34400
34450
  columns,
34401
- dialect7,
34451
+ dialect4,
34402
34452
  session,
34403
34453
  this.mode
34404
34454
  );
@@ -34866,8 +34916,8 @@ var init_session3 = __esm({
34866
34916
  __publicField(MySqlPreparedQuery, _a321, "MySqlPreparedQuery");
34867
34917
  _a322 = entityKind;
34868
34918
  MySqlSession = class {
34869
- constructor(dialect7) {
34870
- this.dialect = dialect7;
34919
+ constructor(dialect4) {
34920
+ this.dialect = dialect4;
34871
34921
  }
34872
34922
  execute(query) {
34873
34923
  return this.prepareQuery(
@@ -34901,8 +34951,8 @@ var init_session3 = __esm({
34901
34951
  };
34902
34952
  __publicField(MySqlSession, _a322, "MySqlSession");
34903
34953
  MySqlTransaction = class extends (_b232 = MySqlDatabase, _a323 = entityKind, _b232) {
34904
- constructor(dialect7, session, schema4, nestedIndex, mode) {
34905
- super(dialect7, session, schema4, mode);
34954
+ constructor(dialect4, session, schema4, nestedIndex, mode) {
34955
+ super(dialect4, session, schema4, mode);
34906
34956
  this.schema = schema4;
34907
34957
  this.nestedIndex = nestedIndex;
34908
34958
  }
@@ -34929,9 +34979,9 @@ function getTableConfig3(table4) {
34929
34979
  const primaryKeys = [];
34930
34980
  const uniqueConstraints = [];
34931
34981
  const foreignKeys = Object.values(table4[MySqlTable.Symbol.InlineForeignKeys]);
34932
- const name2 = table4[Table2.Symbol.Name];
34933
- const schema4 = table4[Table2.Symbol.Schema];
34934
- const baseName = table4[Table2.Symbol.BaseName];
34982
+ const name2 = table4[Table.Symbol.Name];
34983
+ const schema4 = table4[Table.Symbol.Schema];
34984
+ const baseName = table4[Table.Symbol.BaseName];
34935
34985
  const extraConfigBuilder = table4[MySqlTable.Symbol.ExtraConfigBuilder];
34936
34986
  if (extraConfigBuilder !== void 0) {
34937
34987
  const extraConfig = extraConfigBuilder(table4[MySqlTable.Symbol.Columns]);
@@ -35017,7 +35067,7 @@ function clearDefaults(defaultValue, collate) {
35017
35067
  return `(${resultDefault})`;
35018
35068
  }
35019
35069
  }
35020
- var dialect6, generateMySqlSnapshot, fromDatabase3;
35070
+ var generateMySqlSnapshot, fromDatabase3;
35021
35071
  var init_mysqlSerializer = __esm({
35022
35072
  "src/serializer/mysqlSerializer.ts"() {
35023
35073
  "use strict";
@@ -35027,9 +35077,10 @@ var init_mysqlSerializer = __esm({
35027
35077
  init_mysql_core();
35028
35078
  init_mysql_core();
35029
35079
  init_outputs();
35080
+ init_utils();
35030
35081
  init_serializer();
35031
- dialect6 = new MySqlDialect();
35032
- generateMySqlSnapshot = (tables) => {
35082
+ generateMySqlSnapshot = (tables, casing2) => {
35083
+ const dialect4 = new MySqlDialect({ casing: casing2 });
35033
35084
  const result = {};
35034
35085
  const internal = { tables: {}, indexes: {} };
35035
35086
  for (const table4 of tables) {
@@ -35048,12 +35099,13 @@ var init_mysqlSerializer = __esm({
35048
35099
  const primaryKeysObject = {};
35049
35100
  const uniqueConstraintObject = {};
35050
35101
  columns.forEach((column4) => {
35102
+ const name2 = getColumnCasing(column4, casing2);
35051
35103
  const notNull = column4.notNull;
35052
35104
  const sqlTypeLowered = column4.getSQLType().toLowerCase();
35053
35105
  const autoIncrement = typeof column4.autoIncrement === "undefined" ? false : column4.autoIncrement;
35054
35106
  const generated = column4.generated;
35055
35107
  const columnToSet = {
35056
- name: column4.name,
35108
+ name: name2,
35057
35109
  type: column4.getSQLType(),
35058
35110
  primaryKey: false,
35059
35111
  // If field is autoincrement it's notNull by default
@@ -35062,14 +35114,14 @@ var init_mysqlSerializer = __esm({
35062
35114
  autoincrement: autoIncrement,
35063
35115
  onUpdate: column4.hasOnUpdateNow,
35064
35116
  generated: generated ? {
35065
- as: is(generated.as, SQL) ? dialect6.sqlToQuery(generated.as).sql : typeof generated.as === "function" ? dialect6.sqlToQuery(generated.as()).sql : generated.as,
35117
+ as: is(generated.as, SQL) ? dialect4.sqlToQuery(generated.as).sql : typeof generated.as === "function" ? dialect4.sqlToQuery(generated.as()).sql : generated.as,
35066
35118
  type: generated.mode ?? "stored"
35067
35119
  } : void 0
35068
35120
  };
35069
35121
  if (column4.primary) {
35070
- primaryKeysObject[`${tableName}_${column4.name}`] = {
35071
- name: `${tableName}_${column4.name}`,
35072
- columns: [column4.name]
35122
+ primaryKeysObject[`${tableName}_${name2}`] = {
35123
+ name: `${tableName}_${name2}`,
35124
+ columns: [name2]
35073
35125
  };
35074
35126
  }
35075
35127
  if (column4.isUnique) {
@@ -35083,7 +35135,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
35083
35135
  The unique constraint ${source_default.underline.blue(
35084
35136
  column4.uniqueName
35085
35137
  )} on the ${source_default.underline.blue(
35086
- column4.name
35138
+ name2
35087
35139
  )} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
35088
35140
  existingUnique.columns.join(",")
35089
35141
  )} columns
@@ -35098,7 +35150,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
35098
35150
  }
35099
35151
  if (column4.default !== void 0) {
35100
35152
  if (is(column4.default, SQL)) {
35101
- columnToSet.default = sqlToStr(column4.default);
35153
+ columnToSet.default = sqlToStr(column4.default, casing2);
35102
35154
  } else {
35103
35155
  if (typeof column4.default === "string") {
35104
35156
  columnToSet.default = `'${column4.default}'`;
@@ -35120,20 +35172,27 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
35120
35172
  }
35121
35173
  }
35122
35174
  }
35123
- columnsObject[column4.name] = columnToSet;
35175
+ columnsObject[name2] = columnToSet;
35124
35176
  });
35125
35177
  primaryKeys.map((pk) => {
35126
- const columnNames = pk.columns.map((c) => c.name);
35127
- primaryKeysObject[pk.getName()] = {
35128
- name: pk.getName(),
35178
+ const originalColumnNames = pk.columns.map((c) => c.name);
35179
+ const columnNames = pk.columns.map((c) => getColumnCasing(c, casing2));
35180
+ let name2 = pk.getName();
35181
+ if (casing2 !== void 0) {
35182
+ for (let i = 0; i < originalColumnNames.length; i++) {
35183
+ name2 = name2.replace(originalColumnNames[i], columnNames[i]);
35184
+ }
35185
+ }
35186
+ primaryKeysObject[name2] = {
35187
+ name: name2,
35129
35188
  columns: columnNames
35130
35189
  };
35131
35190
  for (const column4 of pk.columns) {
35132
- columnsObject[column4.name].notNull = true;
35191
+ columnsObject[getColumnCasing(column4, casing2)].notNull = true;
35133
35192
  }
35134
35193
  });
35135
35194
  uniqueConstraints?.map((unq) => {
35136
- const columnNames = unq.columns.map((c) => c.name);
35195
+ const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
35137
35196
  const name2 = unq.name ?? uniqueKeyName3(table4, columnNames);
35138
35197
  const existingUnique = uniqueConstraintObject[name2];
35139
35198
  if (typeof existingUnique !== "undefined") {
@@ -35161,15 +35220,25 @@ The unique constraint ${source_default.underline.blue(
35161
35220
  };
35162
35221
  });
35163
35222
  const fks = foreignKeys.map((fk4) => {
35164
- const name2 = fk4.getName();
35165
35223
  const tableFrom = tableName;
35166
35224
  const onDelete = fk4.onDelete ?? "no action";
35167
35225
  const onUpdate = fk4.onUpdate ?? "no action";
35168
35226
  const reference = fk4.reference();
35169
35227
  const referenceFT = reference.foreignTable;
35170
35228
  const tableTo = getTableName(referenceFT);
35171
- const columnsFrom = reference.columns.map((it) => it.name);
35172
- const columnsTo = reference.foreignColumns.map((it) => it.name);
35229
+ const originalColumnsFrom = reference.columns.map((it) => it.name);
35230
+ const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
35231
+ const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
35232
+ const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
35233
+ let name2 = fk4.getName();
35234
+ if (casing2 !== void 0) {
35235
+ for (let i = 0; i < originalColumnsFrom.length; i++) {
35236
+ name2 = name2.replace(originalColumnsFrom[i], columnsFrom[i]);
35237
+ }
35238
+ for (let i = 0; i < originalColumnsTo.length; i++) {
35239
+ name2 = name2.replace(originalColumnsTo[i], columnsTo[i]);
35240
+ }
35241
+ }
35173
35242
  return {
35174
35243
  name: name2,
35175
35244
  tableFrom,
@@ -35188,7 +35257,7 @@ The unique constraint ${source_default.underline.blue(
35188
35257
  const name2 = value.config.name;
35189
35258
  let indexColumns = columns2.map((it) => {
35190
35259
  if (is(it, SQL)) {
35191
- const sql2 = dialect6.sqlToQuery(it, "indexes").sql;
35260
+ const sql2 = dialect4.sqlToQuery(it, "indexes").sql;
35192
35261
  if (typeof internal.indexes[name2] === "undefined") {
35193
35262
  internal.indexes[name2] = {
35194
35263
  columns: {
@@ -35208,7 +35277,7 @@ The unique constraint ${source_default.underline.blue(
35208
35277
  }
35209
35278
  return sql2;
35210
35279
  } else {
35211
- return `${it.name}`;
35280
+ return `${getColumnCasing(it, casing2)}`;
35212
35281
  }
35213
35282
  });
35214
35283
  if (value.config.unique) {
@@ -35570,6 +35639,7 @@ var init_cli = __esm({
35570
35639
  }).strict();
35571
35640
  pushParams = objectType({
35572
35641
  dialect: dialect3,
35642
+ casing: casingType.optional(),
35573
35643
  schema: unionType([stringType(), stringType().array()]),
35574
35644
  tablesFilter: unionType([stringType(), stringType().array()]).optional(),
35575
35645
  schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
@@ -36776,7 +36846,7 @@ init_pgSchema();
36776
36846
  init_pgSerializer();
36777
36847
  init_sqliteSchema();
36778
36848
  init_sqliteSerializer();
36779
- var generateDrizzleJson = (imports, prevId, schemaFilters) => {
36849
+ var generateDrizzleJson = (imports, prevId, schemaFilters, casing2) => {
36780
36850
  const prepared = prepareFromExports(imports);
36781
36851
  const id = (0, import_crypto.randomUUID)();
36782
36852
  const snapshot = generatePgSnapshot(
@@ -36784,6 +36854,7 @@ var generateDrizzleJson = (imports, prevId, schemaFilters) => {
36784
36854
  prepared.enums,
36785
36855
  prepared.schemas,
36786
36856
  prepared.sequences,
36857
+ casing2,
36787
36858
  schemaFilters
36788
36859
  );
36789
36860
  return fillPgSnapshot({
@@ -36854,11 +36925,11 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
36854
36925
  }
36855
36926
  };
36856
36927
  };
36857
- var generateSQLiteDrizzleJson = async (imports, prevId) => {
36928
+ var generateSQLiteDrizzleJson = async (imports, prevId, casing2) => {
36858
36929
  const { prepareFromExports: prepareFromExports4 } = await Promise.resolve().then(() => (init_sqliteImports(), sqliteImports_exports));
36859
36930
  const prepared = prepareFromExports4(imports);
36860
36931
  const id = (0, import_crypto.randomUUID)();
36861
- const snapshot = generateSqliteSnapshot(prepared.tables);
36932
+ const snapshot = generateSqliteSnapshot(prepared.tables, casing2);
36862
36933
  return {
36863
36934
  ...snapshot,
36864
36935
  id,
@@ -36929,11 +37000,11 @@ var pushSQLiteSchema = async (imports, drizzleInstance) => {
36929
37000
  }
36930
37001
  };
36931
37002
  };
36932
- var generateMySQLDrizzleJson = async (imports, prevId) => {
37003
+ var generateMySQLDrizzleJson = async (imports, prevId, casing2) => {
36933
37004
  const { prepareFromExports: prepareFromExports4 } = await Promise.resolve().then(() => (init_mysqlImports(), mysqlImports_exports));
36934
37005
  const prepared = prepareFromExports4(imports);
36935
37006
  const id = (0, import_crypto.randomUUID)();
36936
- const snapshot = generateMySqlSnapshot(prepared.tables);
37007
+ const snapshot = generateMySqlSnapshot(prepared.tables, casing2);
36937
37008
  return {
36938
37009
  ...snapshot,
36939
37010
  id,