drizzle-kit 0.25.0-b8bf113 → 0.25.0-bab5208
Sign up to get free protection for your applications and to get access to all the features.
- package/api.d.mts +4 -3
- package/api.d.ts +4 -3
- package/api.js +936 -865
- package/api.mjs +936 -865
- package/bin.cjs +461 -366
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +2 -5
- package/index.d.ts +2 -5
- package/package.json +1 -1
- package/utils.js +8 -0
- package/utils.mjs +7 -0
package/api.mjs
CHANGED
@@ -554,6 +554,184 @@ var init_source = __esm({
|
|
554
554
|
}
|
555
555
|
});
|
556
556
|
|
557
|
+
// ../drizzle-orm/dist/entity.js
|
558
|
+
function is(value, type) {
|
559
|
+
if (!value || typeof value !== "object") {
|
560
|
+
return false;
|
561
|
+
}
|
562
|
+
if (value instanceof type) {
|
563
|
+
return true;
|
564
|
+
}
|
565
|
+
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
|
566
|
+
throw new Error(
|
567
|
+
`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.`
|
568
|
+
);
|
569
|
+
}
|
570
|
+
let cls = value.constructor;
|
571
|
+
if (cls) {
|
572
|
+
while (cls) {
|
573
|
+
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
|
574
|
+
return true;
|
575
|
+
}
|
576
|
+
cls = Object.getPrototypeOf(cls);
|
577
|
+
}
|
578
|
+
}
|
579
|
+
return false;
|
580
|
+
}
|
581
|
+
var entityKind, hasOwnEntityKind;
|
582
|
+
var init_entity = __esm({
|
583
|
+
"../drizzle-orm/dist/entity.js"() {
|
584
|
+
"use strict";
|
585
|
+
entityKind = Symbol.for("drizzle:entityKind");
|
586
|
+
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
587
|
+
}
|
588
|
+
});
|
589
|
+
|
590
|
+
// ../drizzle-orm/dist/table.utils.js
|
591
|
+
var TableName;
|
592
|
+
var init_table_utils = __esm({
|
593
|
+
"../drizzle-orm/dist/table.utils.js"() {
|
594
|
+
"use strict";
|
595
|
+
TableName = Symbol.for("drizzle:Name");
|
596
|
+
}
|
597
|
+
});
|
598
|
+
|
599
|
+
// ../drizzle-orm/dist/table.js
|
600
|
+
function isTable(table4) {
|
601
|
+
return typeof table4 === "object" && table4 !== null && IsDrizzleTable in table4;
|
602
|
+
}
|
603
|
+
function getTableName(table4) {
|
604
|
+
return table4[TableName];
|
605
|
+
}
|
606
|
+
function getTableUniqueName(table4) {
|
607
|
+
return `${table4[Schema] ?? "public"}.${table4[TableName]}`;
|
608
|
+
}
|
609
|
+
var Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, Table;
|
610
|
+
var init_table = __esm({
|
611
|
+
"../drizzle-orm/dist/table.js"() {
|
612
|
+
"use strict";
|
613
|
+
init_entity();
|
614
|
+
init_table_utils();
|
615
|
+
Schema = Symbol.for("drizzle:Schema");
|
616
|
+
Columns = Symbol.for("drizzle:Columns");
|
617
|
+
ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
618
|
+
OriginalName = Symbol.for("drizzle:OriginalName");
|
619
|
+
BaseName = Symbol.for("drizzle:BaseName");
|
620
|
+
IsAlias = Symbol.for("drizzle:IsAlias");
|
621
|
+
ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
622
|
+
IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
623
|
+
_j = entityKind, _i = TableName, _h = OriginalName, _g = Schema, _f = Columns, _e = ExtraConfigColumns, _d = BaseName, _c = IsAlias, _b = IsDrizzleTable, _a = ExtraConfigBuilder;
|
624
|
+
Table = class {
|
625
|
+
constructor(name2, schema4, baseName) {
|
626
|
+
/**
|
627
|
+
* @internal
|
628
|
+
* Can be changed if the table is aliased.
|
629
|
+
*/
|
630
|
+
__publicField(this, _i);
|
631
|
+
/**
|
632
|
+
* @internal
|
633
|
+
* Used to store the original name of the table, before any aliasing.
|
634
|
+
*/
|
635
|
+
__publicField(this, _h);
|
636
|
+
/** @internal */
|
637
|
+
__publicField(this, _g);
|
638
|
+
/** @internal */
|
639
|
+
__publicField(this, _f);
|
640
|
+
/** @internal */
|
641
|
+
__publicField(this, _e);
|
642
|
+
/**
|
643
|
+
* @internal
|
644
|
+
* Used to store the table name before the transformation via the `tableCreator` functions.
|
645
|
+
*/
|
646
|
+
__publicField(this, _d);
|
647
|
+
/** @internal */
|
648
|
+
__publicField(this, _c, false);
|
649
|
+
/** @internal */
|
650
|
+
__publicField(this, _b, true);
|
651
|
+
/** @internal */
|
652
|
+
__publicField(this, _a);
|
653
|
+
this[TableName] = this[OriginalName] = name2;
|
654
|
+
this[Schema] = schema4;
|
655
|
+
this[BaseName] = baseName;
|
656
|
+
}
|
657
|
+
};
|
658
|
+
__publicField(Table, _j, "Table");
|
659
|
+
/** @internal */
|
660
|
+
__publicField(Table, "Symbol", {
|
661
|
+
Name: TableName,
|
662
|
+
Schema,
|
663
|
+
OriginalName,
|
664
|
+
Columns,
|
665
|
+
ExtraConfigColumns,
|
666
|
+
BaseName,
|
667
|
+
IsAlias,
|
668
|
+
ExtraConfigBuilder
|
669
|
+
});
|
670
|
+
}
|
671
|
+
});
|
672
|
+
|
673
|
+
// ../drizzle-orm/dist/casing.js
|
674
|
+
function toSnakeCase(input) {
|
675
|
+
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
|
676
|
+
return words.map((word) => word.toLowerCase()).join("_");
|
677
|
+
}
|
678
|
+
function toCamelCase(input) {
|
679
|
+
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
|
680
|
+
return words.reduce((acc, word, i) => {
|
681
|
+
const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;
|
682
|
+
return acc + formattedWord;
|
683
|
+
}, "");
|
684
|
+
}
|
685
|
+
function noopCase(input) {
|
686
|
+
return input;
|
687
|
+
}
|
688
|
+
var _a2, CasingCache;
|
689
|
+
var init_casing = __esm({
|
690
|
+
"../drizzle-orm/dist/casing.js"() {
|
691
|
+
"use strict";
|
692
|
+
init_entity();
|
693
|
+
init_table();
|
694
|
+
_a2 = entityKind;
|
695
|
+
CasingCache = class {
|
696
|
+
constructor(casing2) {
|
697
|
+
/** @internal */
|
698
|
+
__publicField(this, "cache", {});
|
699
|
+
__publicField(this, "cachedTables", {});
|
700
|
+
__publicField(this, "convert");
|
701
|
+
this.convert = casing2 === "snake_case" ? toSnakeCase : casing2 === "camelCase" ? toCamelCase : noopCase;
|
702
|
+
}
|
703
|
+
getColumnCasing(column4) {
|
704
|
+
if (!column4.keyAsName)
|
705
|
+
return column4.name;
|
706
|
+
const schema4 = column4.table[Table.Symbol.Schema] ?? "public";
|
707
|
+
const tableName = column4.table[Table.Symbol.OriginalName];
|
708
|
+
const key = `${schema4}.${tableName}.${column4.name}`;
|
709
|
+
if (!this.cache[key]) {
|
710
|
+
this.cacheTable(column4.table);
|
711
|
+
}
|
712
|
+
return this.cache[key];
|
713
|
+
}
|
714
|
+
cacheTable(table4) {
|
715
|
+
const schema4 = table4[Table.Symbol.Schema] ?? "public";
|
716
|
+
const tableName = table4[Table.Symbol.OriginalName];
|
717
|
+
const tableKey2 = `${schema4}.${tableName}`;
|
718
|
+
if (!this.cachedTables[tableKey2]) {
|
719
|
+
for (const column4 of Object.values(table4[Table.Symbol.Columns])) {
|
720
|
+
const columnKey = `${tableKey2}.${column4.name}`;
|
721
|
+
this.cache[columnKey] = this.convert(column4.name);
|
722
|
+
}
|
723
|
+
this.cachedTables[tableKey2] = true;
|
724
|
+
}
|
725
|
+
}
|
726
|
+
clearCache() {
|
727
|
+
this.cache = {};
|
728
|
+
this.cachedTables = {};
|
729
|
+
}
|
730
|
+
};
|
731
|
+
__publicField(CasingCache, _a2, "CasingCache");
|
732
|
+
}
|
733
|
+
});
|
734
|
+
|
557
735
|
// ../node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js
|
558
736
|
var require_old = __commonJS({
|
559
737
|
"../node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports) {
|
@@ -8373,10 +8551,15 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
8373
8551
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
8374
8552
|
return { addedColumns, removedColumns };
|
8375
8553
|
}
|
8554
|
+
function getColumnCasing(column4, casing2) {
|
8555
|
+
if (!column4.name) return "";
|
8556
|
+
return !column4.keyAsName || casing2 === void 0 ? column4.name : casing2 === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
|
8557
|
+
}
|
8376
8558
|
var copy, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey;
|
8377
8559
|
var init_utils = __esm({
|
8378
8560
|
"src/utils.ts"() {
|
8379
8561
|
"use strict";
|
8562
|
+
init_casing();
|
8380
8563
|
init_views();
|
8381
8564
|
init_global();
|
8382
8565
|
init_mysqlSchema();
|
@@ -8625,9 +8808,10 @@ var glob, sqlToStr;
|
|
8625
8808
|
var init_serializer = __esm({
|
8626
8809
|
"src/serializer/index.ts"() {
|
8627
8810
|
"use strict";
|
8811
|
+
init_casing();
|
8628
8812
|
glob = __toESM(require_glob());
|
8629
8813
|
init_views();
|
8630
|
-
sqlToStr = (sql2) => {
|
8814
|
+
sqlToStr = (sql2, casing2) => {
|
8631
8815
|
return sql2.toQuery({
|
8632
8816
|
escapeName: () => {
|
8633
8817
|
throw new Error("we don't support params for `sql` default values");
|
@@ -8637,7 +8821,8 @@ var init_serializer = __esm({
|
|
8637
8821
|
},
|
8638
8822
|
escapeString: () => {
|
8639
8823
|
throw new Error("we don't support params for `sql` default values");
|
8640
|
-
}
|
8824
|
+
},
|
8825
|
+
casing: new CasingCache(casing2)
|
8641
8826
|
}).sql;
|
8642
8827
|
};
|
8643
8828
|
}
|
@@ -11482,10 +11667,10 @@ var init_jsonDiffer = __esm({
|
|
11482
11667
|
});
|
11483
11668
|
|
11484
11669
|
// src/sqlgenerator.ts
|
11485
|
-
function fromJson(statements,
|
11670
|
+
function fromJson(statements, dialect4, action, json22) {
|
11486
11671
|
const result = statements.flatMap((statement) => {
|
11487
11672
|
const filtered = convertors.filter((it) => {
|
11488
|
-
return it.can(statement,
|
11673
|
+
return it.can(statement, dialect4);
|
11489
11674
|
});
|
11490
11675
|
const convertor = filtered.length === 1 ? filtered[0] : void 0;
|
11491
11676
|
if (!convertor) {
|
@@ -11552,8 +11737,8 @@ var init_sqlgenerator = __esm({
|
|
11552
11737
|
Convertor = class {
|
11553
11738
|
};
|
11554
11739
|
PgCreateTableConvertor = class extends Convertor {
|
11555
|
-
can(statement,
|
11556
|
-
return statement.type === "create_table" &&
|
11740
|
+
can(statement, dialect4) {
|
11741
|
+
return statement.type === "create_table" && dialect4 === "postgresql";
|
11557
11742
|
}
|
11558
11743
|
convert(st) {
|
11559
11744
|
const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
|
@@ -11597,8 +11782,8 @@ var init_sqlgenerator = __esm({
|
|
11597
11782
|
}
|
11598
11783
|
};
|
11599
11784
|
MySqlCreateTableConvertor = class extends Convertor {
|
11600
|
-
can(statement,
|
11601
|
-
return statement.type === "create_table" &&
|
11785
|
+
can(statement, dialect4) {
|
11786
|
+
return statement.type === "create_table" && dialect4 === "mysql";
|
11602
11787
|
}
|
11603
11788
|
convert(st) {
|
11604
11789
|
const {
|
@@ -11646,8 +11831,8 @@ var init_sqlgenerator = __esm({
|
|
11646
11831
|
}
|
11647
11832
|
};
|
11648
11833
|
SQLiteCreateTableConvertor = class extends Convertor {
|
11649
|
-
can(statement,
|
11650
|
-
return statement.type === "sqlite_create_table" && (
|
11834
|
+
can(statement, dialect4) {
|
11835
|
+
return statement.type === "sqlite_create_table" && (dialect4 === "sqlite" || dialect4 === "turso");
|
11651
11836
|
}
|
11652
11837
|
convert(st) {
|
11653
11838
|
const {
|
@@ -11709,8 +11894,8 @@ var init_sqlgenerator = __esm({
|
|
11709
11894
|
}
|
11710
11895
|
};
|
11711
11896
|
PgAlterTableAlterColumnSetGenerated = class extends Convertor {
|
11712
|
-
can(statement,
|
11713
|
-
return statement.type === "alter_table_alter_column_set_identity" &&
|
11897
|
+
can(statement, dialect4) {
|
11898
|
+
return statement.type === "alter_table_alter_column_set_identity" && dialect4 === "postgresql";
|
11714
11899
|
}
|
11715
11900
|
convert(statement) {
|
11716
11901
|
const { identity, tableName, columnName, schema: schema4 } = statement;
|
@@ -11722,8 +11907,8 @@ var init_sqlgenerator = __esm({
|
|
11722
11907
|
}
|
11723
11908
|
};
|
11724
11909
|
PgAlterTableAlterColumnDropGenerated = class extends Convertor {
|
11725
|
-
can(statement,
|
11726
|
-
return statement.type === "alter_table_alter_column_drop_identity" &&
|
11910
|
+
can(statement, dialect4) {
|
11911
|
+
return statement.type === "alter_table_alter_column_drop_identity" && dialect4 === "postgresql";
|
11727
11912
|
}
|
11728
11913
|
convert(statement) {
|
11729
11914
|
const { tableName, columnName, schema: schema4 } = statement;
|
@@ -11732,8 +11917,8 @@ var init_sqlgenerator = __esm({
|
|
11732
11917
|
}
|
11733
11918
|
};
|
11734
11919
|
PgAlterTableAlterColumnAlterGenerated = class extends Convertor {
|
11735
|
-
can(statement,
|
11736
|
-
return statement.type === "alter_table_alter_column_change_identity" &&
|
11920
|
+
can(statement, dialect4) {
|
11921
|
+
return statement.type === "alter_table_alter_column_change_identity" && dialect4 === "postgresql";
|
11737
11922
|
}
|
11738
11923
|
convert(statement) {
|
11739
11924
|
const { identity, oldIdentity, tableName, columnName, schema: schema4 } = statement;
|
@@ -11780,8 +11965,8 @@ var init_sqlgenerator = __esm({
|
|
11780
11965
|
}
|
11781
11966
|
};
|
11782
11967
|
PgAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
11783
|
-
can(statement,
|
11784
|
-
return statement.type === "create_unique_constraint" &&
|
11968
|
+
can(statement, dialect4) {
|
11969
|
+
return statement.type === "create_unique_constraint" && dialect4 === "postgresql";
|
11785
11970
|
}
|
11786
11971
|
convert(statement) {
|
11787
11972
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
@@ -11790,8 +11975,8 @@ var init_sqlgenerator = __esm({
|
|
11790
11975
|
}
|
11791
11976
|
};
|
11792
11977
|
PgAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
11793
|
-
can(statement,
|
11794
|
-
return statement.type === "delete_unique_constraint" &&
|
11978
|
+
can(statement, dialect4) {
|
11979
|
+
return statement.type === "delete_unique_constraint" && dialect4 === "postgresql";
|
11795
11980
|
}
|
11796
11981
|
convert(statement) {
|
11797
11982
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
@@ -11800,8 +11985,8 @@ var init_sqlgenerator = __esm({
|
|
11800
11985
|
}
|
11801
11986
|
};
|
11802
11987
|
MySQLAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
11803
|
-
can(statement,
|
11804
|
-
return statement.type === "create_unique_constraint" &&
|
11988
|
+
can(statement, dialect4) {
|
11989
|
+
return statement.type === "create_unique_constraint" && dialect4 === "mysql";
|
11805
11990
|
}
|
11806
11991
|
convert(statement) {
|
11807
11992
|
const unsquashed = MySqlSquasher.unsquashUnique(statement.data);
|
@@ -11809,8 +11994,8 @@ var init_sqlgenerator = __esm({
|
|
11809
11994
|
}
|
11810
11995
|
};
|
11811
11996
|
MySQLAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
11812
|
-
can(statement,
|
11813
|
-
return statement.type === "delete_unique_constraint" &&
|
11997
|
+
can(statement, dialect4) {
|
11998
|
+
return statement.type === "delete_unique_constraint" && dialect4 === "mysql";
|
11814
11999
|
}
|
11815
12000
|
convert(statement) {
|
11816
12001
|
const unsquashed = MySqlSquasher.unsquashUnique(statement.data);
|
@@ -11818,8 +12003,8 @@ var init_sqlgenerator = __esm({
|
|
11818
12003
|
}
|
11819
12004
|
};
|
11820
12005
|
CreatePgSequenceConvertor = class extends Convertor {
|
11821
|
-
can(statement,
|
11822
|
-
return statement.type === "create_sequence" &&
|
12006
|
+
can(statement, dialect4) {
|
12007
|
+
return statement.type === "create_sequence" && dialect4 === "postgresql";
|
11823
12008
|
}
|
11824
12009
|
convert(st) {
|
11825
12010
|
const { name: name2, values, schema: schema4 } = st;
|
@@ -11828,8 +12013,8 @@ var init_sqlgenerator = __esm({
|
|
11828
12013
|
}
|
11829
12014
|
};
|
11830
12015
|
DropPgSequenceConvertor = class extends Convertor {
|
11831
|
-
can(statement,
|
11832
|
-
return statement.type === "drop_sequence" &&
|
12016
|
+
can(statement, dialect4) {
|
12017
|
+
return statement.type === "drop_sequence" && dialect4 === "postgresql";
|
11833
12018
|
}
|
11834
12019
|
convert(st) {
|
11835
12020
|
const { name: name2, schema: schema4 } = st;
|
@@ -11838,8 +12023,8 @@ var init_sqlgenerator = __esm({
|
|
11838
12023
|
}
|
11839
12024
|
};
|
11840
12025
|
RenamePgSequenceConvertor = class extends Convertor {
|
11841
|
-
can(statement,
|
11842
|
-
return statement.type === "rename_sequence" &&
|
12026
|
+
can(statement, dialect4) {
|
12027
|
+
return statement.type === "rename_sequence" && dialect4 === "postgresql";
|
11843
12028
|
}
|
11844
12029
|
convert(st) {
|
11845
12030
|
const { nameFrom, nameTo, schema: schema4 } = st;
|
@@ -11849,8 +12034,8 @@ var init_sqlgenerator = __esm({
|
|
11849
12034
|
}
|
11850
12035
|
};
|
11851
12036
|
MovePgSequenceConvertor = class extends Convertor {
|
11852
|
-
can(statement,
|
11853
|
-
return statement.type === "move_sequence" &&
|
12037
|
+
can(statement, dialect4) {
|
12038
|
+
return statement.type === "move_sequence" && dialect4 === "postgresql";
|
11854
12039
|
}
|
11855
12040
|
convert(st) {
|
11856
12041
|
const { schemaFrom, schemaTo, name: name2 } = st;
|
@@ -11860,8 +12045,8 @@ var init_sqlgenerator = __esm({
|
|
11860
12045
|
}
|
11861
12046
|
};
|
11862
12047
|
AlterPgSequenceConvertor = class extends Convertor {
|
11863
|
-
can(statement,
|
11864
|
-
return statement.type === "alter_sequence" &&
|
12048
|
+
can(statement, dialect4) {
|
12049
|
+
return statement.type === "alter_sequence" && dialect4 === "postgresql";
|
11865
12050
|
}
|
11866
12051
|
convert(st) {
|
11867
12052
|
const { name: name2, schema: schema4, values } = st;
|
@@ -11904,8 +12089,8 @@ var init_sqlgenerator = __esm({
|
|
11904
12089
|
}
|
11905
12090
|
};
|
11906
12091
|
PgDropTableConvertor = class extends Convertor {
|
11907
|
-
can(statement,
|
11908
|
-
return statement.type === "drop_table" &&
|
12092
|
+
can(statement, dialect4) {
|
12093
|
+
return statement.type === "drop_table" && dialect4 === "postgresql";
|
11909
12094
|
}
|
11910
12095
|
convert(statement) {
|
11911
12096
|
const { tableName, schema: schema4 } = statement;
|
@@ -11914,8 +12099,8 @@ var init_sqlgenerator = __esm({
|
|
11914
12099
|
}
|
11915
12100
|
};
|
11916
12101
|
MySQLDropTableConvertor = class extends Convertor {
|
11917
|
-
can(statement,
|
11918
|
-
return statement.type === "drop_table" &&
|
12102
|
+
can(statement, dialect4) {
|
12103
|
+
return statement.type === "drop_table" && dialect4 === "mysql";
|
11919
12104
|
}
|
11920
12105
|
convert(statement) {
|
11921
12106
|
const { tableName } = statement;
|
@@ -11923,8 +12108,8 @@ var init_sqlgenerator = __esm({
|
|
11923
12108
|
}
|
11924
12109
|
};
|
11925
12110
|
SQLiteDropTableConvertor = class extends Convertor {
|
11926
|
-
can(statement,
|
11927
|
-
return statement.type === "drop_table" && (
|
12111
|
+
can(statement, dialect4) {
|
12112
|
+
return statement.type === "drop_table" && (dialect4 === "sqlite" || dialect4 === "turso");
|
11928
12113
|
}
|
11929
12114
|
convert(statement) {
|
11930
12115
|
const { tableName } = statement;
|
@@ -11932,8 +12117,8 @@ var init_sqlgenerator = __esm({
|
|
11932
12117
|
}
|
11933
12118
|
};
|
11934
12119
|
PgRenameTableConvertor = class extends Convertor {
|
11935
|
-
can(statement,
|
11936
|
-
return statement.type === "rename_table" &&
|
12120
|
+
can(statement, dialect4) {
|
12121
|
+
return statement.type === "rename_table" && dialect4 === "postgresql";
|
11937
12122
|
}
|
11938
12123
|
convert(statement) {
|
11939
12124
|
const { tableNameFrom, tableNameTo, toSchema, fromSchema } = statement;
|
@@ -11943,8 +12128,8 @@ var init_sqlgenerator = __esm({
|
|
11943
12128
|
}
|
11944
12129
|
};
|
11945
12130
|
SqliteRenameTableConvertor = class extends Convertor {
|
11946
|
-
can(statement,
|
11947
|
-
return statement.type === "rename_table" && (
|
12131
|
+
can(statement, dialect4) {
|
12132
|
+
return statement.type === "rename_table" && (dialect4 === "sqlite" || dialect4 === "turso");
|
11948
12133
|
}
|
11949
12134
|
convert(statement) {
|
11950
12135
|
const { tableNameFrom, tableNameTo } = statement;
|
@@ -11952,8 +12137,8 @@ var init_sqlgenerator = __esm({
|
|
11952
12137
|
}
|
11953
12138
|
};
|
11954
12139
|
MySqlRenameTableConvertor = class extends Convertor {
|
11955
|
-
can(statement,
|
11956
|
-
return statement.type === "rename_table" &&
|
12140
|
+
can(statement, dialect4) {
|
12141
|
+
return statement.type === "rename_table" && dialect4 === "mysql";
|
11957
12142
|
}
|
11958
12143
|
convert(statement) {
|
11959
12144
|
const { tableNameFrom, tableNameTo } = statement;
|
@@ -11961,8 +12146,8 @@ var init_sqlgenerator = __esm({
|
|
11961
12146
|
}
|
11962
12147
|
};
|
11963
12148
|
PgAlterTableRenameColumnConvertor = class extends Convertor {
|
11964
|
-
can(statement,
|
11965
|
-
return statement.type === "alter_table_rename_column" &&
|
12149
|
+
can(statement, dialect4) {
|
12150
|
+
return statement.type === "alter_table_rename_column" && dialect4 === "postgresql";
|
11966
12151
|
}
|
11967
12152
|
convert(statement) {
|
11968
12153
|
const { tableName, oldColumnName, newColumnName, schema: schema4 } = statement;
|
@@ -11971,8 +12156,8 @@ var init_sqlgenerator = __esm({
|
|
11971
12156
|
}
|
11972
12157
|
};
|
11973
12158
|
MySqlAlterTableRenameColumnConvertor = class extends Convertor {
|
11974
|
-
can(statement,
|
11975
|
-
return statement.type === "alter_table_rename_column" &&
|
12159
|
+
can(statement, dialect4) {
|
12160
|
+
return statement.type === "alter_table_rename_column" && dialect4 === "mysql";
|
11976
12161
|
}
|
11977
12162
|
convert(statement) {
|
11978
12163
|
const { tableName, oldColumnName, newColumnName } = statement;
|
@@ -11980,8 +12165,8 @@ var init_sqlgenerator = __esm({
|
|
11980
12165
|
}
|
11981
12166
|
};
|
11982
12167
|
SQLiteAlterTableRenameColumnConvertor = class extends Convertor {
|
11983
|
-
can(statement,
|
11984
|
-
return statement.type === "alter_table_rename_column" && (
|
12168
|
+
can(statement, dialect4) {
|
12169
|
+
return statement.type === "alter_table_rename_column" && (dialect4 === "sqlite" || dialect4 === "turso");
|
11985
12170
|
}
|
11986
12171
|
convert(statement) {
|
11987
12172
|
const { tableName, oldColumnName, newColumnName } = statement;
|
@@ -11989,8 +12174,8 @@ var init_sqlgenerator = __esm({
|
|
11989
12174
|
}
|
11990
12175
|
};
|
11991
12176
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
11992
|
-
can(statement,
|
11993
|
-
return statement.type === "alter_table_drop_column" &&
|
12177
|
+
can(statement, dialect4) {
|
12178
|
+
return statement.type === "alter_table_drop_column" && dialect4 === "postgresql";
|
11994
12179
|
}
|
11995
12180
|
convert(statement) {
|
11996
12181
|
const { tableName, columnName, schema: schema4 } = statement;
|
@@ -11999,8 +12184,8 @@ var init_sqlgenerator = __esm({
|
|
11999
12184
|
}
|
12000
12185
|
};
|
12001
12186
|
MySqlAlterTableDropColumnConvertor = class extends Convertor {
|
12002
|
-
can(statement,
|
12003
|
-
return statement.type === "alter_table_drop_column" &&
|
12187
|
+
can(statement, dialect4) {
|
12188
|
+
return statement.type === "alter_table_drop_column" && dialect4 === "mysql";
|
12004
12189
|
}
|
12005
12190
|
convert(statement) {
|
12006
12191
|
const { tableName, columnName } = statement;
|
@@ -12008,8 +12193,8 @@ var init_sqlgenerator = __esm({
|
|
12008
12193
|
}
|
12009
12194
|
};
|
12010
12195
|
SQLiteAlterTableDropColumnConvertor = class extends Convertor {
|
12011
|
-
can(statement,
|
12012
|
-
return statement.type === "alter_table_drop_column" && (
|
12196
|
+
can(statement, dialect4) {
|
12197
|
+
return statement.type === "alter_table_drop_column" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12013
12198
|
}
|
12014
12199
|
convert(statement) {
|
12015
12200
|
const { tableName, columnName } = statement;
|
@@ -12017,8 +12202,8 @@ var init_sqlgenerator = __esm({
|
|
12017
12202
|
}
|
12018
12203
|
};
|
12019
12204
|
PgAlterTableAddColumnConvertor = class extends Convertor {
|
12020
|
-
can(statement,
|
12021
|
-
return statement.type === "alter_table_add_column" &&
|
12205
|
+
can(statement, dialect4) {
|
12206
|
+
return statement.type === "alter_table_add_column" && dialect4 === "postgresql";
|
12022
12207
|
}
|
12023
12208
|
convert(statement) {
|
12024
12209
|
const { tableName, column: column4, schema: schema4 } = statement;
|
@@ -12037,8 +12222,8 @@ var init_sqlgenerator = __esm({
|
|
12037
12222
|
}
|
12038
12223
|
};
|
12039
12224
|
MySqlAlterTableAddColumnConvertor = class extends Convertor {
|
12040
|
-
can(statement,
|
12041
|
-
return statement.type === "alter_table_add_column" &&
|
12225
|
+
can(statement, dialect4) {
|
12226
|
+
return statement.type === "alter_table_add_column" && dialect4 === "mysql";
|
12042
12227
|
}
|
12043
12228
|
convert(statement) {
|
12044
12229
|
const { tableName, column: column4 } = statement;
|
@@ -12061,8 +12246,8 @@ var init_sqlgenerator = __esm({
|
|
12061
12246
|
}
|
12062
12247
|
};
|
12063
12248
|
SQLiteAlterTableAddColumnConvertor = class extends Convertor {
|
12064
|
-
can(statement,
|
12065
|
-
return statement.type === "sqlite_alter_table_add_column" && (
|
12249
|
+
can(statement, dialect4) {
|
12250
|
+
return statement.type === "sqlite_alter_table_add_column" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12066
12251
|
}
|
12067
12252
|
convert(statement) {
|
12068
12253
|
const { tableName, column: column4, referenceData } = statement;
|
@@ -12077,8 +12262,8 @@ var init_sqlgenerator = __esm({
|
|
12077
12262
|
}
|
12078
12263
|
};
|
12079
12264
|
PgAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
12080
|
-
can(statement,
|
12081
|
-
return statement.type === "alter_table_alter_column_set_type" &&
|
12265
|
+
can(statement, dialect4) {
|
12266
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect4 === "postgresql";
|
12082
12267
|
}
|
12083
12268
|
convert(statement) {
|
12084
12269
|
const { tableName, columnName, newDataType, schema: schema4 } = statement;
|
@@ -12087,8 +12272,8 @@ var init_sqlgenerator = __esm({
|
|
12087
12272
|
}
|
12088
12273
|
};
|
12089
12274
|
PgAlterTableAlterColumnSetDefaultConvertor = class extends Convertor {
|
12090
|
-
can(statement,
|
12091
|
-
return statement.type === "alter_table_alter_column_set_default" &&
|
12275
|
+
can(statement, dialect4) {
|
12276
|
+
return statement.type === "alter_table_alter_column_set_default" && dialect4 === "postgresql";
|
12092
12277
|
}
|
12093
12278
|
convert(statement) {
|
12094
12279
|
const { tableName, columnName, schema: schema4 } = statement;
|
@@ -12097,8 +12282,8 @@ var init_sqlgenerator = __esm({
|
|
12097
12282
|
}
|
12098
12283
|
};
|
12099
12284
|
PgAlterTableAlterColumnDropDefaultConvertor = class extends Convertor {
|
12100
|
-
can(statement,
|
12101
|
-
return statement.type === "alter_table_alter_column_drop_default" &&
|
12285
|
+
can(statement, dialect4) {
|
12286
|
+
return statement.type === "alter_table_alter_column_drop_default" && dialect4 === "postgresql";
|
12102
12287
|
}
|
12103
12288
|
convert(statement) {
|
12104
12289
|
const { tableName, columnName, schema: schema4 } = statement;
|
@@ -12107,8 +12292,8 @@ var init_sqlgenerator = __esm({
|
|
12107
12292
|
}
|
12108
12293
|
};
|
12109
12294
|
PgAlterTableAlterColumnDropGeneratedConvertor = class extends Convertor {
|
12110
|
-
can(statement,
|
12111
|
-
return statement.type === "alter_table_alter_column_drop_generated" &&
|
12295
|
+
can(statement, dialect4) {
|
12296
|
+
return statement.type === "alter_table_alter_column_drop_generated" && dialect4 === "postgresql";
|
12112
12297
|
}
|
12113
12298
|
convert(statement) {
|
12114
12299
|
const { tableName, columnName, schema: schema4 } = statement;
|
@@ -12117,8 +12302,8 @@ var init_sqlgenerator = __esm({
|
|
12117
12302
|
}
|
12118
12303
|
};
|
12119
12304
|
PgAlterTableAlterColumnSetExpressionConvertor = class extends Convertor {
|
12120
|
-
can(statement,
|
12121
|
-
return statement.type === "alter_table_alter_column_set_generated" &&
|
12305
|
+
can(statement, dialect4) {
|
12306
|
+
return statement.type === "alter_table_alter_column_set_generated" && dialect4 === "postgresql";
|
12122
12307
|
}
|
12123
12308
|
convert(statement) {
|
12124
12309
|
const {
|
@@ -12155,8 +12340,8 @@ var init_sqlgenerator = __esm({
|
|
12155
12340
|
}
|
12156
12341
|
};
|
12157
12342
|
PgAlterTableAlterColumnAlterrGeneratedConvertor = class extends Convertor {
|
12158
|
-
can(statement,
|
12159
|
-
return statement.type === "alter_table_alter_column_alter_generated" &&
|
12343
|
+
can(statement, dialect4) {
|
12344
|
+
return statement.type === "alter_table_alter_column_alter_generated" && dialect4 === "postgresql";
|
12160
12345
|
}
|
12161
12346
|
convert(statement) {
|
12162
12347
|
const {
|
@@ -12193,8 +12378,8 @@ var init_sqlgenerator = __esm({
|
|
12193
12378
|
}
|
12194
12379
|
};
|
12195
12380
|
SqliteAlterTableAlterColumnDropGeneratedConvertor = class extends Convertor {
|
12196
|
-
can(statement,
|
12197
|
-
return statement.type === "alter_table_alter_column_drop_generated" && (
|
12381
|
+
can(statement, dialect4) {
|
12382
|
+
return statement.type === "alter_table_alter_column_drop_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12198
12383
|
}
|
12199
12384
|
convert(statement) {
|
12200
12385
|
const {
|
@@ -12234,8 +12419,8 @@ var init_sqlgenerator = __esm({
|
|
12234
12419
|
}
|
12235
12420
|
};
|
12236
12421
|
SqliteAlterTableAlterColumnSetExpressionConvertor = class extends Convertor {
|
12237
|
-
can(statement,
|
12238
|
-
return statement.type === "alter_table_alter_column_set_generated" && (
|
12422
|
+
can(statement, dialect4) {
|
12423
|
+
return statement.type === "alter_table_alter_column_set_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12239
12424
|
}
|
12240
12425
|
convert(statement) {
|
12241
12426
|
const {
|
@@ -12275,8 +12460,8 @@ var init_sqlgenerator = __esm({
|
|
12275
12460
|
}
|
12276
12461
|
};
|
12277
12462
|
SqliteAlterTableAlterColumnAlterGeneratedConvertor = class extends Convertor {
|
12278
|
-
can(statement,
|
12279
|
-
return statement.type === "alter_table_alter_column_alter_generated" && (
|
12463
|
+
can(statement, dialect4) {
|
12464
|
+
return statement.type === "alter_table_alter_column_alter_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12280
12465
|
}
|
12281
12466
|
convert(statement) {
|
12282
12467
|
const {
|
@@ -12316,8 +12501,8 @@ var init_sqlgenerator = __esm({
|
|
12316
12501
|
}
|
12317
12502
|
};
|
12318
12503
|
MySqlAlterTableAlterColumnAlterrGeneratedConvertor = class extends Convertor {
|
12319
|
-
can(statement,
|
12320
|
-
return statement.type === "alter_table_alter_column_alter_generated" &&
|
12504
|
+
can(statement, dialect4) {
|
12505
|
+
return statement.type === "alter_table_alter_column_alter_generated" && dialect4 === "mysql";
|
12321
12506
|
}
|
12322
12507
|
convert(statement) {
|
12323
12508
|
const {
|
@@ -12354,24 +12539,24 @@ var init_sqlgenerator = __esm({
|
|
12354
12539
|
}
|
12355
12540
|
};
|
12356
12541
|
MySqlAlterTableAddPk = class extends Convertor {
|
12357
|
-
can(statement,
|
12358
|
-
return statement.type === "alter_table_alter_column_set_pk" &&
|
12542
|
+
can(statement, dialect4) {
|
12543
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect4 === "mysql";
|
12359
12544
|
}
|
12360
12545
|
convert(statement) {
|
12361
12546
|
return `ALTER TABLE \`${statement.tableName}\` ADD PRIMARY KEY (\`${statement.columnName}\`);`;
|
12362
12547
|
}
|
12363
12548
|
};
|
12364
12549
|
MySqlAlterTableDropPk = class extends Convertor {
|
12365
|
-
can(statement,
|
12366
|
-
return statement.type === "alter_table_alter_column_drop_pk" &&
|
12550
|
+
can(statement, dialect4) {
|
12551
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect4 === "mysql";
|
12367
12552
|
}
|
12368
12553
|
convert(statement) {
|
12369
12554
|
return `ALTER TABLE \`${statement.tableName}\` DROP PRIMARY KEY`;
|
12370
12555
|
}
|
12371
12556
|
};
|
12372
12557
|
LibSQLModifyColumn = class extends Convertor {
|
12373
|
-
can(statement,
|
12374
|
-
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") &&
|
12558
|
+
can(statement, dialect4) {
|
12559
|
+
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";
|
12375
12560
|
}
|
12376
12561
|
convert(statement, json22) {
|
12377
12562
|
const { tableName, columnName } = statement;
|
@@ -12431,8 +12616,8 @@ var init_sqlgenerator = __esm({
|
|
12431
12616
|
}
|
12432
12617
|
};
|
12433
12618
|
MySqlModifyColumn = class extends Convertor {
|
12434
|
-
can(statement,
|
12435
|
-
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") &&
|
12619
|
+
can(statement, dialect4) {
|
12620
|
+
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";
|
12436
12621
|
}
|
12437
12622
|
convert(statement) {
|
12438
12623
|
const { tableName, columnName } = statement;
|
@@ -12568,8 +12753,8 @@ var init_sqlgenerator = __esm({
|
|
12568
12753
|
}
|
12569
12754
|
};
|
12570
12755
|
PgAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
12571
|
-
can(statement,
|
12572
|
-
return statement.type === "create_composite_pk" &&
|
12756
|
+
can(statement, dialect4) {
|
12757
|
+
return statement.type === "create_composite_pk" && dialect4 === "postgresql";
|
12573
12758
|
}
|
12574
12759
|
convert(statement) {
|
12575
12760
|
const { name: name2, columns } = PgSquasher.unsquashPK(statement.data);
|
@@ -12578,8 +12763,8 @@ var init_sqlgenerator = __esm({
|
|
12578
12763
|
}
|
12579
12764
|
};
|
12580
12765
|
PgAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
12581
|
-
can(statement,
|
12582
|
-
return statement.type === "delete_composite_pk" &&
|
12766
|
+
can(statement, dialect4) {
|
12767
|
+
return statement.type === "delete_composite_pk" && dialect4 === "postgresql";
|
12583
12768
|
}
|
12584
12769
|
convert(statement) {
|
12585
12770
|
const { name: name2, columns } = PgSquasher.unsquashPK(statement.data);
|
@@ -12588,8 +12773,8 @@ var init_sqlgenerator = __esm({
|
|
12588
12773
|
}
|
12589
12774
|
};
|
12590
12775
|
PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
12591
|
-
can(statement,
|
12592
|
-
return statement.type === "alter_composite_pk" &&
|
12776
|
+
can(statement, dialect4) {
|
12777
|
+
return statement.type === "alter_composite_pk" && dialect4 === "postgresql";
|
12593
12778
|
}
|
12594
12779
|
convert(statement) {
|
12595
12780
|
const { name: name2, columns } = PgSquasher.unsquashPK(statement.old);
|
@@ -12602,8 +12787,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12602
12787
|
}
|
12603
12788
|
};
|
12604
12789
|
MySqlAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
12605
|
-
can(statement,
|
12606
|
-
return statement.type === "create_composite_pk" &&
|
12790
|
+
can(statement, dialect4) {
|
12791
|
+
return statement.type === "create_composite_pk" && dialect4 === "mysql";
|
12607
12792
|
}
|
12608
12793
|
convert(statement) {
|
12609
12794
|
const { name: name2, columns } = MySqlSquasher.unsquashPK(statement.data);
|
@@ -12611,8 +12796,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12611
12796
|
}
|
12612
12797
|
};
|
12613
12798
|
MySqlAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
12614
|
-
can(statement,
|
12615
|
-
return statement.type === "delete_composite_pk" &&
|
12799
|
+
can(statement, dialect4) {
|
12800
|
+
return statement.type === "delete_composite_pk" && dialect4 === "mysql";
|
12616
12801
|
}
|
12617
12802
|
convert(statement) {
|
12618
12803
|
const { name: name2, columns } = MySqlSquasher.unsquashPK(statement.data);
|
@@ -12620,8 +12805,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12620
12805
|
}
|
12621
12806
|
};
|
12622
12807
|
MySqlAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
12623
|
-
can(statement,
|
12624
|
-
return statement.type === "alter_composite_pk" &&
|
12808
|
+
can(statement, dialect4) {
|
12809
|
+
return statement.type === "alter_composite_pk" && dialect4 === "mysql";
|
12625
12810
|
}
|
12626
12811
|
convert(statement) {
|
12627
12812
|
const { name: name2, columns } = MySqlSquasher.unsquashPK(statement.old);
|
@@ -12632,8 +12817,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12632
12817
|
}
|
12633
12818
|
};
|
12634
12819
|
PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
|
12635
|
-
can(statement,
|
12636
|
-
return statement.type === "alter_table_alter_column_set_pk" &&
|
12820
|
+
can(statement, dialect4) {
|
12821
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect4 === "postgresql";
|
12637
12822
|
}
|
12638
12823
|
convert(statement) {
|
12639
12824
|
const { tableName, columnName } = statement;
|
@@ -12642,8 +12827,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12642
12827
|
}
|
12643
12828
|
};
|
12644
12829
|
PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
|
12645
|
-
can(statement,
|
12646
|
-
return statement.type === "alter_table_alter_column_drop_pk" &&
|
12830
|
+
can(statement, dialect4) {
|
12831
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect4 === "postgresql";
|
12647
12832
|
}
|
12648
12833
|
convert(statement) {
|
12649
12834
|
const { tableName, columnName, schema: schema4 } = statement;
|
@@ -12666,8 +12851,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12666
12851
|
}
|
12667
12852
|
};
|
12668
12853
|
PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
12669
|
-
can(statement,
|
12670
|
-
return statement.type === "alter_table_alter_column_set_notnull" &&
|
12854
|
+
can(statement, dialect4) {
|
12855
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect4 === "postgresql";
|
12671
12856
|
}
|
12672
12857
|
convert(statement) {
|
12673
12858
|
const { tableName, columnName } = statement;
|
@@ -12676,8 +12861,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12676
12861
|
}
|
12677
12862
|
};
|
12678
12863
|
PgAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
12679
|
-
can(statement,
|
12680
|
-
return statement.type === "alter_table_alter_column_drop_notnull" &&
|
12864
|
+
can(statement, dialect4) {
|
12865
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect4 === "postgresql";
|
12681
12866
|
}
|
12682
12867
|
convert(statement) {
|
12683
12868
|
const { tableName, columnName } = statement;
|
@@ -12686,8 +12871,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12686
12871
|
}
|
12687
12872
|
};
|
12688
12873
|
PgCreateForeignKeyConvertor = class extends Convertor {
|
12689
|
-
can(statement,
|
12690
|
-
return statement.type === "create_reference" &&
|
12874
|
+
can(statement, dialect4) {
|
12875
|
+
return statement.type === "create_reference" && dialect4 === "postgresql";
|
12691
12876
|
}
|
12692
12877
|
convert(statement) {
|
12693
12878
|
const {
|
@@ -12716,8 +12901,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12716
12901
|
}
|
12717
12902
|
};
|
12718
12903
|
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
12719
|
-
can(statement,
|
12720
|
-
return statement.type === "create_reference" &&
|
12904
|
+
can(statement, dialect4) {
|
12905
|
+
return statement.type === "create_reference" && dialect4 === "turso";
|
12721
12906
|
}
|
12722
12907
|
convert(statement, json22, action) {
|
12723
12908
|
const { columnsFrom, columnsTo, tableFrom, onDelete, onUpdate, tableTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
@@ -12733,8 +12918,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12733
12918
|
}
|
12734
12919
|
};
|
12735
12920
|
MySqlCreateForeignKeyConvertor = class extends Convertor {
|
12736
|
-
can(statement,
|
12737
|
-
return statement.type === "create_reference" &&
|
12921
|
+
can(statement, dialect4) {
|
12922
|
+
return statement.type === "create_reference" && dialect4 === "mysql";
|
12738
12923
|
}
|
12739
12924
|
convert(statement) {
|
12740
12925
|
const {
|
@@ -12754,8 +12939,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12754
12939
|
}
|
12755
12940
|
};
|
12756
12941
|
PgAlterForeignKeyConvertor = class extends Convertor {
|
12757
|
-
can(statement,
|
12758
|
-
return statement.type === "alter_reference" &&
|
12942
|
+
can(statement, dialect4) {
|
12943
|
+
return statement.type === "alter_reference" && dialect4 === "postgresql";
|
12759
12944
|
}
|
12760
12945
|
convert(statement) {
|
12761
12946
|
const newFk = PgSquasher.unsquashFK(statement.data);
|
@@ -12779,8 +12964,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12779
12964
|
}
|
12780
12965
|
};
|
12781
12966
|
PgDeleteForeignKeyConvertor = class extends Convertor {
|
12782
|
-
can(statement,
|
12783
|
-
return statement.type === "delete_reference" &&
|
12967
|
+
can(statement, dialect4) {
|
12968
|
+
return statement.type === "delete_reference" && dialect4 === "postgresql";
|
12784
12969
|
}
|
12785
12970
|
convert(statement) {
|
12786
12971
|
const tableFrom = statement.tableName;
|
@@ -12791,8 +12976,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12791
12976
|
}
|
12792
12977
|
};
|
12793
12978
|
MySqlDeleteForeignKeyConvertor = class extends Convertor {
|
12794
|
-
can(statement,
|
12795
|
-
return statement.type === "delete_reference" &&
|
12979
|
+
can(statement, dialect4) {
|
12980
|
+
return statement.type === "delete_reference" && dialect4 === "mysql";
|
12796
12981
|
}
|
12797
12982
|
convert(statement) {
|
12798
12983
|
const tableFrom = statement.tableName;
|
@@ -12802,8 +12987,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12802
12987
|
}
|
12803
12988
|
};
|
12804
12989
|
CreatePgIndexConvertor = class extends Convertor {
|
12805
|
-
can(statement,
|
12806
|
-
return statement.type === "create_index_pg" &&
|
12990
|
+
can(statement, dialect4) {
|
12991
|
+
return statement.type === "create_index_pg" && dialect4 === "postgresql";
|
12807
12992
|
}
|
12808
12993
|
convert(statement) {
|
12809
12994
|
const {
|
@@ -12834,8 +13019,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12834
13019
|
}
|
12835
13020
|
};
|
12836
13021
|
CreateMySqlIndexConvertor = class extends Convertor {
|
12837
|
-
can(statement,
|
12838
|
-
return statement.type === "create_index" &&
|
13022
|
+
can(statement, dialect4) {
|
13023
|
+
return statement.type === "create_index" && dialect4 === "mysql";
|
12839
13024
|
}
|
12840
13025
|
convert(statement) {
|
12841
13026
|
const { name: name2, columns, isUnique } = MySqlSquasher.unsquashIdx(
|
@@ -12849,8 +13034,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12849
13034
|
}
|
12850
13035
|
};
|
12851
13036
|
CreateSqliteIndexConvertor = class extends Convertor {
|
12852
|
-
can(statement,
|
12853
|
-
return statement.type === "create_index" && (
|
13037
|
+
can(statement, dialect4) {
|
13038
|
+
return statement.type === "create_index" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12854
13039
|
}
|
12855
13040
|
convert(statement) {
|
12856
13041
|
const { name: name2, columns, isUnique, where } = SQLiteSquasher.unsquashIdx(
|
@@ -12865,8 +13050,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12865
13050
|
}
|
12866
13051
|
};
|
12867
13052
|
PgDropIndexConvertor = class extends Convertor {
|
12868
|
-
can(statement,
|
12869
|
-
return statement.type === "drop_index" &&
|
13053
|
+
can(statement, dialect4) {
|
13054
|
+
return statement.type === "drop_index" && dialect4 === "postgresql";
|
12870
13055
|
}
|
12871
13056
|
convert(statement) {
|
12872
13057
|
const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
|
@@ -12874,8 +13059,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12874
13059
|
}
|
12875
13060
|
};
|
12876
13061
|
PgCreateSchemaConvertor = class extends Convertor {
|
12877
|
-
can(statement,
|
12878
|
-
return statement.type === "create_schema" &&
|
13062
|
+
can(statement, dialect4) {
|
13063
|
+
return statement.type === "create_schema" && dialect4 === "postgresql";
|
12879
13064
|
}
|
12880
13065
|
convert(statement) {
|
12881
13066
|
const { name: name2 } = statement;
|
@@ -12884,8 +13069,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12884
13069
|
}
|
12885
13070
|
};
|
12886
13071
|
PgRenameSchemaConvertor = class extends Convertor {
|
12887
|
-
can(statement,
|
12888
|
-
return statement.type === "rename_schema" &&
|
13072
|
+
can(statement, dialect4) {
|
13073
|
+
return statement.type === "rename_schema" && dialect4 === "postgresql";
|
12889
13074
|
}
|
12890
13075
|
convert(statement) {
|
12891
13076
|
const { from, to } = statement;
|
@@ -12894,8 +13079,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12894
13079
|
}
|
12895
13080
|
};
|
12896
13081
|
PgDropSchemaConvertor = class extends Convertor {
|
12897
|
-
can(statement,
|
12898
|
-
return statement.type === "drop_schema" &&
|
13082
|
+
can(statement, dialect4) {
|
13083
|
+
return statement.type === "drop_schema" && dialect4 === "postgresql";
|
12899
13084
|
}
|
12900
13085
|
convert(statement) {
|
12901
13086
|
const { name: name2 } = statement;
|
@@ -12904,8 +13089,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12904
13089
|
}
|
12905
13090
|
};
|
12906
13091
|
PgAlterTableSetSchemaConvertor = class extends Convertor {
|
12907
|
-
can(statement,
|
12908
|
-
return statement.type === "alter_table_set_schema" &&
|
13092
|
+
can(statement, dialect4) {
|
13093
|
+
return statement.type === "alter_table_set_schema" && dialect4 === "postgresql";
|
12909
13094
|
}
|
12910
13095
|
convert(statement) {
|
12911
13096
|
const { tableName, schemaFrom, schemaTo } = statement;
|
@@ -12914,8 +13099,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12914
13099
|
}
|
12915
13100
|
};
|
12916
13101
|
PgAlterTableSetNewSchemaConvertor = class extends Convertor {
|
12917
|
-
can(statement,
|
12918
|
-
return statement.type === "alter_table_set_new_schema" &&
|
13102
|
+
can(statement, dialect4) {
|
13103
|
+
return statement.type === "alter_table_set_new_schema" && dialect4 === "postgresql";
|
12919
13104
|
}
|
12920
13105
|
convert(statement) {
|
12921
13106
|
const { tableName, to, from } = statement;
|
@@ -12925,8 +13110,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12925
13110
|
}
|
12926
13111
|
};
|
12927
13112
|
PgAlterTableRemoveFromSchemaConvertor = class extends Convertor {
|
12928
|
-
can(statement,
|
12929
|
-
return statement.type === "alter_table_remove_from_schema" &&
|
13113
|
+
can(statement, dialect4) {
|
13114
|
+
return statement.type === "alter_table_remove_from_schema" && dialect4 === "postgresql";
|
12930
13115
|
}
|
12931
13116
|
convert(statement) {
|
12932
13117
|
const { tableName, schema: schema4 } = statement;
|
@@ -12936,8 +13121,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12936
13121
|
}
|
12937
13122
|
};
|
12938
13123
|
SqliteDropIndexConvertor = class extends Convertor {
|
12939
|
-
can(statement,
|
12940
|
-
return statement.type === "drop_index" && (
|
13124
|
+
can(statement, dialect4) {
|
13125
|
+
return statement.type === "drop_index" && (dialect4 === "sqlite" || dialect4 === "turso");
|
12941
13126
|
}
|
12942
13127
|
convert(statement) {
|
12943
13128
|
const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
|
@@ -12945,8 +13130,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12945
13130
|
}
|
12946
13131
|
};
|
12947
13132
|
MySqlDropIndexConvertor = class extends Convertor {
|
12948
|
-
can(statement,
|
12949
|
-
return statement.type === "drop_index" &&
|
13133
|
+
can(statement, dialect4) {
|
13134
|
+
return statement.type === "drop_index" && dialect4 === "mysql";
|
12950
13135
|
}
|
12951
13136
|
convert(statement) {
|
12952
13137
|
const { name: name2 } = MySqlSquasher.unsquashIdx(statement.data);
|
@@ -12954,8 +13139,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12954
13139
|
}
|
12955
13140
|
};
|
12956
13141
|
SQLiteRecreateTableConvertor = class extends Convertor {
|
12957
|
-
can(statement,
|
12958
|
-
return statement.type === "recreate_table" &&
|
13142
|
+
can(statement, dialect4) {
|
13143
|
+
return statement.type === "recreate_table" && dialect4 === "sqlite";
|
12959
13144
|
}
|
12960
13145
|
convert(statement) {
|
12961
13146
|
const { tableName, columns, compositePKs, referenceData } = statement;
|
@@ -12996,8 +13181,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12996
13181
|
}
|
12997
13182
|
};
|
12998
13183
|
LibSQLRecreateTableConvertor = class extends Convertor {
|
12999
|
-
can(statement,
|
13000
|
-
return statement.type === "recreate_table" &&
|
13184
|
+
can(statement, dialect4) {
|
13185
|
+
return statement.type === "recreate_table" && dialect4 === "turso";
|
13001
13186
|
}
|
13002
13187
|
convert(statement) {
|
13003
13188
|
const { tableName, columns, compositePKs, referenceData } = statement;
|
@@ -16707,7 +16892,7 @@ var init_schemaValidator = __esm({
|
|
16707
16892
|
});
|
16708
16893
|
|
16709
16894
|
// src/cli/validations/common.ts
|
16710
|
-
var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
|
16895
|
+
var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, casingTypes, casingType, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
|
16711
16896
|
var init_common = __esm({
|
16712
16897
|
"src/cli/validations/common.ts"() {
|
16713
16898
|
"use strict";
|
@@ -16733,6 +16918,8 @@ var init_common = __esm({
|
|
16733
16918
|
{
|
16734
16919
|
const _2 = "";
|
16735
16920
|
}
|
16921
|
+
casingTypes = ["snake_case", "camelCase"];
|
16922
|
+
casingType = enumType(casingTypes);
|
16736
16923
|
sqliteDriver = unionType(sqliteDriversLiterals);
|
16737
16924
|
postgresDriver = unionType(postgresqlDriversLiterals);
|
16738
16925
|
driver = unionType([sqliteDriver, postgresDriver]);
|
@@ -16751,7 +16938,8 @@ var init_common = __esm({
|
|
16751
16938
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
16752
16939
|
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
|
16753
16940
|
migrations: configMigrations,
|
16754
|
-
dbCredentials: anyType().optional()
|
16941
|
+
dbCredentials: anyType().optional(),
|
16942
|
+
casing: casingType.optional()
|
16755
16943
|
}).passthrough();
|
16756
16944
|
casing = unionType([literalType("camel"), literalType("preserve")]).default(
|
16757
16945
|
"camel"
|
@@ -18140,51 +18328,17 @@ var init_mjs = __esm({
|
|
18140
18328
|
}
|
18141
18329
|
});
|
18142
18330
|
|
18143
|
-
// ../drizzle-orm/dist/entity.js
|
18144
|
-
function is(value, type) {
|
18145
|
-
if (!value || typeof value !== "object") {
|
18146
|
-
return false;
|
18147
|
-
}
|
18148
|
-
if (value instanceof type) {
|
18149
|
-
return true;
|
18150
|
-
}
|
18151
|
-
if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
|
18152
|
-
throw new Error(
|
18153
|
-
`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.`
|
18154
|
-
);
|
18155
|
-
}
|
18156
|
-
let cls = value.constructor;
|
18157
|
-
if (cls) {
|
18158
|
-
while (cls) {
|
18159
|
-
if (entityKind in cls && cls[entityKind] === type[entityKind]) {
|
18160
|
-
return true;
|
18161
|
-
}
|
18162
|
-
cls = Object.getPrototypeOf(cls);
|
18163
|
-
}
|
18164
|
-
}
|
18165
|
-
return false;
|
18166
|
-
}
|
18167
|
-
var entityKind, hasOwnEntityKind;
|
18168
|
-
var init_entity = __esm({
|
18169
|
-
"../drizzle-orm/dist/entity.js"() {
|
18170
|
-
"use strict";
|
18171
|
-
entityKind = Symbol.for("drizzle:entityKind");
|
18172
|
-
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
18173
|
-
}
|
18174
|
-
});
|
18175
|
-
|
18176
18331
|
// ../drizzle-orm/dist/column.js
|
18177
|
-
var
|
18332
|
+
var _a3, Column2;
|
18178
18333
|
var init_column = __esm({
|
18179
18334
|
"../drizzle-orm/dist/column.js"() {
|
18180
18335
|
"use strict";
|
18181
18336
|
init_entity();
|
18182
|
-
|
18337
|
+
_a3 = entityKind;
|
18183
18338
|
Column2 = class {
|
18184
18339
|
constructor(table4, config) {
|
18185
|
-
/** @internal */
|
18186
|
-
__publicField(this, "keyAsName");
|
18187
18340
|
__publicField(this, "name");
|
18341
|
+
__publicField(this, "keyAsName");
|
18188
18342
|
__publicField(this, "primary");
|
18189
18343
|
__publicField(this, "notNull");
|
18190
18344
|
__publicField(this, "default");
|
@@ -18229,17 +18383,17 @@ var init_column = __esm({
|
|
18229
18383
|
return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
|
18230
18384
|
}
|
18231
18385
|
};
|
18232
|
-
__publicField(Column2,
|
18386
|
+
__publicField(Column2, _a3, "Column");
|
18233
18387
|
}
|
18234
18388
|
});
|
18235
18389
|
|
18236
18390
|
// ../drizzle-orm/dist/column-builder.js
|
18237
|
-
var
|
18391
|
+
var _a4, ColumnBuilder;
|
18238
18392
|
var init_column_builder = __esm({
|
18239
18393
|
"../drizzle-orm/dist/column-builder.js"() {
|
18240
18394
|
"use strict";
|
18241
18395
|
init_entity();
|
18242
|
-
|
18396
|
+
_a4 = entityKind;
|
18243
18397
|
ColumnBuilder = class {
|
18244
18398
|
constructor(name2, dataType, columnType) {
|
18245
18399
|
__publicField(this, "config");
|
@@ -18341,27 +18495,18 @@ var init_column_builder = __esm({
|
|
18341
18495
|
this.config.name = name2;
|
18342
18496
|
}
|
18343
18497
|
};
|
18344
|
-
__publicField(ColumnBuilder,
|
18345
|
-
}
|
18346
|
-
});
|
18347
|
-
|
18348
|
-
// ../drizzle-orm/dist/table.utils.js
|
18349
|
-
var TableName;
|
18350
|
-
var init_table_utils = __esm({
|
18351
|
-
"../drizzle-orm/dist/table.utils.js"() {
|
18352
|
-
"use strict";
|
18353
|
-
TableName = Symbol.for("drizzle:Name");
|
18498
|
+
__publicField(ColumnBuilder, _a4, "ColumnBuilder");
|
18354
18499
|
}
|
18355
18500
|
});
|
18356
18501
|
|
18357
18502
|
// ../drizzle-orm/dist/pg-core/foreign-keys.js
|
18358
|
-
var
|
18503
|
+
var _a5, ForeignKeyBuilder, _a6, ForeignKey;
|
18359
18504
|
var init_foreign_keys = __esm({
|
18360
18505
|
"../drizzle-orm/dist/pg-core/foreign-keys.js"() {
|
18361
18506
|
"use strict";
|
18362
18507
|
init_entity();
|
18363
18508
|
init_table_utils();
|
18364
|
-
|
18509
|
+
_a5 = entityKind;
|
18365
18510
|
ForeignKeyBuilder = class {
|
18366
18511
|
constructor(config, actions) {
|
18367
18512
|
/** @internal */
|
@@ -18392,8 +18537,8 @@ var init_foreign_keys = __esm({
|
|
18392
18537
|
return new ForeignKey(table4, this);
|
18393
18538
|
}
|
18394
18539
|
};
|
18395
|
-
__publicField(ForeignKeyBuilder,
|
18396
|
-
|
18540
|
+
__publicField(ForeignKeyBuilder, _a5, "PgForeignKeyBuilder");
|
18541
|
+
_a6 = entityKind;
|
18397
18542
|
ForeignKey = class {
|
18398
18543
|
constructor(table4, builder) {
|
18399
18544
|
__publicField(this, "reference");
|
@@ -18417,7 +18562,7 @@ var init_foreign_keys = __esm({
|
|
18417
18562
|
return name2 ?? `${chunks.join("_")}_fk`;
|
18418
18563
|
}
|
18419
18564
|
};
|
18420
|
-
__publicField(ForeignKey,
|
18565
|
+
__publicField(ForeignKey, _a6, "PgForeignKey");
|
18421
18566
|
}
|
18422
18567
|
});
|
18423
18568
|
|
@@ -18435,13 +18580,13 @@ var init_tracing_utils = __esm({
|
|
18435
18580
|
function uniqueKeyName(table4, columns) {
|
18436
18581
|
return `${table4[TableName]}_${columns.join("_")}_unique`;
|
18437
18582
|
}
|
18438
|
-
var
|
18583
|
+
var _a7, UniqueConstraintBuilder, _a8, UniqueOnConstraintBuilder, _a9, UniqueConstraint;
|
18439
18584
|
var init_unique_constraint = __esm({
|
18440
18585
|
"../drizzle-orm/dist/pg-core/unique-constraint.js"() {
|
18441
18586
|
"use strict";
|
18442
18587
|
init_entity();
|
18443
18588
|
init_table_utils();
|
18444
|
-
|
18589
|
+
_a7 = entityKind;
|
18445
18590
|
UniqueConstraintBuilder = class {
|
18446
18591
|
constructor(columns, name2) {
|
18447
18592
|
/** @internal */
|
@@ -18460,8 +18605,8 @@ var init_unique_constraint = __esm({
|
|
18460
18605
|
return new UniqueConstraint(table4, this.columns, this.nullsNotDistinctConfig, this.name);
|
18461
18606
|
}
|
18462
18607
|
};
|
18463
|
-
__publicField(UniqueConstraintBuilder,
|
18464
|
-
|
18608
|
+
__publicField(UniqueConstraintBuilder, _a7, "PgUniqueConstraintBuilder");
|
18609
|
+
_a8 = entityKind;
|
18465
18610
|
UniqueOnConstraintBuilder = class {
|
18466
18611
|
constructor(name2) {
|
18467
18612
|
/** @internal */
|
@@ -18472,8 +18617,8 @@ var init_unique_constraint = __esm({
|
|
18472
18617
|
return new UniqueConstraintBuilder(columns, this.name);
|
18473
18618
|
}
|
18474
18619
|
};
|
18475
|
-
__publicField(UniqueOnConstraintBuilder,
|
18476
|
-
|
18620
|
+
__publicField(UniqueOnConstraintBuilder, _a8, "PgUniqueOnConstraintBuilder");
|
18621
|
+
_a9 = entityKind;
|
18477
18622
|
UniqueConstraint = class {
|
18478
18623
|
constructor(table4, columns, nullsNotDistinct, name2) {
|
18479
18624
|
__publicField(this, "columns");
|
@@ -18488,7 +18633,7 @@ var init_unique_constraint = __esm({
|
|
18488
18633
|
return this.name;
|
18489
18634
|
}
|
18490
18635
|
};
|
18491
|
-
__publicField(UniqueConstraint,
|
18636
|
+
__publicField(UniqueConstraint, _a9, "PgUniqueConstraint");
|
18492
18637
|
}
|
18493
18638
|
});
|
18494
18639
|
|
@@ -18574,7 +18719,7 @@ var init_array = __esm({
|
|
18574
18719
|
});
|
18575
18720
|
|
18576
18721
|
// ../drizzle-orm/dist/pg-core/columns/common.js
|
18577
|
-
var
|
18722
|
+
var _a10, _b2, PgColumnBuilder, _a11, _b3, PgColumn, _a12, _b4, ExtraConfigColumn, _a13, IndexedColumn, _a14, _b5, PgArrayBuilder, _a15, _b6, _PgArray, PgArray;
|
18578
18723
|
var init_common2 = __esm({
|
18579
18724
|
"../drizzle-orm/dist/pg-core/columns/common.js"() {
|
18580
18725
|
"use strict";
|
@@ -18585,7 +18730,7 @@ var init_common2 = __esm({
|
|
18585
18730
|
init_tracing_utils();
|
18586
18731
|
init_unique_constraint();
|
18587
18732
|
init_array();
|
18588
|
-
PgColumnBuilder = class extends (
|
18733
|
+
PgColumnBuilder = class extends (_b2 = ColumnBuilder, _a10 = entityKind, _b2) {
|
18589
18734
|
constructor() {
|
18590
18735
|
super(...arguments);
|
18591
18736
|
__publicField(this, "foreignKeyConfigs", []);
|
@@ -18638,8 +18783,8 @@ var init_common2 = __esm({
|
|
18638
18783
|
return new ExtraConfigColumn(table4, this.config);
|
18639
18784
|
}
|
18640
18785
|
};
|
18641
|
-
__publicField(PgColumnBuilder,
|
18642
|
-
PgColumn = class extends (
|
18786
|
+
__publicField(PgColumnBuilder, _a10, "PgColumnBuilder");
|
18787
|
+
PgColumn = class extends (_b3 = Column2, _a11 = entityKind, _b3) {
|
18643
18788
|
constructor(table4, config) {
|
18644
18789
|
if (!config.uniqueName) {
|
18645
18790
|
config.uniqueName = uniqueKeyName(table4, [config.name]);
|
@@ -18648,8 +18793,8 @@ var init_common2 = __esm({
|
|
18648
18793
|
this.table = table4;
|
18649
18794
|
}
|
18650
18795
|
};
|
18651
|
-
__publicField(PgColumn,
|
18652
|
-
ExtraConfigColumn = class extends (
|
18796
|
+
__publicField(PgColumn, _a11, "PgColumn");
|
18797
|
+
ExtraConfigColumn = class extends (_b4 = PgColumn, _a12 = entityKind, _b4) {
|
18653
18798
|
constructor() {
|
18654
18799
|
super(...arguments);
|
18655
18800
|
__publicField(this, "indexConfig", {
|
@@ -18716,20 +18861,22 @@ var init_common2 = __esm({
|
|
18716
18861
|
return this;
|
18717
18862
|
}
|
18718
18863
|
};
|
18719
|
-
__publicField(ExtraConfigColumn,
|
18720
|
-
|
18864
|
+
__publicField(ExtraConfigColumn, _a12, "ExtraConfigColumn");
|
18865
|
+
_a13 = entityKind;
|
18721
18866
|
IndexedColumn = class {
|
18722
|
-
constructor(name2, type, indexConfig) {
|
18867
|
+
constructor(name2, keyAsName, type, indexConfig) {
|
18723
18868
|
__publicField(this, "name");
|
18869
|
+
__publicField(this, "keyAsName");
|
18724
18870
|
__publicField(this, "type");
|
18725
18871
|
__publicField(this, "indexConfig");
|
18726
18872
|
this.name = name2;
|
18873
|
+
this.keyAsName = keyAsName;
|
18727
18874
|
this.type = type;
|
18728
18875
|
this.indexConfig = indexConfig;
|
18729
18876
|
}
|
18730
18877
|
};
|
18731
|
-
__publicField(IndexedColumn,
|
18732
|
-
PgArrayBuilder = class extends (
|
18878
|
+
__publicField(IndexedColumn, _a13, "IndexedColumn");
|
18879
|
+
PgArrayBuilder = class extends (_b5 = PgColumnBuilder, _a14 = entityKind, _b5) {
|
18733
18880
|
constructor(name2, baseBuilder, size) {
|
18734
18881
|
super(name2, "array", "PgArray");
|
18735
18882
|
this.config.baseBuilder = baseBuilder;
|
@@ -18745,8 +18892,8 @@ var init_common2 = __esm({
|
|
18745
18892
|
);
|
18746
18893
|
}
|
18747
18894
|
};
|
18748
|
-
__publicField(PgArrayBuilder,
|
18749
|
-
_PgArray = class _PgArray extends (
|
18895
|
+
__publicField(PgArrayBuilder, _a14, "PgArrayBuilder");
|
18896
|
+
_PgArray = class _PgArray extends (_b6 = PgColumn, _a15 = entityKind, _b6) {
|
18750
18897
|
constructor(table4, config, baseColumn, range) {
|
18751
18898
|
super(table4, config);
|
18752
18899
|
__publicField(this, "size");
|
@@ -18772,7 +18919,7 @@ var init_common2 = __esm({
|
|
18772
18919
|
return makePgArray(a);
|
18773
18920
|
}
|
18774
18921
|
};
|
18775
|
-
__publicField(_PgArray,
|
18922
|
+
__publicField(_PgArray, _a15, "PgArray");
|
18776
18923
|
PgArray = _PgArray;
|
18777
18924
|
}
|
18778
18925
|
});
|
@@ -18793,14 +18940,14 @@ function pgEnumWithSchema(enumName, values, schema4) {
|
|
18793
18940
|
);
|
18794
18941
|
return enumInstance;
|
18795
18942
|
}
|
18796
|
-
var isPgEnumSym,
|
18943
|
+
var isPgEnumSym, _a16, _b7, PgEnumColumnBuilder, _a17, _b8, PgEnumColumn;
|
18797
18944
|
var init_enum = __esm({
|
18798
18945
|
"../drizzle-orm/dist/pg-core/columns/enum.js"() {
|
18799
18946
|
"use strict";
|
18800
18947
|
init_entity();
|
18801
18948
|
init_common2();
|
18802
18949
|
isPgEnumSym = Symbol.for("drizzle:isPgEnum");
|
18803
|
-
PgEnumColumnBuilder = class extends (
|
18950
|
+
PgEnumColumnBuilder = class extends (_b7 = PgColumnBuilder, _a16 = entityKind, _b7) {
|
18804
18951
|
constructor(name2, enumInstance) {
|
18805
18952
|
super(name2, "string", "PgEnumColumn");
|
18806
18953
|
this.config.enum = enumInstance;
|
@@ -18813,8 +18960,8 @@ var init_enum = __esm({
|
|
18813
18960
|
);
|
18814
18961
|
}
|
18815
18962
|
};
|
18816
|
-
__publicField(PgEnumColumnBuilder,
|
18817
|
-
PgEnumColumn = class extends (
|
18963
|
+
__publicField(PgEnumColumnBuilder, _a16, "PgEnumColumnBuilder");
|
18964
|
+
PgEnumColumn = class extends (_b8 = PgColumn, _a17 = entityKind, _b8) {
|
18818
18965
|
constructor(table4, config) {
|
18819
18966
|
super(table4, config);
|
18820
18967
|
__publicField(this, "enum", this.config.enum);
|
@@ -18825,17 +18972,17 @@ var init_enum = __esm({
|
|
18825
18972
|
return this.enum.enumName;
|
18826
18973
|
}
|
18827
18974
|
};
|
18828
|
-
__publicField(PgEnumColumn,
|
18975
|
+
__publicField(PgEnumColumn, _a17, "PgEnumColumn");
|
18829
18976
|
}
|
18830
18977
|
});
|
18831
18978
|
|
18832
18979
|
// ../drizzle-orm/dist/subquery.js
|
18833
|
-
var
|
18980
|
+
var _a18, Subquery, _a19, _b9, WithSubquery;
|
18834
18981
|
var init_subquery = __esm({
|
18835
18982
|
"../drizzle-orm/dist/subquery.js"() {
|
18836
18983
|
"use strict";
|
18837
18984
|
init_entity();
|
18838
|
-
|
18985
|
+
_a18 = entityKind;
|
18839
18986
|
Subquery = class {
|
18840
18987
|
constructor(sql2, selection, alias, isWith = false) {
|
18841
18988
|
this._ = {
|
@@ -18850,10 +18997,10 @@ var init_subquery = __esm({
|
|
18850
18997
|
// return new SQL([this]);
|
18851
18998
|
// }
|
18852
18999
|
};
|
18853
|
-
__publicField(Subquery,
|
18854
|
-
WithSubquery = class extends (
|
19000
|
+
__publicField(Subquery, _a18, "Subquery");
|
19001
|
+
WithSubquery = class extends (_b9 = Subquery, _a19 = entityKind, _b9) {
|
18855
19002
|
};
|
18856
|
-
__publicField(WithSubquery,
|
19003
|
+
__publicField(WithSubquery, _a19, "WithSubquery");
|
18857
19004
|
}
|
18858
19005
|
});
|
18859
19006
|
|
@@ -18916,80 +19063,6 @@ var init_view_common = __esm({
|
|
18916
19063
|
}
|
18917
19064
|
});
|
18918
19065
|
|
18919
|
-
// ../drizzle-orm/dist/table.js
|
18920
|
-
function isTable(table4) {
|
18921
|
-
return typeof table4 === "object" && table4 !== null && IsDrizzleTable in table4;
|
18922
|
-
}
|
18923
|
-
function getTableName(table4) {
|
18924
|
-
return table4[TableName];
|
18925
|
-
}
|
18926
|
-
function getTableUniqueName(table4) {
|
18927
|
-
return `${table4[Schema] ?? "public"}.${table4[TableName]}`;
|
18928
|
-
}
|
18929
|
-
var Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a18, _b9, _c, _d, _e, _f, _g, _h, _i, _j, Table2;
|
18930
|
-
var init_table = __esm({
|
18931
|
-
"../drizzle-orm/dist/table.js"() {
|
18932
|
-
"use strict";
|
18933
|
-
init_entity();
|
18934
|
-
init_table_utils();
|
18935
|
-
Schema = Symbol.for("drizzle:Schema");
|
18936
|
-
Columns = Symbol.for("drizzle:Columns");
|
18937
|
-
ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
18938
|
-
OriginalName = Symbol.for("drizzle:OriginalName");
|
18939
|
-
BaseName = Symbol.for("drizzle:BaseName");
|
18940
|
-
IsAlias = Symbol.for("drizzle:IsAlias");
|
18941
|
-
ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
18942
|
-
IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
18943
|
-
_j = entityKind, _i = TableName, _h = OriginalName, _g = Schema, _f = Columns, _e = ExtraConfigColumns, _d = BaseName, _c = IsAlias, _b9 = IsDrizzleTable, _a18 = ExtraConfigBuilder;
|
18944
|
-
Table2 = class {
|
18945
|
-
constructor(name2, schema4, baseName) {
|
18946
|
-
/**
|
18947
|
-
* @internal
|
18948
|
-
* Can be changed if the table is aliased.
|
18949
|
-
*/
|
18950
|
-
__publicField(this, _i);
|
18951
|
-
/**
|
18952
|
-
* @internal
|
18953
|
-
* Used to store the original name of the table, before any aliasing.
|
18954
|
-
*/
|
18955
|
-
__publicField(this, _h);
|
18956
|
-
/** @internal */
|
18957
|
-
__publicField(this, _g);
|
18958
|
-
/** @internal */
|
18959
|
-
__publicField(this, _f);
|
18960
|
-
/** @internal */
|
18961
|
-
__publicField(this, _e);
|
18962
|
-
/**
|
18963
|
-
* @internal
|
18964
|
-
* Used to store the table name before the transformation via the `tableCreator` functions.
|
18965
|
-
*/
|
18966
|
-
__publicField(this, _d);
|
18967
|
-
/** @internal */
|
18968
|
-
__publicField(this, _c, false);
|
18969
|
-
/** @internal */
|
18970
|
-
__publicField(this, _b9, true);
|
18971
|
-
/** @internal */
|
18972
|
-
__publicField(this, _a18);
|
18973
|
-
this[TableName] = this[OriginalName] = name2;
|
18974
|
-
this[Schema] = schema4;
|
18975
|
-
this[BaseName] = baseName;
|
18976
|
-
}
|
18977
|
-
};
|
18978
|
-
__publicField(Table2, _j, "Table");
|
18979
|
-
/** @internal */
|
18980
|
-
__publicField(Table2, "Symbol", {
|
18981
|
-
Name: TableName,
|
18982
|
-
Schema,
|
18983
|
-
OriginalName,
|
18984
|
-
Columns,
|
18985
|
-
ExtraConfigColumns,
|
18986
|
-
BaseName,
|
18987
|
-
IsAlias,
|
18988
|
-
ExtraConfigBuilder
|
18989
|
-
});
|
18990
|
-
}
|
18991
|
-
});
|
18992
|
-
|
18993
19066
|
// ../drizzle-orm/dist/sql/sql.js
|
18994
19067
|
function isSQLWrapper(value) {
|
18995
19068
|
return value !== null && value !== void 0 && typeof value.getSQL === "function";
|
@@ -19047,7 +19120,7 @@ function fillPlaceholders(params, values) {
|
|
19047
19120
|
return p;
|
19048
19121
|
});
|
19049
19122
|
}
|
19050
|
-
var
|
19123
|
+
var _a20, FakePrimitiveParam, _a21, StringChunk, _a22, _SQL, SQL, _a23, Name, noopDecoder, noopEncoder, noopMapper, _a24, Param, _a25, Placeholder, _a26, _b10, View;
|
19051
19124
|
var init_sql = __esm({
|
19052
19125
|
"../drizzle-orm/dist/sql/sql.js"() {
|
19053
19126
|
"use strict";
|
@@ -19058,11 +19131,11 @@ var init_sql = __esm({
|
|
19058
19131
|
init_view_common();
|
19059
19132
|
init_column();
|
19060
19133
|
init_table();
|
19061
|
-
|
19134
|
+
_a20 = entityKind;
|
19062
19135
|
FakePrimitiveParam = class {
|
19063
19136
|
};
|
19064
|
-
__publicField(FakePrimitiveParam,
|
19065
|
-
|
19137
|
+
__publicField(FakePrimitiveParam, _a20, "FakePrimitiveParam");
|
19138
|
+
_a21 = entityKind;
|
19066
19139
|
StringChunk = class {
|
19067
19140
|
constructor(value) {
|
19068
19141
|
__publicField(this, "value");
|
@@ -19072,8 +19145,8 @@ var init_sql = __esm({
|
|
19072
19145
|
return new SQL([this]);
|
19073
19146
|
}
|
19074
19147
|
};
|
19075
|
-
__publicField(StringChunk,
|
19076
|
-
|
19148
|
+
__publicField(StringChunk, _a21, "StringChunk");
|
19149
|
+
_a22 = entityKind;
|
19077
19150
|
_SQL = class _SQL {
|
19078
19151
|
constructor(queryChunks) {
|
19079
19152
|
/** @internal */
|
@@ -19135,9 +19208,9 @@ var init_sql = __esm({
|
|
19135
19208
|
inlineParams: inlineParams || chunk.shouldInlineParams
|
19136
19209
|
});
|
19137
19210
|
}
|
19138
|
-
if (is(chunk,
|
19139
|
-
const schemaName = chunk[
|
19140
|
-
const tableName = chunk[
|
19211
|
+
if (is(chunk, Table)) {
|
19212
|
+
const schemaName = chunk[Table.Symbol.Schema];
|
19213
|
+
const tableName = chunk[Table.Symbol.Name];
|
19141
19214
|
return {
|
19142
19215
|
sql: schemaName === void 0 ? escapeName(tableName) : escapeName(schemaName) + "." + escapeName(tableName),
|
19143
19216
|
params: []
|
@@ -19148,7 +19221,7 @@ var init_sql = __esm({
|
|
19148
19221
|
if (_config.invokeSource === "indexes") {
|
19149
19222
|
return { sql: escapeName(columnName), params: [] };
|
19150
19223
|
}
|
19151
|
-
return { sql: escapeName(chunk.table[
|
19224
|
+
return { sql: escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName), params: [] };
|
19152
19225
|
}
|
19153
19226
|
if (is(chunk, View)) {
|
19154
19227
|
const schemaName = chunk[ViewBaseConfig].schema;
|
@@ -19260,9 +19333,9 @@ var init_sql = __esm({
|
|
19260
19333
|
return condition ? this : void 0;
|
19261
19334
|
}
|
19262
19335
|
};
|
19263
|
-
__publicField(_SQL,
|
19336
|
+
__publicField(_SQL, _a22, "SQL");
|
19264
19337
|
SQL = _SQL;
|
19265
|
-
|
19338
|
+
_a23 = entityKind;
|
19266
19339
|
Name = class {
|
19267
19340
|
constructor(value) {
|
19268
19341
|
__publicField(this, "brand");
|
@@ -19272,7 +19345,7 @@ var init_sql = __esm({
|
|
19272
19345
|
return new SQL([this]);
|
19273
19346
|
}
|
19274
19347
|
};
|
19275
|
-
__publicField(Name,
|
19348
|
+
__publicField(Name, _a23, "Name");
|
19276
19349
|
noopDecoder = {
|
19277
19350
|
mapFromDriverValue: (value) => value
|
19278
19351
|
};
|
@@ -19283,7 +19356,7 @@ var init_sql = __esm({
|
|
19283
19356
|
...noopDecoder,
|
19284
19357
|
...noopEncoder
|
19285
19358
|
};
|
19286
|
-
|
19359
|
+
_a24 = entityKind;
|
19287
19360
|
Param = class {
|
19288
19361
|
/**
|
19289
19362
|
* @param value - Parameter value
|
@@ -19298,7 +19371,7 @@ var init_sql = __esm({
|
|
19298
19371
|
return new SQL([this]);
|
19299
19372
|
}
|
19300
19373
|
};
|
19301
|
-
__publicField(Param,
|
19374
|
+
__publicField(Param, _a24, "Param");
|
19302
19375
|
((sql2) => {
|
19303
19376
|
function empty() {
|
19304
19377
|
return new SQL([]);
|
@@ -19358,7 +19431,7 @@ var init_sql = __esm({
|
|
19358
19431
|
let Aliased = _Aliased;
|
19359
19432
|
SQL2.Aliased = Aliased;
|
19360
19433
|
})(SQL || (SQL = {}));
|
19361
|
-
|
19434
|
+
_a25 = entityKind;
|
19362
19435
|
Placeholder = class {
|
19363
19436
|
constructor(name2) {
|
19364
19437
|
this.name = name2;
|
@@ -19367,12 +19440,12 @@ var init_sql = __esm({
|
|
19367
19440
|
return new SQL([this]);
|
19368
19441
|
}
|
19369
19442
|
};
|
19370
|
-
__publicField(Placeholder,
|
19371
|
-
_b10 = entityKind,
|
19443
|
+
__publicField(Placeholder, _a25, "Placeholder");
|
19444
|
+
_b10 = entityKind, _a26 = ViewBaseConfig;
|
19372
19445
|
View = class {
|
19373
19446
|
constructor({ name: name2, schema: schema4, selectedFields, query }) {
|
19374
19447
|
/** @internal */
|
19375
|
-
__publicField(this,
|
19448
|
+
__publicField(this, _a26);
|
19376
19449
|
this[ViewBaseConfig] = {
|
19377
19450
|
name: name2,
|
19378
19451
|
originalName: name2,
|
@@ -19391,7 +19464,7 @@ var init_sql = __esm({
|
|
19391
19464
|
Column2.prototype.getSQL = function() {
|
19392
19465
|
return new SQL([this]);
|
19393
19466
|
};
|
19394
|
-
|
19467
|
+
Table.prototype.getSQL = function() {
|
19395
19468
|
return new SQL([this]);
|
19396
19469
|
};
|
19397
19470
|
Subquery.prototype.getSQL = function() {
|
@@ -19430,7 +19503,7 @@ function mapColumnsInSQLToAlias(query, alias) {
|
|
19430
19503
|
return c;
|
19431
19504
|
}));
|
19432
19505
|
}
|
19433
|
-
var
|
19506
|
+
var _a27, ColumnAliasProxyHandler, _a28, TableAliasProxyHandler, _a29, RelationTableAliasProxyHandler;
|
19434
19507
|
var init_alias = __esm({
|
19435
19508
|
"../drizzle-orm/dist/alias.js"() {
|
19436
19509
|
"use strict";
|
@@ -19439,7 +19512,7 @@ var init_alias = __esm({
|
|
19439
19512
|
init_sql();
|
19440
19513
|
init_table();
|
19441
19514
|
init_view_common();
|
19442
|
-
|
19515
|
+
_a27 = entityKind;
|
19443
19516
|
ColumnAliasProxyHandler = class {
|
19444
19517
|
constructor(table4) {
|
19445
19518
|
this.table = table4;
|
@@ -19451,21 +19524,21 @@ var init_alias = __esm({
|
|
19451
19524
|
return columnObj[prop];
|
19452
19525
|
}
|
19453
19526
|
};
|
19454
|
-
__publicField(ColumnAliasProxyHandler,
|
19455
|
-
|
19527
|
+
__publicField(ColumnAliasProxyHandler, _a27, "ColumnAliasProxyHandler");
|
19528
|
+
_a28 = entityKind;
|
19456
19529
|
TableAliasProxyHandler = class {
|
19457
19530
|
constructor(alias, replaceOriginalName) {
|
19458
19531
|
this.alias = alias;
|
19459
19532
|
this.replaceOriginalName = replaceOriginalName;
|
19460
19533
|
}
|
19461
19534
|
get(target, prop) {
|
19462
|
-
if (prop ===
|
19535
|
+
if (prop === Table.Symbol.IsAlias) {
|
19463
19536
|
return true;
|
19464
19537
|
}
|
19465
|
-
if (prop ===
|
19538
|
+
if (prop === Table.Symbol.Name) {
|
19466
19539
|
return this.alias;
|
19467
19540
|
}
|
19468
|
-
if (this.replaceOriginalName && prop ===
|
19541
|
+
if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) {
|
19469
19542
|
return this.alias;
|
19470
19543
|
}
|
19471
19544
|
if (prop === ViewBaseConfig) {
|
@@ -19475,8 +19548,8 @@ var init_alias = __esm({
|
|
19475
19548
|
isAlias: true
|
19476
19549
|
};
|
19477
19550
|
}
|
19478
|
-
if (prop ===
|
19479
|
-
const columns = target[
|
19551
|
+
if (prop === Table.Symbol.Columns) {
|
19552
|
+
const columns = target[Table.Symbol.Columns];
|
19480
19553
|
if (!columns) {
|
19481
19554
|
return columns;
|
19482
19555
|
}
|
@@ -19496,8 +19569,8 @@ var init_alias = __esm({
|
|
19496
19569
|
return value;
|
19497
19570
|
}
|
19498
19571
|
};
|
19499
|
-
__publicField(TableAliasProxyHandler,
|
19500
|
-
|
19572
|
+
__publicField(TableAliasProxyHandler, _a28, "TableAliasProxyHandler");
|
19573
|
+
_a29 = entityKind;
|
19501
19574
|
RelationTableAliasProxyHandler = class {
|
19502
19575
|
constructor(alias) {
|
19503
19576
|
this.alias = alias;
|
@@ -19509,36 +19582,36 @@ var init_alias = __esm({
|
|
19509
19582
|
return target[prop];
|
19510
19583
|
}
|
19511
19584
|
};
|
19512
|
-
__publicField(RelationTableAliasProxyHandler,
|
19585
|
+
__publicField(RelationTableAliasProxyHandler, _a29, "RelationTableAliasProxyHandler");
|
19513
19586
|
}
|
19514
19587
|
});
|
19515
19588
|
|
19516
19589
|
// ../drizzle-orm/dist/errors.js
|
19517
|
-
var
|
19590
|
+
var _a30, _b11, DrizzleError, _a31, _b12, TransactionRollbackError;
|
19518
19591
|
var init_errors = __esm({
|
19519
19592
|
"../drizzle-orm/dist/errors.js"() {
|
19520
19593
|
"use strict";
|
19521
19594
|
init_entity();
|
19522
|
-
DrizzleError = class extends (_b11 = Error,
|
19595
|
+
DrizzleError = class extends (_b11 = Error, _a30 = entityKind, _b11) {
|
19523
19596
|
constructor({ message, cause }) {
|
19524
19597
|
super(message);
|
19525
19598
|
this.name = "DrizzleError";
|
19526
19599
|
this.cause = cause;
|
19527
19600
|
}
|
19528
19601
|
};
|
19529
|
-
__publicField(DrizzleError,
|
19530
|
-
TransactionRollbackError = class extends (_b12 = DrizzleError,
|
19602
|
+
__publicField(DrizzleError, _a30, "DrizzleError");
|
19603
|
+
TransactionRollbackError = class extends (_b12 = DrizzleError, _a31 = entityKind, _b12) {
|
19531
19604
|
constructor() {
|
19532
19605
|
super({ message: "Rollback" });
|
19533
19606
|
}
|
19534
19607
|
};
|
19535
|
-
__publicField(TransactionRollbackError,
|
19608
|
+
__publicField(TransactionRollbackError, _a31, "TransactionRollbackError");
|
19536
19609
|
}
|
19537
19610
|
});
|
19538
19611
|
|
19539
19612
|
// ../drizzle-orm/dist/sql/expressions/conditions.js
|
19540
19613
|
function bindIfParam(value, column4) {
|
19541
|
-
if (isDriverValueEncoder(column4) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column2) && !is(value,
|
19614
|
+
if (isDriverValueEncoder(column4) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column2) && !is(value, Table) && !is(value, View)) {
|
19542
19615
|
return new Param(value, column4);
|
19543
19616
|
}
|
19544
19617
|
return value;
|
@@ -19723,19 +19796,19 @@ var init_expressions2 = __esm({
|
|
19723
19796
|
});
|
19724
19797
|
|
19725
19798
|
// ../drizzle-orm/dist/logger.js
|
19726
|
-
var
|
19799
|
+
var _a32, ConsoleLogWriter, _a33, DefaultLogger, _a34, NoopLogger;
|
19727
19800
|
var init_logger = __esm({
|
19728
19801
|
"../drizzle-orm/dist/logger.js"() {
|
19729
19802
|
"use strict";
|
19730
19803
|
init_entity();
|
19731
|
-
|
19804
|
+
_a32 = entityKind;
|
19732
19805
|
ConsoleLogWriter = class {
|
19733
19806
|
write(message) {
|
19734
19807
|
console.log(message);
|
19735
19808
|
}
|
19736
19809
|
};
|
19737
|
-
__publicField(ConsoleLogWriter,
|
19738
|
-
|
19810
|
+
__publicField(ConsoleLogWriter, _a32, "ConsoleLogWriter");
|
19811
|
+
_a33 = entityKind;
|
19739
19812
|
DefaultLogger = class {
|
19740
19813
|
constructor(config) {
|
19741
19814
|
__publicField(this, "writer");
|
@@ -19753,13 +19826,13 @@ var init_logger = __esm({
|
|
19753
19826
|
this.writer.write(`Query: ${query}${paramsStr}`);
|
19754
19827
|
}
|
19755
19828
|
};
|
19756
|
-
__publicField(DefaultLogger,
|
19757
|
-
|
19829
|
+
__publicField(DefaultLogger, _a33, "DefaultLogger");
|
19830
|
+
_a34 = entityKind;
|
19758
19831
|
NoopLogger = class {
|
19759
19832
|
logQuery() {
|
19760
19833
|
}
|
19761
19834
|
};
|
19762
|
-
__publicField(NoopLogger,
|
19835
|
+
__publicField(NoopLogger, _a34, "NoopLogger");
|
19763
19836
|
}
|
19764
19837
|
});
|
19765
19838
|
|
@@ -19771,15 +19844,15 @@ var init_operations = __esm({
|
|
19771
19844
|
});
|
19772
19845
|
|
19773
19846
|
// ../drizzle-orm/dist/query-promise.js
|
19774
|
-
var
|
19847
|
+
var _a35, _b13, QueryPromise;
|
19775
19848
|
var init_query_promise = __esm({
|
19776
19849
|
"../drizzle-orm/dist/query-promise.js"() {
|
19777
19850
|
"use strict";
|
19778
19851
|
init_entity();
|
19779
|
-
_b13 = entityKind,
|
19852
|
+
_b13 = entityKind, _a35 = Symbol.toStringTag;
|
19780
19853
|
QueryPromise = class {
|
19781
19854
|
constructor() {
|
19782
|
-
__publicField(this,
|
19855
|
+
__publicField(this, _a35, "QueryPromise");
|
19783
19856
|
}
|
19784
19857
|
catch(onRejected) {
|
19785
19858
|
return this.then(void 0, onRejected);
|
@@ -19858,8 +19931,8 @@ function orderSelectedFields(fields, pathPrefix) {
|
|
19858
19931
|
const newPath = pathPrefix ? [...pathPrefix, name2] : [name2];
|
19859
19932
|
if (is(field, Column2) || is(field, SQL) || is(field, SQL.Aliased)) {
|
19860
19933
|
result.push({ path: newPath, field });
|
19861
|
-
} else if (is(field,
|
19862
|
-
result.push(...orderSelectedFields(field[
|
19934
|
+
} else if (is(field, Table)) {
|
19935
|
+
result.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));
|
19863
19936
|
} else {
|
19864
19937
|
result.push(...orderSelectedFields(field, newPath));
|
19865
19938
|
}
|
@@ -19884,7 +19957,7 @@ function mapUpdateSet(table4, values) {
|
|
19884
19957
|
if (is(value, SQL)) {
|
19885
19958
|
return [key, value];
|
19886
19959
|
} else {
|
19887
|
-
return [key, new Param(value, table4[
|
19960
|
+
return [key, new Param(value, table4[Table.Symbol.Columns][key])];
|
19888
19961
|
}
|
19889
19962
|
});
|
19890
19963
|
if (entries.length === 0) {
|
@@ -19906,10 +19979,10 @@ function applyMixins(baseClass, extendedClasses) {
|
|
19906
19979
|
}
|
19907
19980
|
}
|
19908
19981
|
function getTableColumns(table4) {
|
19909
|
-
return table4[
|
19982
|
+
return table4[Table.Symbol.Columns];
|
19910
19983
|
}
|
19911
19984
|
function getTableLikeName(table4) {
|
19912
|
-
return is(table4, Subquery) ? table4._.alias : is(table4, View) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : table4[
|
19985
|
+
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];
|
19913
19986
|
}
|
19914
19987
|
function getColumnNameAndConfig(a, b) {
|
19915
19988
|
return {
|
@@ -19930,13 +20003,13 @@ var init_utils2 = __esm({
|
|
19930
20003
|
});
|
19931
20004
|
|
19932
20005
|
// ../drizzle-orm/dist/pg-core/columns/int.common.js
|
19933
|
-
var
|
20006
|
+
var _a36, _b14, PgIntColumnBaseBuilder;
|
19934
20007
|
var init_int_common = __esm({
|
19935
20008
|
"../drizzle-orm/dist/pg-core/columns/int.common.js"() {
|
19936
20009
|
"use strict";
|
19937
20010
|
init_entity();
|
19938
20011
|
init_common2();
|
19939
|
-
PgIntColumnBaseBuilder = class extends (_b14 = PgColumnBuilder,
|
20012
|
+
PgIntColumnBaseBuilder = class extends (_b14 = PgColumnBuilder, _a36 = entityKind, _b14) {
|
19940
20013
|
generatedAlwaysAsIdentity(sequence) {
|
19941
20014
|
if (sequence) {
|
19942
20015
|
const { name: name2, ...options } = sequence;
|
@@ -19972,7 +20045,7 @@ var init_int_common = __esm({
|
|
19972
20045
|
return this;
|
19973
20046
|
}
|
19974
20047
|
};
|
19975
|
-
__publicField(PgIntColumnBaseBuilder,
|
20048
|
+
__publicField(PgIntColumnBaseBuilder, _a36, "PgIntColumnBaseBuilder");
|
19976
20049
|
}
|
19977
20050
|
});
|
19978
20051
|
|
@@ -19984,7 +20057,7 @@ function bigint(a, b) {
|
|
19984
20057
|
}
|
19985
20058
|
return new PgBigInt64Builder(name2);
|
19986
20059
|
}
|
19987
|
-
var
|
20060
|
+
var _a37, _b15, PgBigInt53Builder, _a38, _b16, PgBigInt53, _a39, _b17, PgBigInt64Builder, _a40, _b18, PgBigInt64;
|
19988
20061
|
var init_bigint = __esm({
|
19989
20062
|
"../drizzle-orm/dist/pg-core/columns/bigint.js"() {
|
19990
20063
|
"use strict";
|
@@ -19992,7 +20065,7 @@ var init_bigint = __esm({
|
|
19992
20065
|
init_utils2();
|
19993
20066
|
init_common2();
|
19994
20067
|
init_int_common();
|
19995
|
-
PgBigInt53Builder = class extends (_b15 = PgIntColumnBaseBuilder,
|
20068
|
+
PgBigInt53Builder = class extends (_b15 = PgIntColumnBaseBuilder, _a37 = entityKind, _b15) {
|
19996
20069
|
constructor(name2) {
|
19997
20070
|
super(name2, "number", "PgBigInt53");
|
19998
20071
|
}
|
@@ -20001,8 +20074,8 @@ var init_bigint = __esm({
|
|
20001
20074
|
return new PgBigInt53(table4, this.config);
|
20002
20075
|
}
|
20003
20076
|
};
|
20004
|
-
__publicField(PgBigInt53Builder,
|
20005
|
-
PgBigInt53 = class extends (_b16 = PgColumn,
|
20077
|
+
__publicField(PgBigInt53Builder, _a37, "PgBigInt53Builder");
|
20078
|
+
PgBigInt53 = class extends (_b16 = PgColumn, _a38 = entityKind, _b16) {
|
20006
20079
|
getSQLType() {
|
20007
20080
|
return "bigint";
|
20008
20081
|
}
|
@@ -20013,8 +20086,8 @@ var init_bigint = __esm({
|
|
20013
20086
|
return Number(value);
|
20014
20087
|
}
|
20015
20088
|
};
|
20016
|
-
__publicField(PgBigInt53,
|
20017
|
-
PgBigInt64Builder = class extends (_b17 = PgIntColumnBaseBuilder,
|
20089
|
+
__publicField(PgBigInt53, _a38, "PgBigInt53");
|
20090
|
+
PgBigInt64Builder = class extends (_b17 = PgIntColumnBaseBuilder, _a39 = entityKind, _b17) {
|
20018
20091
|
constructor(name2) {
|
20019
20092
|
super(name2, "bigint", "PgBigInt64");
|
20020
20093
|
}
|
@@ -20026,8 +20099,8 @@ var init_bigint = __esm({
|
|
20026
20099
|
);
|
20027
20100
|
}
|
20028
20101
|
};
|
20029
|
-
__publicField(PgBigInt64Builder,
|
20030
|
-
PgBigInt64 = class extends (_b18 = PgColumn,
|
20102
|
+
__publicField(PgBigInt64Builder, _a39, "PgBigInt64Builder");
|
20103
|
+
PgBigInt64 = class extends (_b18 = PgColumn, _a40 = entityKind, _b18) {
|
20031
20104
|
getSQLType() {
|
20032
20105
|
return "bigint";
|
20033
20106
|
}
|
@@ -20036,7 +20109,7 @@ var init_bigint = __esm({
|
|
20036
20109
|
return BigInt(value);
|
20037
20110
|
}
|
20038
20111
|
};
|
20039
|
-
__publicField(PgBigInt64,
|
20112
|
+
__publicField(PgBigInt64, _a40, "PgBigInt64");
|
20040
20113
|
}
|
20041
20114
|
});
|
20042
20115
|
|
@@ -20048,14 +20121,14 @@ function bigserial(a, b) {
|
|
20048
20121
|
}
|
20049
20122
|
return new PgBigSerial64Builder(name2);
|
20050
20123
|
}
|
20051
|
-
var
|
20124
|
+
var _a41, _b19, PgBigSerial53Builder, _a42, _b20, PgBigSerial53, _a43, _b21, PgBigSerial64Builder, _a44, _b22, PgBigSerial64;
|
20052
20125
|
var init_bigserial = __esm({
|
20053
20126
|
"../drizzle-orm/dist/pg-core/columns/bigserial.js"() {
|
20054
20127
|
"use strict";
|
20055
20128
|
init_entity();
|
20056
20129
|
init_utils2();
|
20057
20130
|
init_common2();
|
20058
|
-
PgBigSerial53Builder = class extends (_b19 = PgColumnBuilder,
|
20131
|
+
PgBigSerial53Builder = class extends (_b19 = PgColumnBuilder, _a41 = entityKind, _b19) {
|
20059
20132
|
constructor(name2) {
|
20060
20133
|
super(name2, "number", "PgBigSerial53");
|
20061
20134
|
this.config.hasDefault = true;
|
@@ -20069,8 +20142,8 @@ var init_bigserial = __esm({
|
|
20069
20142
|
);
|
20070
20143
|
}
|
20071
20144
|
};
|
20072
|
-
__publicField(PgBigSerial53Builder,
|
20073
|
-
PgBigSerial53 = class extends (_b20 = PgColumn,
|
20145
|
+
__publicField(PgBigSerial53Builder, _a41, "PgBigSerial53Builder");
|
20146
|
+
PgBigSerial53 = class extends (_b20 = PgColumn, _a42 = entityKind, _b20) {
|
20074
20147
|
getSQLType() {
|
20075
20148
|
return "bigserial";
|
20076
20149
|
}
|
@@ -20081,8 +20154,8 @@ var init_bigserial = __esm({
|
|
20081
20154
|
return Number(value);
|
20082
20155
|
}
|
20083
20156
|
};
|
20084
|
-
__publicField(PgBigSerial53,
|
20085
|
-
PgBigSerial64Builder = class extends (_b21 = PgColumnBuilder,
|
20157
|
+
__publicField(PgBigSerial53, _a42, "PgBigSerial53");
|
20158
|
+
PgBigSerial64Builder = class extends (_b21 = PgColumnBuilder, _a43 = entityKind, _b21) {
|
20086
20159
|
constructor(name2) {
|
20087
20160
|
super(name2, "bigint", "PgBigSerial64");
|
20088
20161
|
this.config.hasDefault = true;
|
@@ -20095,8 +20168,8 @@ var init_bigserial = __esm({
|
|
20095
20168
|
);
|
20096
20169
|
}
|
20097
20170
|
};
|
20098
|
-
__publicField(PgBigSerial64Builder,
|
20099
|
-
PgBigSerial64 = class extends (_b22 = PgColumn,
|
20171
|
+
__publicField(PgBigSerial64Builder, _a43, "PgBigSerial64Builder");
|
20172
|
+
PgBigSerial64 = class extends (_b22 = PgColumn, _a44 = entityKind, _b22) {
|
20100
20173
|
getSQLType() {
|
20101
20174
|
return "bigserial";
|
20102
20175
|
}
|
@@ -20105,7 +20178,7 @@ var init_bigserial = __esm({
|
|
20105
20178
|
return BigInt(value);
|
20106
20179
|
}
|
20107
20180
|
};
|
20108
|
-
__publicField(PgBigSerial64,
|
20181
|
+
__publicField(PgBigSerial64, _a44, "PgBigSerial64");
|
20109
20182
|
}
|
20110
20183
|
});
|
20111
20184
|
|
@@ -20113,13 +20186,13 @@ var init_bigserial = __esm({
|
|
20113
20186
|
function boolean(name2) {
|
20114
20187
|
return new PgBooleanBuilder(name2 ?? "");
|
20115
20188
|
}
|
20116
|
-
var
|
20189
|
+
var _a45, _b23, PgBooleanBuilder, _a46, _b24, PgBoolean;
|
20117
20190
|
var init_boolean = __esm({
|
20118
20191
|
"../drizzle-orm/dist/pg-core/columns/boolean.js"() {
|
20119
20192
|
"use strict";
|
20120
20193
|
init_entity();
|
20121
20194
|
init_common2();
|
20122
|
-
PgBooleanBuilder = class extends (_b23 = PgColumnBuilder,
|
20195
|
+
PgBooleanBuilder = class extends (_b23 = PgColumnBuilder, _a45 = entityKind, _b23) {
|
20123
20196
|
constructor(name2) {
|
20124
20197
|
super(name2, "boolean", "PgBoolean");
|
20125
20198
|
}
|
@@ -20128,13 +20201,13 @@ var init_boolean = __esm({
|
|
20128
20201
|
return new PgBoolean(table4, this.config);
|
20129
20202
|
}
|
20130
20203
|
};
|
20131
|
-
__publicField(PgBooleanBuilder,
|
20132
|
-
PgBoolean = class extends (_b24 = PgColumn,
|
20204
|
+
__publicField(PgBooleanBuilder, _a45, "PgBooleanBuilder");
|
20205
|
+
PgBoolean = class extends (_b24 = PgColumn, _a46 = entityKind, _b24) {
|
20133
20206
|
getSQLType() {
|
20134
20207
|
return "boolean";
|
20135
20208
|
}
|
20136
20209
|
};
|
20137
|
-
__publicField(PgBoolean,
|
20210
|
+
__publicField(PgBoolean, _a46, "PgBoolean");
|
20138
20211
|
}
|
20139
20212
|
});
|
20140
20213
|
|
@@ -20143,14 +20216,14 @@ function char(a, b = {}) {
|
|
20143
20216
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
20144
20217
|
return new PgCharBuilder(name2, config);
|
20145
20218
|
}
|
20146
|
-
var
|
20219
|
+
var _a47, _b25, PgCharBuilder, _a48, _b26, PgChar;
|
20147
20220
|
var init_char = __esm({
|
20148
20221
|
"../drizzle-orm/dist/pg-core/columns/char.js"() {
|
20149
20222
|
"use strict";
|
20150
20223
|
init_entity();
|
20151
20224
|
init_utils2();
|
20152
20225
|
init_common2();
|
20153
|
-
PgCharBuilder = class extends (_b25 = PgColumnBuilder,
|
20226
|
+
PgCharBuilder = class extends (_b25 = PgColumnBuilder, _a47 = entityKind, _b25) {
|
20154
20227
|
constructor(name2, config) {
|
20155
20228
|
super(name2, "string", "PgChar");
|
20156
20229
|
this.config.length = config.length;
|
@@ -20161,8 +20234,8 @@ var init_char = __esm({
|
|
20161
20234
|
return new PgChar(table4, this.config);
|
20162
20235
|
}
|
20163
20236
|
};
|
20164
|
-
__publicField(PgCharBuilder,
|
20165
|
-
PgChar = class extends (_b26 = PgColumn,
|
20237
|
+
__publicField(PgCharBuilder, _a47, "PgCharBuilder");
|
20238
|
+
PgChar = class extends (_b26 = PgColumn, _a48 = entityKind, _b26) {
|
20166
20239
|
constructor() {
|
20167
20240
|
super(...arguments);
|
20168
20241
|
__publicField(this, "length", this.config.length);
|
@@ -20172,7 +20245,7 @@ var init_char = __esm({
|
|
20172
20245
|
return this.length === void 0 ? `char` : `char(${this.length})`;
|
20173
20246
|
}
|
20174
20247
|
};
|
20175
|
-
__publicField(PgChar,
|
20248
|
+
__publicField(PgChar, _a48, "PgChar");
|
20176
20249
|
}
|
20177
20250
|
});
|
20178
20251
|
|
@@ -20180,13 +20253,13 @@ var init_char = __esm({
|
|
20180
20253
|
function cidr(name2) {
|
20181
20254
|
return new PgCidrBuilder(name2 ?? "");
|
20182
20255
|
}
|
20183
|
-
var
|
20256
|
+
var _a49, _b27, PgCidrBuilder, _a50, _b28, PgCidr;
|
20184
20257
|
var init_cidr = __esm({
|
20185
20258
|
"../drizzle-orm/dist/pg-core/columns/cidr.js"() {
|
20186
20259
|
"use strict";
|
20187
20260
|
init_entity();
|
20188
20261
|
init_common2();
|
20189
|
-
PgCidrBuilder = class extends (_b27 = PgColumnBuilder,
|
20262
|
+
PgCidrBuilder = class extends (_b27 = PgColumnBuilder, _a49 = entityKind, _b27) {
|
20190
20263
|
constructor(name2) {
|
20191
20264
|
super(name2, "string", "PgCidr");
|
20192
20265
|
}
|
@@ -20195,13 +20268,13 @@ var init_cidr = __esm({
|
|
20195
20268
|
return new PgCidr(table4, this.config);
|
20196
20269
|
}
|
20197
20270
|
};
|
20198
|
-
__publicField(PgCidrBuilder,
|
20199
|
-
PgCidr = class extends (_b28 = PgColumn,
|
20271
|
+
__publicField(PgCidrBuilder, _a49, "PgCidrBuilder");
|
20272
|
+
PgCidr = class extends (_b28 = PgColumn, _a50 = entityKind, _b28) {
|
20200
20273
|
getSQLType() {
|
20201
20274
|
return "cidr";
|
20202
20275
|
}
|
20203
20276
|
};
|
20204
|
-
__publicField(PgCidr,
|
20277
|
+
__publicField(PgCidr, _a50, "PgCidr");
|
20205
20278
|
}
|
20206
20279
|
});
|
20207
20280
|
|
@@ -20212,14 +20285,14 @@ function customType(customTypeParams) {
|
|
20212
20285
|
return new PgCustomColumnBuilder(name2, config, customTypeParams);
|
20213
20286
|
};
|
20214
20287
|
}
|
20215
|
-
var
|
20288
|
+
var _a51, _b29, PgCustomColumnBuilder, _a52, _b30, PgCustomColumn;
|
20216
20289
|
var init_custom = __esm({
|
20217
20290
|
"../drizzle-orm/dist/pg-core/columns/custom.js"() {
|
20218
20291
|
"use strict";
|
20219
20292
|
init_entity();
|
20220
20293
|
init_utils2();
|
20221
20294
|
init_common2();
|
20222
|
-
PgCustomColumnBuilder = class extends (_b29 = PgColumnBuilder,
|
20295
|
+
PgCustomColumnBuilder = class extends (_b29 = PgColumnBuilder, _a51 = entityKind, _b29) {
|
20223
20296
|
constructor(name2, fieldConfig, customTypeParams) {
|
20224
20297
|
super(name2, "custom", "PgCustomColumn");
|
20225
20298
|
this.config.fieldConfig = fieldConfig;
|
@@ -20233,8 +20306,8 @@ var init_custom = __esm({
|
|
20233
20306
|
);
|
20234
20307
|
}
|
20235
20308
|
};
|
20236
|
-
__publicField(PgCustomColumnBuilder,
|
20237
|
-
PgCustomColumn = class extends (_b30 = PgColumn,
|
20309
|
+
__publicField(PgCustomColumnBuilder, _a51, "PgCustomColumnBuilder");
|
20310
|
+
PgCustomColumn = class extends (_b30 = PgColumn, _a52 = entityKind, _b30) {
|
20238
20311
|
constructor(table4, config) {
|
20239
20312
|
super(table4, config);
|
20240
20313
|
__publicField(this, "sqlName");
|
@@ -20254,24 +20327,24 @@ var init_custom = __esm({
|
|
20254
20327
|
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
|
20255
20328
|
}
|
20256
20329
|
};
|
20257
|
-
__publicField(PgCustomColumn,
|
20330
|
+
__publicField(PgCustomColumn, _a52, "PgCustomColumn");
|
20258
20331
|
}
|
20259
20332
|
});
|
20260
20333
|
|
20261
20334
|
// ../drizzle-orm/dist/pg-core/columns/date.common.js
|
20262
|
-
var
|
20335
|
+
var _a53, _b31, PgDateColumnBaseBuilder;
|
20263
20336
|
var init_date_common = __esm({
|
20264
20337
|
"../drizzle-orm/dist/pg-core/columns/date.common.js"() {
|
20265
20338
|
"use strict";
|
20266
20339
|
init_entity();
|
20267
20340
|
init_sql();
|
20268
20341
|
init_common2();
|
20269
|
-
PgDateColumnBaseBuilder = class extends (_b31 = PgColumnBuilder,
|
20342
|
+
PgDateColumnBaseBuilder = class extends (_b31 = PgColumnBuilder, _a53 = entityKind, _b31) {
|
20270
20343
|
defaultNow() {
|
20271
20344
|
return this.default(sql`now()`);
|
20272
20345
|
}
|
20273
20346
|
};
|
20274
|
-
__publicField(PgDateColumnBaseBuilder,
|
20347
|
+
__publicField(PgDateColumnBaseBuilder, _a53, "PgDateColumnBaseBuilder");
|
20275
20348
|
}
|
20276
20349
|
});
|
20277
20350
|
|
@@ -20283,7 +20356,7 @@ function date(a, b) {
|
|
20283
20356
|
}
|
20284
20357
|
return new PgDateStringBuilder(name2);
|
20285
20358
|
}
|
20286
|
-
var
|
20359
|
+
var _a54, _b32, PgDateBuilder, _a55, _b33, PgDate, _a56, _b34, PgDateStringBuilder, _a57, _b35, PgDateString;
|
20287
20360
|
var init_date = __esm({
|
20288
20361
|
"../drizzle-orm/dist/pg-core/columns/date.js"() {
|
20289
20362
|
"use strict";
|
@@ -20291,7 +20364,7 @@ var init_date = __esm({
|
|
20291
20364
|
init_utils2();
|
20292
20365
|
init_common2();
|
20293
20366
|
init_date_common();
|
20294
|
-
PgDateBuilder = class extends (_b32 = PgDateColumnBaseBuilder,
|
20367
|
+
PgDateBuilder = class extends (_b32 = PgDateColumnBaseBuilder, _a54 = entityKind, _b32) {
|
20295
20368
|
constructor(name2) {
|
20296
20369
|
super(name2, "date", "PgDate");
|
20297
20370
|
}
|
@@ -20300,8 +20373,8 @@ var init_date = __esm({
|
|
20300
20373
|
return new PgDate(table4, this.config);
|
20301
20374
|
}
|
20302
20375
|
};
|
20303
|
-
__publicField(PgDateBuilder,
|
20304
|
-
PgDate = class extends (_b33 = PgColumn,
|
20376
|
+
__publicField(PgDateBuilder, _a54, "PgDateBuilder");
|
20377
|
+
PgDate = class extends (_b33 = PgColumn, _a55 = entityKind, _b33) {
|
20305
20378
|
getSQLType() {
|
20306
20379
|
return "date";
|
20307
20380
|
}
|
@@ -20312,8 +20385,8 @@ var init_date = __esm({
|
|
20312
20385
|
return value.toISOString();
|
20313
20386
|
}
|
20314
20387
|
};
|
20315
|
-
__publicField(PgDate,
|
20316
|
-
PgDateStringBuilder = class extends (_b34 = PgDateColumnBaseBuilder,
|
20388
|
+
__publicField(PgDate, _a55, "PgDate");
|
20389
|
+
PgDateStringBuilder = class extends (_b34 = PgDateColumnBaseBuilder, _a56 = entityKind, _b34) {
|
20317
20390
|
constructor(name2) {
|
20318
20391
|
super(name2, "string", "PgDateString");
|
20319
20392
|
}
|
@@ -20325,13 +20398,13 @@ var init_date = __esm({
|
|
20325
20398
|
);
|
20326
20399
|
}
|
20327
20400
|
};
|
20328
|
-
__publicField(PgDateStringBuilder,
|
20329
|
-
PgDateString = class extends (_b35 = PgColumn,
|
20401
|
+
__publicField(PgDateStringBuilder, _a56, "PgDateStringBuilder");
|
20402
|
+
PgDateString = class extends (_b35 = PgColumn, _a57 = entityKind, _b35) {
|
20330
20403
|
getSQLType() {
|
20331
20404
|
return "date";
|
20332
20405
|
}
|
20333
20406
|
};
|
20334
|
-
__publicField(PgDateString,
|
20407
|
+
__publicField(PgDateString, _a57, "PgDateString");
|
20335
20408
|
}
|
20336
20409
|
});
|
20337
20410
|
|
@@ -20339,13 +20412,13 @@ var init_date = __esm({
|
|
20339
20412
|
function doublePrecision(name2) {
|
20340
20413
|
return new PgDoublePrecisionBuilder(name2 ?? "");
|
20341
20414
|
}
|
20342
|
-
var
|
20415
|
+
var _a58, _b36, PgDoublePrecisionBuilder, _a59, _b37, PgDoublePrecision;
|
20343
20416
|
var init_double_precision = __esm({
|
20344
20417
|
"../drizzle-orm/dist/pg-core/columns/double-precision.js"() {
|
20345
20418
|
"use strict";
|
20346
20419
|
init_entity();
|
20347
20420
|
init_common2();
|
20348
|
-
PgDoublePrecisionBuilder = class extends (_b36 = PgColumnBuilder,
|
20421
|
+
PgDoublePrecisionBuilder = class extends (_b36 = PgColumnBuilder, _a58 = entityKind, _b36) {
|
20349
20422
|
constructor(name2) {
|
20350
20423
|
super(name2, "number", "PgDoublePrecision");
|
20351
20424
|
}
|
@@ -20357,8 +20430,8 @@ var init_double_precision = __esm({
|
|
20357
20430
|
);
|
20358
20431
|
}
|
20359
20432
|
};
|
20360
|
-
__publicField(PgDoublePrecisionBuilder,
|
20361
|
-
PgDoublePrecision = class extends (_b37 = PgColumn,
|
20433
|
+
__publicField(PgDoublePrecisionBuilder, _a58, "PgDoublePrecisionBuilder");
|
20434
|
+
PgDoublePrecision = class extends (_b37 = PgColumn, _a59 = entityKind, _b37) {
|
20362
20435
|
getSQLType() {
|
20363
20436
|
return "double precision";
|
20364
20437
|
}
|
@@ -20369,7 +20442,7 @@ var init_double_precision = __esm({
|
|
20369
20442
|
return value;
|
20370
20443
|
}
|
20371
20444
|
};
|
20372
|
-
__publicField(PgDoublePrecision,
|
20445
|
+
__publicField(PgDoublePrecision, _a59, "PgDoublePrecision");
|
20373
20446
|
}
|
20374
20447
|
});
|
20375
20448
|
|
@@ -20377,13 +20450,13 @@ var init_double_precision = __esm({
|
|
20377
20450
|
function inet(name2) {
|
20378
20451
|
return new PgInetBuilder(name2 ?? "");
|
20379
20452
|
}
|
20380
|
-
var
|
20453
|
+
var _a60, _b38, PgInetBuilder, _a61, _b39, PgInet;
|
20381
20454
|
var init_inet = __esm({
|
20382
20455
|
"../drizzle-orm/dist/pg-core/columns/inet.js"() {
|
20383
20456
|
"use strict";
|
20384
20457
|
init_entity();
|
20385
20458
|
init_common2();
|
20386
|
-
PgInetBuilder = class extends (_b38 = PgColumnBuilder,
|
20459
|
+
PgInetBuilder = class extends (_b38 = PgColumnBuilder, _a60 = entityKind, _b38) {
|
20387
20460
|
constructor(name2) {
|
20388
20461
|
super(name2, "string", "PgInet");
|
20389
20462
|
}
|
@@ -20392,13 +20465,13 @@ var init_inet = __esm({
|
|
20392
20465
|
return new PgInet(table4, this.config);
|
20393
20466
|
}
|
20394
20467
|
};
|
20395
|
-
__publicField(PgInetBuilder,
|
20396
|
-
PgInet = class extends (_b39 = PgColumn,
|
20468
|
+
__publicField(PgInetBuilder, _a60, "PgInetBuilder");
|
20469
|
+
PgInet = class extends (_b39 = PgColumn, _a61 = entityKind, _b39) {
|
20397
20470
|
getSQLType() {
|
20398
20471
|
return "inet";
|
20399
20472
|
}
|
20400
20473
|
};
|
20401
|
-
__publicField(PgInet,
|
20474
|
+
__publicField(PgInet, _a61, "PgInet");
|
20402
20475
|
}
|
20403
20476
|
});
|
20404
20477
|
|
@@ -20406,14 +20479,14 @@ var init_inet = __esm({
|
|
20406
20479
|
function integer(name2) {
|
20407
20480
|
return new PgIntegerBuilder(name2 ?? "");
|
20408
20481
|
}
|
20409
|
-
var
|
20482
|
+
var _a62, _b40, PgIntegerBuilder, _a63, _b41, PgInteger;
|
20410
20483
|
var init_integer = __esm({
|
20411
20484
|
"../drizzle-orm/dist/pg-core/columns/integer.js"() {
|
20412
20485
|
"use strict";
|
20413
20486
|
init_entity();
|
20414
20487
|
init_common2();
|
20415
20488
|
init_int_common();
|
20416
|
-
PgIntegerBuilder = class extends (_b40 = PgIntColumnBaseBuilder,
|
20489
|
+
PgIntegerBuilder = class extends (_b40 = PgIntColumnBaseBuilder, _a62 = entityKind, _b40) {
|
20417
20490
|
constructor(name2) {
|
20418
20491
|
super(name2, "number", "PgInteger");
|
20419
20492
|
}
|
@@ -20422,8 +20495,8 @@ var init_integer = __esm({
|
|
20422
20495
|
return new PgInteger(table4, this.config);
|
20423
20496
|
}
|
20424
20497
|
};
|
20425
|
-
__publicField(PgIntegerBuilder,
|
20426
|
-
PgInteger = class extends (_b41 = PgColumn,
|
20498
|
+
__publicField(PgIntegerBuilder, _a62, "PgIntegerBuilder");
|
20499
|
+
PgInteger = class extends (_b41 = PgColumn, _a63 = entityKind, _b41) {
|
20427
20500
|
getSQLType() {
|
20428
20501
|
return "integer";
|
20429
20502
|
}
|
@@ -20434,7 +20507,7 @@ var init_integer = __esm({
|
|
20434
20507
|
return value;
|
20435
20508
|
}
|
20436
20509
|
};
|
20437
|
-
__publicField(PgInteger,
|
20510
|
+
__publicField(PgInteger, _a63, "PgInteger");
|
20438
20511
|
}
|
20439
20512
|
});
|
20440
20513
|
|
@@ -20443,14 +20516,14 @@ function interval(a, b = {}) {
|
|
20443
20516
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
20444
20517
|
return new PgIntervalBuilder(name2, config);
|
20445
20518
|
}
|
20446
|
-
var
|
20519
|
+
var _a64, _b42, PgIntervalBuilder, _a65, _b43, PgInterval;
|
20447
20520
|
var init_interval = __esm({
|
20448
20521
|
"../drizzle-orm/dist/pg-core/columns/interval.js"() {
|
20449
20522
|
"use strict";
|
20450
20523
|
init_entity();
|
20451
20524
|
init_utils2();
|
20452
20525
|
init_common2();
|
20453
|
-
PgIntervalBuilder = class extends (_b42 = PgColumnBuilder,
|
20526
|
+
PgIntervalBuilder = class extends (_b42 = PgColumnBuilder, _a64 = entityKind, _b42) {
|
20454
20527
|
constructor(name2, intervalConfig) {
|
20455
20528
|
super(name2, "string", "PgInterval");
|
20456
20529
|
this.config.intervalConfig = intervalConfig;
|
@@ -20460,8 +20533,8 @@ var init_interval = __esm({
|
|
20460
20533
|
return new PgInterval(table4, this.config);
|
20461
20534
|
}
|
20462
20535
|
};
|
20463
|
-
__publicField(PgIntervalBuilder,
|
20464
|
-
PgInterval = class extends (_b43 = PgColumn,
|
20536
|
+
__publicField(PgIntervalBuilder, _a64, "PgIntervalBuilder");
|
20537
|
+
PgInterval = class extends (_b43 = PgColumn, _a65 = entityKind, _b43) {
|
20465
20538
|
constructor() {
|
20466
20539
|
super(...arguments);
|
20467
20540
|
__publicField(this, "fields", this.config.intervalConfig.fields);
|
@@ -20473,7 +20546,7 @@ var init_interval = __esm({
|
|
20473
20546
|
return `interval${fields}${precision}`;
|
20474
20547
|
}
|
20475
20548
|
};
|
20476
|
-
__publicField(PgInterval,
|
20549
|
+
__publicField(PgInterval, _a65, "PgInterval");
|
20477
20550
|
}
|
20478
20551
|
});
|
20479
20552
|
|
@@ -20481,13 +20554,13 @@ var init_interval = __esm({
|
|
20481
20554
|
function json(name2) {
|
20482
20555
|
return new PgJsonBuilder(name2 ?? "");
|
20483
20556
|
}
|
20484
|
-
var
|
20557
|
+
var _a66, _b44, PgJsonBuilder, _a67, _b45, PgJson;
|
20485
20558
|
var init_json = __esm({
|
20486
20559
|
"../drizzle-orm/dist/pg-core/columns/json.js"() {
|
20487
20560
|
"use strict";
|
20488
20561
|
init_entity();
|
20489
20562
|
init_common2();
|
20490
|
-
PgJsonBuilder = class extends (_b44 = PgColumnBuilder,
|
20563
|
+
PgJsonBuilder = class extends (_b44 = PgColumnBuilder, _a66 = entityKind, _b44) {
|
20491
20564
|
constructor(name2) {
|
20492
20565
|
super(name2, "json", "PgJson");
|
20493
20566
|
}
|
@@ -20496,8 +20569,8 @@ var init_json = __esm({
|
|
20496
20569
|
return new PgJson(table4, this.config);
|
20497
20570
|
}
|
20498
20571
|
};
|
20499
|
-
__publicField(PgJsonBuilder,
|
20500
|
-
PgJson = class extends (_b45 = PgColumn,
|
20572
|
+
__publicField(PgJsonBuilder, _a66, "PgJsonBuilder");
|
20573
|
+
PgJson = class extends (_b45 = PgColumn, _a67 = entityKind, _b45) {
|
20501
20574
|
constructor(table4, config) {
|
20502
20575
|
super(table4, config);
|
20503
20576
|
}
|
@@ -20518,7 +20591,7 @@ var init_json = __esm({
|
|
20518
20591
|
return value;
|
20519
20592
|
}
|
20520
20593
|
};
|
20521
|
-
__publicField(PgJson,
|
20594
|
+
__publicField(PgJson, _a67, "PgJson");
|
20522
20595
|
}
|
20523
20596
|
});
|
20524
20597
|
|
@@ -20526,13 +20599,13 @@ var init_json = __esm({
|
|
20526
20599
|
function jsonb(name2) {
|
20527
20600
|
return new PgJsonbBuilder(name2 ?? "");
|
20528
20601
|
}
|
20529
|
-
var
|
20602
|
+
var _a68, _b46, PgJsonbBuilder, _a69, _b47, PgJsonb;
|
20530
20603
|
var init_jsonb = __esm({
|
20531
20604
|
"../drizzle-orm/dist/pg-core/columns/jsonb.js"() {
|
20532
20605
|
"use strict";
|
20533
20606
|
init_entity();
|
20534
20607
|
init_common2();
|
20535
|
-
PgJsonbBuilder = class extends (_b46 = PgColumnBuilder,
|
20608
|
+
PgJsonbBuilder = class extends (_b46 = PgColumnBuilder, _a68 = entityKind, _b46) {
|
20536
20609
|
constructor(name2) {
|
20537
20610
|
super(name2, "json", "PgJsonb");
|
20538
20611
|
}
|
@@ -20541,8 +20614,8 @@ var init_jsonb = __esm({
|
|
20541
20614
|
return new PgJsonb(table4, this.config);
|
20542
20615
|
}
|
20543
20616
|
};
|
20544
|
-
__publicField(PgJsonbBuilder,
|
20545
|
-
PgJsonb = class extends (_b47 = PgColumn,
|
20617
|
+
__publicField(PgJsonbBuilder, _a68, "PgJsonbBuilder");
|
20618
|
+
PgJsonb = class extends (_b47 = PgColumn, _a69 = entityKind, _b47) {
|
20546
20619
|
constructor(table4, config) {
|
20547
20620
|
super(table4, config);
|
20548
20621
|
}
|
@@ -20563,7 +20636,7 @@ var init_jsonb = __esm({
|
|
20563
20636
|
return value;
|
20564
20637
|
}
|
20565
20638
|
};
|
20566
|
-
__publicField(PgJsonb,
|
20639
|
+
__publicField(PgJsonb, _a69, "PgJsonb");
|
20567
20640
|
}
|
20568
20641
|
});
|
20569
20642
|
|
@@ -20575,14 +20648,14 @@ function line(a, b) {
|
|
20575
20648
|
}
|
20576
20649
|
return new PgLineABCBuilder(name2);
|
20577
20650
|
}
|
20578
|
-
var
|
20651
|
+
var _a70, _b48, PgLineBuilder, _a71, _b49, PgLineTuple, _a72, _b50, PgLineABCBuilder, _a73, _b51, PgLineABC;
|
20579
20652
|
var init_line = __esm({
|
20580
20653
|
"../drizzle-orm/dist/pg-core/columns/line.js"() {
|
20581
20654
|
"use strict";
|
20582
20655
|
init_entity();
|
20583
20656
|
init_utils2();
|
20584
20657
|
init_common2();
|
20585
|
-
PgLineBuilder = class extends (_b48 = PgColumnBuilder,
|
20658
|
+
PgLineBuilder = class extends (_b48 = PgColumnBuilder, _a70 = entityKind, _b48) {
|
20586
20659
|
constructor(name2) {
|
20587
20660
|
super(name2, "array", "PgLine");
|
20588
20661
|
}
|
@@ -20594,8 +20667,8 @@ var init_line = __esm({
|
|
20594
20667
|
);
|
20595
20668
|
}
|
20596
20669
|
};
|
20597
|
-
__publicField(PgLineBuilder,
|
20598
|
-
PgLineTuple = class extends (_b49 = PgColumn,
|
20670
|
+
__publicField(PgLineBuilder, _a70, "PgLineBuilder");
|
20671
|
+
PgLineTuple = class extends (_b49 = PgColumn, _a71 = entityKind, _b49) {
|
20599
20672
|
getSQLType() {
|
20600
20673
|
return "line";
|
20601
20674
|
}
|
@@ -20607,8 +20680,8 @@ var init_line = __esm({
|
|
20607
20680
|
return `{${value[0]},${value[1]},${value[2]}}`;
|
20608
20681
|
}
|
20609
20682
|
};
|
20610
|
-
__publicField(PgLineTuple,
|
20611
|
-
PgLineABCBuilder = class extends (_b50 = PgColumnBuilder,
|
20683
|
+
__publicField(PgLineTuple, _a71, "PgLine");
|
20684
|
+
PgLineABCBuilder = class extends (_b50 = PgColumnBuilder, _a72 = entityKind, _b50) {
|
20612
20685
|
constructor(name2) {
|
20613
20686
|
super(name2, "json", "PgLineABC");
|
20614
20687
|
}
|
@@ -20620,8 +20693,8 @@ var init_line = __esm({
|
|
20620
20693
|
);
|
20621
20694
|
}
|
20622
20695
|
};
|
20623
|
-
__publicField(PgLineABCBuilder,
|
20624
|
-
PgLineABC = class extends (_b51 = PgColumn,
|
20696
|
+
__publicField(PgLineABCBuilder, _a72, "PgLineABCBuilder");
|
20697
|
+
PgLineABC = class extends (_b51 = PgColumn, _a73 = entityKind, _b51) {
|
20625
20698
|
getSQLType() {
|
20626
20699
|
return "line";
|
20627
20700
|
}
|
@@ -20633,7 +20706,7 @@ var init_line = __esm({
|
|
20633
20706
|
return `{${value.a},${value.b},${value.c}}`;
|
20634
20707
|
}
|
20635
20708
|
};
|
20636
|
-
__publicField(PgLineABC,
|
20709
|
+
__publicField(PgLineABC, _a73, "PgLineABC");
|
20637
20710
|
}
|
20638
20711
|
});
|
20639
20712
|
|
@@ -20641,13 +20714,13 @@ var init_line = __esm({
|
|
20641
20714
|
function macaddr(name2) {
|
20642
20715
|
return new PgMacaddrBuilder(name2 ?? "");
|
20643
20716
|
}
|
20644
|
-
var
|
20717
|
+
var _a74, _b52, PgMacaddrBuilder, _a75, _b53, PgMacaddr;
|
20645
20718
|
var init_macaddr = __esm({
|
20646
20719
|
"../drizzle-orm/dist/pg-core/columns/macaddr.js"() {
|
20647
20720
|
"use strict";
|
20648
20721
|
init_entity();
|
20649
20722
|
init_common2();
|
20650
|
-
PgMacaddrBuilder = class extends (_b52 = PgColumnBuilder,
|
20723
|
+
PgMacaddrBuilder = class extends (_b52 = PgColumnBuilder, _a74 = entityKind, _b52) {
|
20651
20724
|
constructor(name2) {
|
20652
20725
|
super(name2, "string", "PgMacaddr");
|
20653
20726
|
}
|
@@ -20656,13 +20729,13 @@ var init_macaddr = __esm({
|
|
20656
20729
|
return new PgMacaddr(table4, this.config);
|
20657
20730
|
}
|
20658
20731
|
};
|
20659
|
-
__publicField(PgMacaddrBuilder,
|
20660
|
-
PgMacaddr = class extends (_b53 = PgColumn,
|
20732
|
+
__publicField(PgMacaddrBuilder, _a74, "PgMacaddrBuilder");
|
20733
|
+
PgMacaddr = class extends (_b53 = PgColumn, _a75 = entityKind, _b53) {
|
20661
20734
|
getSQLType() {
|
20662
20735
|
return "macaddr";
|
20663
20736
|
}
|
20664
20737
|
};
|
20665
|
-
__publicField(PgMacaddr,
|
20738
|
+
__publicField(PgMacaddr, _a75, "PgMacaddr");
|
20666
20739
|
}
|
20667
20740
|
});
|
20668
20741
|
|
@@ -20670,13 +20743,13 @@ var init_macaddr = __esm({
|
|
20670
20743
|
function macaddr8(name2) {
|
20671
20744
|
return new PgMacaddr8Builder(name2 ?? "");
|
20672
20745
|
}
|
20673
|
-
var
|
20746
|
+
var _a76, _b54, PgMacaddr8Builder, _a77, _b55, PgMacaddr8;
|
20674
20747
|
var init_macaddr8 = __esm({
|
20675
20748
|
"../drizzle-orm/dist/pg-core/columns/macaddr8.js"() {
|
20676
20749
|
"use strict";
|
20677
20750
|
init_entity();
|
20678
20751
|
init_common2();
|
20679
|
-
PgMacaddr8Builder = class extends (_b54 = PgColumnBuilder,
|
20752
|
+
PgMacaddr8Builder = class extends (_b54 = PgColumnBuilder, _a76 = entityKind, _b54) {
|
20680
20753
|
constructor(name2) {
|
20681
20754
|
super(name2, "string", "PgMacaddr8");
|
20682
20755
|
}
|
@@ -20685,13 +20758,13 @@ var init_macaddr8 = __esm({
|
|
20685
20758
|
return new PgMacaddr8(table4, this.config);
|
20686
20759
|
}
|
20687
20760
|
};
|
20688
|
-
__publicField(PgMacaddr8Builder,
|
20689
|
-
PgMacaddr8 = class extends (_b55 = PgColumn,
|
20761
|
+
__publicField(PgMacaddr8Builder, _a76, "PgMacaddr8Builder");
|
20762
|
+
PgMacaddr8 = class extends (_b55 = PgColumn, _a77 = entityKind, _b55) {
|
20690
20763
|
getSQLType() {
|
20691
20764
|
return "macaddr8";
|
20692
20765
|
}
|
20693
20766
|
};
|
20694
|
-
__publicField(PgMacaddr8,
|
20767
|
+
__publicField(PgMacaddr8, _a77, "PgMacaddr8");
|
20695
20768
|
}
|
20696
20769
|
});
|
20697
20770
|
|
@@ -20700,14 +20773,14 @@ function numeric(a, b) {
|
|
20700
20773
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
20701
20774
|
return new PgNumericBuilder(name2, config?.precision, config?.scale);
|
20702
20775
|
}
|
20703
|
-
var
|
20776
|
+
var _a78, _b56, PgNumericBuilder, _a79, _b57, PgNumeric;
|
20704
20777
|
var init_numeric = __esm({
|
20705
20778
|
"../drizzle-orm/dist/pg-core/columns/numeric.js"() {
|
20706
20779
|
"use strict";
|
20707
20780
|
init_entity();
|
20708
20781
|
init_utils2();
|
20709
20782
|
init_common2();
|
20710
|
-
PgNumericBuilder = class extends (_b56 = PgColumnBuilder,
|
20783
|
+
PgNumericBuilder = class extends (_b56 = PgColumnBuilder, _a78 = entityKind, _b56) {
|
20711
20784
|
constructor(name2, precision, scale) {
|
20712
20785
|
super(name2, "string", "PgNumeric");
|
20713
20786
|
this.config.precision = precision;
|
@@ -20718,8 +20791,8 @@ var init_numeric = __esm({
|
|
20718
20791
|
return new PgNumeric(table4, this.config);
|
20719
20792
|
}
|
20720
20793
|
};
|
20721
|
-
__publicField(PgNumericBuilder,
|
20722
|
-
PgNumeric = class extends (_b57 = PgColumn,
|
20794
|
+
__publicField(PgNumericBuilder, _a78, "PgNumericBuilder");
|
20795
|
+
PgNumeric = class extends (_b57 = PgColumn, _a79 = entityKind, _b57) {
|
20723
20796
|
constructor(table4, config) {
|
20724
20797
|
super(table4, config);
|
20725
20798
|
__publicField(this, "precision");
|
@@ -20737,7 +20810,7 @@ var init_numeric = __esm({
|
|
20737
20810
|
}
|
20738
20811
|
}
|
20739
20812
|
};
|
20740
|
-
__publicField(PgNumeric,
|
20813
|
+
__publicField(PgNumeric, _a79, "PgNumeric");
|
20741
20814
|
}
|
20742
20815
|
});
|
20743
20816
|
|
@@ -20749,14 +20822,14 @@ function point(a, b) {
|
|
20749
20822
|
}
|
20750
20823
|
return new PgPointObjectBuilder(name2);
|
20751
20824
|
}
|
20752
|
-
var
|
20825
|
+
var _a80, _b58, PgPointTupleBuilder, _a81, _b59, PgPointTuple, _a82, _b60, PgPointObjectBuilder, _a83, _b61, PgPointObject;
|
20753
20826
|
var init_point = __esm({
|
20754
20827
|
"../drizzle-orm/dist/pg-core/columns/point.js"() {
|
20755
20828
|
"use strict";
|
20756
20829
|
init_entity();
|
20757
20830
|
init_utils2();
|
20758
20831
|
init_common2();
|
20759
|
-
PgPointTupleBuilder = class extends (_b58 = PgColumnBuilder,
|
20832
|
+
PgPointTupleBuilder = class extends (_b58 = PgColumnBuilder, _a80 = entityKind, _b58) {
|
20760
20833
|
constructor(name2) {
|
20761
20834
|
super(name2, "array", "PgPointTuple");
|
20762
20835
|
}
|
@@ -20768,8 +20841,8 @@ var init_point = __esm({
|
|
20768
20841
|
);
|
20769
20842
|
}
|
20770
20843
|
};
|
20771
|
-
__publicField(PgPointTupleBuilder,
|
20772
|
-
PgPointTuple = class extends (_b59 = PgColumn,
|
20844
|
+
__publicField(PgPointTupleBuilder, _a80, "PgPointTupleBuilder");
|
20845
|
+
PgPointTuple = class extends (_b59 = PgColumn, _a81 = entityKind, _b59) {
|
20773
20846
|
getSQLType() {
|
20774
20847
|
return "point";
|
20775
20848
|
}
|
@@ -20784,8 +20857,8 @@ var init_point = __esm({
|
|
20784
20857
|
return `(${value[0]},${value[1]})`;
|
20785
20858
|
}
|
20786
20859
|
};
|
20787
|
-
__publicField(PgPointTuple,
|
20788
|
-
PgPointObjectBuilder = class extends (_b60 = PgColumnBuilder,
|
20860
|
+
__publicField(PgPointTuple, _a81, "PgPointTuple");
|
20861
|
+
PgPointObjectBuilder = class extends (_b60 = PgColumnBuilder, _a82 = entityKind, _b60) {
|
20789
20862
|
constructor(name2) {
|
20790
20863
|
super(name2, "json", "PgPointObject");
|
20791
20864
|
}
|
@@ -20797,8 +20870,8 @@ var init_point = __esm({
|
|
20797
20870
|
);
|
20798
20871
|
}
|
20799
20872
|
};
|
20800
|
-
__publicField(PgPointObjectBuilder,
|
20801
|
-
PgPointObject = class extends (_b61 = PgColumn,
|
20873
|
+
__publicField(PgPointObjectBuilder, _a82, "PgPointObjectBuilder");
|
20874
|
+
PgPointObject = class extends (_b61 = PgColumn, _a83 = entityKind, _b61) {
|
20802
20875
|
getSQLType() {
|
20803
20876
|
return "point";
|
20804
20877
|
}
|
@@ -20813,7 +20886,7 @@ var init_point = __esm({
|
|
20813
20886
|
return `(${value.x},${value.y})`;
|
20814
20887
|
}
|
20815
20888
|
};
|
20816
|
-
__publicField(PgPointObject,
|
20889
|
+
__publicField(PgPointObject, _a83, "PgPointObject");
|
20817
20890
|
}
|
20818
20891
|
});
|
20819
20892
|
|
@@ -20869,7 +20942,7 @@ function geometry(a, b) {
|
|
20869
20942
|
}
|
20870
20943
|
return new PgGeometryObjectBuilder(name2);
|
20871
20944
|
}
|
20872
|
-
var
|
20945
|
+
var _a84, _b62, PgGeometryBuilder, _a85, _b63, PgGeometry, _a86, _b64, PgGeometryObjectBuilder, _a87, _b65, PgGeometryObject;
|
20873
20946
|
var init_geometry = __esm({
|
20874
20947
|
"../drizzle-orm/dist/pg-core/columns/postgis_extension/geometry.js"() {
|
20875
20948
|
"use strict";
|
@@ -20877,7 +20950,7 @@ var init_geometry = __esm({
|
|
20877
20950
|
init_utils2();
|
20878
20951
|
init_common2();
|
20879
20952
|
init_utils3();
|
20880
|
-
PgGeometryBuilder = class extends (_b62 = PgColumnBuilder,
|
20953
|
+
PgGeometryBuilder = class extends (_b62 = PgColumnBuilder, _a84 = entityKind, _b62) {
|
20881
20954
|
constructor(name2) {
|
20882
20955
|
super(name2, "array", "PgGeometry");
|
20883
20956
|
}
|
@@ -20889,8 +20962,8 @@ var init_geometry = __esm({
|
|
20889
20962
|
);
|
20890
20963
|
}
|
20891
20964
|
};
|
20892
|
-
__publicField(PgGeometryBuilder,
|
20893
|
-
PgGeometry = class extends (_b63 = PgColumn,
|
20965
|
+
__publicField(PgGeometryBuilder, _a84, "PgGeometryBuilder");
|
20966
|
+
PgGeometry = class extends (_b63 = PgColumn, _a85 = entityKind, _b63) {
|
20894
20967
|
getSQLType() {
|
20895
20968
|
return "geometry(point)";
|
20896
20969
|
}
|
@@ -20901,8 +20974,8 @@ var init_geometry = __esm({
|
|
20901
20974
|
return `point(${value[0]} ${value[1]})`;
|
20902
20975
|
}
|
20903
20976
|
};
|
20904
|
-
__publicField(PgGeometry,
|
20905
|
-
PgGeometryObjectBuilder = class extends (_b64 = PgColumnBuilder,
|
20977
|
+
__publicField(PgGeometry, _a85, "PgGeometry");
|
20978
|
+
PgGeometryObjectBuilder = class extends (_b64 = PgColumnBuilder, _a86 = entityKind, _b64) {
|
20906
20979
|
constructor(name2) {
|
20907
20980
|
super(name2, "json", "PgGeometryObject");
|
20908
20981
|
}
|
@@ -20914,8 +20987,8 @@ var init_geometry = __esm({
|
|
20914
20987
|
);
|
20915
20988
|
}
|
20916
20989
|
};
|
20917
|
-
__publicField(PgGeometryObjectBuilder,
|
20918
|
-
PgGeometryObject = class extends (_b65 = PgColumn,
|
20990
|
+
__publicField(PgGeometryObjectBuilder, _a86, "PgGeometryObjectBuilder");
|
20991
|
+
PgGeometryObject = class extends (_b65 = PgColumn, _a87 = entityKind, _b65) {
|
20919
20992
|
getSQLType() {
|
20920
20993
|
return "geometry(point)";
|
20921
20994
|
}
|
@@ -20927,7 +21000,7 @@ var init_geometry = __esm({
|
|
20927
21000
|
return `point(${value.x} ${value.y})`;
|
20928
21001
|
}
|
20929
21002
|
};
|
20930
|
-
__publicField(PgGeometryObject,
|
21003
|
+
__publicField(PgGeometryObject, _a87, "PgGeometryObject");
|
20931
21004
|
}
|
20932
21005
|
});
|
20933
21006
|
|
@@ -20935,13 +21008,13 @@ var init_geometry = __esm({
|
|
20935
21008
|
function real(name2) {
|
20936
21009
|
return new PgRealBuilder(name2 ?? "");
|
20937
21010
|
}
|
20938
|
-
var
|
21011
|
+
var _a88, _b66, PgRealBuilder, _a89, _b67, PgReal;
|
20939
21012
|
var init_real = __esm({
|
20940
21013
|
"../drizzle-orm/dist/pg-core/columns/real.js"() {
|
20941
21014
|
"use strict";
|
20942
21015
|
init_entity();
|
20943
21016
|
init_common2();
|
20944
|
-
PgRealBuilder = class extends (_b66 = PgColumnBuilder,
|
21017
|
+
PgRealBuilder = class extends (_b66 = PgColumnBuilder, _a88 = entityKind, _b66) {
|
20945
21018
|
constructor(name2, length) {
|
20946
21019
|
super(name2, "number", "PgReal");
|
20947
21020
|
this.config.length = length;
|
@@ -20951,8 +21024,8 @@ var init_real = __esm({
|
|
20951
21024
|
return new PgReal(table4, this.config);
|
20952
21025
|
}
|
20953
21026
|
};
|
20954
|
-
__publicField(PgRealBuilder,
|
20955
|
-
PgReal = class extends (_b67 = PgColumn,
|
21027
|
+
__publicField(PgRealBuilder, _a88, "PgRealBuilder");
|
21028
|
+
PgReal = class extends (_b67 = PgColumn, _a89 = entityKind, _b67) {
|
20956
21029
|
constructor(table4, config) {
|
20957
21030
|
super(table4, config);
|
20958
21031
|
__publicField(this, "mapFromDriverValue", (value) => {
|
@@ -20966,7 +21039,7 @@ var init_real = __esm({
|
|
20966
21039
|
return "real";
|
20967
21040
|
}
|
20968
21041
|
};
|
20969
|
-
__publicField(PgReal,
|
21042
|
+
__publicField(PgReal, _a89, "PgReal");
|
20970
21043
|
}
|
20971
21044
|
});
|
20972
21045
|
|
@@ -20974,13 +21047,13 @@ var init_real = __esm({
|
|
20974
21047
|
function serial(name2) {
|
20975
21048
|
return new PgSerialBuilder(name2 ?? "");
|
20976
21049
|
}
|
20977
|
-
var
|
21050
|
+
var _a90, _b68, PgSerialBuilder, _a91, _b69, PgSerial;
|
20978
21051
|
var init_serial = __esm({
|
20979
21052
|
"../drizzle-orm/dist/pg-core/columns/serial.js"() {
|
20980
21053
|
"use strict";
|
20981
21054
|
init_entity();
|
20982
21055
|
init_common2();
|
20983
|
-
PgSerialBuilder = class extends (_b68 = PgColumnBuilder,
|
21056
|
+
PgSerialBuilder = class extends (_b68 = PgColumnBuilder, _a90 = entityKind, _b68) {
|
20984
21057
|
constructor(name2) {
|
20985
21058
|
super(name2, "number", "PgSerial");
|
20986
21059
|
this.config.hasDefault = true;
|
@@ -20991,13 +21064,13 @@ var init_serial = __esm({
|
|
20991
21064
|
return new PgSerial(table4, this.config);
|
20992
21065
|
}
|
20993
21066
|
};
|
20994
|
-
__publicField(PgSerialBuilder,
|
20995
|
-
PgSerial = class extends (_b69 = PgColumn,
|
21067
|
+
__publicField(PgSerialBuilder, _a90, "PgSerialBuilder");
|
21068
|
+
PgSerial = class extends (_b69 = PgColumn, _a91 = entityKind, _b69) {
|
20996
21069
|
getSQLType() {
|
20997
21070
|
return "serial";
|
20998
21071
|
}
|
20999
21072
|
};
|
21000
|
-
__publicField(PgSerial,
|
21073
|
+
__publicField(PgSerial, _a91, "PgSerial");
|
21001
21074
|
}
|
21002
21075
|
});
|
21003
21076
|
|
@@ -21005,14 +21078,14 @@ var init_serial = __esm({
|
|
21005
21078
|
function smallint(name2) {
|
21006
21079
|
return new PgSmallIntBuilder(name2 ?? "");
|
21007
21080
|
}
|
21008
|
-
var
|
21081
|
+
var _a92, _b70, PgSmallIntBuilder, _a93, _b71, PgSmallInt;
|
21009
21082
|
var init_smallint = __esm({
|
21010
21083
|
"../drizzle-orm/dist/pg-core/columns/smallint.js"() {
|
21011
21084
|
"use strict";
|
21012
21085
|
init_entity();
|
21013
21086
|
init_common2();
|
21014
21087
|
init_int_common();
|
21015
|
-
PgSmallIntBuilder = class extends (_b70 = PgIntColumnBaseBuilder,
|
21088
|
+
PgSmallIntBuilder = class extends (_b70 = PgIntColumnBaseBuilder, _a92 = entityKind, _b70) {
|
21016
21089
|
constructor(name2) {
|
21017
21090
|
super(name2, "number", "PgSmallInt");
|
21018
21091
|
}
|
@@ -21021,8 +21094,8 @@ var init_smallint = __esm({
|
|
21021
21094
|
return new PgSmallInt(table4, this.config);
|
21022
21095
|
}
|
21023
21096
|
};
|
21024
|
-
__publicField(PgSmallIntBuilder,
|
21025
|
-
PgSmallInt = class extends (_b71 = PgColumn,
|
21097
|
+
__publicField(PgSmallIntBuilder, _a92, "PgSmallIntBuilder");
|
21098
|
+
PgSmallInt = class extends (_b71 = PgColumn, _a93 = entityKind, _b71) {
|
21026
21099
|
constructor() {
|
21027
21100
|
super(...arguments);
|
21028
21101
|
__publicField(this, "mapFromDriverValue", (value) => {
|
@@ -21036,7 +21109,7 @@ var init_smallint = __esm({
|
|
21036
21109
|
return "smallint";
|
21037
21110
|
}
|
21038
21111
|
};
|
21039
|
-
__publicField(PgSmallInt,
|
21112
|
+
__publicField(PgSmallInt, _a93, "PgSmallInt");
|
21040
21113
|
}
|
21041
21114
|
});
|
21042
21115
|
|
@@ -21044,13 +21117,13 @@ var init_smallint = __esm({
|
|
21044
21117
|
function smallserial(name2) {
|
21045
21118
|
return new PgSmallSerialBuilder(name2 ?? "");
|
21046
21119
|
}
|
21047
|
-
var
|
21120
|
+
var _a94, _b72, PgSmallSerialBuilder, _a95, _b73, PgSmallSerial;
|
21048
21121
|
var init_smallserial = __esm({
|
21049
21122
|
"../drizzle-orm/dist/pg-core/columns/smallserial.js"() {
|
21050
21123
|
"use strict";
|
21051
21124
|
init_entity();
|
21052
21125
|
init_common2();
|
21053
|
-
PgSmallSerialBuilder = class extends (_b72 = PgColumnBuilder,
|
21126
|
+
PgSmallSerialBuilder = class extends (_b72 = PgColumnBuilder, _a94 = entityKind, _b72) {
|
21054
21127
|
constructor(name2) {
|
21055
21128
|
super(name2, "number", "PgSmallSerial");
|
21056
21129
|
this.config.hasDefault = true;
|
@@ -21064,13 +21137,13 @@ var init_smallserial = __esm({
|
|
21064
21137
|
);
|
21065
21138
|
}
|
21066
21139
|
};
|
21067
|
-
__publicField(PgSmallSerialBuilder,
|
21068
|
-
PgSmallSerial = class extends (_b73 = PgColumn,
|
21140
|
+
__publicField(PgSmallSerialBuilder, _a94, "PgSmallSerialBuilder");
|
21141
|
+
PgSmallSerial = class extends (_b73 = PgColumn, _a95 = entityKind, _b73) {
|
21069
21142
|
getSQLType() {
|
21070
21143
|
return "smallserial";
|
21071
21144
|
}
|
21072
21145
|
};
|
21073
|
-
__publicField(PgSmallSerial,
|
21146
|
+
__publicField(PgSmallSerial, _a95, "PgSmallSerial");
|
21074
21147
|
}
|
21075
21148
|
});
|
21076
21149
|
|
@@ -21079,14 +21152,14 @@ function text(a, b = {}) {
|
|
21079
21152
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21080
21153
|
return new PgTextBuilder(name2, config);
|
21081
21154
|
}
|
21082
|
-
var
|
21155
|
+
var _a96, _b74, PgTextBuilder, _a97, _b75, PgText;
|
21083
21156
|
var init_text = __esm({
|
21084
21157
|
"../drizzle-orm/dist/pg-core/columns/text.js"() {
|
21085
21158
|
"use strict";
|
21086
21159
|
init_entity();
|
21087
21160
|
init_utils2();
|
21088
21161
|
init_common2();
|
21089
|
-
PgTextBuilder = class extends (_b74 = PgColumnBuilder,
|
21162
|
+
PgTextBuilder = class extends (_b74 = PgColumnBuilder, _a96 = entityKind, _b74) {
|
21090
21163
|
constructor(name2, config) {
|
21091
21164
|
super(name2, "string", "PgText");
|
21092
21165
|
this.config.enumValues = config.enum;
|
@@ -21096,8 +21169,8 @@ var init_text = __esm({
|
|
21096
21169
|
return new PgText(table4, this.config);
|
21097
21170
|
}
|
21098
21171
|
};
|
21099
|
-
__publicField(PgTextBuilder,
|
21100
|
-
PgText = class extends (_b75 = PgColumn,
|
21172
|
+
__publicField(PgTextBuilder, _a96, "PgTextBuilder");
|
21173
|
+
PgText = class extends (_b75 = PgColumn, _a97 = entityKind, _b75) {
|
21101
21174
|
constructor() {
|
21102
21175
|
super(...arguments);
|
21103
21176
|
__publicField(this, "enumValues", this.config.enumValues);
|
@@ -21106,7 +21179,7 @@ var init_text = __esm({
|
|
21106
21179
|
return "text";
|
21107
21180
|
}
|
21108
21181
|
};
|
21109
|
-
__publicField(PgText,
|
21182
|
+
__publicField(PgText, _a97, "PgText");
|
21110
21183
|
}
|
21111
21184
|
});
|
21112
21185
|
|
@@ -21115,7 +21188,7 @@ function time(a, b = {}) {
|
|
21115
21188
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21116
21189
|
return new PgTimeBuilder(name2, config.withTimezone ?? false, config.precision);
|
21117
21190
|
}
|
21118
|
-
var
|
21191
|
+
var _a98, _b76, PgTimeBuilder, _a99, _b77, PgTime;
|
21119
21192
|
var init_time = __esm({
|
21120
21193
|
"../drizzle-orm/dist/pg-core/columns/time.js"() {
|
21121
21194
|
"use strict";
|
@@ -21123,7 +21196,7 @@ var init_time = __esm({
|
|
21123
21196
|
init_utils2();
|
21124
21197
|
init_common2();
|
21125
21198
|
init_date_common();
|
21126
|
-
PgTimeBuilder = class extends (_b76 = PgDateColumnBaseBuilder,
|
21199
|
+
PgTimeBuilder = class extends (_b76 = PgDateColumnBaseBuilder, _a98 = entityKind, _b76) {
|
21127
21200
|
constructor(name2, withTimezone, precision) {
|
21128
21201
|
super(name2, "string", "PgTime");
|
21129
21202
|
this.withTimezone = withTimezone;
|
@@ -21136,8 +21209,8 @@ var init_time = __esm({
|
|
21136
21209
|
return new PgTime(table4, this.config);
|
21137
21210
|
}
|
21138
21211
|
};
|
21139
|
-
__publicField(PgTimeBuilder,
|
21140
|
-
PgTime = class extends (_b77 = PgColumn,
|
21212
|
+
__publicField(PgTimeBuilder, _a98, "PgTimeBuilder");
|
21213
|
+
PgTime = class extends (_b77 = PgColumn, _a99 = entityKind, _b77) {
|
21141
21214
|
constructor(table4, config) {
|
21142
21215
|
super(table4, config);
|
21143
21216
|
__publicField(this, "withTimezone");
|
@@ -21150,7 +21223,7 @@ var init_time = __esm({
|
|
21150
21223
|
return `time${precision}${this.withTimezone ? " with time zone" : ""}`;
|
21151
21224
|
}
|
21152
21225
|
};
|
21153
|
-
__publicField(PgTime,
|
21226
|
+
__publicField(PgTime, _a99, "PgTime");
|
21154
21227
|
}
|
21155
21228
|
});
|
21156
21229
|
|
@@ -21162,7 +21235,7 @@ function timestamp(a, b = {}) {
|
|
21162
21235
|
}
|
21163
21236
|
return new PgTimestampBuilder(name2, config?.withTimezone ?? false, config?.precision);
|
21164
21237
|
}
|
21165
|
-
var
|
21238
|
+
var _a100, _b78, PgTimestampBuilder, _a101, _b79, PgTimestamp, _a102, _b80, PgTimestampStringBuilder, _a103, _b81, PgTimestampString;
|
21166
21239
|
var init_timestamp = __esm({
|
21167
21240
|
"../drizzle-orm/dist/pg-core/columns/timestamp.js"() {
|
21168
21241
|
"use strict";
|
@@ -21170,7 +21243,7 @@ var init_timestamp = __esm({
|
|
21170
21243
|
init_utils2();
|
21171
21244
|
init_common2();
|
21172
21245
|
init_date_common();
|
21173
|
-
PgTimestampBuilder = class extends (_b78 = PgDateColumnBaseBuilder,
|
21246
|
+
PgTimestampBuilder = class extends (_b78 = PgDateColumnBaseBuilder, _a100 = entityKind, _b78) {
|
21174
21247
|
constructor(name2, withTimezone, precision) {
|
21175
21248
|
super(name2, "date", "PgTimestamp");
|
21176
21249
|
this.config.withTimezone = withTimezone;
|
@@ -21181,8 +21254,8 @@ var init_timestamp = __esm({
|
|
21181
21254
|
return new PgTimestamp(table4, this.config);
|
21182
21255
|
}
|
21183
21256
|
};
|
21184
|
-
__publicField(PgTimestampBuilder,
|
21185
|
-
PgTimestamp = class extends (_b79 = PgColumn,
|
21257
|
+
__publicField(PgTimestampBuilder, _a100, "PgTimestampBuilder");
|
21258
|
+
PgTimestamp = class extends (_b79 = PgColumn, _a101 = entityKind, _b79) {
|
21186
21259
|
constructor(table4, config) {
|
21187
21260
|
super(table4, config);
|
21188
21261
|
__publicField(this, "withTimezone");
|
@@ -21201,8 +21274,8 @@ var init_timestamp = __esm({
|
|
21201
21274
|
return `timestamp${precision}${this.withTimezone ? " with time zone" : ""}`;
|
21202
21275
|
}
|
21203
21276
|
};
|
21204
|
-
__publicField(PgTimestamp,
|
21205
|
-
PgTimestampStringBuilder = class extends (_b80 = PgDateColumnBaseBuilder,
|
21277
|
+
__publicField(PgTimestamp, _a101, "PgTimestamp");
|
21278
|
+
PgTimestampStringBuilder = class extends (_b80 = PgDateColumnBaseBuilder, _a102 = entityKind, _b80) {
|
21206
21279
|
constructor(name2, withTimezone, precision) {
|
21207
21280
|
super(name2, "string", "PgTimestampString");
|
21208
21281
|
this.config.withTimezone = withTimezone;
|
@@ -21216,8 +21289,8 @@ var init_timestamp = __esm({
|
|
21216
21289
|
);
|
21217
21290
|
}
|
21218
21291
|
};
|
21219
|
-
__publicField(PgTimestampStringBuilder,
|
21220
|
-
PgTimestampString = class extends (_b81 = PgColumn,
|
21292
|
+
__publicField(PgTimestampStringBuilder, _a102, "PgTimestampStringBuilder");
|
21293
|
+
PgTimestampString = class extends (_b81 = PgColumn, _a103 = entityKind, _b81) {
|
21221
21294
|
constructor(table4, config) {
|
21222
21295
|
super(table4, config);
|
21223
21296
|
__publicField(this, "withTimezone");
|
@@ -21230,7 +21303,7 @@ var init_timestamp = __esm({
|
|
21230
21303
|
return `timestamp${precision}${this.withTimezone ? " with time zone" : ""}`;
|
21231
21304
|
}
|
21232
21305
|
};
|
21233
|
-
__publicField(PgTimestampString,
|
21306
|
+
__publicField(PgTimestampString, _a103, "PgTimestampString");
|
21234
21307
|
}
|
21235
21308
|
});
|
21236
21309
|
|
@@ -21238,14 +21311,14 @@ var init_timestamp = __esm({
|
|
21238
21311
|
function uuid(name2) {
|
21239
21312
|
return new PgUUIDBuilder(name2 ?? "");
|
21240
21313
|
}
|
21241
|
-
var
|
21314
|
+
var _a104, _b82, PgUUIDBuilder, _a105, _b83, PgUUID;
|
21242
21315
|
var init_uuid = __esm({
|
21243
21316
|
"../drizzle-orm/dist/pg-core/columns/uuid.js"() {
|
21244
21317
|
"use strict";
|
21245
21318
|
init_entity();
|
21246
21319
|
init_sql();
|
21247
21320
|
init_common2();
|
21248
|
-
PgUUIDBuilder = class extends (_b82 = PgColumnBuilder,
|
21321
|
+
PgUUIDBuilder = class extends (_b82 = PgColumnBuilder, _a104 = entityKind, _b82) {
|
21249
21322
|
constructor(name2) {
|
21250
21323
|
super(name2, "string", "PgUUID");
|
21251
21324
|
}
|
@@ -21260,13 +21333,13 @@ var init_uuid = __esm({
|
|
21260
21333
|
return new PgUUID(table4, this.config);
|
21261
21334
|
}
|
21262
21335
|
};
|
21263
|
-
__publicField(PgUUIDBuilder,
|
21264
|
-
PgUUID = class extends (_b83 = PgColumn,
|
21336
|
+
__publicField(PgUUIDBuilder, _a104, "PgUUIDBuilder");
|
21337
|
+
PgUUID = class extends (_b83 = PgColumn, _a105 = entityKind, _b83) {
|
21265
21338
|
getSQLType() {
|
21266
21339
|
return "uuid";
|
21267
21340
|
}
|
21268
21341
|
};
|
21269
|
-
__publicField(PgUUID,
|
21342
|
+
__publicField(PgUUID, _a105, "PgUUID");
|
21270
21343
|
}
|
21271
21344
|
});
|
21272
21345
|
|
@@ -21275,14 +21348,14 @@ function varchar(a, b = {}) {
|
|
21275
21348
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21276
21349
|
return new PgVarcharBuilder(name2, config);
|
21277
21350
|
}
|
21278
|
-
var
|
21351
|
+
var _a106, _b84, PgVarcharBuilder, _a107, _b85, PgVarchar;
|
21279
21352
|
var init_varchar = __esm({
|
21280
21353
|
"../drizzle-orm/dist/pg-core/columns/varchar.js"() {
|
21281
21354
|
"use strict";
|
21282
21355
|
init_entity();
|
21283
21356
|
init_utils2();
|
21284
21357
|
init_common2();
|
21285
|
-
PgVarcharBuilder = class extends (_b84 = PgColumnBuilder,
|
21358
|
+
PgVarcharBuilder = class extends (_b84 = PgColumnBuilder, _a106 = entityKind, _b84) {
|
21286
21359
|
constructor(name2, config) {
|
21287
21360
|
super(name2, "string", "PgVarchar");
|
21288
21361
|
this.config.length = config.length;
|
@@ -21293,8 +21366,8 @@ var init_varchar = __esm({
|
|
21293
21366
|
return new PgVarchar(table4, this.config);
|
21294
21367
|
}
|
21295
21368
|
};
|
21296
|
-
__publicField(PgVarcharBuilder,
|
21297
|
-
PgVarchar = class extends (_b85 = PgColumn,
|
21369
|
+
__publicField(PgVarcharBuilder, _a106, "PgVarcharBuilder");
|
21370
|
+
PgVarchar = class extends (_b85 = PgColumn, _a107 = entityKind, _b85) {
|
21298
21371
|
constructor() {
|
21299
21372
|
super(...arguments);
|
21300
21373
|
__publicField(this, "length", this.config.length);
|
@@ -21304,7 +21377,7 @@ var init_varchar = __esm({
|
|
21304
21377
|
return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
|
21305
21378
|
}
|
21306
21379
|
};
|
21307
|
-
__publicField(PgVarchar,
|
21380
|
+
__publicField(PgVarchar, _a107, "PgVarchar");
|
21308
21381
|
}
|
21309
21382
|
});
|
21310
21383
|
|
@@ -21313,14 +21386,14 @@ function bit(a, b) {
|
|
21313
21386
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21314
21387
|
return new PgBinaryVectorBuilder(name2, config);
|
21315
21388
|
}
|
21316
|
-
var
|
21389
|
+
var _a108, _b86, PgBinaryVectorBuilder, _a109, _b87, PgBinaryVector;
|
21317
21390
|
var init_bit = __esm({
|
21318
21391
|
"../drizzle-orm/dist/pg-core/columns/vector_extension/bit.js"() {
|
21319
21392
|
"use strict";
|
21320
21393
|
init_entity();
|
21321
21394
|
init_utils2();
|
21322
21395
|
init_common2();
|
21323
|
-
PgBinaryVectorBuilder = class extends (_b86 = PgColumnBuilder,
|
21396
|
+
PgBinaryVectorBuilder = class extends (_b86 = PgColumnBuilder, _a108 = entityKind, _b86) {
|
21324
21397
|
constructor(name2, config) {
|
21325
21398
|
super(name2, "string", "PgBinaryVector");
|
21326
21399
|
this.config.dimensions = config.dimensions;
|
@@ -21333,8 +21406,8 @@ var init_bit = __esm({
|
|
21333
21406
|
);
|
21334
21407
|
}
|
21335
21408
|
};
|
21336
|
-
__publicField(PgBinaryVectorBuilder,
|
21337
|
-
PgBinaryVector = class extends (_b87 = PgColumn,
|
21409
|
+
__publicField(PgBinaryVectorBuilder, _a108, "PgBinaryVectorBuilder");
|
21410
|
+
PgBinaryVector = class extends (_b87 = PgColumn, _a109 = entityKind, _b87) {
|
21338
21411
|
constructor() {
|
21339
21412
|
super(...arguments);
|
21340
21413
|
__publicField(this, "dimensions", this.config.dimensions);
|
@@ -21343,7 +21416,7 @@ var init_bit = __esm({
|
|
21343
21416
|
return `bit(${this.dimensions})`;
|
21344
21417
|
}
|
21345
21418
|
};
|
21346
|
-
__publicField(PgBinaryVector,
|
21419
|
+
__publicField(PgBinaryVector, _a109, "PgBinaryVector");
|
21347
21420
|
}
|
21348
21421
|
});
|
21349
21422
|
|
@@ -21352,14 +21425,14 @@ function halfvec(a, b) {
|
|
21352
21425
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21353
21426
|
return new PgHalfVectorBuilder(name2, config);
|
21354
21427
|
}
|
21355
|
-
var
|
21428
|
+
var _a110, _b88, PgHalfVectorBuilder, _a111, _b89, PgHalfVector;
|
21356
21429
|
var init_halfvec = __esm({
|
21357
21430
|
"../drizzle-orm/dist/pg-core/columns/vector_extension/halfvec.js"() {
|
21358
21431
|
"use strict";
|
21359
21432
|
init_entity();
|
21360
21433
|
init_utils2();
|
21361
21434
|
init_common2();
|
21362
|
-
PgHalfVectorBuilder = class extends (_b88 = PgColumnBuilder,
|
21435
|
+
PgHalfVectorBuilder = class extends (_b88 = PgColumnBuilder, _a110 = entityKind, _b88) {
|
21363
21436
|
constructor(name2, config) {
|
21364
21437
|
super(name2, "array", "PgHalfVector");
|
21365
21438
|
this.config.dimensions = config.dimensions;
|
@@ -21372,8 +21445,8 @@ var init_halfvec = __esm({
|
|
21372
21445
|
);
|
21373
21446
|
}
|
21374
21447
|
};
|
21375
|
-
__publicField(PgHalfVectorBuilder,
|
21376
|
-
PgHalfVector = class extends (_b89 = PgColumn,
|
21448
|
+
__publicField(PgHalfVectorBuilder, _a110, "PgHalfVectorBuilder");
|
21449
|
+
PgHalfVector = class extends (_b89 = PgColumn, _a111 = entityKind, _b89) {
|
21377
21450
|
constructor() {
|
21378
21451
|
super(...arguments);
|
21379
21452
|
__publicField(this, "dimensions", this.config.dimensions);
|
@@ -21388,7 +21461,7 @@ var init_halfvec = __esm({
|
|
21388
21461
|
return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
|
21389
21462
|
}
|
21390
21463
|
};
|
21391
|
-
__publicField(PgHalfVector,
|
21464
|
+
__publicField(PgHalfVector, _a111, "PgHalfVector");
|
21392
21465
|
}
|
21393
21466
|
});
|
21394
21467
|
|
@@ -21397,14 +21470,14 @@ function sparsevec(a, b) {
|
|
21397
21470
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21398
21471
|
return new PgSparseVectorBuilder(name2, config);
|
21399
21472
|
}
|
21400
|
-
var
|
21473
|
+
var _a112, _b90, PgSparseVectorBuilder, _a113, _b91, PgSparseVector;
|
21401
21474
|
var init_sparsevec = __esm({
|
21402
21475
|
"../drizzle-orm/dist/pg-core/columns/vector_extension/sparsevec.js"() {
|
21403
21476
|
"use strict";
|
21404
21477
|
init_entity();
|
21405
21478
|
init_utils2();
|
21406
21479
|
init_common2();
|
21407
|
-
PgSparseVectorBuilder = class extends (_b90 = PgColumnBuilder,
|
21480
|
+
PgSparseVectorBuilder = class extends (_b90 = PgColumnBuilder, _a112 = entityKind, _b90) {
|
21408
21481
|
constructor(name2, config) {
|
21409
21482
|
super(name2, "string", "PgSparseVector");
|
21410
21483
|
this.config.dimensions = config.dimensions;
|
@@ -21417,8 +21490,8 @@ var init_sparsevec = __esm({
|
|
21417
21490
|
);
|
21418
21491
|
}
|
21419
21492
|
};
|
21420
|
-
__publicField(PgSparseVectorBuilder,
|
21421
|
-
PgSparseVector = class extends (_b91 = PgColumn,
|
21493
|
+
__publicField(PgSparseVectorBuilder, _a112, "PgSparseVectorBuilder");
|
21494
|
+
PgSparseVector = class extends (_b91 = PgColumn, _a113 = entityKind, _b91) {
|
21422
21495
|
constructor() {
|
21423
21496
|
super(...arguments);
|
21424
21497
|
__publicField(this, "dimensions", this.config.dimensions);
|
@@ -21427,7 +21500,7 @@ var init_sparsevec = __esm({
|
|
21427
21500
|
return `sparsevec(${this.dimensions})`;
|
21428
21501
|
}
|
21429
21502
|
};
|
21430
|
-
__publicField(PgSparseVector,
|
21503
|
+
__publicField(PgSparseVector, _a113, "PgSparseVector");
|
21431
21504
|
}
|
21432
21505
|
});
|
21433
21506
|
|
@@ -21436,14 +21509,14 @@ function vector(a, b) {
|
|
21436
21509
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
21437
21510
|
return new PgVectorBuilder(name2, config);
|
21438
21511
|
}
|
21439
|
-
var
|
21512
|
+
var _a114, _b92, PgVectorBuilder, _a115, _b93, PgVector;
|
21440
21513
|
var init_vector2 = __esm({
|
21441
21514
|
"../drizzle-orm/dist/pg-core/columns/vector_extension/vector.js"() {
|
21442
21515
|
"use strict";
|
21443
21516
|
init_entity();
|
21444
21517
|
init_utils2();
|
21445
21518
|
init_common2();
|
21446
|
-
PgVectorBuilder = class extends (_b92 = PgColumnBuilder,
|
21519
|
+
PgVectorBuilder = class extends (_b92 = PgColumnBuilder, _a114 = entityKind, _b92) {
|
21447
21520
|
constructor(name2, config) {
|
21448
21521
|
super(name2, "array", "PgVector");
|
21449
21522
|
this.config.dimensions = config.dimensions;
|
@@ -21453,8 +21526,8 @@ var init_vector2 = __esm({
|
|
21453
21526
|
return new PgVector(table4, this.config);
|
21454
21527
|
}
|
21455
21528
|
};
|
21456
|
-
__publicField(PgVectorBuilder,
|
21457
|
-
PgVector = class extends (_b93 = PgColumn,
|
21529
|
+
__publicField(PgVectorBuilder, _a114, "PgVectorBuilder");
|
21530
|
+
PgVector = class extends (_b93 = PgColumn, _a115 = entityKind, _b93) {
|
21458
21531
|
constructor() {
|
21459
21532
|
super(...arguments);
|
21460
21533
|
__publicField(this, "dimensions", this.config.dimensions);
|
@@ -21469,7 +21542,7 @@ var init_vector2 = __esm({
|
|
21469
21542
|
return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
|
21470
21543
|
}
|
21471
21544
|
};
|
21472
|
-
__publicField(PgVector,
|
21545
|
+
__publicField(PgVector, _a115, "PgVector");
|
21473
21546
|
}
|
21474
21547
|
});
|
21475
21548
|
|
@@ -21570,14 +21643,14 @@ function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name
|
|
21570
21643
|
})
|
21571
21644
|
);
|
21572
21645
|
const table4 = Object.assign(rawTable, builtColumns);
|
21573
|
-
table4[
|
21574
|
-
table4[
|
21646
|
+
table4[Table.Symbol.Columns] = builtColumns;
|
21647
|
+
table4[Table.Symbol.ExtraConfigColumns] = builtColumnsForExtraConfig;
|
21575
21648
|
if (extraConfig) {
|
21576
21649
|
table4[PgTable.Symbol.ExtraConfigBuilder] = extraConfig;
|
21577
21650
|
}
|
21578
21651
|
return table4;
|
21579
21652
|
}
|
21580
|
-
var InlineForeignKeys,
|
21653
|
+
var InlineForeignKeys, _a116, _b94, _c2, _d2, PgTable, pgTable;
|
21581
21654
|
var init_table2 = __esm({
|
21582
21655
|
"../drizzle-orm/dist/pg-core/table.js"() {
|
21583
21656
|
"use strict";
|
@@ -21585,18 +21658,18 @@ var init_table2 = __esm({
|
|
21585
21658
|
init_table();
|
21586
21659
|
init_all();
|
21587
21660
|
InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
|
21588
|
-
PgTable = class extends (_d2 =
|
21661
|
+
PgTable = class extends (_d2 = Table, _c2 = entityKind, _b94 = InlineForeignKeys, _a116 = Table.Symbol.ExtraConfigBuilder, _d2) {
|
21589
21662
|
constructor() {
|
21590
21663
|
super(...arguments);
|
21591
21664
|
/**@internal */
|
21592
21665
|
__publicField(this, _b94, []);
|
21593
21666
|
/** @internal */
|
21594
|
-
__publicField(this,
|
21667
|
+
__publicField(this, _a116);
|
21595
21668
|
}
|
21596
21669
|
};
|
21597
21670
|
__publicField(PgTable, _c2, "PgTable");
|
21598
21671
|
/** @internal */
|
21599
|
-
__publicField(PgTable, "Symbol", Object.assign({},
|
21672
|
+
__publicField(PgTable, "Symbol", Object.assign({}, Table.Symbol, {
|
21600
21673
|
InlineForeignKeys
|
21601
21674
|
}));
|
21602
21675
|
pgTable = (name2, columns, extraConfig) => {
|
@@ -21606,13 +21679,13 @@ var init_table2 = __esm({
|
|
21606
21679
|
});
|
21607
21680
|
|
21608
21681
|
// ../drizzle-orm/dist/pg-core/primary-keys.js
|
21609
|
-
var
|
21682
|
+
var _a117, PrimaryKeyBuilder, _a118, PrimaryKey;
|
21610
21683
|
var init_primary_keys = __esm({
|
21611
21684
|
"../drizzle-orm/dist/pg-core/primary-keys.js"() {
|
21612
21685
|
"use strict";
|
21613
21686
|
init_entity();
|
21614
21687
|
init_table2();
|
21615
|
-
|
21688
|
+
_a117 = entityKind;
|
21616
21689
|
PrimaryKeyBuilder = class {
|
21617
21690
|
constructor(columns, name2) {
|
21618
21691
|
/** @internal */
|
@@ -21627,8 +21700,8 @@ var init_primary_keys = __esm({
|
|
21627
21700
|
return new PrimaryKey(table4, this.columns, this.name);
|
21628
21701
|
}
|
21629
21702
|
};
|
21630
|
-
__publicField(PrimaryKeyBuilder,
|
21631
|
-
|
21703
|
+
__publicField(PrimaryKeyBuilder, _a117, "PgPrimaryKeyBuilder");
|
21704
|
+
_a118 = entityKind;
|
21632
21705
|
PrimaryKey = class {
|
21633
21706
|
constructor(table4, columns, name2) {
|
21634
21707
|
__publicField(this, "columns");
|
@@ -21641,7 +21714,7 @@ var init_primary_keys = __esm({
|
|
21641
21714
|
return this.name ?? `${this.table[PgTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
|
21642
21715
|
}
|
21643
21716
|
};
|
21644
|
-
__publicField(PrimaryKey,
|
21717
|
+
__publicField(PrimaryKey, _a118, "PgPrimaryKey");
|
21645
21718
|
}
|
21646
21719
|
});
|
21647
21720
|
|
@@ -21680,33 +21753,33 @@ function getOrderByOperators() {
|
|
21680
21753
|
};
|
21681
21754
|
}
|
21682
21755
|
function extractTablesRelationalConfig(schema4, configHelpers) {
|
21683
|
-
if (Object.keys(schema4).length === 1 && "default" in schema4 && !is(schema4["default"],
|
21756
|
+
if (Object.keys(schema4).length === 1 && "default" in schema4 && !is(schema4["default"], Table)) {
|
21684
21757
|
schema4 = schema4["default"];
|
21685
21758
|
}
|
21686
21759
|
const tableNamesMap = {};
|
21687
21760
|
const relationsBuffer = {};
|
21688
21761
|
const tablesConfig = {};
|
21689
21762
|
for (const [key, value] of Object.entries(schema4)) {
|
21690
|
-
if (is(value,
|
21763
|
+
if (is(value, Table)) {
|
21691
21764
|
const dbName = getTableUniqueName(value);
|
21692
21765
|
const bufferedRelations = relationsBuffer[dbName];
|
21693
21766
|
tableNamesMap[dbName] = key;
|
21694
21767
|
tablesConfig[key] = {
|
21695
21768
|
tsName: key,
|
21696
|
-
dbName: value[
|
21697
|
-
schema: value[
|
21698
|
-
columns: value[
|
21769
|
+
dbName: value[Table.Symbol.Name],
|
21770
|
+
schema: value[Table.Symbol.Schema],
|
21771
|
+
columns: value[Table.Symbol.Columns],
|
21699
21772
|
relations: bufferedRelations?.relations ?? {},
|
21700
21773
|
primaryKey: bufferedRelations?.primaryKey ?? []
|
21701
21774
|
};
|
21702
21775
|
for (const column4 of Object.values(
|
21703
|
-
value[
|
21776
|
+
value[Table.Symbol.Columns]
|
21704
21777
|
)) {
|
21705
21778
|
if (column4.primary) {
|
21706
21779
|
tablesConfig[key].primaryKey.push(column4);
|
21707
21780
|
}
|
21708
21781
|
}
|
21709
|
-
const extraConfig = value[
|
21782
|
+
const extraConfig = value[Table.Symbol.ExtraConfigBuilder]?.(value[Table.Symbol.ExtraConfigColumns]);
|
21710
21783
|
if (extraConfig) {
|
21711
21784
|
for (const configEntry of Object.values(extraConfig)) {
|
21712
21785
|
if (is(configEntry, PrimaryKeyBuilder)) {
|
@@ -21778,7 +21851,7 @@ function normalizeRelation(schema4, tableNamesMap, relation) {
|
|
21778
21851
|
const referencedTableTsName = tableNamesMap[getTableUniqueName(relation.referencedTable)];
|
21779
21852
|
if (!referencedTableTsName) {
|
21780
21853
|
throw new Error(
|
21781
|
-
`Table "${relation.referencedTable[
|
21854
|
+
`Table "${relation.referencedTable[Table.Symbol.Name]}" not found in schema`
|
21782
21855
|
);
|
21783
21856
|
}
|
21784
21857
|
const referencedTableConfig = schema4[referencedTableTsName];
|
@@ -21789,7 +21862,7 @@ function normalizeRelation(schema4, tableNamesMap, relation) {
|
|
21789
21862
|
const sourceTableTsName = tableNamesMap[getTableUniqueName(sourceTable)];
|
21790
21863
|
if (!sourceTableTsName) {
|
21791
21864
|
throw new Error(
|
21792
|
-
`Table "${sourceTable[
|
21865
|
+
`Table "${sourceTable[Table.Symbol.Name]}" not found in schema`
|
21793
21866
|
);
|
21794
21867
|
}
|
21795
21868
|
const reverseRelations = [];
|
@@ -21804,7 +21877,7 @@ function normalizeRelation(schema4, tableNamesMap, relation) {
|
|
21804
21877
|
throw relation.relationName ? new Error(
|
21805
21878
|
`There are multiple relations with name "${relation.relationName}" in table "${referencedTableTsName}"`
|
21806
21879
|
) : new Error(
|
21807
|
-
`There are multiple relations between "${referencedTableTsName}" and "${relation.sourceTable[
|
21880
|
+
`There are multiple relations between "${referencedTableTsName}" and "${relation.sourceTable[Table.Symbol.Name]}". Please specify relation name`
|
21808
21881
|
);
|
21809
21882
|
}
|
21810
21883
|
if (reverseRelations[0] && is(reverseRelations[0], One) && reverseRelations[0].config) {
|
@@ -21864,7 +21937,7 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
|
|
21864
21937
|
}
|
21865
21938
|
return result;
|
21866
21939
|
}
|
21867
|
-
var
|
21940
|
+
var _a119, Relation, _a120, Relations, _a121, _b95, _One, One, _a122, _b96, _Many, Many;
|
21868
21941
|
var init_relations = __esm({
|
21869
21942
|
"../drizzle-orm/dist/relations.js"() {
|
21870
21943
|
"use strict";
|
@@ -21874,7 +21947,7 @@ var init_relations = __esm({
|
|
21874
21947
|
init_primary_keys();
|
21875
21948
|
init_expressions();
|
21876
21949
|
init_sql();
|
21877
|
-
|
21950
|
+
_a119 = entityKind;
|
21878
21951
|
Relation = class {
|
21879
21952
|
constructor(sourceTable, referencedTable, relationName) {
|
21880
21953
|
__publicField(this, "referencedTableName");
|
@@ -21882,19 +21955,19 @@ var init_relations = __esm({
|
|
21882
21955
|
this.sourceTable = sourceTable;
|
21883
21956
|
this.referencedTable = referencedTable;
|
21884
21957
|
this.relationName = relationName;
|
21885
|
-
this.referencedTableName = referencedTable[
|
21958
|
+
this.referencedTableName = referencedTable[Table.Symbol.Name];
|
21886
21959
|
}
|
21887
21960
|
};
|
21888
|
-
__publicField(Relation,
|
21889
|
-
|
21961
|
+
__publicField(Relation, _a119, "Relation");
|
21962
|
+
_a120 = entityKind;
|
21890
21963
|
Relations = class {
|
21891
21964
|
constructor(table4, config) {
|
21892
21965
|
this.table = table4;
|
21893
21966
|
this.config = config;
|
21894
21967
|
}
|
21895
21968
|
};
|
21896
|
-
__publicField(Relations,
|
21897
|
-
_One = class _One extends (_b95 = Relation,
|
21969
|
+
__publicField(Relations, _a120, "Relations");
|
21970
|
+
_One = class _One extends (_b95 = Relation, _a121 = entityKind, _b95) {
|
21898
21971
|
constructor(sourceTable, referencedTable, config, isNullable) {
|
21899
21972
|
super(sourceTable, referencedTable, config?.relationName);
|
21900
21973
|
this.config = config;
|
@@ -21911,9 +21984,9 @@ var init_relations = __esm({
|
|
21911
21984
|
return relation;
|
21912
21985
|
}
|
21913
21986
|
};
|
21914
|
-
__publicField(_One,
|
21987
|
+
__publicField(_One, _a121, "One");
|
21915
21988
|
One = _One;
|
21916
|
-
_Many = class _Many extends (_b96 = Relation,
|
21989
|
+
_Many = class _Many extends (_b96 = Relation, _a122 = entityKind, _b96) {
|
21917
21990
|
constructor(sourceTable, referencedTable, config) {
|
21918
21991
|
super(sourceTable, referencedTable, config?.relationName);
|
21919
21992
|
this.config = config;
|
@@ -21928,7 +22001,7 @@ var init_relations = __esm({
|
|
21928
22001
|
return relation;
|
21929
22002
|
}
|
21930
22003
|
};
|
21931
|
-
__publicField(_Many,
|
22004
|
+
__publicField(_Many, _a122, "Many");
|
21932
22005
|
Many = _Many;
|
21933
22006
|
}
|
21934
22007
|
});
|
@@ -22063,7 +22136,7 @@ __export(dist_exports, {
|
|
22063
22136
|
Schema: () => Schema,
|
22064
22137
|
StringChunk: () => StringChunk,
|
22065
22138
|
Subquery: () => Subquery,
|
22066
|
-
Table: () =>
|
22139
|
+
Table: () => Table,
|
22067
22140
|
TableAliasProxyHandler: () => TableAliasProxyHandler,
|
22068
22141
|
TransactionRollbackError: () => TransactionRollbackError,
|
22069
22142
|
View: () => View,
|
@@ -22178,12 +22251,12 @@ var init_alias2 = __esm({
|
|
22178
22251
|
});
|
22179
22252
|
|
22180
22253
|
// ../drizzle-orm/dist/pg-core/checks.js
|
22181
|
-
var
|
22254
|
+
var _a123, CheckBuilder, _a124, Check;
|
22182
22255
|
var init_checks = __esm({
|
22183
22256
|
"../drizzle-orm/dist/pg-core/checks.js"() {
|
22184
22257
|
"use strict";
|
22185
22258
|
init_entity();
|
22186
|
-
|
22259
|
+
_a123 = entityKind;
|
22187
22260
|
CheckBuilder = class {
|
22188
22261
|
constructor(name2, value) {
|
22189
22262
|
__publicField(this, "brand");
|
@@ -22195,8 +22268,8 @@ var init_checks = __esm({
|
|
22195
22268
|
return new Check(table4, this);
|
22196
22269
|
}
|
22197
22270
|
};
|
22198
|
-
__publicField(CheckBuilder,
|
22199
|
-
|
22271
|
+
__publicField(CheckBuilder, _a123, "PgCheckBuilder");
|
22272
|
+
_a124 = entityKind;
|
22200
22273
|
Check = class {
|
22201
22274
|
constructor(table4, builder) {
|
22202
22275
|
__publicField(this, "name");
|
@@ -22206,7 +22279,7 @@ var init_checks = __esm({
|
|
22206
22279
|
this.value = builder.value;
|
22207
22280
|
}
|
22208
22281
|
};
|
22209
|
-
__publicField(Check,
|
22282
|
+
__publicField(Check, _a124, "PgCheck");
|
22210
22283
|
}
|
22211
22284
|
});
|
22212
22285
|
|
@@ -22253,7 +22326,7 @@ var init_columns = __esm({
|
|
22253
22326
|
});
|
22254
22327
|
|
22255
22328
|
// ../drizzle-orm/dist/pg-core/query-builders/delete.js
|
22256
|
-
var
|
22329
|
+
var _a125, _b97, PgDeleteBase;
|
22257
22330
|
var init_delete = __esm({
|
22258
22331
|
"../drizzle-orm/dist/pg-core/query-builders/delete.js"() {
|
22259
22332
|
"use strict";
|
@@ -22262,8 +22335,8 @@ var init_delete = __esm({
|
|
22262
22335
|
init_table();
|
22263
22336
|
init_tracing();
|
22264
22337
|
init_utils2();
|
22265
|
-
PgDeleteBase = class extends (_b97 = QueryPromise,
|
22266
|
-
constructor(table4, session,
|
22338
|
+
PgDeleteBase = class extends (_b97 = QueryPromise, _a125 = entityKind, _b97) {
|
22339
|
+
constructor(table4, session, dialect4, withList) {
|
22267
22340
|
super();
|
22268
22341
|
__publicField(this, "config");
|
22269
22342
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -22272,7 +22345,7 @@ var init_delete = __esm({
|
|
22272
22345
|
});
|
22273
22346
|
});
|
22274
22347
|
this.session = session;
|
22275
|
-
this.dialect =
|
22348
|
+
this.dialect = dialect4;
|
22276
22349
|
this.config = { table: table4, withList };
|
22277
22350
|
}
|
22278
22351
|
/**
|
@@ -22308,7 +22381,7 @@ var init_delete = __esm({
|
|
22308
22381
|
this.config.where = where;
|
22309
22382
|
return this;
|
22310
22383
|
}
|
22311
|
-
returning(fields = this.config.table[
|
22384
|
+
returning(fields = this.config.table[Table.Symbol.Columns]) {
|
22312
22385
|
this.config.returning = orderSelectedFields(fields);
|
22313
22386
|
return this;
|
22314
22387
|
}
|
@@ -22333,12 +22406,12 @@ var init_delete = __esm({
|
|
22333
22406
|
return this;
|
22334
22407
|
}
|
22335
22408
|
};
|
22336
|
-
__publicField(PgDeleteBase,
|
22409
|
+
__publicField(PgDeleteBase, _a125, "PgDelete");
|
22337
22410
|
}
|
22338
22411
|
});
|
22339
22412
|
|
22340
22413
|
// ../drizzle-orm/dist/pg-core/query-builders/insert.js
|
22341
|
-
var
|
22414
|
+
var _a126, PgInsertBuilder, _a127, _b98, PgInsertBase;
|
22342
22415
|
var init_insert = __esm({
|
22343
22416
|
"../drizzle-orm/dist/pg-core/query-builders/insert.js"() {
|
22344
22417
|
"use strict";
|
@@ -22348,12 +22421,12 @@ var init_insert = __esm({
|
|
22348
22421
|
init_table();
|
22349
22422
|
init_tracing();
|
22350
22423
|
init_utils2();
|
22351
|
-
|
22424
|
+
_a126 = entityKind;
|
22352
22425
|
PgInsertBuilder = class {
|
22353
|
-
constructor(table4, session,
|
22426
|
+
constructor(table4, session, dialect4, withList) {
|
22354
22427
|
this.table = table4;
|
22355
22428
|
this.session = session;
|
22356
|
-
this.dialect =
|
22429
|
+
this.dialect = dialect4;
|
22357
22430
|
this.withList = withList;
|
22358
22431
|
}
|
22359
22432
|
values(values) {
|
@@ -22363,7 +22436,7 @@ var init_insert = __esm({
|
|
22363
22436
|
}
|
22364
22437
|
const mappedValues = values.map((entry) => {
|
22365
22438
|
const result = {};
|
22366
|
-
const cols = this.table[
|
22439
|
+
const cols = this.table[Table.Symbol.Columns];
|
22367
22440
|
for (const colKey of Object.keys(entry)) {
|
22368
22441
|
const colValue = entry[colKey];
|
22369
22442
|
result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
|
@@ -22373,9 +22446,9 @@ var init_insert = __esm({
|
|
22373
22446
|
return new PgInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList);
|
22374
22447
|
}
|
22375
22448
|
};
|
22376
|
-
__publicField(PgInsertBuilder,
|
22377
|
-
PgInsertBase = class extends (_b98 = QueryPromise,
|
22378
|
-
constructor(table4, values, session,
|
22449
|
+
__publicField(PgInsertBuilder, _a126, "PgInsertBuilder");
|
22450
|
+
PgInsertBase = class extends (_b98 = QueryPromise, _a127 = entityKind, _b98) {
|
22451
|
+
constructor(table4, values, session, dialect4, withList) {
|
22379
22452
|
super();
|
22380
22453
|
__publicField(this, "config");
|
22381
22454
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -22384,10 +22457,10 @@ var init_insert = __esm({
|
|
22384
22457
|
});
|
22385
22458
|
});
|
22386
22459
|
this.session = session;
|
22387
|
-
this.dialect =
|
22460
|
+
this.dialect = dialect4;
|
22388
22461
|
this.config = { table: table4, values, withList };
|
22389
22462
|
}
|
22390
|
-
returning(fields = this.config.table[
|
22463
|
+
returning(fields = this.config.table[Table.Symbol.Columns]) {
|
22391
22464
|
this.config.returning = orderSelectedFields(fields);
|
22392
22465
|
return this;
|
22393
22466
|
}
|
@@ -22489,69 +22562,7 @@ var init_insert = __esm({
|
|
22489
22562
|
return this;
|
22490
22563
|
}
|
22491
22564
|
};
|
22492
|
-
__publicField(PgInsertBase,
|
22493
|
-
}
|
22494
|
-
});
|
22495
|
-
|
22496
|
-
// ../drizzle-orm/dist/casing.js
|
22497
|
-
function toSnakeCase(input) {
|
22498
|
-
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
|
22499
|
-
return words.map((word) => word.toLowerCase()).join("_");
|
22500
|
-
}
|
22501
|
-
function toCamelCase(input) {
|
22502
|
-
const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
|
22503
|
-
return words.reduce((acc, word, i) => {
|
22504
|
-
const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;
|
22505
|
-
return acc + formattedWord;
|
22506
|
-
}, "");
|
22507
|
-
}
|
22508
|
-
function noopCase(input) {
|
22509
|
-
return input;
|
22510
|
-
}
|
22511
|
-
var _a127, CasingCache;
|
22512
|
-
var init_casing = __esm({
|
22513
|
-
"../drizzle-orm/dist/casing.js"() {
|
22514
|
-
"use strict";
|
22515
|
-
init_entity();
|
22516
|
-
init_table();
|
22517
|
-
_a127 = entityKind;
|
22518
|
-
CasingCache = class {
|
22519
|
-
constructor(casing2) {
|
22520
|
-
/** @internal */
|
22521
|
-
__publicField(this, "cache", {});
|
22522
|
-
__publicField(this, "cachedTables", {});
|
22523
|
-
__publicField(this, "convert");
|
22524
|
-
this.convert = casing2 === "snake_case" ? toSnakeCase : casing2 === "camelCase" ? toCamelCase : noopCase;
|
22525
|
-
}
|
22526
|
-
getColumnCasing(column4) {
|
22527
|
-
if (!column4.keyAsName)
|
22528
|
-
return column4.name;
|
22529
|
-
const schema4 = column4.table[Table2.Symbol.Schema] ?? "public";
|
22530
|
-
const tableName = column4.table[Table2.Symbol.OriginalName];
|
22531
|
-
const key = `${schema4}.${tableName}.${column4.name}`;
|
22532
|
-
if (!this.cache[key]) {
|
22533
|
-
this.cacheTable(column4.table);
|
22534
|
-
}
|
22535
|
-
return this.cache[key];
|
22536
|
-
}
|
22537
|
-
cacheTable(table4) {
|
22538
|
-
const schema4 = table4[Table2.Symbol.Schema] ?? "public";
|
22539
|
-
const tableName = table4[Table2.Symbol.OriginalName];
|
22540
|
-
const tableKey2 = `${schema4}.${tableName}`;
|
22541
|
-
if (!this.cachedTables[tableKey2]) {
|
22542
|
-
for (const column4 of Object.values(table4[Table2.Symbol.Columns])) {
|
22543
|
-
const columnKey = `${tableKey2}.${column4.name}`;
|
22544
|
-
this.cache[columnKey] = this.convert(column4.name);
|
22545
|
-
}
|
22546
|
-
this.cachedTables[tableKey2] = true;
|
22547
|
-
}
|
22548
|
-
}
|
22549
|
-
clearCache() {
|
22550
|
-
this.cache = {};
|
22551
|
-
this.cachedTables = {};
|
22552
|
-
}
|
22553
|
-
};
|
22554
|
-
__publicField(CasingCache, _a127, "CasingCache");
|
22565
|
+
__publicField(PgInsertBase, _a127, "PgInsert");
|
22555
22566
|
}
|
22556
22567
|
});
|
22557
22568
|
|
@@ -22653,7 +22664,7 @@ var init_dialect = __esm({
|
|
22653
22664
|
return sql`${withSql}delete from ${table4}${whereSql}${returningSql}`;
|
22654
22665
|
}
|
22655
22666
|
buildUpdateSet(table4, set) {
|
22656
|
-
const tableColumns = table4[
|
22667
|
+
const tableColumns = table4[Table.Symbol.Columns];
|
22657
22668
|
const columnNames = Object.keys(tableColumns).filter(
|
22658
22669
|
(colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
|
22659
22670
|
);
|
@@ -22744,7 +22755,7 @@ var init_dialect = __esm({
|
|
22744
22755
|
const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
|
22745
22756
|
for (const f of fieldsList) {
|
22746
22757
|
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(
|
22747
|
-
({ alias }) => alias === (table22[
|
22758
|
+
({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName])
|
22748
22759
|
))(f.field.table)) {
|
22749
22760
|
const tableName = getTableName(f.field.table);
|
22750
22761
|
throw new Error(
|
@@ -22760,12 +22771,12 @@ var init_dialect = __esm({
|
|
22760
22771
|
}
|
22761
22772
|
const selection = this.buildSelection(fieldsList, { isSingleTable });
|
22762
22773
|
const tableSql = (() => {
|
22763
|
-
if (is(table4,
|
22764
|
-
let fullName = sql`${sql.identifier(table4[
|
22765
|
-
if (table4[
|
22766
|
-
fullName = sql`${sql.identifier(table4[
|
22774
|
+
if (is(table4, Table) && table4[Table.Symbol.OriginalName] !== table4[Table.Symbol.Name]) {
|
22775
|
+
let fullName = sql`${sql.identifier(table4[Table.Symbol.OriginalName])}`;
|
22776
|
+
if (table4[Table.Symbol.Schema]) {
|
22777
|
+
fullName = sql`${sql.identifier(table4[Table.Symbol.Schema])}.${fullName}`;
|
22767
22778
|
}
|
22768
|
-
return sql`${fullName} ${sql.identifier(table4[
|
22779
|
+
return sql`${fullName} ${sql.identifier(table4[Table.Symbol.Name])}`;
|
22769
22780
|
}
|
22770
22781
|
return table4;
|
22771
22782
|
})();
|
@@ -22886,7 +22897,7 @@ var init_dialect = __esm({
|
|
22886
22897
|
}
|
22887
22898
|
buildInsertQuery({ table: table4, values, onConflict, returning, withList }) {
|
22888
22899
|
const valuesSqlList = [];
|
22889
|
-
const columns = table4[
|
22900
|
+
const columns = table4[Table.Symbol.Columns];
|
22890
22901
|
const colEntries = Object.entries(columns).filter(([_2, col]) => !col.shouldDisableInsert());
|
22891
22902
|
const insertOrder = colEntries.map(
|
22892
22903
|
([, column4]) => sql.identifier(this.casing.getColumnCasing(column4))
|
@@ -23844,7 +23855,7 @@ var init_select2 = __esm({
|
|
23844
23855
|
};
|
23845
23856
|
__publicField(PgSelectBuilder, _a132, "PgSelectBuilder");
|
23846
23857
|
PgSelectQueryBuilderBase = class extends (_b100 = TypedQueryBuilder, _a133 = entityKind, _b100) {
|
23847
|
-
constructor({ table: table4, fields, isPartialSelect, session, dialect:
|
23858
|
+
constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
|
23848
23859
|
super();
|
23849
23860
|
__publicField(this, "_");
|
23850
23861
|
__publicField(this, "config");
|
@@ -24160,7 +24171,7 @@ var init_select2 = __esm({
|
|
24160
24171
|
};
|
24161
24172
|
this.isPartialSelect = isPartialSelect;
|
24162
24173
|
this.session = session;
|
24163
|
-
this.dialect =
|
24174
|
+
this.dialect = dialect4;
|
24164
24175
|
this._ = {
|
24165
24176
|
selectedFields: fields
|
24166
24177
|
};
|
@@ -24181,7 +24192,7 @@ var init_select2 = __esm({
|
|
24181
24192
|
};
|
24182
24193
|
}
|
24183
24194
|
if (typeof tableName === "string" && !is(table4, SQL)) {
|
24184
|
-
const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[
|
24195
|
+
const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table.Symbol.Columns];
|
24185
24196
|
this.config.fields[tableName] = selection;
|
24186
24197
|
}
|
24187
24198
|
}
|
@@ -24455,13 +24466,13 @@ var init_select2 = __esm({
|
|
24455
24466
|
}
|
24456
24467
|
/** @internal */
|
24457
24468
|
_prepare(name2) {
|
24458
|
-
const { session, config, dialect:
|
24469
|
+
const { session, config, dialect: dialect4, joinsNotNullableMap } = this;
|
24459
24470
|
if (!session) {
|
24460
24471
|
throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");
|
24461
24472
|
}
|
24462
24473
|
return tracer.startActiveSpan("drizzle.prepareQuery", () => {
|
24463
24474
|
const fieldsList = orderSelectedFields(config.fields);
|
24464
|
-
const query = session.prepareQuery(
|
24475
|
+
const query = session.prepareQuery(dialect4.sqlToQuery(this.getSQL()), fieldsList, name2, true);
|
24465
24476
|
query.joinsNotNullableMap = joinsNotNullableMap;
|
24466
24477
|
return query;
|
24467
24478
|
});
|
@@ -24508,11 +24519,11 @@ var init_query_builder2 = __esm({
|
|
24508
24519
|
init_select2();
|
24509
24520
|
_a135 = entityKind;
|
24510
24521
|
QueryBuilder = class {
|
24511
|
-
constructor(
|
24522
|
+
constructor(dialect4) {
|
24512
24523
|
__publicField(this, "dialect");
|
24513
24524
|
__publicField(this, "dialectConfig");
|
24514
|
-
this.dialect = is(
|
24515
|
-
this.dialectConfig = is(
|
24525
|
+
this.dialect = is(dialect4, PgDialect) ? dialect4 : void 0;
|
24526
|
+
this.dialectConfig = is(dialect4, PgDialect) ? void 0 : dialect4;
|
24516
24527
|
}
|
24517
24528
|
$with(alias) {
|
24518
24529
|
const queryBuilder = this;
|
@@ -24600,7 +24611,7 @@ var init_refresh_materialized_view = __esm({
|
|
24600
24611
|
init_query_promise();
|
24601
24612
|
init_tracing();
|
24602
24613
|
PgRefreshMaterializedView = class extends (_b102 = QueryPromise, _a136 = entityKind, _b102) {
|
24603
|
-
constructor(view, session,
|
24614
|
+
constructor(view, session, dialect4) {
|
24604
24615
|
super();
|
24605
24616
|
__publicField(this, "config");
|
24606
24617
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -24609,7 +24620,7 @@ var init_refresh_materialized_view = __esm({
|
|
24609
24620
|
});
|
24610
24621
|
});
|
24611
24622
|
this.session = session;
|
24612
|
-
this.dialect =
|
24623
|
+
this.dialect = dialect4;
|
24613
24624
|
this.config = { view };
|
24614
24625
|
}
|
24615
24626
|
concurrently() {
|
@@ -24666,10 +24677,10 @@ var init_update = __esm({
|
|
24666
24677
|
init_utils2();
|
24667
24678
|
_a137 = entityKind;
|
24668
24679
|
PgUpdateBuilder = class {
|
24669
|
-
constructor(table4, session,
|
24680
|
+
constructor(table4, session, dialect4, withList) {
|
24670
24681
|
this.table = table4;
|
24671
24682
|
this.session = session;
|
24672
|
-
this.dialect =
|
24683
|
+
this.dialect = dialect4;
|
24673
24684
|
this.withList = withList;
|
24674
24685
|
}
|
24675
24686
|
set(values) {
|
@@ -24684,14 +24695,14 @@ var init_update = __esm({
|
|
24684
24695
|
};
|
24685
24696
|
__publicField(PgUpdateBuilder, _a137, "PgUpdateBuilder");
|
24686
24697
|
PgUpdateBase = class extends (_b103 = QueryPromise, _a138 = entityKind, _b103) {
|
24687
|
-
constructor(table4, set, session,
|
24698
|
+
constructor(table4, set, session, dialect4, withList) {
|
24688
24699
|
super();
|
24689
24700
|
__publicField(this, "config");
|
24690
24701
|
__publicField(this, "execute", (placeholderValues) => {
|
24691
24702
|
return this._prepare().execute(placeholderValues);
|
24692
24703
|
});
|
24693
24704
|
this.session = session;
|
24694
|
-
this.dialect =
|
24705
|
+
this.dialect = dialect4;
|
24695
24706
|
this.config = { set, table: table4, withList };
|
24696
24707
|
}
|
24697
24708
|
/**
|
@@ -24731,7 +24742,7 @@ var init_update = __esm({
|
|
24731
24742
|
this.config.where = where;
|
24732
24743
|
return this;
|
24733
24744
|
}
|
24734
|
-
returning(fields = this.config.table[
|
24745
|
+
returning(fields = this.config.table[Table.Symbol.Columns]) {
|
24735
24746
|
this.config.returning = orderSelectedFields(fields);
|
24736
24747
|
return this;
|
24737
24748
|
}
|
@@ -24837,13 +24848,13 @@ var init_query = __esm({
|
|
24837
24848
|
init_tracing();
|
24838
24849
|
_a140 = entityKind;
|
24839
24850
|
RelationalQueryBuilder = class {
|
24840
|
-
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig,
|
24851
|
+
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
|
24841
24852
|
this.fullSchema = fullSchema;
|
24842
24853
|
this.schema = schema4;
|
24843
24854
|
this.tableNamesMap = tableNamesMap;
|
24844
24855
|
this.table = table4;
|
24845
24856
|
this.tableConfig = tableConfig;
|
24846
|
-
this.dialect =
|
24857
|
+
this.dialect = dialect4;
|
24847
24858
|
this.session = session;
|
24848
24859
|
}
|
24849
24860
|
findMany(config) {
|
@@ -24875,14 +24886,14 @@ var init_query = __esm({
|
|
24875
24886
|
};
|
24876
24887
|
__publicField(RelationalQueryBuilder, _a140, "PgRelationalQueryBuilder");
|
24877
24888
|
PgRelationalQuery = class extends (_b105 = QueryPromise, _a141 = entityKind, _b105) {
|
24878
|
-
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig,
|
24889
|
+
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
|
24879
24890
|
super();
|
24880
24891
|
this.fullSchema = fullSchema;
|
24881
24892
|
this.schema = schema4;
|
24882
24893
|
this.tableNamesMap = tableNamesMap;
|
24883
24894
|
this.table = table4;
|
24884
24895
|
this.tableConfig = tableConfig;
|
24885
|
-
this.dialect =
|
24896
|
+
this.dialect = dialect4;
|
24886
24897
|
this.session = session;
|
24887
24898
|
this.config = config;
|
24888
24899
|
this.mode = mode;
|
@@ -24997,9 +25008,9 @@ var init_db = __esm({
|
|
24997
25008
|
init_refresh_materialized_view();
|
24998
25009
|
_a143 = entityKind;
|
24999
25010
|
PgDatabase = class {
|
25000
|
-
constructor(
|
25011
|
+
constructor(dialect4, session, schema4) {
|
25001
25012
|
__publicField(this, "query");
|
25002
|
-
this.dialect =
|
25013
|
+
this.dialect = dialect4;
|
25003
25014
|
this.session = session;
|
25004
25015
|
this._ = schema4 ? {
|
25005
25016
|
schema: schema4.schema,
|
@@ -25021,7 +25032,7 @@ var init_db = __esm({
|
|
25021
25032
|
this._.tableNamesMap,
|
25022
25033
|
schema4.fullSchema[tableName],
|
25023
25034
|
columns,
|
25024
|
-
|
25035
|
+
dialect4,
|
25025
25036
|
session
|
25026
25037
|
);
|
25027
25038
|
}
|
@@ -25289,7 +25300,7 @@ var init_indexes = __esm({
|
|
25289
25300
|
return it;
|
25290
25301
|
}
|
25291
25302
|
it = it;
|
25292
|
-
const clonedIndexedColumn = new IndexedColumn(it.name, it.columnType, it.indexConfig);
|
25303
|
+
const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
|
25293
25304
|
it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
|
25294
25305
|
return clonedIndexedColumn;
|
25295
25306
|
}),
|
@@ -25305,7 +25316,7 @@ var init_indexes = __esm({
|
|
25305
25316
|
return it;
|
25306
25317
|
}
|
25307
25318
|
it = it;
|
25308
|
-
const clonedIndexedColumn = new IndexedColumn(it.name, it.columnType, it.indexConfig);
|
25319
|
+
const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
|
25309
25320
|
it.indexConfig = it.defaultConfig;
|
25310
25321
|
return clonedIndexedColumn;
|
25311
25322
|
}),
|
@@ -25332,7 +25343,7 @@ var init_indexes = __esm({
|
|
25332
25343
|
return it;
|
25333
25344
|
}
|
25334
25345
|
it = it;
|
25335
|
-
const clonedIndexedColumn = new IndexedColumn(it.name, it.columnType, it.indexConfig);
|
25346
|
+
const clonedIndexedColumn = new IndexedColumn(it.name, !!it.keyAsName, it.columnType, it.indexConfig);
|
25336
25347
|
it.indexConfig = JSON.parse(JSON.stringify(it.defaultConfig));
|
25337
25348
|
return clonedIndexedColumn;
|
25338
25349
|
}),
|
@@ -25730,8 +25741,8 @@ var init_session = __esm({
|
|
25730
25741
|
__publicField(PgPreparedQuery, _a157, "PgPreparedQuery");
|
25731
25742
|
_a158 = entityKind;
|
25732
25743
|
PgSession = class {
|
25733
|
-
constructor(
|
25734
|
-
this.dialect =
|
25744
|
+
constructor(dialect4) {
|
25745
|
+
this.dialect = dialect4;
|
25735
25746
|
}
|
25736
25747
|
execute(query) {
|
25737
25748
|
return tracer.startActiveSpan("drizzle.operation", () => {
|
@@ -25763,8 +25774,8 @@ var init_session = __esm({
|
|
25763
25774
|
};
|
25764
25775
|
__publicField(PgSession, _a158, "PgSession");
|
25765
25776
|
PgTransaction = class extends (_b113 = PgDatabase, _a159 = entityKind, _b113) {
|
25766
|
-
constructor(
|
25767
|
-
super(
|
25777
|
+
constructor(dialect4, session, schema4, nestedIndex = 0) {
|
25778
|
+
super(dialect4, session, schema4);
|
25768
25779
|
this.schema = schema4;
|
25769
25780
|
this.nestedIndex = nestedIndex;
|
25770
25781
|
}
|
@@ -25802,17 +25813,17 @@ var init_subquery2 = __esm({
|
|
25802
25813
|
|
25803
25814
|
// ../drizzle-orm/dist/pg-core/utils.js
|
25804
25815
|
function getTableConfig(table4) {
|
25805
|
-
const columns = Object.values(table4[
|
25816
|
+
const columns = Object.values(table4[Table.Symbol.Columns]);
|
25806
25817
|
const indexes = [];
|
25807
25818
|
const checks = [];
|
25808
25819
|
const primaryKeys = [];
|
25809
25820
|
const foreignKeys = Object.values(table4[PgTable.Symbol.InlineForeignKeys]);
|
25810
25821
|
const uniqueConstraints = [];
|
25811
|
-
const name2 = table4[
|
25812
|
-
const schema4 = table4[
|
25822
|
+
const name2 = table4[Table.Symbol.Name];
|
25823
|
+
const schema4 = table4[Table.Symbol.Schema];
|
25813
25824
|
const extraConfigBuilder = table4[PgTable.Symbol.ExtraConfigBuilder];
|
25814
25825
|
if (extraConfigBuilder !== void 0) {
|
25815
|
-
const extraConfig = extraConfigBuilder(table4[
|
25826
|
+
const extraConfig = extraConfigBuilder(table4[Table.Symbol.ExtraConfigColumns]);
|
25816
25827
|
for (const builder of Object.values(extraConfig)) {
|
25817
25828
|
if (is(builder, IndexBuilder)) {
|
25818
25829
|
indexes.push(builder.build(table4));
|
@@ -25923,7 +25934,7 @@ function buildArrayString(array, sqlType) {
|
|
25923
25934
|
}).join(",");
|
25924
25935
|
return `{${values}}`;
|
25925
25936
|
}
|
25926
|
-
var
|
25937
|
+
var indexName, generatePgSnapshot, trimChar, fromDatabase, defaultForColumn;
|
25927
25938
|
var init_pgSerializer = __esm({
|
25928
25939
|
"src/serializer/pgSerializer.ts"() {
|
25929
25940
|
"use strict";
|
@@ -25935,11 +25946,11 @@ var init_pgSerializer = __esm({
|
|
25935
25946
|
init_outputs();
|
25936
25947
|
init_utils();
|
25937
25948
|
init_serializer();
|
25938
|
-
dialect4 = new PgDialect();
|
25939
25949
|
indexName = (tableName, columns) => {
|
25940
25950
|
return `${tableName}_${columns.join("_")}_index`;
|
25941
25951
|
};
|
25942
|
-
generatePgSnapshot = (tables, enums, schemas, sequences, schemaFilter) => {
|
25952
|
+
generatePgSnapshot = (tables, enums, schemas, sequences, casing2, schemaFilter) => {
|
25953
|
+
const dialect4 = new PgDialect({ casing: casing2 });
|
25943
25954
|
const result = {};
|
25944
25955
|
const sequencesToReturn = {};
|
25945
25956
|
const indexesInSchema = {};
|
@@ -25963,6 +25974,7 @@ var init_pgSerializer = __esm({
|
|
25963
25974
|
const primaryKeysObject = {};
|
25964
25975
|
const uniqueConstraintObject = {};
|
25965
25976
|
columns.forEach((column4) => {
|
25977
|
+
const name2 = getColumnCasing(column4, casing2);
|
25966
25978
|
const notNull = column4.notNull;
|
25967
25979
|
const primaryKey = column4.primary;
|
25968
25980
|
const sqlTypeLowered = column4.getSQLType().toLowerCase();
|
@@ -25975,7 +25987,7 @@ var init_pgSerializer = __esm({
|
|
25975
25987
|
const startWith = stringFromIdentityProperty(identity?.sequenceOptions?.startWith) ?? (parseFloat(increment) < 0 ? maxValue : minValue);
|
25976
25988
|
const cache = stringFromIdentityProperty(identity?.sequenceOptions?.cache) ?? "1";
|
25977
25989
|
const columnToSet = {
|
25978
|
-
name:
|
25990
|
+
name: name2,
|
25979
25991
|
type: column4.getSQLType(),
|
25980
25992
|
typeSchema,
|
25981
25993
|
primaryKey,
|
@@ -25986,7 +25998,7 @@ var init_pgSerializer = __esm({
|
|
25986
25998
|
} : void 0,
|
25987
25999
|
identity: identity ? {
|
25988
26000
|
type: identity.type,
|
25989
|
-
name: identity.sequenceName ?? `${tableName}_${
|
26001
|
+
name: identity.sequenceName ?? `${tableName}_${name2}_seq`,
|
25990
26002
|
schema: schema4 ?? "public",
|
25991
26003
|
increment,
|
25992
26004
|
startWith,
|
@@ -26007,7 +26019,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
26007
26019
|
The unique constraint ${source_default.underline.blue(
|
26008
26020
|
column4.uniqueName
|
26009
26021
|
)} on the ${source_default.underline.blue(
|
26010
|
-
|
26022
|
+
name2
|
26011
26023
|
)} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
|
26012
26024
|
existingUnique.columns.join(",")
|
26013
26025
|
)} columns
|
@@ -26023,7 +26035,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
26023
26035
|
}
|
26024
26036
|
if (column4.default !== void 0) {
|
26025
26037
|
if (is(column4.default, SQL)) {
|
26026
|
-
columnToSet.default = sqlToStr(column4.default);
|
26038
|
+
columnToSet.default = sqlToStr(column4.default, casing2);
|
26027
26039
|
} else {
|
26028
26040
|
if (typeof column4.default === "string") {
|
26029
26041
|
columnToSet.default = `'${column4.default}'`;
|
@@ -26051,17 +26063,24 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
26051
26063
|
}
|
26052
26064
|
}
|
26053
26065
|
}
|
26054
|
-
columnsObject[
|
26066
|
+
columnsObject[name2] = columnToSet;
|
26055
26067
|
});
|
26056
26068
|
primaryKeys.map((pk) => {
|
26057
|
-
const
|
26058
|
-
|
26059
|
-
|
26069
|
+
const originalColumnNames = pk.columns.map((c) => c.name);
|
26070
|
+
const columnNames = pk.columns.map((c) => getColumnCasing(c, casing2));
|
26071
|
+
let name2 = pk.getName();
|
26072
|
+
if (casing2 !== void 0) {
|
26073
|
+
for (let i = 0; i < originalColumnNames.length; i++) {
|
26074
|
+
name2 = name2.replace(originalColumnNames[i], columnNames[i]);
|
26075
|
+
}
|
26076
|
+
}
|
26077
|
+
primaryKeysObject[name2] = {
|
26078
|
+
name: name2,
|
26060
26079
|
columns: columnNames
|
26061
26080
|
};
|
26062
26081
|
});
|
26063
26082
|
uniqueConstraints?.map((unq) => {
|
26064
|
-
const columnNames = unq.columns.map((c) => c
|
26083
|
+
const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
|
26065
26084
|
const name2 = unq.name ?? uniqueKeyName(table4, columnNames);
|
26066
26085
|
const existingUnique = uniqueConstraintObject[name2];
|
26067
26086
|
if (typeof existingUnique !== "undefined") {
|
@@ -26088,15 +26107,25 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
26088
26107
|
};
|
26089
26108
|
});
|
26090
26109
|
const fks = foreignKeys.map((fk4) => {
|
26091
|
-
const name2 = fk4.getName();
|
26092
26110
|
const tableFrom = tableName;
|
26093
26111
|
const onDelete = fk4.onDelete;
|
26094
26112
|
const onUpdate = fk4.onUpdate;
|
26095
26113
|
const reference = fk4.reference();
|
26096
26114
|
const tableTo = getTableName(reference.foreignTable);
|
26097
26115
|
const schemaTo = getTableConfig(reference.foreignTable).schema;
|
26098
|
-
const
|
26099
|
-
const
|
26116
|
+
const originalColumnsFrom = reference.columns.map((it) => it.name);
|
26117
|
+
const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
|
26118
|
+
const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
|
26119
|
+
const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
|
26120
|
+
let name2 = fk4.getName();
|
26121
|
+
if (casing2 !== void 0) {
|
26122
|
+
for (let i = 0; i < originalColumnsFrom.length; i++) {
|
26123
|
+
name2 = name2.replace(originalColumnsFrom[i], columnsFrom[i]);
|
26124
|
+
}
|
26125
|
+
for (let i = 0; i < originalColumnsTo.length; i++) {
|
26126
|
+
name2 = name2.replace(originalColumnsTo[i], columnsTo[i]);
|
26127
|
+
}
|
26128
|
+
}
|
26100
26129
|
return {
|
26101
26130
|
name: name2,
|
26102
26131
|
tableFrom,
|
@@ -26129,12 +26158,13 @@ ${withStyle.errorWarning(
|
|
26129
26158
|
}
|
26130
26159
|
}
|
26131
26160
|
it = it;
|
26161
|
+
const name3 = getColumnCasing(it, casing2);
|
26132
26162
|
if (!is(it, SQL) && it.type === "PgVector" && typeof it.indexConfig.opClass === "undefined") {
|
26133
26163
|
console.log(
|
26134
26164
|
`
|
26135
26165
|
${withStyle.errorWarning(
|
26136
26166
|
`You are specifying an index on the ${source_default.blueBright(
|
26137
|
-
|
26167
|
+
name3
|
26138
26168
|
)} column inside the ${source_default.blueBright(
|
26139
26169
|
tableName
|
26140
26170
|
)} table with the ${source_default.blueBright(
|
@@ -26144,7 +26174,7 @@ ${withStyle.errorWarning(
|
|
26144
26174
|
)}].
|
26145
26175
|
|
26146
26176
|
You can specify it using current syntax: ${source_default.underline(
|
26147
|
-
`index("${value.config.name}").using("${value.config.method}", table.${
|
26177
|
+
`index("${value.config.name}").using("${value.config.method}", table.${name3}.op("${vectorOps[0]}"))`
|
26148
26178
|
)}
|
26149
26179
|
|
26150
26180
|
You can check the "pg_vector" docs for more info: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing
|
@@ -26153,7 +26183,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
|
|
26153
26183
|
);
|
26154
26184
|
process.exit(1);
|
26155
26185
|
}
|
26156
|
-
indexColumnNames.push(
|
26186
|
+
indexColumnNames.push(name3);
|
26157
26187
|
});
|
26158
26188
|
const name2 = value.config.name ? value.config.name : indexName(tableName, indexColumnNames);
|
26159
26189
|
let indexColumns = columns2.map(
|
@@ -26168,7 +26198,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
|
|
26168
26198
|
} else {
|
26169
26199
|
it = it;
|
26170
26200
|
return {
|
26171
|
-
expression: it
|
26201
|
+
expression: getColumnCasing(it, casing2),
|
26172
26202
|
isExpression: false,
|
26173
26203
|
asc: it.indexConfig?.order === "asc",
|
26174
26204
|
nulls: it.indexConfig?.nulls ? it.indexConfig?.nulls : it.indexConfig?.order === "desc" ? "first" : "last",
|
@@ -27564,8 +27594,8 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
|
|
27564
27594
|
})
|
27565
27595
|
);
|
27566
27596
|
const table4 = Object.assign(rawTable, builtColumns);
|
27567
|
-
table4[
|
27568
|
-
table4[
|
27597
|
+
table4[Table.Symbol.Columns] = builtColumns;
|
27598
|
+
table4[Table.Symbol.ExtraConfigColumns] = builtColumns;
|
27569
27599
|
if (extraConfig) {
|
27570
27600
|
table4[SQLiteTable.Symbol.ExtraConfigBuilder] = extraConfig;
|
27571
27601
|
}
|
@@ -27579,7 +27609,7 @@ var init_table3 = __esm({
|
|
27579
27609
|
init_table();
|
27580
27610
|
init_all2();
|
27581
27611
|
InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
27582
|
-
SQLiteTable = class extends (_e2 =
|
27612
|
+
SQLiteTable = class extends (_e2 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a193 = Table.Symbol.ExtraConfigBuilder, _e2) {
|
27583
27613
|
constructor() {
|
27584
27614
|
super(...arguments);
|
27585
27615
|
/** @internal */
|
@@ -27592,7 +27622,7 @@ var init_table3 = __esm({
|
|
27592
27622
|
};
|
27593
27623
|
__publicField(SQLiteTable, _d3, "SQLiteTable");
|
27594
27624
|
/** @internal */
|
27595
|
-
__publicField(SQLiteTable, "Symbol", Object.assign({},
|
27625
|
+
__publicField(SQLiteTable, "Symbol", Object.assign({}, Table.Symbol, {
|
27596
27626
|
InlineForeignKeys: InlineForeignKeys2
|
27597
27627
|
}));
|
27598
27628
|
sqliteTable = (name2, columns, extraConfig) => {
|
@@ -27611,7 +27641,7 @@ var init_delete2 = __esm({
|
|
27611
27641
|
init_table3();
|
27612
27642
|
init_utils2();
|
27613
27643
|
SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a194 = entityKind, _b141) {
|
27614
|
-
constructor(table4, session,
|
27644
|
+
constructor(table4, session, dialect4, withList) {
|
27615
27645
|
super();
|
27616
27646
|
/** @internal */
|
27617
27647
|
__publicField(this, "config");
|
@@ -27629,7 +27659,7 @@ var init_delete2 = __esm({
|
|
27629
27659
|
});
|
27630
27660
|
this.table = table4;
|
27631
27661
|
this.session = session;
|
27632
|
-
this.dialect =
|
27662
|
+
this.dialect = dialect4;
|
27633
27663
|
this.config = { table: table4, withList };
|
27634
27664
|
}
|
27635
27665
|
/**
|
@@ -27713,10 +27743,10 @@ var init_insert2 = __esm({
|
|
27713
27743
|
init_utils2();
|
27714
27744
|
_a195 = entityKind;
|
27715
27745
|
SQLiteInsertBuilder = class {
|
27716
|
-
constructor(table4, session,
|
27746
|
+
constructor(table4, session, dialect4, withList) {
|
27717
27747
|
this.table = table4;
|
27718
27748
|
this.session = session;
|
27719
|
-
this.dialect =
|
27749
|
+
this.dialect = dialect4;
|
27720
27750
|
this.withList = withList;
|
27721
27751
|
}
|
27722
27752
|
values(values) {
|
@@ -27726,7 +27756,7 @@ var init_insert2 = __esm({
|
|
27726
27756
|
}
|
27727
27757
|
const mappedValues = values.map((entry) => {
|
27728
27758
|
const result = {};
|
27729
|
-
const cols = this.table[
|
27759
|
+
const cols = this.table[Table.Symbol.Columns];
|
27730
27760
|
for (const colKey of Object.keys(entry)) {
|
27731
27761
|
const colValue = entry[colKey];
|
27732
27762
|
result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
|
@@ -27738,7 +27768,7 @@ var init_insert2 = __esm({
|
|
27738
27768
|
};
|
27739
27769
|
__publicField(SQLiteInsertBuilder, _a195, "SQLiteInsertBuilder");
|
27740
27770
|
SQLiteInsertBase = class extends (_b142 = QueryPromise, _a196 = entityKind, _b142) {
|
27741
|
-
constructor(table4, values, session,
|
27771
|
+
constructor(table4, values, session, dialect4, withList) {
|
27742
27772
|
super();
|
27743
27773
|
/** @internal */
|
27744
27774
|
__publicField(this, "config");
|
@@ -27755,7 +27785,7 @@ var init_insert2 = __esm({
|
|
27755
27785
|
return this._prepare().values(placeholderValues);
|
27756
27786
|
});
|
27757
27787
|
this.session = session;
|
27758
|
-
this.dialect =
|
27788
|
+
this.dialect = dialect4;
|
27759
27789
|
this.config = { table: table4, values, withList };
|
27760
27790
|
}
|
27761
27791
|
returning(fields = this.config.table[SQLiteTable.Symbol.Columns]) {
|
@@ -27937,7 +27967,7 @@ var init_dialect2 = __esm({
|
|
27937
27967
|
return sql`${withSql}delete from ${table4}${whereSql}${returningSql}`;
|
27938
27968
|
}
|
27939
27969
|
buildUpdateSet(table4, set) {
|
27940
|
-
const tableColumns = table4[
|
27970
|
+
const tableColumns = table4[Table.Symbol.Columns];
|
27941
27971
|
const columnNames = Object.keys(tableColumns).filter(
|
27942
27972
|
(colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
|
27943
27973
|
);
|
@@ -27996,7 +28026,7 @@ var init_dialect2 = __esm({
|
|
27996
28026
|
chunk.push(sql` as ${sql.identifier(field.fieldAlias)}`);
|
27997
28027
|
}
|
27998
28028
|
} else if (is(field, Column2)) {
|
27999
|
-
const tableName = field.table[
|
28029
|
+
const tableName = field.table[Table.Symbol.Name];
|
28000
28030
|
if (isSingleTable) {
|
28001
28031
|
chunk.push(sql.identifier(this.casing.getColumnCasing(field)));
|
28002
28032
|
} else {
|
@@ -28028,7 +28058,7 @@ var init_dialect2 = __esm({
|
|
28028
28058
|
const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
|
28029
28059
|
for (const f of fieldsList) {
|
28030
28060
|
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(
|
28031
|
-
({ alias }) => alias === (table22[
|
28061
|
+
({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName])
|
28032
28062
|
))(f.field.table)) {
|
28033
28063
|
const tableName = getTableName(f.field.table);
|
28034
28064
|
throw new Error(
|
@@ -28041,8 +28071,8 @@ var init_dialect2 = __esm({
|
|
28041
28071
|
const distinctSql = distinct ? sql` distinct` : void 0;
|
28042
28072
|
const selection = this.buildSelection(fieldsList, { isSingleTable });
|
28043
28073
|
const tableSql = (() => {
|
28044
|
-
if (is(table4,
|
28045
|
-
return sql`${sql.identifier(table4[
|
28074
|
+
if (is(table4, Table) && table4[Table.Symbol.OriginalName] !== table4[Table.Symbol.Name]) {
|
28075
|
+
return sql`${sql.identifier(table4[Table.Symbol.OriginalName])} ${sql.identifier(table4[Table.Symbol.Name])}`;
|
28046
28076
|
}
|
28047
28077
|
return table4;
|
28048
28078
|
})();
|
@@ -28148,7 +28178,7 @@ var init_dialect2 = __esm({
|
|
28148
28178
|
}
|
28149
28179
|
buildInsertQuery({ table: table4, values, onConflict, returning, withList }) {
|
28150
28180
|
const valuesSqlList = [];
|
28151
|
-
const columns = table4[
|
28181
|
+
const columns = table4[Table.Symbol.Columns];
|
28152
28182
|
const colEntries = Object.entries(columns).filter(
|
28153
28183
|
([_2, col]) => !col.shouldDisableInsert()
|
28154
28184
|
);
|
@@ -28557,7 +28587,7 @@ var init_select3 = __esm({
|
|
28557
28587
|
};
|
28558
28588
|
__publicField(SQLiteSelectBuilder, _a201, "SQLiteSelectBuilder");
|
28559
28589
|
SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a202 = entityKind, _b146) {
|
28560
|
-
constructor({ table: table4, fields, isPartialSelect, session, dialect:
|
28590
|
+
constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
|
28561
28591
|
super();
|
28562
28592
|
__publicField(this, "_");
|
28563
28593
|
/** @internal */
|
@@ -28792,7 +28822,7 @@ var init_select3 = __esm({
|
|
28792
28822
|
};
|
28793
28823
|
this.isPartialSelect = isPartialSelect;
|
28794
28824
|
this.session = session;
|
28795
|
-
this.dialect =
|
28825
|
+
this.dialect = dialect4;
|
28796
28826
|
this._ = {
|
28797
28827
|
selectedFields: fields
|
28798
28828
|
};
|
@@ -28813,7 +28843,7 @@ var init_select3 = __esm({
|
|
28813
28843
|
};
|
28814
28844
|
}
|
28815
28845
|
if (typeof tableName === "string" && !is(table4, SQL)) {
|
28816
|
-
const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[
|
28846
|
+
const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table.Symbol.Columns];
|
28817
28847
|
this.config.fields[tableName] = selection;
|
28818
28848
|
}
|
28819
28849
|
}
|
@@ -29127,11 +29157,11 @@ var init_query_builder3 = __esm({
|
|
29127
29157
|
init_select3();
|
29128
29158
|
_a204 = entityKind;
|
29129
29159
|
QueryBuilder2 = class {
|
29130
|
-
constructor(
|
29160
|
+
constructor(dialect4) {
|
29131
29161
|
__publicField(this, "dialect");
|
29132
29162
|
__publicField(this, "dialectConfig");
|
29133
|
-
this.dialect = is(
|
29134
|
-
this.dialectConfig = is(
|
29163
|
+
this.dialect = is(dialect4, SQLiteDialect) ? dialect4 : void 0;
|
29164
|
+
this.dialectConfig = is(dialect4, SQLiteDialect) ? void 0 : dialect4;
|
29135
29165
|
}
|
29136
29166
|
$with(alias) {
|
29137
29167
|
const queryBuilder = this;
|
@@ -29209,10 +29239,10 @@ var init_update2 = __esm({
|
|
29209
29239
|
init_utils2();
|
29210
29240
|
_a205 = entityKind;
|
29211
29241
|
SQLiteUpdateBuilder = class {
|
29212
|
-
constructor(table4, session,
|
29242
|
+
constructor(table4, session, dialect4, withList) {
|
29213
29243
|
this.table = table4;
|
29214
29244
|
this.session = session;
|
29215
|
-
this.dialect =
|
29245
|
+
this.dialect = dialect4;
|
29216
29246
|
this.withList = withList;
|
29217
29247
|
}
|
29218
29248
|
set(values) {
|
@@ -29227,7 +29257,7 @@ var init_update2 = __esm({
|
|
29227
29257
|
};
|
29228
29258
|
__publicField(SQLiteUpdateBuilder, _a205, "SQLiteUpdateBuilder");
|
29229
29259
|
SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a206 = entityKind, _b148) {
|
29230
|
-
constructor(table4, set, session,
|
29260
|
+
constructor(table4, set, session, dialect4, withList) {
|
29231
29261
|
super();
|
29232
29262
|
/** @internal */
|
29233
29263
|
__publicField(this, "config");
|
@@ -29244,7 +29274,7 @@ var init_update2 = __esm({
|
|
29244
29274
|
return this._prepare().values(placeholderValues);
|
29245
29275
|
});
|
29246
29276
|
this.session = session;
|
29247
|
-
this.dialect =
|
29277
|
+
this.dialect = dialect4;
|
29248
29278
|
this.config = { set, table: table4, withList };
|
29249
29279
|
}
|
29250
29280
|
/**
|
@@ -29395,14 +29425,14 @@ var init_query2 = __esm({
|
|
29395
29425
|
init_relations();
|
29396
29426
|
_a208 = entityKind;
|
29397
29427
|
RelationalQueryBuilder2 = class {
|
29398
|
-
constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig,
|
29428
|
+
constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
|
29399
29429
|
this.mode = mode;
|
29400
29430
|
this.fullSchema = fullSchema;
|
29401
29431
|
this.schema = schema4;
|
29402
29432
|
this.tableNamesMap = tableNamesMap;
|
29403
29433
|
this.table = table4;
|
29404
29434
|
this.tableConfig = tableConfig;
|
29405
|
-
this.dialect =
|
29435
|
+
this.dialect = dialect4;
|
29406
29436
|
this.session = session;
|
29407
29437
|
}
|
29408
29438
|
findMany(config) {
|
@@ -29454,7 +29484,7 @@ var init_query2 = __esm({
|
|
29454
29484
|
};
|
29455
29485
|
__publicField(RelationalQueryBuilder2, _a208, "SQLiteAsyncRelationalQueryBuilder");
|
29456
29486
|
SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a209 = entityKind, _b150) {
|
29457
|
-
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig,
|
29487
|
+
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
|
29458
29488
|
super();
|
29459
29489
|
/** @internal */
|
29460
29490
|
__publicField(this, "mode");
|
@@ -29463,7 +29493,7 @@ var init_query2 = __esm({
|
|
29463
29493
|
this.tableNamesMap = tableNamesMap;
|
29464
29494
|
this.table = table4;
|
29465
29495
|
this.tableConfig = tableConfig;
|
29466
|
-
this.dialect =
|
29496
|
+
this.dialect = dialect4;
|
29467
29497
|
this.session = session;
|
29468
29498
|
this.config = config;
|
29469
29499
|
this.mode = mode;
|
@@ -29547,13 +29577,13 @@ var init_raw2 = __esm({
|
|
29547
29577
|
init_entity();
|
29548
29578
|
init_query_promise();
|
29549
29579
|
SQLiteRaw = class extends (_b152 = QueryPromise, _a211 = entityKind, _b152) {
|
29550
|
-
constructor(execute, getSQL, action,
|
29580
|
+
constructor(execute, getSQL, action, dialect4, mapBatchResult) {
|
29551
29581
|
super();
|
29552
29582
|
/** @internal */
|
29553
29583
|
__publicField(this, "config");
|
29554
29584
|
this.execute = execute;
|
29555
29585
|
this.getSQL = getSQL;
|
29556
|
-
this.dialect =
|
29586
|
+
this.dialect = dialect4;
|
29557
29587
|
this.mapBatchResult = mapBatchResult;
|
29558
29588
|
this.config = { action };
|
29559
29589
|
}
|
@@ -29590,10 +29620,10 @@ var init_db2 = __esm({
|
|
29590
29620
|
init_raw2();
|
29591
29621
|
_a212 = entityKind;
|
29592
29622
|
BaseSQLiteDatabase = class {
|
29593
|
-
constructor(resultKind,
|
29623
|
+
constructor(resultKind, dialect4, session, schema4) {
|
29594
29624
|
__publicField(this, "query");
|
29595
29625
|
this.resultKind = resultKind;
|
29596
|
-
this.dialect =
|
29626
|
+
this.dialect = dialect4;
|
29597
29627
|
this.session = session;
|
29598
29628
|
this._ = schema4 ? {
|
29599
29629
|
schema: schema4.schema,
|
@@ -29615,7 +29645,7 @@ var init_db2 = __esm({
|
|
29615
29645
|
this._.tableNamesMap,
|
29616
29646
|
schema4.fullSchema[tableName],
|
29617
29647
|
columns,
|
29618
|
-
|
29648
|
+
dialect4,
|
29619
29649
|
session
|
29620
29650
|
);
|
29621
29651
|
}
|
@@ -30033,8 +30063,8 @@ var init_session2 = __esm({
|
|
30033
30063
|
__publicField(SQLitePreparedQuery, _a219, "PreparedQuery");
|
30034
30064
|
_a220 = entityKind;
|
30035
30065
|
SQLiteSession = class {
|
30036
|
-
constructor(
|
30037
|
-
this.dialect =
|
30066
|
+
constructor(dialect4) {
|
30067
|
+
this.dialect = dialect4;
|
30038
30068
|
}
|
30039
30069
|
prepareOneTimeQuery(query, fields, executeMethod, isResponseInArrayMode) {
|
30040
30070
|
return this.prepareQuery(query, fields, executeMethod, isResponseInArrayMode);
|
@@ -30079,8 +30109,8 @@ var init_session2 = __esm({
|
|
30079
30109
|
};
|
30080
30110
|
__publicField(SQLiteSession, _a220, "SQLiteSession");
|
30081
30111
|
SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a221 = entityKind, _b154) {
|
30082
|
-
constructor(resultType,
|
30083
|
-
super(resultType,
|
30112
|
+
constructor(resultType, dialect4, session, schema4, nestedIndex = 0) {
|
30113
|
+
super(resultType, dialect4, session, schema4);
|
30084
30114
|
this.schema = schema4;
|
30085
30115
|
this.nestedIndex = nestedIndex;
|
30086
30116
|
}
|
@@ -30116,7 +30146,7 @@ function getTableConfig2(table4) {
|
|
30116
30146
|
const primaryKeys = [];
|
30117
30147
|
const uniqueConstraints = [];
|
30118
30148
|
const foreignKeys = Object.values(table4[SQLiteTable.Symbol.InlineForeignKeys]);
|
30119
|
-
const name2 = table4[
|
30149
|
+
const name2 = table4[Table.Symbol.Name];
|
30120
30150
|
const extraConfigBuilder = table4[SQLiteTable.Symbol.ExtraConfigBuilder];
|
30121
30151
|
if (extraConfigBuilder !== void 0) {
|
30122
30152
|
const extraConfig = extraConfigBuilder(table4[SQLiteTable.Symbol.Columns]);
|
@@ -30347,7 +30377,7 @@ function extractGeneratedColumns(input) {
|
|
30347
30377
|
}
|
30348
30378
|
return columns;
|
30349
30379
|
}
|
30350
|
-
var
|
30380
|
+
var generateSqliteSnapshot, fromDatabase2;
|
30351
30381
|
var init_sqliteSerializer = __esm({
|
30352
30382
|
"src/serializer/sqliteSerializer.ts"() {
|
30353
30383
|
"use strict";
|
@@ -30355,9 +30385,10 @@ var init_sqliteSerializer = __esm({
|
|
30355
30385
|
init_dist();
|
30356
30386
|
init_sqlite_core();
|
30357
30387
|
init_outputs();
|
30388
|
+
init_utils();
|
30358
30389
|
init_serializer();
|
30359
|
-
|
30360
|
-
|
30390
|
+
generateSqliteSnapshot = (tables, casing2) => {
|
30391
|
+
const dialect4 = new SQLiteSyncDialect({ casing: casing2 });
|
30361
30392
|
const result = {};
|
30362
30393
|
const internal = { indexes: {} };
|
30363
30394
|
for (const table4 of tables) {
|
@@ -30375,28 +30406,29 @@ var init_sqliteSerializer = __esm({
|
|
30375
30406
|
uniqueConstraints
|
30376
30407
|
} = getTableConfig2(table4);
|
30377
30408
|
columns.forEach((column4) => {
|
30409
|
+
const name2 = getColumnCasing(column4, casing2);
|
30378
30410
|
const notNull = column4.notNull;
|
30379
30411
|
const primaryKey = column4.primary;
|
30380
30412
|
const generated = column4.generated;
|
30381
30413
|
const columnToSet = {
|
30382
|
-
name:
|
30414
|
+
name: name2,
|
30383
30415
|
type: column4.getSQLType(),
|
30384
30416
|
primaryKey,
|
30385
30417
|
notNull,
|
30386
30418
|
autoincrement: is(column4, SQLiteBaseInteger) ? column4.autoIncrement : false,
|
30387
30419
|
generated: generated ? {
|
30388
|
-
as: is(generated.as, SQL) ? `(${
|
30420
|
+
as: is(generated.as, SQL) ? `(${dialect4.sqlToQuery(generated.as, "indexes").sql})` : typeof generated.as === "function" ? `(${dialect4.sqlToQuery(generated.as(), "indexes").sql})` : `(${generated.as})`,
|
30389
30421
|
type: generated.mode ?? "virtual"
|
30390
30422
|
} : void 0
|
30391
30423
|
};
|
30392
30424
|
if (column4.default !== void 0) {
|
30393
30425
|
if (is(column4.default, SQL)) {
|
30394
|
-
columnToSet.default = sqlToStr(column4.default);
|
30426
|
+
columnToSet.default = sqlToStr(column4.default, casing2);
|
30395
30427
|
} else {
|
30396
30428
|
columnToSet.default = typeof column4.default === "string" ? `'${column4.default}'` : typeof column4.default === "object" || Array.isArray(column4.default) ? `'${JSON.stringify(column4.default)}'` : column4.default;
|
30397
30429
|
}
|
30398
30430
|
}
|
30399
|
-
columnsObject[
|
30431
|
+
columnsObject[name2] = columnToSet;
|
30400
30432
|
if (column4.isUnique) {
|
30401
30433
|
const existingUnique = indexesObject[column4.uniqueName];
|
30402
30434
|
if (typeof existingUnique !== "undefined") {
|
@@ -30408,7 +30440,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
30408
30440
|
The unique constraint ${source_default.underline.blue(
|
30409
30441
|
column4.uniqueName
|
30410
30442
|
)} on the ${source_default.underline.blue(
|
30411
|
-
|
30443
|
+
name2
|
30412
30444
|
)} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
|
30413
30445
|
existingUnique.columns.join(",")
|
30414
30446
|
)} columns
|
@@ -30424,15 +30456,25 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
30424
30456
|
}
|
30425
30457
|
});
|
30426
30458
|
const foreignKeys = tableForeignKeys.map((fk4) => {
|
30427
|
-
const name2 = fk4.getName();
|
30428
30459
|
const tableFrom = tableName;
|
30429
30460
|
const onDelete = fk4.onDelete ?? "no action";
|
30430
30461
|
const onUpdate = fk4.onUpdate ?? "no action";
|
30431
30462
|
const reference = fk4.reference();
|
30432
30463
|
const referenceFT = reference.foreignTable;
|
30433
30464
|
const tableTo = getTableName(referenceFT);
|
30434
|
-
const
|
30435
|
-
const
|
30465
|
+
const originalColumnsFrom = reference.columns.map((it) => it.name);
|
30466
|
+
const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
|
30467
|
+
const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
|
30468
|
+
const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
|
30469
|
+
let name2 = fk4.getName();
|
30470
|
+
if (casing2 !== void 0) {
|
30471
|
+
for (let i = 0; i < originalColumnsFrom.length; i++) {
|
30472
|
+
name2 = name2.replace(originalColumnsFrom[i], columnsFrom[i]);
|
30473
|
+
}
|
30474
|
+
for (let i = 0; i < originalColumnsTo.length; i++) {
|
30475
|
+
name2 = name2.replace(originalColumnsTo[i], columnsTo[i]);
|
30476
|
+
}
|
30477
|
+
}
|
30436
30478
|
return {
|
30437
30479
|
name: name2,
|
30438
30480
|
tableFrom,
|
@@ -30451,7 +30493,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
30451
30493
|
const name2 = value.config.name;
|
30452
30494
|
let indexColumns = columns2.map((it) => {
|
30453
30495
|
if (is(it, SQL)) {
|
30454
|
-
const sql2 =
|
30496
|
+
const sql2 = dialect4.sqlToQuery(it, "indexes").sql;
|
30455
30497
|
if (typeof internal.indexes[name2] === "undefined") {
|
30456
30498
|
internal.indexes[name2] = {
|
30457
30499
|
columns: {
|
@@ -30471,13 +30513,13 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
30471
30513
|
}
|
30472
30514
|
return sql2;
|
30473
30515
|
} else {
|
30474
|
-
return it
|
30516
|
+
return getColumnCasing(it, casing2);
|
30475
30517
|
}
|
30476
30518
|
});
|
30477
30519
|
let where = void 0;
|
30478
30520
|
if (value.config.where !== void 0) {
|
30479
30521
|
if (is(value.config.where, SQL)) {
|
30480
|
-
where =
|
30522
|
+
where = dialect4.sqlToQuery(value.config.where).sql;
|
30481
30523
|
}
|
30482
30524
|
}
|
30483
30525
|
indexesObject[name2] = {
|
@@ -30488,7 +30530,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
30488
30530
|
};
|
30489
30531
|
});
|
30490
30532
|
uniqueConstraints?.map((unq) => {
|
30491
|
-
const columnNames = unq.columns.map((c) => c
|
30533
|
+
const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
|
30492
30534
|
const name2 = unq.name ?? uniqueKeyName2(table4, columnNames);
|
30493
30535
|
const existingUnique = indexesObject[name2];
|
30494
30536
|
if (typeof existingUnique !== "undefined") {
|
@@ -30518,12 +30560,20 @@ The unique constraint ${source_default.underline.blue(
|
|
30518
30560
|
});
|
30519
30561
|
primaryKeys.forEach((it) => {
|
30520
30562
|
if (it.columns.length > 1) {
|
30521
|
-
|
30522
|
-
|
30523
|
-
|
30563
|
+
const originalColumnNames = it.columns.map((c) => c.name);
|
30564
|
+
const columnNames = it.columns.map((c) => getColumnCasing(c, casing2));
|
30565
|
+
let name2 = it.getName();
|
30566
|
+
if (casing2 !== void 0) {
|
30567
|
+
for (let i = 0; i < originalColumnNames.length; i++) {
|
30568
|
+
name2 = name2.replace(originalColumnNames[i], columnNames[i]);
|
30569
|
+
}
|
30570
|
+
}
|
30571
|
+
primaryKeysObject[name2] = {
|
30572
|
+
columns: columnNames,
|
30573
|
+
name: name2
|
30524
30574
|
};
|
30525
30575
|
} else {
|
30526
|
-
columnsObject[it.columns[0]
|
30576
|
+
columnsObject[getColumnCasing(it.columns[0], casing2)].primaryKey = true;
|
30527
30577
|
}
|
30528
30578
|
});
|
30529
30579
|
result[tableName] = {
|
@@ -32203,7 +32253,7 @@ var init_delete3 = __esm({
|
|
32203
32253
|
init_entity();
|
32204
32254
|
init_query_promise();
|
32205
32255
|
MySqlDeleteBase = class extends (_b221 = QueryPromise, _a296 = entityKind, _b221) {
|
32206
|
-
constructor(table4, session,
|
32256
|
+
constructor(table4, session, dialect4, withList) {
|
32207
32257
|
super();
|
32208
32258
|
__publicField(this, "config");
|
32209
32259
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -32218,7 +32268,7 @@ var init_delete3 = __esm({
|
|
32218
32268
|
__publicField(this, "iterator", this.createIterator());
|
32219
32269
|
this.table = table4;
|
32220
32270
|
this.session = session;
|
32221
|
-
this.dialect =
|
32271
|
+
this.dialect = dialect4;
|
32222
32272
|
this.config = { table: table4, withList };
|
32223
32273
|
}
|
32224
32274
|
/**
|
@@ -32288,11 +32338,11 @@ var init_insert3 = __esm({
|
|
32288
32338
|
init_utils2();
|
32289
32339
|
_a297 = entityKind;
|
32290
32340
|
MySqlInsertBuilder = class {
|
32291
|
-
constructor(table4, session,
|
32341
|
+
constructor(table4, session, dialect4) {
|
32292
32342
|
__publicField(this, "shouldIgnore", false);
|
32293
32343
|
this.table = table4;
|
32294
32344
|
this.session = session;
|
32295
|
-
this.dialect =
|
32345
|
+
this.dialect = dialect4;
|
32296
32346
|
}
|
32297
32347
|
ignore() {
|
32298
32348
|
this.shouldIgnore = true;
|
@@ -32305,7 +32355,7 @@ var init_insert3 = __esm({
|
|
32305
32355
|
}
|
32306
32356
|
const mappedValues = values.map((entry) => {
|
32307
32357
|
const result = {};
|
32308
|
-
const cols = this.table[
|
32358
|
+
const cols = this.table[Table.Symbol.Columns];
|
32309
32359
|
for (const colKey of Object.keys(entry)) {
|
32310
32360
|
const colValue = entry[colKey];
|
32311
32361
|
result[colKey] = is(colValue, SQL) ? colValue : new Param(colValue, cols[colKey]);
|
@@ -32317,7 +32367,7 @@ var init_insert3 = __esm({
|
|
32317
32367
|
};
|
32318
32368
|
__publicField(MySqlInsertBuilder, _a297, "MySqlInsertBuilder");
|
32319
32369
|
MySqlInsertBase = class extends (_b222 = QueryPromise, _a298 = entityKind, _b222) {
|
32320
|
-
constructor(table4, values, ignore, session,
|
32370
|
+
constructor(table4, values, ignore, session, dialect4) {
|
32321
32371
|
super();
|
32322
32372
|
__publicField(this, "config");
|
32323
32373
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -32331,7 +32381,7 @@ var init_insert3 = __esm({
|
|
32331
32381
|
});
|
32332
32382
|
__publicField(this, "iterator", this.createIterator());
|
32333
32383
|
this.session = session;
|
32334
|
-
this.dialect =
|
32384
|
+
this.dialect = dialect4;
|
32335
32385
|
this.config = { table: table4, values, ignore };
|
32336
32386
|
}
|
32337
32387
|
/**
|
@@ -32367,12 +32417,12 @@ var init_insert3 = __esm({
|
|
32367
32417
|
}
|
32368
32418
|
$returningId() {
|
32369
32419
|
const returning = [];
|
32370
|
-
for (const [key, value] of Object.entries(this.config.table[
|
32420
|
+
for (const [key, value] of Object.entries(this.config.table[Table.Symbol.Columns])) {
|
32371
32421
|
if (value.primary) {
|
32372
32422
|
returning.push({ field: value, path: [key] });
|
32373
32423
|
}
|
32374
32424
|
}
|
32375
|
-
this.config.returning = orderSelectedFields(this.config.table[
|
32425
|
+
this.config.returning = orderSelectedFields(this.config.table[Table.Symbol.Columns]);
|
32376
32426
|
return this;
|
32377
32427
|
}
|
32378
32428
|
/** @internal */
|
@@ -32474,8 +32524,8 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
|
|
32474
32524
|
})
|
32475
32525
|
);
|
32476
32526
|
const table4 = Object.assign(rawTable, builtColumns);
|
32477
|
-
table4[
|
32478
|
-
table4[
|
32527
|
+
table4[Table.Symbol.Columns] = builtColumns;
|
32528
|
+
table4[Table.Symbol.ExtraConfigColumns] = builtColumns;
|
32479
32529
|
if (extraConfig) {
|
32480
32530
|
table4[MySqlTable.Symbol.ExtraConfigBuilder] = extraConfig;
|
32481
32531
|
}
|
@@ -32489,7 +32539,7 @@ var init_table4 = __esm({
|
|
32489
32539
|
init_table();
|
32490
32540
|
init_all3();
|
32491
32541
|
InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
|
32492
|
-
MySqlTable = class extends (_e3 =
|
32542
|
+
MySqlTable = class extends (_e3 = Table, _d4 = entityKind, _c10 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a299 = Table.Symbol.ExtraConfigBuilder, _e3) {
|
32493
32543
|
constructor() {
|
32494
32544
|
super(...arguments);
|
32495
32545
|
/** @internal */
|
@@ -32502,7 +32552,7 @@ var init_table4 = __esm({
|
|
32502
32552
|
};
|
32503
32553
|
__publicField(MySqlTable, _d4, "MySqlTable");
|
32504
32554
|
/** @internal */
|
32505
|
-
__publicField(MySqlTable, "Symbol", Object.assign({},
|
32555
|
+
__publicField(MySqlTable, "Symbol", Object.assign({}, Table.Symbol, {
|
32506
32556
|
InlineForeignKeys: InlineForeignKeys3
|
32507
32557
|
}));
|
32508
32558
|
mysqlTable = (name2, columns, extraConfig) => {
|
@@ -32607,7 +32657,7 @@ var init_dialect3 = __esm({
|
|
32607
32657
|
return sql`${withSql}delete from ${table4}${whereSql}${returningSql}`;
|
32608
32658
|
}
|
32609
32659
|
buildUpdateSet(table4, set) {
|
32610
|
-
const tableColumns = table4[
|
32660
|
+
const tableColumns = table4[Table.Symbol.Columns];
|
32611
32661
|
const columnNames = Object.keys(tableColumns).filter(
|
32612
32662
|
(colName) => set[colName] !== void 0 || tableColumns[colName]?.onUpdateFn !== void 0
|
32613
32663
|
);
|
@@ -32698,7 +32748,7 @@ var init_dialect3 = __esm({
|
|
32698
32748
|
const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
|
32699
32749
|
for (const f of fieldsList) {
|
32700
32750
|
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(
|
32701
|
-
({ alias }) => alias === (table22[
|
32751
|
+
({ alias }) => alias === (table22[Table.Symbol.IsAlias] ? getTableName(table22) : table22[Table.Symbol.BaseName])
|
32702
32752
|
))(f.field.table)) {
|
32703
32753
|
const tableName = getTableName(f.field.table);
|
32704
32754
|
throw new Error(
|
@@ -32711,8 +32761,8 @@ var init_dialect3 = __esm({
|
|
32711
32761
|
const distinctSql = distinct ? sql` distinct` : void 0;
|
32712
32762
|
const selection = this.buildSelection(fieldsList, { isSingleTable });
|
32713
32763
|
const tableSql = (() => {
|
32714
|
-
if (is(table4,
|
32715
|
-
return sql`${sql.identifier(table4[
|
32764
|
+
if (is(table4, Table) && table4[Table.Symbol.OriginalName] !== table4[Table.Symbol.Name]) {
|
32765
|
+
return sql`${sql.identifier(table4[Table.Symbol.OriginalName])} ${sql.identifier(table4[Table.Symbol.Name])}`;
|
32716
32766
|
}
|
32717
32767
|
return table4;
|
32718
32768
|
})();
|
@@ -32825,7 +32875,7 @@ var init_dialect3 = __esm({
|
|
32825
32875
|
}
|
32826
32876
|
buildInsertQuery({ table: table4, values, ignore, onConflict }) {
|
32827
32877
|
const valuesSqlList = [];
|
32828
|
-
const columns = table4[
|
32878
|
+
const columns = table4[Table.Symbol.Columns];
|
32829
32879
|
const colEntries = Object.entries(columns).filter(
|
32830
32880
|
([_2, col]) => !col.shouldDisableInsert()
|
32831
32881
|
);
|
@@ -33410,7 +33460,7 @@ var init_select4 = __esm({
|
|
33410
33460
|
};
|
33411
33461
|
__publicField(MySqlSelectBuilder, _a302, "MySqlSelectBuilder");
|
33412
33462
|
MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a303 = entityKind, _b225) {
|
33413
|
-
constructor({ table: table4, fields, isPartialSelect, session, dialect:
|
33463
|
+
constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
|
33414
33464
|
super();
|
33415
33465
|
__publicField(this, "_");
|
33416
33466
|
__publicField(this, "config");
|
@@ -33727,7 +33777,7 @@ var init_select4 = __esm({
|
|
33727
33777
|
};
|
33728
33778
|
this.isPartialSelect = isPartialSelect;
|
33729
33779
|
this.session = session;
|
33730
|
-
this.dialect =
|
33780
|
+
this.dialect = dialect4;
|
33731
33781
|
this._ = {
|
33732
33782
|
selectedFields: fields
|
33733
33783
|
};
|
@@ -33748,7 +33798,7 @@ var init_select4 = __esm({
|
|
33748
33798
|
};
|
33749
33799
|
}
|
33750
33800
|
if (typeof tableName === "string" && !is(table4, SQL)) {
|
33751
|
-
const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[
|
33801
|
+
const selection = is(table4, Subquery) ? table4._.selectedFields : is(table4, View) ? table4[ViewBaseConfig].selectedFields : table4[Table.Symbol.Columns];
|
33752
33802
|
this.config.fields[tableName] = selection;
|
33753
33803
|
}
|
33754
33804
|
}
|
@@ -34066,11 +34116,11 @@ var init_query_builder4 = __esm({
|
|
34066
34116
|
init_select4();
|
34067
34117
|
_a305 = entityKind;
|
34068
34118
|
QueryBuilder3 = class {
|
34069
|
-
constructor(
|
34119
|
+
constructor(dialect4) {
|
34070
34120
|
__publicField(this, "dialect");
|
34071
34121
|
__publicField(this, "dialectConfig");
|
34072
|
-
this.dialect = is(
|
34073
|
-
this.dialectConfig = is(
|
34122
|
+
this.dialect = is(dialect4, MySqlDialect) ? dialect4 : void 0;
|
34123
|
+
this.dialectConfig = is(dialect4, MySqlDialect) ? void 0 : dialect4;
|
34074
34124
|
}
|
34075
34125
|
$with(alias) {
|
34076
34126
|
const queryBuilder = this;
|
@@ -34147,10 +34197,10 @@ var init_update3 = __esm({
|
|
34147
34197
|
init_utils2();
|
34148
34198
|
_a306 = entityKind;
|
34149
34199
|
MySqlUpdateBuilder = class {
|
34150
|
-
constructor(table4, session,
|
34200
|
+
constructor(table4, session, dialect4, withList) {
|
34151
34201
|
this.table = table4;
|
34152
34202
|
this.session = session;
|
34153
|
-
this.dialect =
|
34203
|
+
this.dialect = dialect4;
|
34154
34204
|
this.withList = withList;
|
34155
34205
|
}
|
34156
34206
|
set(values) {
|
@@ -34159,7 +34209,7 @@ var init_update3 = __esm({
|
|
34159
34209
|
};
|
34160
34210
|
__publicField(MySqlUpdateBuilder, _a306, "MySqlUpdateBuilder");
|
34161
34211
|
MySqlUpdateBase = class extends (_b227 = QueryPromise, _a307 = entityKind, _b227) {
|
34162
|
-
constructor(table4, set, session,
|
34212
|
+
constructor(table4, set, session, dialect4, withList) {
|
34163
34213
|
super();
|
34164
34214
|
__publicField(this, "config");
|
34165
34215
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -34173,7 +34223,7 @@ var init_update3 = __esm({
|
|
34173
34223
|
});
|
34174
34224
|
__publicField(this, "iterator", this.createIterator());
|
34175
34225
|
this.session = session;
|
34176
|
-
this.dialect =
|
34226
|
+
this.dialect = dialect4;
|
34177
34227
|
this.config = { set, table: table4, withList };
|
34178
34228
|
}
|
34179
34229
|
/**
|
@@ -34258,13 +34308,13 @@ var init_query3 = __esm({
|
|
34258
34308
|
init_relations();
|
34259
34309
|
_a308 = entityKind;
|
34260
34310
|
RelationalQueryBuilder3 = class {
|
34261
|
-
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig,
|
34311
|
+
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, mode) {
|
34262
34312
|
this.fullSchema = fullSchema;
|
34263
34313
|
this.schema = schema4;
|
34264
34314
|
this.tableNamesMap = tableNamesMap;
|
34265
34315
|
this.table = table4;
|
34266
34316
|
this.tableConfig = tableConfig;
|
34267
|
-
this.dialect =
|
34317
|
+
this.dialect = dialect4;
|
34268
34318
|
this.session = session;
|
34269
34319
|
this.mode = mode;
|
34270
34320
|
}
|
@@ -34299,14 +34349,14 @@ var init_query3 = __esm({
|
|
34299
34349
|
};
|
34300
34350
|
__publicField(RelationalQueryBuilder3, _a308, "MySqlRelationalQueryBuilder");
|
34301
34351
|
MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a309 = entityKind, _b228) {
|
34302
|
-
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig,
|
34352
|
+
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, queryMode, mode) {
|
34303
34353
|
super();
|
34304
34354
|
this.fullSchema = fullSchema;
|
34305
34355
|
this.schema = schema4;
|
34306
34356
|
this.tableNamesMap = tableNamesMap;
|
34307
34357
|
this.table = table4;
|
34308
34358
|
this.tableConfig = tableConfig;
|
34309
|
-
this.dialect =
|
34359
|
+
this.dialect = dialect4;
|
34310
34360
|
this.session = session;
|
34311
34361
|
this.config = config;
|
34312
34362
|
this.queryMode = queryMode;
|
@@ -34380,9 +34430,9 @@ var init_db3 = __esm({
|
|
34380
34430
|
init_query3();
|
34381
34431
|
_a310 = entityKind;
|
34382
34432
|
MySqlDatabase = class {
|
34383
|
-
constructor(
|
34433
|
+
constructor(dialect4, session, schema4, mode) {
|
34384
34434
|
__publicField(this, "query");
|
34385
|
-
this.dialect =
|
34435
|
+
this.dialect = dialect4;
|
34386
34436
|
this.session = session;
|
34387
34437
|
this.mode = mode;
|
34388
34438
|
this._ = schema4 ? {
|
@@ -34403,7 +34453,7 @@ var init_db3 = __esm({
|
|
34403
34453
|
this._.tableNamesMap,
|
34404
34454
|
schema4.fullSchema[tableName],
|
34405
34455
|
columns,
|
34406
|
-
|
34456
|
+
dialect4,
|
34407
34457
|
session,
|
34408
34458
|
this.mode
|
34409
34459
|
);
|
@@ -34871,8 +34921,8 @@ var init_session3 = __esm({
|
|
34871
34921
|
__publicField(MySqlPreparedQuery, _a321, "MySqlPreparedQuery");
|
34872
34922
|
_a322 = entityKind;
|
34873
34923
|
MySqlSession = class {
|
34874
|
-
constructor(
|
34875
|
-
this.dialect =
|
34924
|
+
constructor(dialect4) {
|
34925
|
+
this.dialect = dialect4;
|
34876
34926
|
}
|
34877
34927
|
execute(query) {
|
34878
34928
|
return this.prepareQuery(
|
@@ -34906,8 +34956,8 @@ var init_session3 = __esm({
|
|
34906
34956
|
};
|
34907
34957
|
__publicField(MySqlSession, _a322, "MySqlSession");
|
34908
34958
|
MySqlTransaction = class extends (_b232 = MySqlDatabase, _a323 = entityKind, _b232) {
|
34909
|
-
constructor(
|
34910
|
-
super(
|
34959
|
+
constructor(dialect4, session, schema4, nestedIndex, mode) {
|
34960
|
+
super(dialect4, session, schema4, mode);
|
34911
34961
|
this.schema = schema4;
|
34912
34962
|
this.nestedIndex = nestedIndex;
|
34913
34963
|
}
|
@@ -34934,9 +34984,9 @@ function getTableConfig3(table4) {
|
|
34934
34984
|
const primaryKeys = [];
|
34935
34985
|
const uniqueConstraints = [];
|
34936
34986
|
const foreignKeys = Object.values(table4[MySqlTable.Symbol.InlineForeignKeys]);
|
34937
|
-
const name2 = table4[
|
34938
|
-
const schema4 = table4[
|
34939
|
-
const baseName = table4[
|
34987
|
+
const name2 = table4[Table.Symbol.Name];
|
34988
|
+
const schema4 = table4[Table.Symbol.Schema];
|
34989
|
+
const baseName = table4[Table.Symbol.BaseName];
|
34940
34990
|
const extraConfigBuilder = table4[MySqlTable.Symbol.ExtraConfigBuilder];
|
34941
34991
|
if (extraConfigBuilder !== void 0) {
|
34942
34992
|
const extraConfig = extraConfigBuilder(table4[MySqlTable.Symbol.Columns]);
|
@@ -35022,7 +35072,7 @@ function clearDefaults(defaultValue, collate) {
|
|
35022
35072
|
return `(${resultDefault})`;
|
35023
35073
|
}
|
35024
35074
|
}
|
35025
|
-
var
|
35075
|
+
var generateMySqlSnapshot, fromDatabase3;
|
35026
35076
|
var init_mysqlSerializer = __esm({
|
35027
35077
|
"src/serializer/mysqlSerializer.ts"() {
|
35028
35078
|
"use strict";
|
@@ -35032,9 +35082,10 @@ var init_mysqlSerializer = __esm({
|
|
35032
35082
|
init_mysql_core();
|
35033
35083
|
init_mysql_core();
|
35034
35084
|
init_outputs();
|
35085
|
+
init_utils();
|
35035
35086
|
init_serializer();
|
35036
|
-
|
35037
|
-
|
35087
|
+
generateMySqlSnapshot = (tables, casing2) => {
|
35088
|
+
const dialect4 = new MySqlDialect({ casing: casing2 });
|
35038
35089
|
const result = {};
|
35039
35090
|
const internal = { tables: {}, indexes: {} };
|
35040
35091
|
for (const table4 of tables) {
|
@@ -35053,12 +35104,13 @@ var init_mysqlSerializer = __esm({
|
|
35053
35104
|
const primaryKeysObject = {};
|
35054
35105
|
const uniqueConstraintObject = {};
|
35055
35106
|
columns.forEach((column4) => {
|
35107
|
+
const name2 = getColumnCasing(column4, casing2);
|
35056
35108
|
const notNull = column4.notNull;
|
35057
35109
|
const sqlTypeLowered = column4.getSQLType().toLowerCase();
|
35058
35110
|
const autoIncrement = typeof column4.autoIncrement === "undefined" ? false : column4.autoIncrement;
|
35059
35111
|
const generated = column4.generated;
|
35060
35112
|
const columnToSet = {
|
35061
|
-
name:
|
35113
|
+
name: name2,
|
35062
35114
|
type: column4.getSQLType(),
|
35063
35115
|
primaryKey: false,
|
35064
35116
|
// If field is autoincrement it's notNull by default
|
@@ -35067,14 +35119,14 @@ var init_mysqlSerializer = __esm({
|
|
35067
35119
|
autoincrement: autoIncrement,
|
35068
35120
|
onUpdate: column4.hasOnUpdateNow,
|
35069
35121
|
generated: generated ? {
|
35070
|
-
as: is(generated.as, SQL) ?
|
35122
|
+
as: is(generated.as, SQL) ? dialect4.sqlToQuery(generated.as).sql : typeof generated.as === "function" ? dialect4.sqlToQuery(generated.as()).sql : generated.as,
|
35071
35123
|
type: generated.mode ?? "stored"
|
35072
35124
|
} : void 0
|
35073
35125
|
};
|
35074
35126
|
if (column4.primary) {
|
35075
|
-
primaryKeysObject[`${tableName}_${
|
35076
|
-
name: `${tableName}_${
|
35077
|
-
columns: [
|
35127
|
+
primaryKeysObject[`${tableName}_${name2}`] = {
|
35128
|
+
name: `${tableName}_${name2}`,
|
35129
|
+
columns: [name2]
|
35078
35130
|
};
|
35079
35131
|
}
|
35080
35132
|
if (column4.isUnique) {
|
@@ -35088,7 +35140,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
35088
35140
|
The unique constraint ${source_default.underline.blue(
|
35089
35141
|
column4.uniqueName
|
35090
35142
|
)} on the ${source_default.underline.blue(
|
35091
|
-
|
35143
|
+
name2
|
35092
35144
|
)} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
|
35093
35145
|
existingUnique.columns.join(",")
|
35094
35146
|
)} columns
|
@@ -35103,7 +35155,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
35103
35155
|
}
|
35104
35156
|
if (column4.default !== void 0) {
|
35105
35157
|
if (is(column4.default, SQL)) {
|
35106
|
-
columnToSet.default = sqlToStr(column4.default);
|
35158
|
+
columnToSet.default = sqlToStr(column4.default, casing2);
|
35107
35159
|
} else {
|
35108
35160
|
if (typeof column4.default === "string") {
|
35109
35161
|
columnToSet.default = `'${column4.default}'`;
|
@@ -35125,20 +35177,27 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
35125
35177
|
}
|
35126
35178
|
}
|
35127
35179
|
}
|
35128
|
-
columnsObject[
|
35180
|
+
columnsObject[name2] = columnToSet;
|
35129
35181
|
});
|
35130
35182
|
primaryKeys.map((pk) => {
|
35131
|
-
const
|
35132
|
-
|
35133
|
-
|
35183
|
+
const originalColumnNames = pk.columns.map((c) => c.name);
|
35184
|
+
const columnNames = pk.columns.map((c) => getColumnCasing(c, casing2));
|
35185
|
+
let name2 = pk.getName();
|
35186
|
+
if (casing2 !== void 0) {
|
35187
|
+
for (let i = 0; i < originalColumnNames.length; i++) {
|
35188
|
+
name2 = name2.replace(originalColumnNames[i], columnNames[i]);
|
35189
|
+
}
|
35190
|
+
}
|
35191
|
+
primaryKeysObject[name2] = {
|
35192
|
+
name: name2,
|
35134
35193
|
columns: columnNames
|
35135
35194
|
};
|
35136
35195
|
for (const column4 of pk.columns) {
|
35137
|
-
columnsObject[column4
|
35196
|
+
columnsObject[getColumnCasing(column4, casing2)].notNull = true;
|
35138
35197
|
}
|
35139
35198
|
});
|
35140
35199
|
uniqueConstraints?.map((unq) => {
|
35141
|
-
const columnNames = unq.columns.map((c) => c
|
35200
|
+
const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
|
35142
35201
|
const name2 = unq.name ?? uniqueKeyName3(table4, columnNames);
|
35143
35202
|
const existingUnique = uniqueConstraintObject[name2];
|
35144
35203
|
if (typeof existingUnique !== "undefined") {
|
@@ -35166,15 +35225,25 @@ The unique constraint ${source_default.underline.blue(
|
|
35166
35225
|
};
|
35167
35226
|
});
|
35168
35227
|
const fks = foreignKeys.map((fk4) => {
|
35169
|
-
const name2 = fk4.getName();
|
35170
35228
|
const tableFrom = tableName;
|
35171
35229
|
const onDelete = fk4.onDelete ?? "no action";
|
35172
35230
|
const onUpdate = fk4.onUpdate ?? "no action";
|
35173
35231
|
const reference = fk4.reference();
|
35174
35232
|
const referenceFT = reference.foreignTable;
|
35175
35233
|
const tableTo = getTableName(referenceFT);
|
35176
|
-
const
|
35177
|
-
const
|
35234
|
+
const originalColumnsFrom = reference.columns.map((it) => it.name);
|
35235
|
+
const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
|
35236
|
+
const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
|
35237
|
+
const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
|
35238
|
+
let name2 = fk4.getName();
|
35239
|
+
if (casing2 !== void 0) {
|
35240
|
+
for (let i = 0; i < originalColumnsFrom.length; i++) {
|
35241
|
+
name2 = name2.replace(originalColumnsFrom[i], columnsFrom[i]);
|
35242
|
+
}
|
35243
|
+
for (let i = 0; i < originalColumnsTo.length; i++) {
|
35244
|
+
name2 = name2.replace(originalColumnsTo[i], columnsTo[i]);
|
35245
|
+
}
|
35246
|
+
}
|
35178
35247
|
return {
|
35179
35248
|
name: name2,
|
35180
35249
|
tableFrom,
|
@@ -35193,7 +35262,7 @@ The unique constraint ${source_default.underline.blue(
|
|
35193
35262
|
const name2 = value.config.name;
|
35194
35263
|
let indexColumns = columns2.map((it) => {
|
35195
35264
|
if (is(it, SQL)) {
|
35196
|
-
const sql2 =
|
35265
|
+
const sql2 = dialect4.sqlToQuery(it, "indexes").sql;
|
35197
35266
|
if (typeof internal.indexes[name2] === "undefined") {
|
35198
35267
|
internal.indexes[name2] = {
|
35199
35268
|
columns: {
|
@@ -35213,7 +35282,7 @@ The unique constraint ${source_default.underline.blue(
|
|
35213
35282
|
}
|
35214
35283
|
return sql2;
|
35215
35284
|
} else {
|
35216
|
-
return `${it
|
35285
|
+
return `${getColumnCasing(it, casing2)}`;
|
35217
35286
|
}
|
35218
35287
|
});
|
35219
35288
|
if (value.config.unique) {
|
@@ -35575,6 +35644,7 @@ var init_cli = __esm({
|
|
35575
35644
|
}).strict();
|
35576
35645
|
pushParams = objectType({
|
35577
35646
|
dialect: dialect3,
|
35647
|
+
casing: casingType.optional(),
|
35578
35648
|
schema: unionType([stringType(), stringType().array()]),
|
35579
35649
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
35580
35650
|
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
@@ -36767,7 +36837,7 @@ init_pgSchema();
|
|
36767
36837
|
init_pgSerializer();
|
36768
36838
|
init_sqliteSchema();
|
36769
36839
|
init_sqliteSerializer();
|
36770
|
-
var generateDrizzleJson = (imports, prevId, schemaFilters) => {
|
36840
|
+
var generateDrizzleJson = (imports, prevId, schemaFilters, casing2) => {
|
36771
36841
|
const prepared = prepareFromExports(imports);
|
36772
36842
|
const id = randomUUID();
|
36773
36843
|
const snapshot = generatePgSnapshot(
|
@@ -36775,6 +36845,7 @@ var generateDrizzleJson = (imports, prevId, schemaFilters) => {
|
|
36775
36845
|
prepared.enums,
|
36776
36846
|
prepared.schemas,
|
36777
36847
|
prepared.sequences,
|
36848
|
+
casing2,
|
36778
36849
|
schemaFilters
|
36779
36850
|
);
|
36780
36851
|
return fillPgSnapshot({
|
@@ -36845,11 +36916,11 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
|
36845
36916
|
}
|
36846
36917
|
};
|
36847
36918
|
};
|
36848
|
-
var generateSQLiteDrizzleJson = async (imports, prevId) => {
|
36919
|
+
var generateSQLiteDrizzleJson = async (imports, prevId, casing2) => {
|
36849
36920
|
const { prepareFromExports: prepareFromExports4 } = await Promise.resolve().then(() => (init_sqliteImports(), sqliteImports_exports));
|
36850
36921
|
const prepared = prepareFromExports4(imports);
|
36851
36922
|
const id = randomUUID();
|
36852
|
-
const snapshot = generateSqliteSnapshot(prepared.tables);
|
36923
|
+
const snapshot = generateSqliteSnapshot(prepared.tables, casing2);
|
36853
36924
|
return {
|
36854
36925
|
...snapshot,
|
36855
36926
|
id,
|
@@ -36920,11 +36991,11 @@ var pushSQLiteSchema = async (imports, drizzleInstance) => {
|
|
36920
36991
|
}
|
36921
36992
|
};
|
36922
36993
|
};
|
36923
|
-
var generateMySQLDrizzleJson = async (imports, prevId) => {
|
36994
|
+
var generateMySQLDrizzleJson = async (imports, prevId, casing2) => {
|
36924
36995
|
const { prepareFromExports: prepareFromExports4 } = await Promise.resolve().then(() => (init_mysqlImports(), mysqlImports_exports));
|
36925
36996
|
const prepared = prepareFromExports4(imports);
|
36926
36997
|
const id = randomUUID();
|
36927
|
-
const snapshot = generateMySqlSnapshot(prepared.tables);
|
36998
|
+
const snapshot = generateMySqlSnapshot(prepared.tables, casing2);
|
36928
36999
|
return {
|
36929
37000
|
...snapshot,
|
36930
37001
|
id,
|