drizzle-kit 0.23.2-eddab2e → 0.24.0-38d6dab
Sign up to get free protection for your applications and to get access to all the features.
- package/api.d.mts +20 -4
- package/api.d.ts +20 -4
- package/api.js +1694 -783
- package/api.mjs +1694 -783
- package/bin.cjs +1658 -394
- package/package.json +2 -2
- package/utils.js +14 -0
- package/utils.mjs +12 -0
package/api.js
CHANGED
@@ -8338,6 +8338,16 @@ var init_sqliteSchema = __esm({
|
|
8338
8338
|
});
|
8339
8339
|
|
8340
8340
|
// src/utils.ts
|
8341
|
+
function isPgArrayType(sqlType) {
|
8342
|
+
return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
|
8343
|
+
}
|
8344
|
+
function findAddedAndRemoved(columnNames1, columnNames2) {
|
8345
|
+
const set1 = new Set(columnNames1);
|
8346
|
+
const set2 = new Set(columnNames2);
|
8347
|
+
const addedColumns = columnNames2.filter((it) => !set1.has(it));
|
8348
|
+
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
8349
|
+
return { addedColumns, removedColumns };
|
8350
|
+
}
|
8341
8351
|
var copy, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey;
|
8342
8352
|
var init_utils = __esm({
|
8343
8353
|
"src/utils.ts"() {
|
@@ -8711,14 +8721,14 @@ var require_heap = __commonJS({
|
|
8711
8721
|
return item;
|
8712
8722
|
};
|
8713
8723
|
heapify = function(array, cmp) {
|
8714
|
-
var i, _i2,
|
8724
|
+
var i, _i2, _j2, _len, _ref, _ref1, _results, _results1;
|
8715
8725
|
if (cmp == null) {
|
8716
8726
|
cmp = defaultCmp;
|
8717
8727
|
}
|
8718
8728
|
_ref1 = function() {
|
8719
8729
|
_results1 = [];
|
8720
|
-
for (var
|
8721
|
-
_results1.push(
|
8730
|
+
for (var _j3 = 0, _ref2 = floor(array.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
|
8731
|
+
_results1.push(_j3);
|
8722
8732
|
}
|
8723
8733
|
return _results1;
|
8724
8734
|
}.apply(this).reverse();
|
@@ -8759,7 +8769,7 @@ var require_heap = __commonJS({
|
|
8759
8769
|
return result.sort(cmp).reverse();
|
8760
8770
|
};
|
8761
8771
|
nsmallest = function(array, n, cmp) {
|
8762
|
-
var elem, i, los, result, _i2,
|
8772
|
+
var elem, i, los, result, _i2, _j2, _len, _ref, _ref1, _results;
|
8763
8773
|
if (cmp == null) {
|
8764
8774
|
cmp = defaultCmp;
|
8765
8775
|
}
|
@@ -8782,7 +8792,7 @@ var require_heap = __commonJS({
|
|
8782
8792
|
}
|
8783
8793
|
heapify(array, cmp);
|
8784
8794
|
_results = [];
|
8785
|
-
for (i =
|
8795
|
+
for (i = _j2 = 0, _ref1 = min2(n, array.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
|
8786
8796
|
_results.push(heappop(array, cmp));
|
8787
8797
|
}
|
8788
8798
|
return _results;
|
@@ -11447,7 +11457,20 @@ var init_jsonDiffer = __esm({
|
|
11447
11457
|
});
|
11448
11458
|
|
11449
11459
|
// src/sqlgenerator.ts
|
11450
|
-
|
11460
|
+
function fromJson(statements, dialect7, action, driver2, json2) {
|
11461
|
+
const result = statements.flatMap((statement) => {
|
11462
|
+
const filtered = convertors.filter((it) => {
|
11463
|
+
return it.can(statement, dialect7, driver2);
|
11464
|
+
});
|
11465
|
+
const convertor = filtered.length === 1 ? filtered[0] : void 0;
|
11466
|
+
if (!convertor) {
|
11467
|
+
return "";
|
11468
|
+
}
|
11469
|
+
return convertor.convert(statement, json2, action);
|
11470
|
+
}).filter((it) => it !== "");
|
11471
|
+
return result;
|
11472
|
+
}
|
11473
|
+
var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, SQLiteAlterTableAddUniqueConstraintConvertor, SQLiteAlterTableDropUniqueConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, AlterTypeAddValueConvertor, PgDropTableConvertor, MySQLDropTableConvertor, SQLiteDropTableConvertor, PgRenameTableConvertor, SqliteRenameTableConvertor, MySqlRenameTableConvertor, PgAlterTableRenameColumnConvertor, MySqlAlterTableRenameColumnConvertor, SQLiteAlterTableRenameColumnConvertor, PgAlterTableDropColumnConvertor, MySqlAlterTableDropColumnConvertor, SQLiteAlterTableDropColumnConvertor, PgAlterTableAddColumnConvertor, MySqlAlterTableAddColumnConvertor, SQLiteAlterTableAddColumnConvertor, PgAlterTableAlterColumnSetTypeConvertor, SQLiteAlterTableAlterColumnSetTypeConvertor, PgAlterTableAlterColumnSetDefaultConvertor, SqliteAlterTableAlterColumnSetDefaultConvertor, PgAlterTableAlterColumnDropDefaultConvertor, PgAlterTableAlterColumnDropGeneratedConvertor, PgAlterTableAlterColumnSetExpressionConvertor, PgAlterTableAlterColumnAlterrGeneratedConvertor, SqliteAlterTableAlterColumnDropGeneratedConvertor, SqliteAlterTableAlterColumnSetExpressionConvertor, SqliteAlterTableAlterColumnAlterGeneratedConvertor, MySqlAlterTableAlterColumnAlterrGeneratedConvertor, MySqlAlterTableAddPk, MySqlAlterTableDropPk, LibSQLModifyColumn, MySqlModifyColumn, SqliteAlterTableAlterColumnDropDefaultConvertor, PgAlterTableCreateCompositePrimaryKeyConvertor, PgAlterTableDeleteCompositePrimaryKeyConvertor, PgAlterTableAlterCompositePrimaryKeyConvertor, MySqlAlterTableCreateCompositePrimaryKeyConvertor, MySqlAlterTableDeleteCompositePrimaryKeyConvertor, MySqlAlterTableAlterCompositePrimaryKeyConvertor, SqliteAlterTableCreateCompositePrimaryKeyConvertor, SqliteAlterTableDeleteCompositePrimaryKeyConvertor, SqliteAlterTableAlterCompositePrimaryKeyConvertor, PgAlterTableAlterColumnSetPrimaryKeyConvertor, PgAlterTableAlterColumnDropPrimaryKeyConvertor, PgAlterTableAlterColumnSetNotNullConvertor, SqliteAlterTableAlterColumnSetNotNullConvertor, SqliteAlterTableAlterColumnSetAutoincrementConvertor, SqliteAlterTableAlterColumnDropAutoincrementConvertor, PgAlterTableAlterColumnDropNotNullConvertor, SqliteAlterTableAlterColumnDropNotNullConvertor, PgCreateForeignKeyConvertor, SqliteCreateForeignKeyConvertor, LibSQLCreateForeignKeyConvertor, MySqlCreateForeignKeyConvertor, PgAlterForeignKeyConvertor, SqliteAlterForeignKeyConvertor, PgDeleteForeignKeyConvertor, SqliteDeleteForeignKeyConvertor, LibSQLDeleteForeignKeyConvertor, MySqlDeleteForeignKeyConvertor, CreatePgIndexConvertor, CreateMySqlIndexConvertor, CreateSqliteIndexConvertor, PgDropIndexConvertor, PgCreateSchemaConvertor, PgRenameSchemaConvertor, PgDropSchemaConvertor, PgAlterTableSetSchemaConvertor, PgAlterTableSetNewSchemaConvertor, PgAlterTableRemoveFromSchemaConvertor, SqliteDropIndexConvertor, MySqlDropIndexConvertor, SQLiteRecreateTableConvertor, LibSQLRecreateTableConvertor, convertors;
|
11451
11474
|
var init_sqlgenerator = __esm({
|
11452
11475
|
"src/sqlgenerator.ts"() {
|
11453
11476
|
"use strict";
|
@@ -11963,7 +11986,7 @@ var init_sqlgenerator = __esm({
|
|
11963
11986
|
}
|
11964
11987
|
convert(statement) {
|
11965
11988
|
const { tableName, oldColumnName, newColumnName } = statement;
|
11966
|
-
return `ALTER TABLE \`${tableName}\` RENAME COLUMN
|
11989
|
+
return `ALTER TABLE \`${tableName}\` RENAME COLUMN "${oldColumnName}" TO "${newColumnName}";`;
|
11967
11990
|
}
|
11968
11991
|
};
|
11969
11992
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
@@ -12065,8 +12088,8 @@ var init_sqlgenerator = __esm({
|
|
12065
12088
|
}
|
12066
12089
|
};
|
12067
12090
|
SQLiteAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
12068
|
-
can(statement, dialect7) {
|
12069
|
-
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "sqlite";
|
12091
|
+
can(statement, dialect7, driver2) {
|
12092
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "sqlite" && !driver2;
|
12070
12093
|
}
|
12071
12094
|
convert(statement) {
|
12072
12095
|
return `/*
|
@@ -12377,6 +12400,46 @@ var init_sqlgenerator = __esm({
|
|
12377
12400
|
return `ALTER TABLE \`${statement.tableName}\` DROP PRIMARY KEY`;
|
12378
12401
|
}
|
12379
12402
|
};
|
12403
|
+
LibSQLModifyColumn = class extends Convertor {
|
12404
|
+
can(statement, dialect7, driver2) {
|
12405
|
+
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default") && dialect7 === "sqlite" && driver2 === "turso";
|
12406
|
+
}
|
12407
|
+
convert(statement, json2) {
|
12408
|
+
const { tableName, columnName } = statement;
|
12409
|
+
let columnType = ``;
|
12410
|
+
let columnDefault = "";
|
12411
|
+
let columnNotNull = "";
|
12412
|
+
switch (statement.type) {
|
12413
|
+
case "alter_table_alter_column_set_type":
|
12414
|
+
columnType = ` ${statement.newDataType}`;
|
12415
|
+
columnDefault = statement.columnDefault ? ` DEFAULT ${statement.columnDefault}` : "";
|
12416
|
+
columnNotNull = statement.columnNotNull ? ` NOT NULL` : "";
|
12417
|
+
break;
|
12418
|
+
case "alter_table_alter_column_drop_notnull":
|
12419
|
+
columnType = ` ${statement.newDataType}`;
|
12420
|
+
columnDefault = statement.columnDefault ? ` DEFAULT ${statement.columnDefault}` : "";
|
12421
|
+
columnNotNull = "";
|
12422
|
+
break;
|
12423
|
+
case "alter_table_alter_column_set_notnull":
|
12424
|
+
columnType = ` ${statement.newDataType}`;
|
12425
|
+
columnDefault = statement.columnDefault ? ` DEFAULT ${statement.columnDefault}` : "";
|
12426
|
+
columnNotNull = ` NOT NULL`;
|
12427
|
+
break;
|
12428
|
+
case "alter_table_alter_column_set_default":
|
12429
|
+
columnType = ` ${statement.newDataType}`;
|
12430
|
+
columnDefault = ` DEFAULT ${statement.newDefaultValue}`;
|
12431
|
+
columnNotNull = statement.columnNotNull ? ` NOT NULL` : "";
|
12432
|
+
break;
|
12433
|
+
case "alter_table_alter_column_drop_default":
|
12434
|
+
columnType = ` ${statement.newDataType}`;
|
12435
|
+
columnDefault = "";
|
12436
|
+
columnNotNull = statement.columnNotNull ? ` NOT NULL` : "";
|
12437
|
+
break;
|
12438
|
+
}
|
12439
|
+
columnDefault = columnDefault instanceof Date ? columnDefault.toISOString() : columnDefault;
|
12440
|
+
return `ALTER TABLE \`${tableName}\` ALTER COLUMN "${columnName}" TO "${columnName}"${columnType}${columnNotNull}${columnDefault};`;
|
12441
|
+
}
|
12442
|
+
};
|
12380
12443
|
MySqlModifyColumn = class extends Convertor {
|
12381
12444
|
can(statement, dialect7) {
|
12382
12445
|
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_on_update" || statement.type === "alter_table_alter_column_set_on_update" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_generated" || statement.type === "alter_table_alter_column_drop_generated") && dialect7 === "mysql";
|
@@ -12717,8 +12780,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12717
12780
|
}
|
12718
12781
|
};
|
12719
12782
|
SqliteAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
12720
|
-
can(statement, dialect7) {
|
12721
|
-
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "sqlite";
|
12783
|
+
can(statement, dialect7, driver2) {
|
12784
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "sqlite" && !driver2;
|
12722
12785
|
}
|
12723
12786
|
convert(statement) {
|
12724
12787
|
return `/*
|
@@ -12732,8 +12795,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12732
12795
|
}
|
12733
12796
|
};
|
12734
12797
|
SqliteAlterTableAlterColumnSetAutoincrementConvertor = class extends Convertor {
|
12735
|
-
can(statement, dialect7) {
|
12736
|
-
return statement.type === "alter_table_alter_column_set_autoincrement" && dialect7 === "sqlite";
|
12798
|
+
can(statement, dialect7, driver2) {
|
12799
|
+
return statement.type === "alter_table_alter_column_set_autoincrement" && dialect7 === "sqlite" && !driver2;
|
12737
12800
|
}
|
12738
12801
|
convert(statement) {
|
12739
12802
|
return `/*
|
@@ -12747,8 +12810,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12747
12810
|
}
|
12748
12811
|
};
|
12749
12812
|
SqliteAlterTableAlterColumnDropAutoincrementConvertor = class extends Convertor {
|
12750
|
-
can(statement, dialect7) {
|
12751
|
-
return statement.type === "alter_table_alter_column_drop_autoincrement" && dialect7 === "sqlite";
|
12813
|
+
can(statement, dialect7, driver2) {
|
12814
|
+
return statement.type === "alter_table_alter_column_drop_autoincrement" && dialect7 === "sqlite" && !driver2;
|
12752
12815
|
}
|
12753
12816
|
convert(statement) {
|
12754
12817
|
return `/*
|
@@ -12772,8 +12835,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12772
12835
|
}
|
12773
12836
|
};
|
12774
12837
|
SqliteAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
12775
|
-
can(statement, dialect7) {
|
12776
|
-
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "sqlite";
|
12838
|
+
can(statement, dialect7, driver2) {
|
12839
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "sqlite" && !driver2;
|
12777
12840
|
}
|
12778
12841
|
convert(statement) {
|
12779
12842
|
return `/*
|
@@ -12817,8 +12880,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12817
12880
|
}
|
12818
12881
|
};
|
12819
12882
|
SqliteCreateForeignKeyConvertor = class extends Convertor {
|
12820
|
-
can(statement, dialect7) {
|
12821
|
-
return statement.type === "create_reference" && dialect7 === "sqlite";
|
12883
|
+
can(statement, dialect7, driver2) {
|
12884
|
+
return statement.type === "create_reference" && dialect7 === "sqlite" && !driver2;
|
12822
12885
|
}
|
12823
12886
|
convert(statement) {
|
12824
12887
|
return `/*
|
@@ -12830,6 +12893,32 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12830
12893
|
*/`;
|
12831
12894
|
}
|
12832
12895
|
};
|
12896
|
+
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
12897
|
+
can(statement, dialect7, driver2) {
|
12898
|
+
return statement.type === "create_reference" && dialect7 === "sqlite" && driver2 === "turso";
|
12899
|
+
}
|
12900
|
+
convert(statement, json2, action) {
|
12901
|
+
const { columnsFrom, columnsTo, tableFrom, onDelete, onUpdate, tableTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
12902
|
+
const { columnDefault, columnNotNull, columnType, isMulticolumn } = statement;
|
12903
|
+
if (isMulticolumn) {
|
12904
|
+
return `/*
|
12905
|
+
LibSQL does not support "Creating foreign key on multiple columns" out of the box, we do not generate automatic migration for that, so it has to be done manually
|
12906
|
+
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
|
12907
|
+
https://www.sqlite.org/lang_altertable.html
|
12908
|
+
|
12909
|
+
Due to that we don't generate migration automatically and it has to be done manually
|
12910
|
+
*/`;
|
12911
|
+
}
|
12912
|
+
const onDeleteStatement = onDelete ? ` ON DELETE ${onDelete}` : "";
|
12913
|
+
const onUpdateStatement = onUpdate ? ` ON UPDATE ${onUpdate}` : "";
|
12914
|
+
const columnsDefaultValue = columnDefault ? ` DEFAULT ${columnDefault}` : "";
|
12915
|
+
const columnNotNullValue = columnNotNull ? ` NOT NULL` : "";
|
12916
|
+
const columnTypeValue = columnType ? ` ${columnType}` : "";
|
12917
|
+
const columnFrom = columnsFrom[0];
|
12918
|
+
const columnTo = columnsTo[0];
|
12919
|
+
return `ALTER TABLE \`${tableFrom}\` ALTER COLUMN "${columnFrom}" TO "${columnFrom}"${columnTypeValue}${columnNotNullValue}${columnsDefaultValue} REFERENCES ${tableTo}(${columnTo})${onDeleteStatement}${onUpdateStatement};`;
|
12920
|
+
}
|
12921
|
+
};
|
12833
12922
|
MySqlCreateForeignKeyConvertor = class extends Convertor {
|
12834
12923
|
can(statement, dialect7) {
|
12835
12924
|
return statement.type === "create_reference" && dialect7 === "mysql";
|
@@ -12903,8 +12992,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12903
12992
|
}
|
12904
12993
|
};
|
12905
12994
|
SqliteDeleteForeignKeyConvertor = class extends Convertor {
|
12906
|
-
can(statement, dialect7) {
|
12907
|
-
return statement.type === "delete_reference" && dialect7 === "sqlite";
|
12995
|
+
can(statement, dialect7, driver2) {
|
12996
|
+
return statement.type === "delete_reference" && dialect7 === "sqlite" && !driver2;
|
12908
12997
|
}
|
12909
12998
|
convert(statement) {
|
12910
12999
|
return `/*
|
@@ -12916,6 +13005,29 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12916
13005
|
*/`;
|
12917
13006
|
}
|
12918
13007
|
};
|
13008
|
+
LibSQLDeleteForeignKeyConvertor = class extends Convertor {
|
13009
|
+
can(statement, dialect7, driver2) {
|
13010
|
+
return statement.type === "delete_reference" && dialect7 === "sqlite" && driver2 === "turso";
|
13011
|
+
}
|
13012
|
+
convert(statement, json2, action) {
|
13013
|
+
const { columnsFrom, tableFrom } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
13014
|
+
const { columnDefault, columnNotNull, columnType, isMulticolumn } = statement;
|
13015
|
+
if (isMulticolumn) {
|
13016
|
+
return `/*
|
13017
|
+
LibSQL does not support "Creating foreign key on multiple columns" out of the box, we do not generate automatic migration for that, so it has to be done manually
|
13018
|
+
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
|
13019
|
+
https://www.sqlite.org/lang_altertable.html
|
13020
|
+
|
13021
|
+
Due to that we don't generate migration automatically and it has to be done manually
|
13022
|
+
*/`;
|
13023
|
+
}
|
13024
|
+
const columnsDefaultValue = columnDefault ? ` DEFAULT ${columnDefault}` : "";
|
13025
|
+
const columnNotNullValue = columnNotNull ? ` NOT NULL` : "";
|
13026
|
+
const columnTypeValue = columnType ? ` ${columnType}` : "";
|
13027
|
+
const columnFrom = columnsFrom[0];
|
13028
|
+
return `ALTER TABLE \`${tableFrom}\` ALTER COLUMN "${columnFrom}" TO "${columnFrom}"${columnTypeValue}${columnNotNullValue}${columnsDefaultValue};`;
|
13029
|
+
}
|
13030
|
+
};
|
12919
13031
|
MySqlDeleteForeignKeyConvertor = class extends Convertor {
|
12920
13032
|
can(statement, dialect7) {
|
12921
13033
|
return statement.type === "delete_reference" && dialect7 === "mysql";
|
@@ -13079,10 +13191,90 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13079
13191
|
return `DROP INDEX \`${name2}\` ON \`${statement.tableName}\`;`;
|
13080
13192
|
}
|
13081
13193
|
};
|
13194
|
+
SQLiteRecreateTableConvertor = class extends Convertor {
|
13195
|
+
can(statement, dialect7, driver2) {
|
13196
|
+
return statement.type === "recreate_table" && dialect7 === "sqlite" && !driver2;
|
13197
|
+
}
|
13198
|
+
convert(statement) {
|
13199
|
+
const { tableName, columns, compositePKs, referenceData } = statement;
|
13200
|
+
const columnNames = columns.map((it) => `"${it.name}"`).join(", ");
|
13201
|
+
const sqlStatements = [];
|
13202
|
+
sqlStatements.push(
|
13203
|
+
new SqliteRenameTableConvertor().convert({
|
13204
|
+
fromSchema: "",
|
13205
|
+
tableNameFrom: tableName,
|
13206
|
+
tableNameTo: `__old__generate_${tableName}`,
|
13207
|
+
toSchema: "",
|
13208
|
+
type: "rename_table"
|
13209
|
+
})
|
13210
|
+
);
|
13211
|
+
sqlStatements.push(
|
13212
|
+
new SQLiteCreateTableConvertor().convert({
|
13213
|
+
type: "sqlite_create_table",
|
13214
|
+
tableName,
|
13215
|
+
columns,
|
13216
|
+
referenceData,
|
13217
|
+
compositePKs
|
13218
|
+
})
|
13219
|
+
);
|
13220
|
+
sqlStatements.push(
|
13221
|
+
`INSERT INTO \`${tableName}\`(${columnNames}) SELECT ${columnNames} FROM \`__old__generate_${tableName}\`;`
|
13222
|
+
);
|
13223
|
+
sqlStatements.push(
|
13224
|
+
new SQLiteDropTableConvertor().convert({
|
13225
|
+
type: "drop_table",
|
13226
|
+
tableName: `__old__generate_${tableName}`,
|
13227
|
+
schema: ""
|
13228
|
+
})
|
13229
|
+
);
|
13230
|
+
return sqlStatements;
|
13231
|
+
}
|
13232
|
+
};
|
13233
|
+
LibSQLRecreateTableConvertor = class extends Convertor {
|
13234
|
+
can(statement, dialect7, driver2) {
|
13235
|
+
return statement.type === "recreate_table" && dialect7 === "sqlite" && driver2 === "turso";
|
13236
|
+
}
|
13237
|
+
convert(statement) {
|
13238
|
+
const { tableName, columns, compositePKs, referenceData } = statement;
|
13239
|
+
const columnNames = columns.map((it) => `"${it.name}"`).join(", ");
|
13240
|
+
const sqlStatements = [];
|
13241
|
+
sqlStatements.push(
|
13242
|
+
new SqliteRenameTableConvertor().convert({
|
13243
|
+
fromSchema: "",
|
13244
|
+
tableNameFrom: tableName,
|
13245
|
+
tableNameTo: `__old__generate_${tableName}`,
|
13246
|
+
toSchema: "",
|
13247
|
+
type: "rename_table"
|
13248
|
+
})
|
13249
|
+
);
|
13250
|
+
sqlStatements.push(
|
13251
|
+
new SQLiteCreateTableConvertor().convert({
|
13252
|
+
type: "sqlite_create_table",
|
13253
|
+
tableName,
|
13254
|
+
columns,
|
13255
|
+
referenceData,
|
13256
|
+
compositePKs
|
13257
|
+
})
|
13258
|
+
);
|
13259
|
+
sqlStatements.push(
|
13260
|
+
`INSERT INTO \`${tableName}\`(${columnNames}) SELECT ${columnNames} FROM \`__old__generate_${tableName}\`;`
|
13261
|
+
);
|
13262
|
+
sqlStatements.push(
|
13263
|
+
new SQLiteDropTableConvertor().convert({
|
13264
|
+
type: "drop_table",
|
13265
|
+
tableName: `__old__generate_${tableName}`,
|
13266
|
+
schema: ""
|
13267
|
+
})
|
13268
|
+
);
|
13269
|
+
return sqlStatements;
|
13270
|
+
}
|
13271
|
+
};
|
13082
13272
|
convertors = [];
|
13083
13273
|
convertors.push(new PgCreateTableConvertor());
|
13084
13274
|
convertors.push(new MySqlCreateTableConvertor());
|
13085
13275
|
convertors.push(new SQLiteCreateTableConvertor());
|
13276
|
+
convertors.push(new SQLiteRecreateTableConvertor());
|
13277
|
+
convertors.push(new LibSQLRecreateTableConvertor());
|
13086
13278
|
convertors.push(new CreateTypeEnumConvertor());
|
13087
13279
|
convertors.push(new CreatePgSequenceConvertor());
|
13088
13280
|
convertors.push(new DropPgSequenceConvertor());
|
@@ -13130,6 +13322,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13130
13322
|
convertors.push(new SqliteAlterTableAlterColumnAlterGeneratedConvertor());
|
13131
13323
|
convertors.push(new SqliteAlterTableAlterColumnSetExpressionConvertor());
|
13132
13324
|
convertors.push(new MySqlModifyColumn());
|
13325
|
+
convertors.push(new LibSQLModifyColumn());
|
13133
13326
|
convertors.push(new PgCreateForeignKeyConvertor());
|
13134
13327
|
convertors.push(new MySqlCreateForeignKeyConvertor());
|
13135
13328
|
convertors.push(new PgAlterForeignKeyConvertor());
|
@@ -13144,7 +13337,9 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13144
13337
|
convertors.push(new SQLiteAlterTableAlterColumnSetTypeConvertor());
|
13145
13338
|
convertors.push(new SqliteAlterForeignKeyConvertor());
|
13146
13339
|
convertors.push(new SqliteDeleteForeignKeyConvertor());
|
13340
|
+
convertors.push(new LibSQLDeleteForeignKeyConvertor());
|
13147
13341
|
convertors.push(new SqliteCreateForeignKeyConvertor());
|
13342
|
+
convertors.push(new LibSQLCreateForeignKeyConvertor());
|
13148
13343
|
convertors.push(new SQLiteAlterTableAddUniqueConstraintConvertor());
|
13149
13344
|
convertors.push(new SQLiteAlterTableDropUniqueConstraintConvertor());
|
13150
13345
|
convertors.push(new PgAlterTableAlterColumnDropGenerated());
|
@@ -13167,19 +13362,6 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13167
13362
|
convertors.push(new MySqlAlterTableCreateCompositePrimaryKeyConvertor());
|
13168
13363
|
convertors.push(new MySqlAlterTableAddPk());
|
13169
13364
|
convertors.push(new MySqlAlterTableAlterCompositePrimaryKeyConvertor());
|
13170
|
-
fromJson = (statements, dialect7) => {
|
13171
|
-
const result = statements.flatMap((statement) => {
|
13172
|
-
const filtered = convertors.filter((it) => {
|
13173
|
-
return it.can(statement, dialect7);
|
13174
|
-
});
|
13175
|
-
const convertor = filtered.length === 1 ? filtered[0] : void 0;
|
13176
|
-
if (!convertor) {
|
13177
|
-
return "";
|
13178
|
-
}
|
13179
|
-
return convertor.convert(statement);
|
13180
|
-
}).filter((it) => it !== "");
|
13181
|
-
return result;
|
13182
|
-
};
|
13183
13365
|
https: `
|
13184
13366
|
create table users (
|
13185
13367
|
id int,
|
@@ -13206,12 +13388,237 @@ drop type __venum;
|
|
13206
13388
|
}
|
13207
13389
|
});
|
13208
13390
|
|
13391
|
+
// src/cli/commands/sqlitePushUtils.ts
|
13392
|
+
var _moveDataStatements, getOldTableName, getNewTableName, logSuggestionsAndReturn;
|
13393
|
+
var init_sqlitePushUtils = __esm({
|
13394
|
+
"src/cli/commands/sqlitePushUtils.ts"() {
|
13395
|
+
"use strict";
|
13396
|
+
init_source();
|
13397
|
+
init_sqliteSchema();
|
13398
|
+
init_sqlgenerator();
|
13399
|
+
init_utils();
|
13400
|
+
_moveDataStatements = (tableName, json, dataLoss = false) => {
|
13401
|
+
const statements = [];
|
13402
|
+
statements.push(
|
13403
|
+
new SqliteRenameTableConvertor().convert({
|
13404
|
+
type: "rename_table",
|
13405
|
+
tableNameFrom: tableName,
|
13406
|
+
tableNameTo: `__old_push_${tableName}`,
|
13407
|
+
fromSchema: "",
|
13408
|
+
toSchema: ""
|
13409
|
+
})
|
13410
|
+
);
|
13411
|
+
const tableColumns = Object.values(json.tables[tableName].columns);
|
13412
|
+
const referenceData = Object.values(json.tables[tableName].foreignKeys);
|
13413
|
+
const compositePKs = Object.values(
|
13414
|
+
json.tables[tableName].compositePrimaryKeys
|
13415
|
+
).map((it) => SQLiteSquasher.unsquashPK(it));
|
13416
|
+
const fks = referenceData.map((it) => SQLiteSquasher.unsquashPushFK(it));
|
13417
|
+
statements.push(
|
13418
|
+
new SQLiteCreateTableConvertor().convert({
|
13419
|
+
type: "sqlite_create_table",
|
13420
|
+
tableName,
|
13421
|
+
columns: tableColumns,
|
13422
|
+
referenceData: fks,
|
13423
|
+
compositePKs
|
13424
|
+
})
|
13425
|
+
);
|
13426
|
+
if (!dataLoss) {
|
13427
|
+
const columns = Object.keys(json.tables[tableName].columns).map(
|
13428
|
+
(c) => `"${c}"`
|
13429
|
+
);
|
13430
|
+
statements.push(
|
13431
|
+
`INSERT INTO \`${tableName}\`(${columns.join(
|
13432
|
+
", "
|
13433
|
+
)}) SELECT (${columns.join(", ")}) FROM \`__old_push_${tableName}\`;`
|
13434
|
+
);
|
13435
|
+
}
|
13436
|
+
statements.push(
|
13437
|
+
new SQLiteDropTableConvertor().convert({
|
13438
|
+
type: "drop_table",
|
13439
|
+
tableName: `__old_push_${tableName}`,
|
13440
|
+
schema: ""
|
13441
|
+
})
|
13442
|
+
);
|
13443
|
+
for (const idx of Object.values(json.tables[tableName].indexes)) {
|
13444
|
+
statements.push(
|
13445
|
+
new CreateSqliteIndexConvertor().convert({
|
13446
|
+
type: "create_index",
|
13447
|
+
tableName,
|
13448
|
+
schema: "",
|
13449
|
+
data: idx
|
13450
|
+
})
|
13451
|
+
);
|
13452
|
+
}
|
13453
|
+
return statements;
|
13454
|
+
};
|
13455
|
+
getOldTableName = (tableName, meta) => {
|
13456
|
+
for (const key of Object.keys(meta.tables)) {
|
13457
|
+
const value = meta.tables[key];
|
13458
|
+
if (`"${tableName}"` === value) {
|
13459
|
+
return key.substring(1, key.length - 1);
|
13460
|
+
}
|
13461
|
+
}
|
13462
|
+
return tableName;
|
13463
|
+
};
|
13464
|
+
getNewTableName = (tableName, meta) => {
|
13465
|
+
if (typeof meta.tables[`"${tableName}"`] !== "undefined") {
|
13466
|
+
return meta.tables[`"${tableName}"`].substring(
|
13467
|
+
1,
|
13468
|
+
meta.tables[`"${tableName}"`].length - 1
|
13469
|
+
);
|
13470
|
+
}
|
13471
|
+
return tableName;
|
13472
|
+
};
|
13473
|
+
logSuggestionsAndReturn = async (connection, statements, json1, json2, meta) => {
|
13474
|
+
let shouldAskForApprove = false;
|
13475
|
+
const statementsToExecute = [];
|
13476
|
+
const infoToPrint = [];
|
13477
|
+
const tablesToRemove = [];
|
13478
|
+
const columnsToRemove = [];
|
13479
|
+
const schemasToRemove = [];
|
13480
|
+
const tablesToTruncate = [];
|
13481
|
+
for (const statement of statements) {
|
13482
|
+
if (statement.type === "drop_table") {
|
13483
|
+
const res = await connection.query(
|
13484
|
+
`select count(*) as count from \`${statement.tableName}\``
|
13485
|
+
);
|
13486
|
+
const count2 = Number(res[0].count);
|
13487
|
+
if (count2 > 0) {
|
13488
|
+
infoToPrint.push(
|
13489
|
+
`\xB7 You're about to delete ${source_default.underline(
|
13490
|
+
statement.tableName
|
13491
|
+
)} table with ${count2} items`
|
13492
|
+
);
|
13493
|
+
tablesToRemove.push(statement.tableName);
|
13494
|
+
shouldAskForApprove = true;
|
13495
|
+
}
|
13496
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13497
|
+
statementsToExecute.push(
|
13498
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13499
|
+
);
|
13500
|
+
} else if (statement.type === "alter_table_drop_column") {
|
13501
|
+
const tableName = statement.tableName;
|
13502
|
+
const columnName = statement.columnName;
|
13503
|
+
const res = await connection.query(
|
13504
|
+
`select count(\`${tableName}\`.\`${columnName}\`) as count from \`${tableName}\``
|
13505
|
+
);
|
13506
|
+
const count2 = Number(res[0].count);
|
13507
|
+
if (count2 > 0) {
|
13508
|
+
infoToPrint.push(
|
13509
|
+
`\xB7 You're about to delete ${source_default.underline(
|
13510
|
+
columnName
|
13511
|
+
)} column in ${tableName} table with ${count2} items`
|
13512
|
+
);
|
13513
|
+
columnsToRemove.push(`${tableName}_${statement.columnName}`);
|
13514
|
+
shouldAskForApprove = true;
|
13515
|
+
}
|
13516
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13517
|
+
statementsToExecute.push(
|
13518
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13519
|
+
);
|
13520
|
+
} else if (statement.type === "sqlite_alter_table_add_column" && (statement.column.notNull && !statement.column.default)) {
|
13521
|
+
const tableName = statement.tableName;
|
13522
|
+
const columnName = statement.column.name;
|
13523
|
+
const res = await connection.query(
|
13524
|
+
`select count(*) as count from \`${tableName}\``
|
13525
|
+
);
|
13526
|
+
const count2 = Number(res[0].count);
|
13527
|
+
if (count2 > 0) {
|
13528
|
+
infoToPrint.push(
|
13529
|
+
`\xB7 You're about to add not-null ${source_default.underline(
|
13530
|
+
columnName
|
13531
|
+
)} column without default value, which contains ${count2} items`
|
13532
|
+
);
|
13533
|
+
tablesToTruncate.push(tableName);
|
13534
|
+
statementsToExecute.push(`delete from ${tableName};`);
|
13535
|
+
shouldAskForApprove = true;
|
13536
|
+
}
|
13537
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13538
|
+
statementsToExecute.push(
|
13539
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13540
|
+
);
|
13541
|
+
} else if (statement.type === "recreate_table") {
|
13542
|
+
const tableName = statement.tableName;
|
13543
|
+
const oldTableName = getOldTableName(tableName, meta);
|
13544
|
+
const prevColumnNames = Object.keys(json1.tables[oldTableName].columns);
|
13545
|
+
const currentColumnNames = Object.keys(json2.tables[tableName].columns);
|
13546
|
+
const { removedColumns, addedColumns } = findAddedAndRemoved(
|
13547
|
+
prevColumnNames,
|
13548
|
+
currentColumnNames
|
13549
|
+
);
|
13550
|
+
if (removedColumns.length) {
|
13551
|
+
for (const removedColumn of removedColumns) {
|
13552
|
+
const res = await connection.query(
|
13553
|
+
`select count(\`${tableName}\`.\`${removedColumn}\`) as count from \`${tableName}\``
|
13554
|
+
);
|
13555
|
+
const count2 = Number(res[0].count);
|
13556
|
+
if (count2 > 0) {
|
13557
|
+
infoToPrint.push(
|
13558
|
+
`\xB7 You're about to delete ${source_default.underline(
|
13559
|
+
removedColumn
|
13560
|
+
)} column in ${tableName} table with ${count2} items`
|
13561
|
+
);
|
13562
|
+
columnsToRemove.push(removedColumn);
|
13563
|
+
shouldAskForApprove = true;
|
13564
|
+
}
|
13565
|
+
}
|
13566
|
+
}
|
13567
|
+
if (addedColumns.length) {
|
13568
|
+
for (const addedColumn of addedColumns) {
|
13569
|
+
const [res] = await connection.query(
|
13570
|
+
`select count(*) as count from \`${tableName}\``
|
13571
|
+
);
|
13572
|
+
const columnConf = json2.tables[tableName].columns[addedColumn];
|
13573
|
+
const count2 = Number(res.count);
|
13574
|
+
if (count2 > 0 && columnConf.notNull && !columnConf.default) {
|
13575
|
+
infoToPrint.push(
|
13576
|
+
`\xB7 You're about to add not-null ${source_default.underline(
|
13577
|
+
addedColumn
|
13578
|
+
)} column without default value to table, which contains ${count2} items`
|
13579
|
+
);
|
13580
|
+
shouldAskForApprove = true;
|
13581
|
+
tablesToTruncate.push(tableName);
|
13582
|
+
}
|
13583
|
+
}
|
13584
|
+
}
|
13585
|
+
statementsToExecute.push(..._moveDataStatements(tableName, json2));
|
13586
|
+
const tablesReferencingCurrent = [];
|
13587
|
+
for (const table4 of Object.values(json2.tables)) {
|
13588
|
+
const tablesRefs = Object.values(json2.tables[table4.name].foreignKeys).filter((t) => SQLiteSquasher.unsquashPushFK(t).tableTo === tableName).map((it) => SQLiteSquasher.unsquashPushFK(it).tableFrom);
|
13589
|
+
tablesReferencingCurrent.push(...tablesRefs);
|
13590
|
+
}
|
13591
|
+
const uniqueTableRefs = [...new Set(tablesReferencingCurrent)];
|
13592
|
+
for (const table4 of uniqueTableRefs) {
|
13593
|
+
statementsToExecute.push(..._moveDataStatements(table4, json2));
|
13594
|
+
}
|
13595
|
+
} else {
|
13596
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13597
|
+
statementsToExecute.push(
|
13598
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13599
|
+
);
|
13600
|
+
}
|
13601
|
+
}
|
13602
|
+
return {
|
13603
|
+
statementsToExecute,
|
13604
|
+
shouldAskForApprove,
|
13605
|
+
infoToPrint,
|
13606
|
+
columnsToRemove: [...new Set(columnsToRemove)],
|
13607
|
+
schemasToRemove: [...new Set(schemasToRemove)],
|
13608
|
+
tablesToTruncate: [...new Set(tablesToTruncate)],
|
13609
|
+
tablesToRemove: [...new Set(tablesToRemove)]
|
13610
|
+
};
|
13611
|
+
};
|
13612
|
+
}
|
13613
|
+
});
|
13614
|
+
|
13209
13615
|
// src/jsonStatements.ts
|
13210
|
-
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
|
13616
|
+
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
|
13211
13617
|
var init_jsonStatements = __esm({
|
13212
13618
|
"src/jsonStatements.ts"() {
|
13213
13619
|
"use strict";
|
13214
13620
|
init_source();
|
13621
|
+
init_sqlitePushUtils();
|
13215
13622
|
init_views();
|
13216
13623
|
init_mysqlSchema();
|
13217
13624
|
init_pgSchema();
|
@@ -13995,6 +14402,49 @@ var init_jsonStatements = __esm({
|
|
13995
14402
|
const columnPk = json2.tables[tableName].columns[columnName].primaryKey;
|
13996
14403
|
const columnGenerated = json2.tables[tableName].columns[columnName].generated;
|
13997
14404
|
const compositePk = json2.tables[tableName].compositePrimaryKeys[`${tableName}_${columnName}`];
|
14405
|
+
if (column4.autoincrement?.type === "added") {
|
14406
|
+
statements.push({
|
14407
|
+
type: "alter_table_alter_column_set_autoincrement",
|
14408
|
+
tableName,
|
14409
|
+
columnName,
|
14410
|
+
schema: schema4,
|
14411
|
+
newDataType: columnType,
|
14412
|
+
columnDefault,
|
14413
|
+
columnOnUpdate,
|
14414
|
+
columnNotNull,
|
14415
|
+
columnAutoIncrement,
|
14416
|
+
columnPk
|
14417
|
+
});
|
14418
|
+
}
|
14419
|
+
if (column4.autoincrement?.type === "changed") {
|
14420
|
+
const type = column4.autoincrement.new ? "alter_table_alter_column_set_autoincrement" : "alter_table_alter_column_drop_autoincrement";
|
14421
|
+
statements.push({
|
14422
|
+
type,
|
14423
|
+
tableName,
|
14424
|
+
columnName,
|
14425
|
+
schema: schema4,
|
14426
|
+
newDataType: columnType,
|
14427
|
+
columnDefault,
|
14428
|
+
columnOnUpdate,
|
14429
|
+
columnNotNull,
|
14430
|
+
columnAutoIncrement,
|
14431
|
+
columnPk
|
14432
|
+
});
|
14433
|
+
}
|
14434
|
+
if (column4.autoincrement?.type === "deleted") {
|
14435
|
+
statements.push({
|
14436
|
+
type: "alter_table_alter_column_drop_autoincrement",
|
14437
|
+
tableName,
|
14438
|
+
columnName,
|
14439
|
+
schema: schema4,
|
14440
|
+
newDataType: columnType,
|
14441
|
+
columnDefault,
|
14442
|
+
columnOnUpdate,
|
14443
|
+
columnNotNull,
|
14444
|
+
columnAutoIncrement,
|
14445
|
+
columnPk
|
14446
|
+
});
|
14447
|
+
}
|
13998
14448
|
if (typeof column4.name !== "string") {
|
13999
14449
|
statements.push({
|
14000
14450
|
type: "alter_table_rename_column",
|
@@ -14258,33 +14708,111 @@ var init_jsonStatements = __esm({
|
|
14258
14708
|
};
|
14259
14709
|
});
|
14260
14710
|
};
|
14261
|
-
|
14711
|
+
prepareLibSQLCreateReferencesJson = (tableName, schema4, foreignKeys, json2, action) => {
|
14262
14712
|
return Object.values(foreignKeys).map((fkData) => {
|
14713
|
+
const { columnsFrom, tableFrom, columnsTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(fkData) : SQLiteSquasher.unsquashFK(fkData);
|
14714
|
+
let isMulticolumn = false;
|
14715
|
+
if (columnsFrom.length > 1 || columnsTo.length > 1) {
|
14716
|
+
isMulticolumn = true;
|
14717
|
+
return {
|
14718
|
+
type: "create_reference",
|
14719
|
+
tableName,
|
14720
|
+
data: fkData,
|
14721
|
+
schema: schema4,
|
14722
|
+
isMulticolumn
|
14723
|
+
};
|
14724
|
+
}
|
14725
|
+
const columnFrom = columnsFrom[0];
|
14726
|
+
const {
|
14727
|
+
notNull: columnNotNull,
|
14728
|
+
default: columnDefault,
|
14729
|
+
type: columnType
|
14730
|
+
} = json2.tables[tableFrom].columns[columnFrom];
|
14263
14731
|
return {
|
14264
|
-
type: "
|
14732
|
+
type: "create_reference",
|
14265
14733
|
tableName,
|
14266
14734
|
data: fkData,
|
14267
|
-
schema: schema4
|
14735
|
+
schema: schema4,
|
14736
|
+
columnNotNull,
|
14737
|
+
columnDefault,
|
14738
|
+
columnType
|
14268
14739
|
};
|
14269
14740
|
});
|
14270
14741
|
};
|
14271
|
-
|
14272
|
-
|
14273
|
-
|
14274
|
-
stmts.push({
|
14742
|
+
prepareDropReferencesJson = (tableName, schema4, foreignKeys) => {
|
14743
|
+
return Object.values(foreignKeys).map((fkData) => {
|
14744
|
+
return {
|
14275
14745
|
type: "delete_reference",
|
14276
14746
|
tableName,
|
14277
|
-
|
14278
|
-
|
14279
|
-
}
|
14280
|
-
stmts.push({
|
14281
|
-
type: "create_reference",
|
14282
|
-
tableName,
|
14283
|
-
schema: schema4,
|
14284
|
-
data: val.__new
|
14285
|
-
});
|
14747
|
+
data: fkData,
|
14748
|
+
schema: schema4
|
14749
|
+
};
|
14286
14750
|
});
|
14287
|
-
|
14751
|
+
};
|
14752
|
+
prepareLibSQLDropReferencesJson = (tableName, schema4, foreignKeys, json2, meta, action) => {
|
14753
|
+
const statements = Object.values(foreignKeys).map((fkData) => {
|
14754
|
+
const { columnsFrom, tableFrom, columnsTo, name: name2, tableTo, onDelete, onUpdate } = action === "push" ? SQLiteSquasher.unsquashPushFK(fkData) : SQLiteSquasher.unsquashFK(fkData);
|
14755
|
+
const keys = Object.keys(json2.tables[tableName].columns);
|
14756
|
+
const filtered = columnsFrom.filter((it) => keys.includes(it));
|
14757
|
+
const fullDrop = filtered.length === 0;
|
14758
|
+
if (fullDrop) return;
|
14759
|
+
let isMulticolumn = false;
|
14760
|
+
if (columnsFrom.length > 1 || columnsTo.length > 1) {
|
14761
|
+
isMulticolumn = true;
|
14762
|
+
return {
|
14763
|
+
type: "delete_reference",
|
14764
|
+
tableName,
|
14765
|
+
data: fkData,
|
14766
|
+
schema: schema4,
|
14767
|
+
isMulticolumn
|
14768
|
+
};
|
14769
|
+
}
|
14770
|
+
const columnFrom = columnsFrom[0];
|
14771
|
+
const newTableName = getNewTableName(tableFrom, meta);
|
14772
|
+
const {
|
14773
|
+
notNull: columnNotNull,
|
14774
|
+
default: columnDefault,
|
14775
|
+
type: columnType
|
14776
|
+
} = json2.tables[newTableName].columns[columnFrom];
|
14777
|
+
const fkToSquash = {
|
14778
|
+
columnsFrom,
|
14779
|
+
columnsTo,
|
14780
|
+
name: name2,
|
14781
|
+
tableFrom: newTableName,
|
14782
|
+
tableTo,
|
14783
|
+
onDelete,
|
14784
|
+
onUpdate
|
14785
|
+
};
|
14786
|
+
const foreignKey = action === "push" ? SQLiteSquasher.squashPushFK(fkToSquash) : SQLiteSquasher.squashFK(fkToSquash);
|
14787
|
+
return {
|
14788
|
+
type: "delete_reference",
|
14789
|
+
tableName,
|
14790
|
+
data: foreignKey,
|
14791
|
+
schema: schema4,
|
14792
|
+
columnNotNull,
|
14793
|
+
columnDefault,
|
14794
|
+
columnType
|
14795
|
+
};
|
14796
|
+
});
|
14797
|
+
return statements.filter((it) => it);
|
14798
|
+
};
|
14799
|
+
prepareAlterReferencesJson = (tableName, schema4, foreignKeys) => {
|
14800
|
+
const stmts = [];
|
14801
|
+
Object.values(foreignKeys).map((val) => {
|
14802
|
+
stmts.push({
|
14803
|
+
type: "delete_reference",
|
14804
|
+
tableName,
|
14805
|
+
schema: schema4,
|
14806
|
+
data: val.__old
|
14807
|
+
});
|
14808
|
+
stmts.push({
|
14809
|
+
type: "create_reference",
|
14810
|
+
tableName,
|
14811
|
+
schema: schema4,
|
14812
|
+
data: val.__new
|
14813
|
+
});
|
14814
|
+
});
|
14815
|
+
return stmts;
|
14288
14816
|
};
|
14289
14817
|
prepareDropIndexesJson = (tableName, schema4, indexes) => {
|
14290
14818
|
return Object.values(indexes).map((indexData) => {
|
@@ -14421,10 +14949,298 @@ var init_jsonStatements = __esm({
|
|
14421
14949
|
}
|
14422
14950
|
});
|
14423
14951
|
|
14952
|
+
// src/statementCombiner.ts
|
14953
|
+
var prepareLibSQLRecreateTable, prepareSQLiteRecreateTable, libSQLCombineStatements, sqliteCombineStatements;
|
14954
|
+
var init_statementCombiner = __esm({
|
14955
|
+
"src/statementCombiner.ts"() {
|
14956
|
+
"use strict";
|
14957
|
+
init_jsonStatements();
|
14958
|
+
init_sqliteSchema();
|
14959
|
+
prepareLibSQLRecreateTable = (table4, action) => {
|
14960
|
+
const { name: name2, columns, uniqueConstraints, indexes } = table4;
|
14961
|
+
const composites = Object.values(table4.compositePrimaryKeys).map(
|
14962
|
+
(it) => SQLiteSquasher.unsquashPK(it)
|
14963
|
+
);
|
14964
|
+
const references2 = Object.values(table4.foreignKeys);
|
14965
|
+
const fks = references2.map(
|
14966
|
+
(it) => action === "push" ? SQLiteSquasher.unsquashPushFK(it) : SQLiteSquasher.unsquashFK(it)
|
14967
|
+
);
|
14968
|
+
const statements = [
|
14969
|
+
{
|
14970
|
+
type: "recreate_table",
|
14971
|
+
tableName: name2,
|
14972
|
+
columns: Object.values(columns),
|
14973
|
+
compositePKs: composites,
|
14974
|
+
referenceData: fks,
|
14975
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
14976
|
+
}
|
14977
|
+
];
|
14978
|
+
if (Object.keys(indexes).length) {
|
14979
|
+
statements.push(...prepareCreateIndexesJson(name2, "", indexes));
|
14980
|
+
}
|
14981
|
+
return statements;
|
14982
|
+
};
|
14983
|
+
prepareSQLiteRecreateTable = (table4, action) => {
|
14984
|
+
const { name: name2, columns, uniqueConstraints, indexes } = table4;
|
14985
|
+
const composites = Object.values(table4.compositePrimaryKeys).map(
|
14986
|
+
(it) => SQLiteSquasher.unsquashPK(it)
|
14987
|
+
);
|
14988
|
+
const references2 = Object.values(table4.foreignKeys);
|
14989
|
+
const fks = references2.map(
|
14990
|
+
(it) => action === "push" ? SQLiteSquasher.unsquashPushFK(it) : SQLiteSquasher.unsquashFK(it)
|
14991
|
+
);
|
14992
|
+
const statements = [
|
14993
|
+
{
|
14994
|
+
type: "recreate_table",
|
14995
|
+
tableName: name2,
|
14996
|
+
columns: Object.values(columns),
|
14997
|
+
compositePKs: composites,
|
14998
|
+
referenceData: fks,
|
14999
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
15000
|
+
}
|
15001
|
+
];
|
15002
|
+
if (Object.keys(indexes).length) {
|
15003
|
+
statements.push(...prepareCreateIndexesJson(name2, "", indexes));
|
15004
|
+
}
|
15005
|
+
return statements;
|
15006
|
+
};
|
15007
|
+
libSQLCombineStatements = (statements, json2, action) => {
|
15008
|
+
const newStatements = {};
|
15009
|
+
for (const statement of statements) {
|
15010
|
+
if (statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk" || statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk") {
|
15011
|
+
const tableName2 = statement.tableName;
|
15012
|
+
const statementsForTable2 = newStatements[tableName2];
|
15013
|
+
if (!statementsForTable2) {
|
15014
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15015
|
+
continue;
|
15016
|
+
}
|
15017
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15018
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15019
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15020
|
+
if (wasRename) {
|
15021
|
+
newStatements[tableName2].push(...preparedStatements);
|
15022
|
+
} else {
|
15023
|
+
newStatements[tableName2] = preparedStatements;
|
15024
|
+
}
|
15025
|
+
continue;
|
15026
|
+
}
|
15027
|
+
continue;
|
15028
|
+
}
|
15029
|
+
if (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") {
|
15030
|
+
const { tableName: tableName2, columnName, columnPk } = statement;
|
15031
|
+
const columnIsPartOfUniqueIndex = Object.values(
|
15032
|
+
json2.tables[tableName2].indexes
|
15033
|
+
).some((it) => {
|
15034
|
+
const unsquashIndex = SQLiteSquasher.unsquashIdx(it);
|
15035
|
+
return unsquashIndex.columns.includes(columnName) && unsquashIndex.isUnique;
|
15036
|
+
});
|
15037
|
+
const columnIsPartOfForeignKey = Object.values(
|
15038
|
+
json2.tables[tableName2].foreignKeys
|
15039
|
+
).some((it) => {
|
15040
|
+
const unsquashFk = action === "push" ? SQLiteSquasher.unsquashPushFK(it) : SQLiteSquasher.unsquashFK(it);
|
15041
|
+
return unsquashFk.columnsFrom.includes(columnName);
|
15042
|
+
});
|
15043
|
+
const statementsForTable2 = newStatements[tableName2];
|
15044
|
+
if (!statementsForTable2 && (columnIsPartOfUniqueIndex || columnIsPartOfForeignKey || columnPk)) {
|
15045
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15046
|
+
continue;
|
15047
|
+
}
|
15048
|
+
if (statementsForTable2 && (columnIsPartOfUniqueIndex || columnIsPartOfForeignKey || columnPk)) {
|
15049
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15050
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15051
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15052
|
+
if (wasRename) {
|
15053
|
+
newStatements[tableName2].push(...preparedStatements);
|
15054
|
+
} else {
|
15055
|
+
newStatements[tableName2] = preparedStatements;
|
15056
|
+
}
|
15057
|
+
}
|
15058
|
+
continue;
|
15059
|
+
}
|
15060
|
+
if (statementsForTable2 && !(columnIsPartOfUniqueIndex || columnIsPartOfForeignKey || columnPk)) {
|
15061
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15062
|
+
newStatements[tableName2].push(statement);
|
15063
|
+
}
|
15064
|
+
continue;
|
15065
|
+
}
|
15066
|
+
newStatements[tableName2] = [statement];
|
15067
|
+
continue;
|
15068
|
+
}
|
15069
|
+
if (statement.type === "create_reference") {
|
15070
|
+
const tableName2 = statement.tableName;
|
15071
|
+
const data = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
15072
|
+
const statementsForTable2 = newStatements[tableName2];
|
15073
|
+
if (!statementsForTable2) {
|
15074
|
+
newStatements[tableName2] = statement.isMulticolumn ? prepareLibSQLRecreateTable(json2.tables[tableName2], action) : newStatements[tableName2] = [statement];
|
15075
|
+
continue;
|
15076
|
+
}
|
15077
|
+
if (!statement.isMulticolumn && statementsForTable2.some(
|
15078
|
+
(st) => st.type === "sqlite_alter_table_add_column" && st.column.name === data.columnsFrom[0]
|
15079
|
+
)) {
|
15080
|
+
continue;
|
15081
|
+
}
|
15082
|
+
if (statement.isMulticolumn) {
|
15083
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15084
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15085
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15086
|
+
if (wasRename) {
|
15087
|
+
newStatements[tableName2].push(...preparedStatements);
|
15088
|
+
} else {
|
15089
|
+
newStatements[tableName2] = preparedStatements;
|
15090
|
+
}
|
15091
|
+
continue;
|
15092
|
+
}
|
15093
|
+
continue;
|
15094
|
+
}
|
15095
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15096
|
+
newStatements[tableName2].push(statement);
|
15097
|
+
}
|
15098
|
+
continue;
|
15099
|
+
}
|
15100
|
+
if (statement.type === "delete_reference") {
|
15101
|
+
const tableName2 = statement.tableName;
|
15102
|
+
const statementsForTable2 = newStatements[tableName2];
|
15103
|
+
if (!statementsForTable2) {
|
15104
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15105
|
+
continue;
|
15106
|
+
}
|
15107
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15108
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15109
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15110
|
+
if (wasRename) {
|
15111
|
+
newStatements[tableName2].push(...preparedStatements);
|
15112
|
+
} else {
|
15113
|
+
newStatements[tableName2] = preparedStatements;
|
15114
|
+
}
|
15115
|
+
continue;
|
15116
|
+
}
|
15117
|
+
continue;
|
15118
|
+
}
|
15119
|
+
if (statement.type === "sqlite_alter_table_add_column" && statement.column.primaryKey) {
|
15120
|
+
const tableName2 = statement.tableName;
|
15121
|
+
const statementsForTable2 = newStatements[tableName2];
|
15122
|
+
if (!statementsForTable2) {
|
15123
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15124
|
+
continue;
|
15125
|
+
}
|
15126
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15127
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15128
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15129
|
+
if (wasRename) {
|
15130
|
+
newStatements[tableName2].push(...preparedStatements);
|
15131
|
+
} else {
|
15132
|
+
newStatements[tableName2] = preparedStatements;
|
15133
|
+
}
|
15134
|
+
continue;
|
15135
|
+
}
|
15136
|
+
continue;
|
15137
|
+
}
|
15138
|
+
const tableName = statement.type === "rename_table" ? statement.tableNameTo : statement.tableName;
|
15139
|
+
const statementsForTable = newStatements[tableName];
|
15140
|
+
if (!statementsForTable) {
|
15141
|
+
newStatements[tableName] = [statement];
|
15142
|
+
continue;
|
15143
|
+
}
|
15144
|
+
if (!statementsForTable.some(({ type }) => type === "recreate_table")) {
|
15145
|
+
newStatements[tableName].push(statement);
|
15146
|
+
}
|
15147
|
+
}
|
15148
|
+
const combinedStatements = Object.values(newStatements).flat();
|
15149
|
+
const renamedTables = combinedStatements.filter((it) => it.type === "rename_table");
|
15150
|
+
const renamedColumns = combinedStatements.filter((it) => it.type === "alter_table_rename_column");
|
15151
|
+
const rest = combinedStatements.filter((it) => it.type !== "rename_table" && it.type !== "alter_table_rename_column");
|
15152
|
+
return [...renamedTables, ...renamedColumns, ...rest];
|
15153
|
+
};
|
15154
|
+
sqliteCombineStatements = (statements, json2, action) => {
|
15155
|
+
const newStatements = {};
|
15156
|
+
for (const statement of statements) {
|
15157
|
+
if (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk" || statement.type === "delete_reference" || statement.type === "alter_reference" || statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk" || statement.type === "create_unique_constraint" || statement.type === "delete_unique_constraint") {
|
15158
|
+
const tableName2 = statement.tableName;
|
15159
|
+
const statementsForTable2 = newStatements[tableName2];
|
15160
|
+
if (!statementsForTable2) {
|
15161
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15162
|
+
continue;
|
15163
|
+
}
|
15164
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15165
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15166
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15167
|
+
if (wasRename) {
|
15168
|
+
newStatements[tableName2].push(...preparedStatements);
|
15169
|
+
} else {
|
15170
|
+
newStatements[tableName2] = preparedStatements;
|
15171
|
+
}
|
15172
|
+
continue;
|
15173
|
+
}
|
15174
|
+
continue;
|
15175
|
+
}
|
15176
|
+
if (statement.type === "sqlite_alter_table_add_column" && statement.column.primaryKey) {
|
15177
|
+
const tableName2 = statement.tableName;
|
15178
|
+
const statementsForTable2 = newStatements[tableName2];
|
15179
|
+
if (!statementsForTable2) {
|
15180
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15181
|
+
continue;
|
15182
|
+
}
|
15183
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15184
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15185
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15186
|
+
if (wasRename) {
|
15187
|
+
newStatements[tableName2].push(...preparedStatements);
|
15188
|
+
} else {
|
15189
|
+
newStatements[tableName2] = preparedStatements;
|
15190
|
+
}
|
15191
|
+
continue;
|
15192
|
+
}
|
15193
|
+
continue;
|
15194
|
+
}
|
15195
|
+
if (statement.type === "create_reference") {
|
15196
|
+
const tableName2 = statement.tableName;
|
15197
|
+
const data = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
15198
|
+
const statementsForTable2 = newStatements[tableName2];
|
15199
|
+
if (!statementsForTable2) {
|
15200
|
+
newStatements[tableName2] = prepareSQLiteRecreateTable(json2.tables[tableName2], action);
|
15201
|
+
continue;
|
15202
|
+
}
|
15203
|
+
if (data.columnsFrom.length === 1 && statementsForTable2.some(
|
15204
|
+
(st) => st.type === "sqlite_alter_table_add_column" && st.column.name === data.columnsFrom[0]
|
15205
|
+
)) {
|
15206
|
+
continue;
|
15207
|
+
}
|
15208
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15209
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15210
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15211
|
+
if (wasRename) {
|
15212
|
+
newStatements[tableName2].push(...preparedStatements);
|
15213
|
+
} else {
|
15214
|
+
newStatements[tableName2] = preparedStatements;
|
15215
|
+
}
|
15216
|
+
continue;
|
15217
|
+
}
|
15218
|
+
continue;
|
15219
|
+
}
|
15220
|
+
const tableName = statement.type === "rename_table" ? statement.tableNameTo : statement.tableName;
|
15221
|
+
const statementsForTable = newStatements[tableName];
|
15222
|
+
if (!statementsForTable) {
|
15223
|
+
newStatements[tableName] = [statement];
|
15224
|
+
continue;
|
15225
|
+
}
|
15226
|
+
if (!statementsForTable.some(({ type }) => type === "recreate_table")) {
|
15227
|
+
newStatements[tableName].push(statement);
|
15228
|
+
}
|
15229
|
+
}
|
15230
|
+
const combinedStatements = Object.values(newStatements).flat();
|
15231
|
+
const renamedTables = combinedStatements.filter((it) => it.type === "rename_table");
|
15232
|
+
const renamedColumns = combinedStatements.filter((it) => it.type === "alter_table_rename_column");
|
15233
|
+
const rest = combinedStatements.filter((it) => it.type !== "rename_table" && it.type !== "alter_table_rename_column");
|
15234
|
+
return [...renamedTables, ...renamedColumns, ...rest];
|
15235
|
+
};
|
15236
|
+
}
|
15237
|
+
});
|
15238
|
+
|
14424
15239
|
// src/snapshotsDiffer.ts
|
14425
15240
|
var snapshotsDiffer_exports = {};
|
14426
15241
|
__export(snapshotsDiffer_exports, {
|
14427
15242
|
alteredTableScheme: () => alteredTableScheme,
|
15243
|
+
applyLibSQLSnapshotsDiff: () => applyLibSQLSnapshotsDiff,
|
14428
15244
|
applyMysqlSnapshotsDiff: () => applyMysqlSnapshotsDiff,
|
14429
15245
|
applyPgSnapshotsDiff: () => applyPgSnapshotsDiff,
|
14430
15246
|
applySqliteSnapshotsDiff: () => applySqliteSnapshotsDiff,
|
@@ -14434,7 +15250,7 @@ __export(snapshotsDiffer_exports, {
|
|
14434
15250
|
makePatched: () => makePatched,
|
14435
15251
|
makeSelfOrPatched: () => makeSelfOrPatched
|
14436
15252
|
});
|
14437
|
-
var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema, alteredColumnSchema, enumSchema2, changedEnumSchema, tableScheme, alteredTableScheme, diffResultScheme, diffResultSchemeMysql, diffResultSchemeSQLite, schemaChangeFor, nameChangeFor, nameSchemaChangeFor, columnChangeFor, applyPgSnapshotsDiff, applyMysqlSnapshotsDiff, applySqliteSnapshotsDiff;
|
15253
|
+
var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema, alteredColumnSchema, enumSchema2, changedEnumSchema, tableScheme, alteredTableScheme, diffResultScheme, diffResultSchemeMysql, diffResultSchemeSQLite, schemaChangeFor, nameChangeFor, nameSchemaChangeFor, columnChangeFor, applyPgSnapshotsDiff, applyMysqlSnapshotsDiff, applySqliteSnapshotsDiff, applyLibSQLSnapshotsDiff;
|
14438
15254
|
var init_snapshotsDiffer = __esm({
|
14439
15255
|
"src/snapshotsDiffer.ts"() {
|
14440
15256
|
"use strict";
|
@@ -14446,6 +15262,7 @@ var init_snapshotsDiffer = __esm({
|
|
14446
15262
|
init_mysqlSchema();
|
14447
15263
|
init_pgSchema();
|
14448
15264
|
init_sqliteSchema();
|
15265
|
+
init_statementCombiner();
|
14449
15266
|
init_utils();
|
14450
15267
|
makeChanged = (schema4) => {
|
14451
15268
|
return objectType({
|
@@ -15363,9 +16180,308 @@ var init_snapshotsDiffer = __esm({
|
|
15363
16180
|
);
|
15364
16181
|
alteredCompositePKs = prepareAlterCompositePrimaryKeyMySql(
|
15365
16182
|
it.name,
|
15366
|
-
it.alteredCompositePKs,
|
15367
|
-
prevFull,
|
15368
|
-
curFull
|
16183
|
+
it.alteredCompositePKs,
|
16184
|
+
prevFull,
|
16185
|
+
curFull
|
16186
|
+
);
|
16187
|
+
let addedUniqueConstraints = [];
|
16188
|
+
let deletedUniqueConstraints = [];
|
16189
|
+
let alteredUniqueConstraints = [];
|
16190
|
+
addedUniqueConstraints = prepareAddUniqueConstraintPg(
|
16191
|
+
it.name,
|
16192
|
+
it.schema,
|
16193
|
+
it.addedUniqueConstraints
|
16194
|
+
);
|
16195
|
+
deletedUniqueConstraints = prepareDeleteUniqueConstraintPg(
|
16196
|
+
it.name,
|
16197
|
+
it.schema,
|
16198
|
+
it.deletedUniqueConstraints
|
16199
|
+
);
|
16200
|
+
if (it.alteredUniqueConstraints) {
|
16201
|
+
const added = {};
|
16202
|
+
const deleted = {};
|
16203
|
+
for (const k of Object.keys(it.alteredUniqueConstraints)) {
|
16204
|
+
added[k] = it.alteredUniqueConstraints[k].__new;
|
16205
|
+
deleted[k] = it.alteredUniqueConstraints[k].__old;
|
16206
|
+
}
|
16207
|
+
addedUniqueConstraints.push(
|
16208
|
+
...prepareAddUniqueConstraintPg(it.name, it.schema, added)
|
16209
|
+
);
|
16210
|
+
deletedUniqueConstraints.push(
|
16211
|
+
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
16212
|
+
);
|
16213
|
+
}
|
16214
|
+
jsonAddedCompositePKs.push(...addedCompositePKs);
|
16215
|
+
jsonDeletedCompositePKs.push(...deletedCompositePKs);
|
16216
|
+
jsonAlteredCompositePKs.push(...alteredCompositePKs);
|
16217
|
+
jsonAddedUniqueConstraints.push(...addedUniqueConstraints);
|
16218
|
+
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
16219
|
+
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
16220
|
+
});
|
16221
|
+
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
16222
|
+
const tableName = it.tableName;
|
16223
|
+
const schema4 = it.schema;
|
16224
|
+
return {
|
16225
|
+
from: { schema: schema4, table: tableName, column: it.oldColumnName },
|
16226
|
+
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
16227
|
+
};
|
16228
|
+
});
|
16229
|
+
const jsonTableAlternations = alteredTables.map((it) => {
|
16230
|
+
return prepareAlterColumnsMysql(
|
16231
|
+
it.name,
|
16232
|
+
it.schema,
|
16233
|
+
it.altered,
|
16234
|
+
json1,
|
16235
|
+
json2,
|
16236
|
+
action
|
16237
|
+
);
|
16238
|
+
}).flat();
|
16239
|
+
const jsonCreateIndexesForAllAlteredTables = alteredTables.map((it) => {
|
16240
|
+
return prepareCreateIndexesJson(
|
16241
|
+
it.name,
|
16242
|
+
it.schema,
|
16243
|
+
it.addedIndexes || {},
|
16244
|
+
curFull.internal
|
16245
|
+
);
|
16246
|
+
}).flat();
|
16247
|
+
const jsonDropIndexesForAllAlteredTables = alteredTables.map((it) => {
|
16248
|
+
return prepareDropIndexesJson(
|
16249
|
+
it.name,
|
16250
|
+
it.schema,
|
16251
|
+
it.deletedIndexes || {}
|
16252
|
+
);
|
16253
|
+
}).flat();
|
16254
|
+
alteredTables.forEach((it) => {
|
16255
|
+
const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
|
16256
|
+
(current, item) => {
|
16257
|
+
current[item] = it.alteredIndexes[item].__old;
|
16258
|
+
return current;
|
16259
|
+
},
|
16260
|
+
{}
|
16261
|
+
);
|
16262
|
+
const createdIndexes = Object.keys(it.alteredIndexes).reduce(
|
16263
|
+
(current, item) => {
|
16264
|
+
current[item] = it.alteredIndexes[item].__new;
|
16265
|
+
return current;
|
16266
|
+
},
|
16267
|
+
{}
|
16268
|
+
);
|
16269
|
+
jsonCreateIndexesForAllAlteredTables.push(
|
16270
|
+
...prepareCreateIndexesJson(it.name, it.schema, createdIndexes || {})
|
16271
|
+
);
|
16272
|
+
jsonDropIndexesForAllAlteredTables.push(
|
16273
|
+
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
16274
|
+
);
|
16275
|
+
});
|
16276
|
+
const jsonCreateReferencesForCreatedTables = createdTables.map((it) => {
|
16277
|
+
return prepareCreateReferencesJson(it.name, it.schema, it.foreignKeys);
|
16278
|
+
}).flat();
|
16279
|
+
const jsonReferencesForAllAlteredTables = alteredTables.map((it) => {
|
16280
|
+
const forAdded = prepareCreateReferencesJson(
|
16281
|
+
it.name,
|
16282
|
+
it.schema,
|
16283
|
+
it.addedForeignKeys
|
16284
|
+
);
|
16285
|
+
const forAltered = prepareDropReferencesJson(
|
16286
|
+
it.name,
|
16287
|
+
it.schema,
|
16288
|
+
it.deletedForeignKeys
|
16289
|
+
);
|
16290
|
+
const alteredFKs = prepareAlterReferencesJson(
|
16291
|
+
it.name,
|
16292
|
+
it.schema,
|
16293
|
+
it.alteredForeignKeys
|
16294
|
+
);
|
16295
|
+
return [...forAdded, ...forAltered, ...alteredFKs];
|
16296
|
+
}).flat();
|
16297
|
+
const jsonCreatedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
16298
|
+
(t) => t.type === "create_reference"
|
16299
|
+
);
|
16300
|
+
const jsonDroppedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
16301
|
+
(t) => t.type === "delete_reference"
|
16302
|
+
);
|
16303
|
+
const jsonMySqlCreateTables = createdTables.map((it) => {
|
16304
|
+
return prepareMySqlCreateTableJson(
|
16305
|
+
it,
|
16306
|
+
curFull,
|
16307
|
+
curFull.internal
|
16308
|
+
);
|
16309
|
+
});
|
16310
|
+
jsonStatements.push(...jsonMySqlCreateTables);
|
16311
|
+
jsonStatements.push(...jsonDropTables);
|
16312
|
+
jsonStatements.push(...jsonRenameTables);
|
16313
|
+
jsonStatements.push(...jsonRenameColumnsStatements);
|
16314
|
+
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
16315
|
+
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
16316
|
+
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
16317
|
+
jsonStatements.push(...jsonDeletedCompositePKs);
|
16318
|
+
jsonStatements.push(...jsonTableAlternations);
|
16319
|
+
jsonStatements.push(...jsonAddedCompositePKs);
|
16320
|
+
jsonStatements.push(...jsonAddedUniqueConstraints);
|
16321
|
+
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
16322
|
+
jsonStatements.push(...jsonAddColumnsStatemets);
|
16323
|
+
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
16324
|
+
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
16325
|
+
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
16326
|
+
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
16327
|
+
jsonStatements.push(...jsonDropColumnsStatemets);
|
16328
|
+
jsonStatements.push(...jsonAlteredCompositePKs);
|
16329
|
+
jsonStatements.push(...jsonAddedUniqueConstraints);
|
16330
|
+
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
16331
|
+
const sqlStatements = fromJson(jsonStatements, "mysql");
|
16332
|
+
const uniqueSqlStatements = [];
|
16333
|
+
sqlStatements.forEach((ss) => {
|
16334
|
+
if (!uniqueSqlStatements.includes(ss)) {
|
16335
|
+
uniqueSqlStatements.push(ss);
|
16336
|
+
}
|
16337
|
+
});
|
16338
|
+
const rTables = renamedTables.map((it) => {
|
16339
|
+
return { from: it.from, to: it.to };
|
16340
|
+
});
|
16341
|
+
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
16342
|
+
return {
|
16343
|
+
statements: jsonStatements,
|
16344
|
+
sqlStatements: uniqueSqlStatements,
|
16345
|
+
_meta
|
16346
|
+
};
|
16347
|
+
};
|
16348
|
+
applySqliteSnapshotsDiff = async (json1, json2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
|
16349
|
+
const tablesDiff = diffSchemasOrTables(json1.tables, json2.tables);
|
16350
|
+
const {
|
16351
|
+
created: createdTables,
|
16352
|
+
deleted: deletedTables,
|
16353
|
+
renamed: renamedTables
|
16354
|
+
} = await tablesResolver2({
|
16355
|
+
created: tablesDiff.added,
|
16356
|
+
deleted: tablesDiff.deleted
|
16357
|
+
});
|
16358
|
+
const tablesPatchedSnap1 = copy(json1);
|
16359
|
+
tablesPatchedSnap1.tables = mapEntries(tablesPatchedSnap1.tables, (_2, it) => {
|
16360
|
+
const { name: name2 } = nameChangeFor(it, renamedTables);
|
16361
|
+
it.name = name2;
|
16362
|
+
return [name2, it];
|
16363
|
+
});
|
16364
|
+
const res = diffColumns(tablesPatchedSnap1.tables, json2.tables);
|
16365
|
+
const columnRenames = [];
|
16366
|
+
const columnCreates = [];
|
16367
|
+
const columnDeletes = [];
|
16368
|
+
for (let entry of Object.values(res)) {
|
16369
|
+
const { renamed, created, deleted } = await columnsResolver2({
|
16370
|
+
tableName: entry.name,
|
16371
|
+
schema: entry.schema,
|
16372
|
+
deleted: entry.columns.deleted,
|
16373
|
+
created: entry.columns.added
|
16374
|
+
});
|
16375
|
+
if (created.length > 0) {
|
16376
|
+
columnCreates.push({
|
16377
|
+
table: entry.name,
|
16378
|
+
columns: created
|
16379
|
+
});
|
16380
|
+
}
|
16381
|
+
if (deleted.length > 0) {
|
16382
|
+
columnDeletes.push({
|
16383
|
+
table: entry.name,
|
16384
|
+
columns: deleted
|
16385
|
+
});
|
16386
|
+
}
|
16387
|
+
if (renamed.length > 0) {
|
16388
|
+
columnRenames.push({
|
16389
|
+
table: entry.name,
|
16390
|
+
renames: renamed
|
16391
|
+
});
|
16392
|
+
}
|
16393
|
+
}
|
16394
|
+
const columnRenamesDict = columnRenames.reduce(
|
16395
|
+
(acc, it) => {
|
16396
|
+
acc[it.table] = it.renames;
|
16397
|
+
return acc;
|
16398
|
+
},
|
16399
|
+
{}
|
16400
|
+
);
|
16401
|
+
const columnsPatchedSnap1 = copy(tablesPatchedSnap1);
|
16402
|
+
columnsPatchedSnap1.tables = mapEntries(
|
16403
|
+
columnsPatchedSnap1.tables,
|
16404
|
+
(tableKey2, tableValue) => {
|
16405
|
+
const patchedColumns = mapKeys(
|
16406
|
+
tableValue.columns,
|
16407
|
+
(columnKey, column4) => {
|
16408
|
+
const rens = columnRenamesDict[tableValue.name] || [];
|
16409
|
+
const newName = columnChangeFor(columnKey, rens);
|
16410
|
+
column4.name = newName;
|
16411
|
+
return newName;
|
16412
|
+
}
|
16413
|
+
);
|
16414
|
+
tableValue.columns = patchedColumns;
|
16415
|
+
return [tableKey2, tableValue];
|
16416
|
+
}
|
16417
|
+
);
|
16418
|
+
const diffResult = applyJsonDiff(columnsPatchedSnap1, json2);
|
16419
|
+
const typedResult = diffResultSchemeSQLite.parse(diffResult);
|
16420
|
+
const tablesMap = {};
|
16421
|
+
typedResult.alteredTablesWithColumns.forEach((obj) => {
|
16422
|
+
tablesMap[obj.name] = obj;
|
16423
|
+
});
|
16424
|
+
const jsonCreateTables = createdTables.map((it) => {
|
16425
|
+
return prepareSQLiteCreateTable(it, action);
|
16426
|
+
});
|
16427
|
+
const jsonCreateIndexesForCreatedTables = createdTables.map((it) => {
|
16428
|
+
return prepareCreateIndexesJson(
|
16429
|
+
it.name,
|
16430
|
+
it.schema,
|
16431
|
+
it.indexes,
|
16432
|
+
curFull.internal
|
16433
|
+
);
|
16434
|
+
}).flat();
|
16435
|
+
const jsonDropTables = deletedTables.map((it) => {
|
16436
|
+
return prepareDropTableJson(it);
|
16437
|
+
});
|
16438
|
+
const jsonRenameTables = renamedTables.map((it) => {
|
16439
|
+
return prepareRenameTableJson(it.from, it.to);
|
16440
|
+
});
|
16441
|
+
const jsonRenameColumnsStatements = columnRenames.map((it) => prepareRenameColumns(it.table, "", it.renames)).flat();
|
16442
|
+
const jsonDropColumnsStatemets = columnDeletes.map((it) => _prepareDropColumns(it.table, "", it.columns)).flat();
|
16443
|
+
const jsonAddColumnsStatemets = columnCreates.map((it) => {
|
16444
|
+
return _prepareSqliteAddColumns(
|
16445
|
+
it.table,
|
16446
|
+
it.columns,
|
16447
|
+
tablesMap[it.table] && tablesMap[it.table].addedForeignKeys ? Object.values(tablesMap[it.table].addedForeignKeys) : []
|
16448
|
+
);
|
16449
|
+
}).flat();
|
16450
|
+
const allAltered = typedResult.alteredTablesWithColumns;
|
16451
|
+
const jsonAddedCompositePKs = [];
|
16452
|
+
const jsonDeletedCompositePKs = [];
|
16453
|
+
const jsonAlteredCompositePKs = [];
|
16454
|
+
const jsonAddedUniqueConstraints = [];
|
16455
|
+
const jsonDeletedUniqueConstraints = [];
|
16456
|
+
const jsonAlteredUniqueConstraints = [];
|
16457
|
+
allAltered.forEach((it) => {
|
16458
|
+
let addedColumns = [];
|
16459
|
+
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
16460
|
+
const addedPkColumns = it.addedCompositePKs[addedPkName];
|
16461
|
+
addedColumns = SQLiteSquasher.unsquashPK(addedPkColumns);
|
16462
|
+
}
|
16463
|
+
let deletedColumns = [];
|
16464
|
+
for (const deletedPkName of Object.keys(it.deletedCompositePKs)) {
|
16465
|
+
const deletedPkColumns = it.deletedCompositePKs[deletedPkName];
|
16466
|
+
deletedColumns = SQLiteSquasher.unsquashPK(deletedPkColumns);
|
16467
|
+
}
|
16468
|
+
const doPerformDeleteAndCreate = JSON.stringify(addedColumns) !== JSON.stringify(deletedColumns);
|
16469
|
+
let addedCompositePKs = [];
|
16470
|
+
let deletedCompositePKs = [];
|
16471
|
+
let alteredCompositePKs = [];
|
16472
|
+
if (doPerformDeleteAndCreate) {
|
16473
|
+
addedCompositePKs = prepareAddCompositePrimaryKeySqlite(
|
16474
|
+
it.name,
|
16475
|
+
it.addedCompositePKs
|
16476
|
+
);
|
16477
|
+
deletedCompositePKs = prepareDeleteCompositePrimaryKeySqlite(
|
16478
|
+
it.name,
|
16479
|
+
it.deletedCompositePKs
|
16480
|
+
);
|
16481
|
+
}
|
16482
|
+
alteredCompositePKs = prepareAlterCompositePrimaryKeySqlite(
|
16483
|
+
it.name,
|
16484
|
+
it.alteredCompositePKs
|
15369
16485
|
);
|
15370
16486
|
let addedUniqueConstraints = [];
|
15371
16487
|
let deletedUniqueConstraints = [];
|
@@ -15409,17 +16525,10 @@ var init_snapshotsDiffer = __esm({
|
|
15409
16525
|
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
15410
16526
|
};
|
15411
16527
|
});
|
15412
|
-
const jsonTableAlternations =
|
15413
|
-
return
|
15414
|
-
it.name,
|
15415
|
-
it.schema,
|
15416
|
-
it.altered,
|
15417
|
-
json1,
|
15418
|
-
json2,
|
15419
|
-
action
|
15420
|
-
);
|
16528
|
+
const jsonTableAlternations = allAltered.map((it) => {
|
16529
|
+
return prepareSqliteAlterColumns(it.name, it.schema, it.altered, json2);
|
15421
16530
|
}).flat();
|
15422
|
-
const jsonCreateIndexesForAllAlteredTables =
|
16531
|
+
const jsonCreateIndexesForAllAlteredTables = allAltered.map((it) => {
|
15423
16532
|
return prepareCreateIndexesJson(
|
15424
16533
|
it.name,
|
15425
16534
|
it.schema,
|
@@ -15427,14 +16536,14 @@ var init_snapshotsDiffer = __esm({
|
|
15427
16536
|
curFull.internal
|
15428
16537
|
);
|
15429
16538
|
}).flat();
|
15430
|
-
const jsonDropIndexesForAllAlteredTables =
|
16539
|
+
const jsonDropIndexesForAllAlteredTables = allAltered.map((it) => {
|
15431
16540
|
return prepareDropIndexesJson(
|
15432
16541
|
it.name,
|
15433
16542
|
it.schema,
|
15434
16543
|
it.deletedIndexes || {}
|
15435
16544
|
);
|
15436
16545
|
}).flat();
|
15437
|
-
|
16546
|
+
allAltered.forEach((it) => {
|
15438
16547
|
const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
|
15439
16548
|
(current, item) => {
|
15440
16549
|
current[item] = it.alteredIndexes[item].__old;
|
@@ -15450,16 +16559,18 @@ var init_snapshotsDiffer = __esm({
|
|
15450
16559
|
{}
|
15451
16560
|
);
|
15452
16561
|
jsonCreateIndexesForAllAlteredTables.push(
|
15453
|
-
...prepareCreateIndexesJson(
|
16562
|
+
...prepareCreateIndexesJson(
|
16563
|
+
it.name,
|
16564
|
+
it.schema,
|
16565
|
+
createdIndexes || {},
|
16566
|
+
curFull.internal
|
16567
|
+
)
|
15454
16568
|
);
|
15455
16569
|
jsonDropIndexesForAllAlteredTables.push(
|
15456
16570
|
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
15457
16571
|
);
|
15458
16572
|
});
|
15459
|
-
const
|
15460
|
-
return prepareCreateReferencesJson(it.name, it.schema, it.foreignKeys);
|
15461
|
-
}).flat();
|
15462
|
-
const jsonReferencesForAllAlteredTables = alteredTables.map((it) => {
|
16573
|
+
const jsonReferencesForAllAlteredTables = allAltered.map((it) => {
|
15463
16574
|
const forAdded = prepareCreateReferencesJson(
|
15464
16575
|
it.name,
|
15465
16576
|
it.schema,
|
@@ -15483,35 +16594,25 @@ var init_snapshotsDiffer = __esm({
|
|
15483
16594
|
const jsonDroppedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
15484
16595
|
(t) => t.type === "delete_reference"
|
15485
16596
|
);
|
15486
|
-
const
|
15487
|
-
|
15488
|
-
it,
|
15489
|
-
curFull,
|
15490
|
-
curFull.internal
|
15491
|
-
);
|
15492
|
-
});
|
15493
|
-
jsonStatements.push(...jsonMySqlCreateTables);
|
16597
|
+
const jsonStatements = [];
|
16598
|
+
jsonStatements.push(...jsonCreateTables);
|
15494
16599
|
jsonStatements.push(...jsonDropTables);
|
15495
16600
|
jsonStatements.push(...jsonRenameTables);
|
15496
16601
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
15497
|
-
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
15498
16602
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
15499
16603
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
15500
16604
|
jsonStatements.push(...jsonDeletedCompositePKs);
|
15501
16605
|
jsonStatements.push(...jsonTableAlternations);
|
15502
16606
|
jsonStatements.push(...jsonAddedCompositePKs);
|
15503
|
-
jsonStatements.push(...jsonAddedUniqueConstraints);
|
15504
|
-
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
15505
16607
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
15506
|
-
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
15507
16608
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
15508
|
-
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
15509
16609
|
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
16610
|
+
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
15510
16611
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
15511
16612
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
15512
|
-
jsonStatements.push(...jsonAddedUniqueConstraints);
|
15513
16613
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
15514
|
-
const
|
16614
|
+
const combinedJsonStatements = sqliteCombineStatements(jsonStatements, json2, action);
|
16615
|
+
const sqlStatements = fromJson(combinedJsonStatements, "sqlite");
|
15515
16616
|
const uniqueSqlStatements = [];
|
15516
16617
|
sqlStatements.forEach((ss) => {
|
15517
16618
|
if (!uniqueSqlStatements.includes(ss)) {
|
@@ -15523,12 +16624,12 @@ var init_snapshotsDiffer = __esm({
|
|
15523
16624
|
});
|
15524
16625
|
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
15525
16626
|
return {
|
15526
|
-
statements:
|
16627
|
+
statements: combinedJsonStatements,
|
15527
16628
|
sqlStatements: uniqueSqlStatements,
|
15528
16629
|
_meta
|
15529
16630
|
};
|
15530
16631
|
};
|
15531
|
-
|
16632
|
+
applyLibSQLSnapshotsDiff = async (json1, json2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
|
15532
16633
|
const tablesDiff = diffSchemasOrTables(json1.tables, json2.tables);
|
15533
16634
|
const {
|
15534
16635
|
created: createdTables,
|
@@ -15630,6 +16731,18 @@ var init_snapshotsDiffer = __esm({
|
|
15630
16731
|
tablesMap[it.table] && tablesMap[it.table].addedForeignKeys ? Object.values(tablesMap[it.table].addedForeignKeys) : []
|
15631
16732
|
);
|
15632
16733
|
}).flat();
|
16734
|
+
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
16735
|
+
const tableName = it.tableName;
|
16736
|
+
const schema4 = it.schema;
|
16737
|
+
return {
|
16738
|
+
from: { schema: schema4, table: tableName, column: it.oldColumnName },
|
16739
|
+
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
16740
|
+
};
|
16741
|
+
});
|
16742
|
+
const rTables = renamedTables.map((it) => {
|
16743
|
+
return { from: it.from, to: it.to };
|
16744
|
+
});
|
16745
|
+
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
15633
16746
|
const allAltered = typedResult.alteredTablesWithColumns;
|
15634
16747
|
const jsonAddedCompositePKs = [];
|
15635
16748
|
const jsonDeletedCompositePKs = [];
|
@@ -15700,14 +16813,6 @@ var init_snapshotsDiffer = __esm({
|
|
15700
16813
|
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
15701
16814
|
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
15702
16815
|
});
|
15703
|
-
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
15704
|
-
const tableName = it.tableName;
|
15705
|
-
const schema4 = it.schema;
|
15706
|
-
return {
|
15707
|
-
from: { schema: schema4, table: tableName, column: it.oldColumnName },
|
15708
|
-
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
15709
|
-
};
|
15710
|
-
});
|
15711
16816
|
const jsonTableAlternations = allAltered.map((it) => {
|
15712
16817
|
return prepareSqliteAlterColumns(it.name, it.schema, it.altered, json2);
|
15713
16818
|
}).flat();
|
@@ -15754,21 +16859,22 @@ var init_snapshotsDiffer = __esm({
|
|
15754
16859
|
);
|
15755
16860
|
});
|
15756
16861
|
const jsonReferencesForAllAlteredTables = allAltered.map((it) => {
|
15757
|
-
const forAdded =
|
15758
|
-
it.name,
|
15759
|
-
it.schema,
|
15760
|
-
it.addedForeignKeys
|
15761
|
-
);
|
15762
|
-
const forAltered = prepareDropReferencesJson(
|
16862
|
+
const forAdded = prepareLibSQLCreateReferencesJson(
|
15763
16863
|
it.name,
|
15764
16864
|
it.schema,
|
15765
|
-
it.
|
16865
|
+
it.addedForeignKeys,
|
16866
|
+
json2,
|
16867
|
+
action
|
15766
16868
|
);
|
15767
|
-
const
|
16869
|
+
const forAltered = prepareLibSQLDropReferencesJson(
|
15768
16870
|
it.name,
|
15769
16871
|
it.schema,
|
15770
|
-
it.
|
16872
|
+
it.deletedForeignKeys,
|
16873
|
+
json2,
|
16874
|
+
_meta,
|
16875
|
+
action
|
15771
16876
|
);
|
16877
|
+
const alteredFKs = prepareAlterReferencesJson(it.name, it.schema, it.alteredForeignKeys);
|
15772
16878
|
return [...forAdded, ...forAltered, ...alteredFKs];
|
15773
16879
|
}).flat();
|
15774
16880
|
const jsonCreatedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
@@ -15794,19 +16900,22 @@ var init_snapshotsDiffer = __esm({
|
|
15794
16900
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
15795
16901
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
15796
16902
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
15797
|
-
const
|
16903
|
+
const combinedJsonStatements = libSQLCombineStatements(jsonStatements, json2, action);
|
16904
|
+
const sqlStatements = fromJson(
|
16905
|
+
combinedJsonStatements,
|
16906
|
+
"sqlite",
|
16907
|
+
action,
|
16908
|
+
"turso",
|
16909
|
+
json2
|
16910
|
+
);
|
15798
16911
|
const uniqueSqlStatements = [];
|
15799
16912
|
sqlStatements.forEach((ss) => {
|
15800
16913
|
if (!uniqueSqlStatements.includes(ss)) {
|
15801
16914
|
uniqueSqlStatements.push(ss);
|
15802
16915
|
}
|
15803
16916
|
});
|
15804
|
-
const rTables = renamedTables.map((it) => {
|
15805
|
-
return { from: it.from, to: it.to };
|
15806
|
-
});
|
15807
|
-
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
15808
16917
|
return {
|
15809
|
-
statements:
|
16918
|
+
statements: combinedJsonStatements,
|
15810
16919
|
sqlStatements: uniqueSqlStatements,
|
15811
16920
|
_meta
|
15812
16921
|
};
|
@@ -17272,7 +18381,7 @@ var init_mjs = __esm({
|
|
17272
18381
|
}
|
17273
18382
|
});
|
17274
18383
|
|
17275
|
-
// ../
|
18384
|
+
// ../drizzle-orm/dist/entity.js
|
17276
18385
|
function is(value, type) {
|
17277
18386
|
if (!value || typeof value !== "object") {
|
17278
18387
|
return false;
|
@@ -17298,17 +18407,17 @@ function is(value, type) {
|
|
17298
18407
|
}
|
17299
18408
|
var entityKind, hasOwnEntityKind;
|
17300
18409
|
var init_entity = __esm({
|
17301
|
-
"../
|
18410
|
+
"../drizzle-orm/dist/entity.js"() {
|
17302
18411
|
"use strict";
|
17303
18412
|
entityKind = Symbol.for("drizzle:entityKind");
|
17304
18413
|
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
17305
18414
|
}
|
17306
18415
|
});
|
17307
18416
|
|
17308
|
-
// ../
|
18417
|
+
// ../drizzle-orm/dist/column.js
|
17309
18418
|
var _a, Column2;
|
17310
18419
|
var init_column = __esm({
|
17311
|
-
"../
|
18420
|
+
"../drizzle-orm/dist/column.js"() {
|
17312
18421
|
"use strict";
|
17313
18422
|
init_entity();
|
17314
18423
|
_a = entityKind;
|
@@ -17362,10 +18471,10 @@ var init_column = __esm({
|
|
17362
18471
|
}
|
17363
18472
|
});
|
17364
18473
|
|
17365
|
-
// ../
|
18474
|
+
// ../drizzle-orm/dist/column-builder.js
|
17366
18475
|
var _a2, ColumnBuilder;
|
17367
18476
|
var init_column_builder = __esm({
|
17368
|
-
"../
|
18477
|
+
"../drizzle-orm/dist/column-builder.js"() {
|
17369
18478
|
"use strict";
|
17370
18479
|
init_entity();
|
17371
18480
|
_a2 = entityKind;
|
@@ -17467,7 +18576,7 @@ var init_column_builder = __esm({
|
|
17467
18576
|
}
|
17468
18577
|
});
|
17469
18578
|
|
17470
|
-
// ../
|
18579
|
+
// ../drizzle-orm/dist/table.js
|
17471
18580
|
function isTable(table4) {
|
17472
18581
|
return typeof table4 === "object" && table4 !== null && IsDrizzleTable in table4;
|
17473
18582
|
}
|
@@ -17477,9 +18586,9 @@ function getTableName(table4) {
|
|
17477
18586
|
function getTableUniqueName(table4) {
|
17478
18587
|
return `${table4[Schema] ?? "public"}.${table4[TableName]}`;
|
17479
18588
|
}
|
17480
|
-
var TableName, Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a3, _b, _c, _d, _e, _f, _g, _h, _i, Table2;
|
18589
|
+
var TableName, Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, Table2;
|
17481
18590
|
var init_table = __esm({
|
17482
|
-
"../
|
18591
|
+
"../drizzle-orm/dist/table.js"() {
|
17483
18592
|
"use strict";
|
17484
18593
|
init_entity();
|
17485
18594
|
TableName = Symbol.for("drizzle:Name");
|
@@ -17491,32 +18600,34 @@ var init_table = __esm({
|
|
17491
18600
|
IsAlias = Symbol.for("drizzle:IsAlias");
|
17492
18601
|
ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
17493
18602
|
IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
17494
|
-
|
18603
|
+
_j = entityKind, _i = TableName, _h = OriginalName, _g = Schema, _f = Columns, _e = ExtraConfigColumns, _d = BaseName, _c = IsAlias, _b = IsDrizzleTable, _a3 = ExtraConfigBuilder;
|
17495
18604
|
Table2 = class {
|
17496
18605
|
constructor(name2, schema4, baseName) {
|
17497
18606
|
/**
|
17498
18607
|
* @internal
|
17499
18608
|
* Can be changed if the table is aliased.
|
17500
18609
|
*/
|
17501
|
-
__publicField(this,
|
18610
|
+
__publicField(this, _i);
|
17502
18611
|
/**
|
17503
18612
|
* @internal
|
17504
18613
|
* Used to store the original name of the table, before any aliasing.
|
17505
18614
|
*/
|
18615
|
+
__publicField(this, _h);
|
18616
|
+
/** @internal */
|
17506
18617
|
__publicField(this, _g);
|
17507
18618
|
/** @internal */
|
17508
18619
|
__publicField(this, _f);
|
17509
18620
|
/** @internal */
|
17510
18621
|
__publicField(this, _e);
|
17511
|
-
/** @internal */
|
17512
|
-
__publicField(this, _d);
|
17513
18622
|
/**
|
17514
18623
|
* @internal
|
17515
18624
|
* Used to store the table name before the transformation via the `tableCreator` functions.
|
17516
18625
|
*/
|
17517
|
-
__publicField(this,
|
18626
|
+
__publicField(this, _d);
|
18627
|
+
/** @internal */
|
18628
|
+
__publicField(this, _c, false);
|
17518
18629
|
/** @internal */
|
17519
|
-
__publicField(this, _b,
|
18630
|
+
__publicField(this, _b, true);
|
17520
18631
|
/** @internal */
|
17521
18632
|
__publicField(this, _a3);
|
17522
18633
|
this[TableName] = this[OriginalName] = name2;
|
@@ -17524,7 +18635,7 @@ var init_table = __esm({
|
|
17524
18635
|
this[BaseName] = baseName;
|
17525
18636
|
}
|
17526
18637
|
};
|
17527
|
-
__publicField(Table2,
|
18638
|
+
__publicField(Table2, _j, "Table");
|
17528
18639
|
/** @internal */
|
17529
18640
|
__publicField(Table2, "Symbol", {
|
17530
18641
|
Name: TableName,
|
@@ -17539,7 +18650,7 @@ var init_table = __esm({
|
|
17539
18650
|
}
|
17540
18651
|
});
|
17541
18652
|
|
17542
|
-
// ../
|
18653
|
+
// ../drizzle-orm/dist/pg-core/table.js
|
17543
18654
|
function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name2) {
|
17544
18655
|
const rawTable = new PgTable(name2, schema4, baseName);
|
17545
18656
|
const builtColumns = Object.fromEntries(
|
@@ -17567,7 +18678,7 @@ function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name
|
|
17567
18678
|
}
|
17568
18679
|
var InlineForeignKeys, _a4, _b2, _c2, _d2, PgTable, pgTable;
|
17569
18680
|
var init_table2 = __esm({
|
17570
|
-
"../
|
18681
|
+
"../drizzle-orm/dist/pg-core/table.js"() {
|
17571
18682
|
"use strict";
|
17572
18683
|
init_entity();
|
17573
18684
|
init_table();
|
@@ -17592,10 +18703,10 @@ var init_table2 = __esm({
|
|
17592
18703
|
}
|
17593
18704
|
});
|
17594
18705
|
|
17595
|
-
// ../
|
18706
|
+
// ../drizzle-orm/dist/pg-core/foreign-keys.js
|
17596
18707
|
var _a5, ForeignKeyBuilder, _a6, ForeignKey;
|
17597
18708
|
var init_foreign_keys = __esm({
|
17598
|
-
"../
|
18709
|
+
"../drizzle-orm/dist/pg-core/foreign-keys.js"() {
|
17599
18710
|
"use strict";
|
17600
18711
|
init_entity();
|
17601
18712
|
init_table2();
|
@@ -17659,23 +18770,23 @@ var init_foreign_keys = __esm({
|
|
17659
18770
|
}
|
17660
18771
|
});
|
17661
18772
|
|
17662
|
-
// ../
|
18773
|
+
// ../drizzle-orm/dist/tracing-utils.js
|
17663
18774
|
function iife(fn, ...args) {
|
17664
18775
|
return fn(...args);
|
17665
18776
|
}
|
17666
18777
|
var init_tracing_utils = __esm({
|
17667
|
-
"../
|
18778
|
+
"../drizzle-orm/dist/tracing-utils.js"() {
|
17668
18779
|
"use strict";
|
17669
18780
|
}
|
17670
18781
|
});
|
17671
18782
|
|
17672
|
-
// ../
|
18783
|
+
// ../drizzle-orm/dist/pg-core/unique-constraint.js
|
17673
18784
|
function uniqueKeyName(table4, columns) {
|
17674
18785
|
return `${table4[PgTable.Symbol.Name]}_${columns.join("_")}_unique`;
|
17675
18786
|
}
|
17676
18787
|
var _a7, UniqueConstraintBuilder, _a8, UniqueOnConstraintBuilder, _a9, UniqueConstraint;
|
17677
18788
|
var init_unique_constraint = __esm({
|
17678
|
-
"../
|
18789
|
+
"../drizzle-orm/dist/pg-core/unique-constraint.js"() {
|
17679
18790
|
"use strict";
|
17680
18791
|
init_entity();
|
17681
18792
|
init_table2();
|
@@ -17730,7 +18841,7 @@ var init_unique_constraint = __esm({
|
|
17730
18841
|
}
|
17731
18842
|
});
|
17732
18843
|
|
17733
|
-
// ../
|
18844
|
+
// ../drizzle-orm/dist/pg-core/utils/array.js
|
17734
18845
|
function parsePgArrayValue(arrayString, startFrom, inQuotes) {
|
17735
18846
|
for (let i = startFrom; i < arrayString.length; i++) {
|
17736
18847
|
const char = arrayString[i];
|
@@ -17806,15 +18917,15 @@ function makePgArray(array) {
|
|
17806
18917
|
}).join(",")}}`;
|
17807
18918
|
}
|
17808
18919
|
var init_array = __esm({
|
17809
|
-
"../
|
18920
|
+
"../drizzle-orm/dist/pg-core/utils/array.js"() {
|
17810
18921
|
"use strict";
|
17811
18922
|
}
|
17812
18923
|
});
|
17813
18924
|
|
17814
|
-
// ../
|
18925
|
+
// ../drizzle-orm/dist/pg-core/columns/common.js
|
17815
18926
|
var _a10, _b3, PgColumnBuilder, _a11, _b4, PgColumn, _a12, _b5, ExtraConfigColumn, _a13, IndexedColumn, _a14, _b6, PgArrayBuilder, _a15, _b7, _PgArray, PgArray;
|
17816
18927
|
var init_common2 = __esm({
|
17817
|
-
"../
|
18928
|
+
"../drizzle-orm/dist/pg-core/columns/common.js"() {
|
17818
18929
|
"use strict";
|
17819
18930
|
init_column_builder();
|
17820
18931
|
init_column();
|
@@ -18015,7 +19126,7 @@ var init_common2 = __esm({
|
|
18015
19126
|
}
|
18016
19127
|
});
|
18017
19128
|
|
18018
|
-
// ../
|
19129
|
+
// ../drizzle-orm/dist/pg-core/columns/enum.js
|
18019
19130
|
function isPgEnum(obj) {
|
18020
19131
|
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
18021
19132
|
}
|
@@ -18033,7 +19144,7 @@ function pgEnumWithSchema(enumName, values, schema4) {
|
|
18033
19144
|
}
|
18034
19145
|
var isPgEnumSym, _a16, _b8, PgEnumColumnBuilder, _a17, _b9, PgEnumColumn;
|
18035
19146
|
var init_enum = __esm({
|
18036
|
-
"../
|
19147
|
+
"../drizzle-orm/dist/pg-core/columns/enum.js"() {
|
18037
19148
|
"use strict";
|
18038
19149
|
init_entity();
|
18039
19150
|
init_common2();
|
@@ -18067,10 +19178,10 @@ var init_enum = __esm({
|
|
18067
19178
|
}
|
18068
19179
|
});
|
18069
19180
|
|
18070
|
-
// ../
|
19181
|
+
// ../drizzle-orm/dist/subquery.js
|
18071
19182
|
var _a18, Subquery, _a19, _b10, WithSubquery;
|
18072
19183
|
var init_subquery = __esm({
|
18073
|
-
"../
|
19184
|
+
"../drizzle-orm/dist/subquery.js"() {
|
18074
19185
|
"use strict";
|
18075
19186
|
init_entity();
|
18076
19187
|
_a18 = entityKind;
|
@@ -18095,19 +19206,19 @@ var init_subquery = __esm({
|
|
18095
19206
|
}
|
18096
19207
|
});
|
18097
19208
|
|
18098
|
-
// ../
|
19209
|
+
// ../drizzle-orm/dist/version.js
|
18099
19210
|
var version;
|
18100
19211
|
var init_version = __esm({
|
18101
|
-
"../
|
19212
|
+
"../drizzle-orm/dist/version.js"() {
|
18102
19213
|
"use strict";
|
18103
|
-
version = "0.
|
19214
|
+
version = "0.33.0";
|
18104
19215
|
}
|
18105
19216
|
});
|
18106
19217
|
|
18107
|
-
// ../
|
19218
|
+
// ../drizzle-orm/dist/tracing.js
|
18108
19219
|
var otel, rawTracer, tracer;
|
18109
19220
|
var init_tracing = __esm({
|
18110
|
-
"../
|
19221
|
+
"../drizzle-orm/dist/tracing.js"() {
|
18111
19222
|
"use strict";
|
18112
19223
|
init_tracing_utils();
|
18113
19224
|
init_version();
|
@@ -18145,16 +19256,16 @@ var init_tracing = __esm({
|
|
18145
19256
|
}
|
18146
19257
|
});
|
18147
19258
|
|
18148
|
-
// ../
|
19259
|
+
// ../drizzle-orm/dist/view-common.js
|
18149
19260
|
var ViewBaseConfig;
|
18150
19261
|
var init_view_common = __esm({
|
18151
|
-
"../
|
19262
|
+
"../drizzle-orm/dist/view-common.js"() {
|
18152
19263
|
"use strict";
|
18153
19264
|
ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
18154
19265
|
}
|
18155
19266
|
});
|
18156
19267
|
|
18157
|
-
// ../
|
19268
|
+
// ../drizzle-orm/dist/sql/sql.js
|
18158
19269
|
function isSQLWrapper(value) {
|
18159
19270
|
return value !== null && value !== void 0 && typeof value.getSQL === "function";
|
18160
19271
|
}
|
@@ -18202,12 +19313,18 @@ function fillPlaceholders(params, values) {
|
|
18202
19313
|
}
|
18203
19314
|
return values[p.name];
|
18204
19315
|
}
|
19316
|
+
if (is(p, Param) && is(p.value, Placeholder)) {
|
19317
|
+
if (!(p.value.name in values)) {
|
19318
|
+
throw new Error(`No value for placeholder "${p.value.name}" was provided`);
|
19319
|
+
}
|
19320
|
+
return p.encoder.mapToDriverValue(values[p.value.name]);
|
19321
|
+
}
|
18205
19322
|
return p;
|
18206
19323
|
});
|
18207
19324
|
}
|
18208
19325
|
var _a20, FakePrimitiveParam, _a21, StringChunk, _a22, _SQL, SQL, _a23, Name, noopDecoder, noopEncoder, noopMapper, _a24, Param, _a25, Placeholder, _a26, _b11, View;
|
18209
19326
|
var init_sql = __esm({
|
18210
|
-
"../
|
19327
|
+
"../drizzle-orm/dist/sql/sql.js"() {
|
18211
19328
|
"use strict";
|
18212
19329
|
init_entity();
|
18213
19330
|
init_enum();
|
@@ -18315,6 +19432,9 @@ var init_sql = __esm({
|
|
18315
19432
|
};
|
18316
19433
|
}
|
18317
19434
|
if (is(chunk, Param)) {
|
19435
|
+
if (is(chunk.value, Placeholder)) {
|
19436
|
+
return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
|
19437
|
+
}
|
18318
19438
|
const mappedValue = chunk.value === null ? null : chunk.encoder.mapToDriverValue(chunk.value);
|
18319
19439
|
if (is(mappedValue, _SQL)) {
|
18320
19440
|
return this.buildQueryFromSourceParams([mappedValue], config);
|
@@ -18322,7 +19442,7 @@ var init_sql = __esm({
|
|
18322
19442
|
if (inlineParams) {
|
18323
19443
|
return { sql: this.mapInlineParam(mappedValue, config), params: [] };
|
18324
19444
|
}
|
18325
|
-
let typings;
|
19445
|
+
let typings = ["none"];
|
18326
19446
|
if (prepareTyping) {
|
18327
19447
|
typings = [prepareTyping(chunk.encoder)];
|
18328
19448
|
}
|
@@ -18364,7 +19484,7 @@ var init_sql = __esm({
|
|
18364
19484
|
if (inlineParams) {
|
18365
19485
|
return { sql: this.mapInlineParam(chunk, config), params: [] };
|
18366
19486
|
}
|
18367
|
-
return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk] };
|
19487
|
+
return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
|
18368
19488
|
}));
|
18369
19489
|
}
|
18370
19490
|
mapInlineParam(chunk, { escapeString }) {
|
@@ -18553,7 +19673,7 @@ var init_sql = __esm({
|
|
18553
19673
|
}
|
18554
19674
|
});
|
18555
19675
|
|
18556
|
-
// ../
|
19676
|
+
// ../drizzle-orm/dist/alias.js
|
18557
19677
|
function aliasedTable(table4, tableAlias) {
|
18558
19678
|
return new Proxy(table4, new TableAliasProxyHandler(tableAlias, false));
|
18559
19679
|
}
|
@@ -18585,7 +19705,7 @@ function mapColumnsInSQLToAlias(query, alias) {
|
|
18585
19705
|
}
|
18586
19706
|
var _a27, ColumnAliasProxyHandler, _a28, TableAliasProxyHandler, _a29, RelationTableAliasProxyHandler;
|
18587
19707
|
var init_alias = __esm({
|
18588
|
-
"../
|
19708
|
+
"../drizzle-orm/dist/alias.js"() {
|
18589
19709
|
"use strict";
|
18590
19710
|
init_column();
|
18591
19711
|
init_entity();
|
@@ -18666,10 +19786,10 @@ var init_alias = __esm({
|
|
18666
19786
|
}
|
18667
19787
|
});
|
18668
19788
|
|
18669
|
-
// ../
|
19789
|
+
// ../drizzle-orm/dist/errors.js
|
18670
19790
|
var _a30, _b12, DrizzleError, _a31, _b13, TransactionRollbackError;
|
18671
19791
|
var init_errors = __esm({
|
18672
|
-
"../
|
19792
|
+
"../drizzle-orm/dist/errors.js"() {
|
18673
19793
|
"use strict";
|
18674
19794
|
init_entity();
|
18675
19795
|
DrizzleError = class extends (_b12 = Error, _a30 = entityKind, _b12) {
|
@@ -18689,7 +19809,7 @@ var init_errors = __esm({
|
|
18689
19809
|
}
|
18690
19810
|
});
|
18691
19811
|
|
18692
|
-
// ../
|
19812
|
+
// ../drizzle-orm/dist/sql/expressions/conditions.js
|
18693
19813
|
function bindIfParam(value, column4) {
|
18694
19814
|
if (isDriverValueEncoder(column4) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column2) && !is(value, Table2) && !is(value, View)) {
|
18695
19815
|
return new Param(value, column4);
|
@@ -18817,7 +19937,7 @@ function arrayOverlaps(column4, values) {
|
|
18817
19937
|
}
|
18818
19938
|
var eq, ne, gt, gte, lt, lte;
|
18819
19939
|
var init_conditions = __esm({
|
18820
|
-
"../
|
19940
|
+
"../drizzle-orm/dist/sql/expressions/conditions.js"() {
|
18821
19941
|
"use strict";
|
18822
19942
|
init_column();
|
18823
19943
|
init_entity();
|
@@ -18844,7 +19964,7 @@ var init_conditions = __esm({
|
|
18844
19964
|
}
|
18845
19965
|
});
|
18846
19966
|
|
18847
|
-
// ../
|
19967
|
+
// ../drizzle-orm/dist/sql/expressions/select.js
|
18848
19968
|
function asc(column4) {
|
18849
19969
|
return sql`${column4} asc`;
|
18850
19970
|
}
|
@@ -18852,33 +19972,33 @@ function desc(column4) {
|
|
18852
19972
|
return sql`${column4} desc`;
|
18853
19973
|
}
|
18854
19974
|
var init_select = __esm({
|
18855
|
-
"../
|
19975
|
+
"../drizzle-orm/dist/sql/expressions/select.js"() {
|
18856
19976
|
"use strict";
|
18857
19977
|
init_sql();
|
18858
19978
|
}
|
18859
19979
|
});
|
18860
19980
|
|
18861
|
-
// ../
|
19981
|
+
// ../drizzle-orm/dist/sql/expressions/index.js
|
18862
19982
|
var init_expressions = __esm({
|
18863
|
-
"../
|
19983
|
+
"../drizzle-orm/dist/sql/expressions/index.js"() {
|
18864
19984
|
"use strict";
|
18865
19985
|
init_conditions();
|
18866
19986
|
init_select();
|
18867
19987
|
}
|
18868
19988
|
});
|
18869
19989
|
|
18870
|
-
// ../
|
19990
|
+
// ../drizzle-orm/dist/expressions.js
|
18871
19991
|
var init_expressions2 = __esm({
|
18872
|
-
"../
|
19992
|
+
"../drizzle-orm/dist/expressions.js"() {
|
18873
19993
|
"use strict";
|
18874
19994
|
init_expressions();
|
18875
19995
|
}
|
18876
19996
|
});
|
18877
19997
|
|
18878
|
-
// ../
|
19998
|
+
// ../drizzle-orm/dist/logger.js
|
18879
19999
|
var _a32, ConsoleLogWriter, _a33, DefaultLogger, _a34, NoopLogger;
|
18880
20000
|
var init_logger = __esm({
|
18881
|
-
"../
|
20001
|
+
"../drizzle-orm/dist/logger.js"() {
|
18882
20002
|
"use strict";
|
18883
20003
|
init_entity();
|
18884
20004
|
_a32 = entityKind;
|
@@ -18916,17 +20036,17 @@ var init_logger = __esm({
|
|
18916
20036
|
}
|
18917
20037
|
});
|
18918
20038
|
|
18919
|
-
// ../
|
20039
|
+
// ../drizzle-orm/dist/operations.js
|
18920
20040
|
var init_operations = __esm({
|
18921
|
-
"../
|
20041
|
+
"../drizzle-orm/dist/operations.js"() {
|
18922
20042
|
"use strict";
|
18923
20043
|
}
|
18924
20044
|
});
|
18925
20045
|
|
18926
|
-
// ../
|
20046
|
+
// ../drizzle-orm/dist/query-promise.js
|
18927
20047
|
var _a35, _b14, QueryPromise;
|
18928
20048
|
var init_query_promise = __esm({
|
18929
|
-
"../
|
20049
|
+
"../drizzle-orm/dist/query-promise.js"() {
|
18930
20050
|
"use strict";
|
18931
20051
|
init_entity();
|
18932
20052
|
_b14 = entityKind, _a35 = Symbol.toStringTag;
|
@@ -18957,10 +20077,10 @@ var init_query_promise = __esm({
|
|
18957
20077
|
}
|
18958
20078
|
});
|
18959
20079
|
|
18960
|
-
// ../
|
20080
|
+
// ../drizzle-orm/dist/pg-core/primary-keys.js
|
18961
20081
|
var _a36, PrimaryKeyBuilder, _a37, PrimaryKey;
|
18962
20082
|
var init_primary_keys = __esm({
|
18963
|
-
"../
|
20083
|
+
"../drizzle-orm/dist/pg-core/primary-keys.js"() {
|
18964
20084
|
"use strict";
|
18965
20085
|
init_entity();
|
18966
20086
|
init_table2();
|
@@ -18997,7 +20117,7 @@ var init_primary_keys = __esm({
|
|
18997
20117
|
}
|
18998
20118
|
});
|
18999
20119
|
|
19000
|
-
// ../
|
20120
|
+
// ../drizzle-orm/dist/relations.js
|
19001
20121
|
function getOperators() {
|
19002
20122
|
return {
|
19003
20123
|
and,
|
@@ -19218,7 +20338,7 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
|
|
19218
20338
|
}
|
19219
20339
|
var _a38, Relation, _a39, Relations, _a40, _b15, _One, One, _a41, _b16, _Many, Many;
|
19220
20340
|
var init_relations = __esm({
|
19221
|
-
"../
|
20341
|
+
"../drizzle-orm/dist/relations.js"() {
|
19222
20342
|
"use strict";
|
19223
20343
|
init_table();
|
19224
20344
|
init_column();
|
@@ -19285,7 +20405,7 @@ var init_relations = __esm({
|
|
19285
20405
|
}
|
19286
20406
|
});
|
19287
20407
|
|
19288
|
-
// ../
|
20408
|
+
// ../drizzle-orm/dist/sql/functions/aggregate.js
|
19289
20409
|
function count(expression) {
|
19290
20410
|
return sql`count(${expression || sql.raw("*")})`.mapWith(Number);
|
19291
20411
|
}
|
@@ -19311,7 +20431,7 @@ function min(expression) {
|
|
19311
20431
|
return sql`min(${expression})`.mapWith(is(expression, Column2) ? expression : String);
|
19312
20432
|
}
|
19313
20433
|
var init_aggregate = __esm({
|
19314
|
-
"../
|
20434
|
+
"../drizzle-orm/dist/sql/functions/aggregate.js"() {
|
19315
20435
|
"use strict";
|
19316
20436
|
init_column();
|
19317
20437
|
init_entity();
|
@@ -19319,7 +20439,7 @@ var init_aggregate = __esm({
|
|
19319
20439
|
}
|
19320
20440
|
});
|
19321
20441
|
|
19322
|
-
// ../
|
20442
|
+
// ../drizzle-orm/dist/sql/functions/vector.js
|
19323
20443
|
function toSql(value) {
|
19324
20444
|
return JSON.stringify(value);
|
19325
20445
|
}
|
@@ -19360,24 +20480,24 @@ function jaccardDistance(column4, value) {
|
|
19360
20480
|
return sql`${column4} <%> ${value}`;
|
19361
20481
|
}
|
19362
20482
|
var init_vector = __esm({
|
19363
|
-
"../
|
20483
|
+
"../drizzle-orm/dist/sql/functions/vector.js"() {
|
19364
20484
|
"use strict";
|
19365
20485
|
init_sql();
|
19366
20486
|
}
|
19367
20487
|
});
|
19368
20488
|
|
19369
|
-
// ../
|
20489
|
+
// ../drizzle-orm/dist/sql/functions/index.js
|
19370
20490
|
var init_functions = __esm({
|
19371
|
-
"../
|
20491
|
+
"../drizzle-orm/dist/sql/functions/index.js"() {
|
19372
20492
|
"use strict";
|
19373
20493
|
init_aggregate();
|
19374
20494
|
init_vector();
|
19375
20495
|
}
|
19376
20496
|
});
|
19377
20497
|
|
19378
|
-
// ../
|
20498
|
+
// ../drizzle-orm/dist/sql/index.js
|
19379
20499
|
var init_sql2 = __esm({
|
19380
|
-
"../
|
20500
|
+
"../drizzle-orm/dist/sql/index.js"() {
|
19381
20501
|
"use strict";
|
19382
20502
|
init_expressions();
|
19383
20503
|
init_functions();
|
@@ -19385,7 +20505,7 @@ var init_sql2 = __esm({
|
|
19385
20505
|
}
|
19386
20506
|
});
|
19387
20507
|
|
19388
|
-
// ../
|
20508
|
+
// ../drizzle-orm/dist/utils.js
|
19389
20509
|
function mapResultRow(columns, row, joinsNotNullableMap) {
|
19390
20510
|
const nullifyMap = {};
|
19391
20511
|
const result = columns.reduce(
|
@@ -19493,7 +20613,7 @@ function getTableLikeName(table4) {
|
|
19493
20613
|
return is(table4, Subquery) ? table4._.alias : is(table4, View) ? table4[ViewBaseConfig].name : is(table4, SQL) ? void 0 : table4[Table2.Symbol.IsAlias] ? table4[Table2.Symbol.Name] : table4[Table2.Symbol.BaseName];
|
19494
20614
|
}
|
19495
20615
|
var init_utils2 = __esm({
|
19496
|
-
"../
|
20616
|
+
"../drizzle-orm/dist/utils.js"() {
|
19497
20617
|
"use strict";
|
19498
20618
|
init_column();
|
19499
20619
|
init_entity();
|
@@ -19504,9 +20624,9 @@ var init_utils2 = __esm({
|
|
19504
20624
|
}
|
19505
20625
|
});
|
19506
20626
|
|
19507
|
-
// ../
|
19508
|
-
var
|
19509
|
-
__export(
|
20627
|
+
// ../drizzle-orm/dist/index.js
|
20628
|
+
var dist_exports = {};
|
20629
|
+
__export(dist_exports, {
|
19510
20630
|
BaseName: () => BaseName,
|
19511
20631
|
Column: () => Column2,
|
19512
20632
|
ColumnAliasProxyHandler: () => ColumnAliasProxyHandler,
|
@@ -19620,8 +20740,8 @@ __export(drizzle_orm_exports, {
|
|
19620
20740
|
sum: () => sum,
|
19621
20741
|
sumDistinct: () => sumDistinct
|
19622
20742
|
});
|
19623
|
-
var
|
19624
|
-
"../
|
20743
|
+
var init_dist = __esm({
|
20744
|
+
"../drizzle-orm/dist/index.js"() {
|
19625
20745
|
"use strict";
|
19626
20746
|
init_alias();
|
19627
20747
|
init_column_builder();
|
@@ -19641,17 +20761,17 @@ var init_drizzle_orm = __esm({
|
|
19641
20761
|
}
|
19642
20762
|
});
|
19643
20763
|
|
19644
|
-
// ../
|
20764
|
+
// ../drizzle-orm/dist/pg-core/alias.js
|
19645
20765
|
var init_alias2 = __esm({
|
19646
|
-
"../
|
20766
|
+
"../drizzle-orm/dist/pg-core/alias.js"() {
|
19647
20767
|
"use strict";
|
19648
20768
|
}
|
19649
20769
|
});
|
19650
20770
|
|
19651
|
-
// ../
|
20771
|
+
// ../drizzle-orm/dist/pg-core/checks.js
|
19652
20772
|
var _a42, CheckBuilder, _a43, Check;
|
19653
20773
|
var init_checks = __esm({
|
19654
|
-
"../
|
20774
|
+
"../drizzle-orm/dist/pg-core/checks.js"() {
|
19655
20775
|
"use strict";
|
19656
20776
|
init_entity();
|
19657
20777
|
_a42 = entityKind;
|
@@ -19681,10 +20801,10 @@ var init_checks = __esm({
|
|
19681
20801
|
}
|
19682
20802
|
});
|
19683
20803
|
|
19684
|
-
// ../
|
20804
|
+
// ../drizzle-orm/dist/pg-core/columns/int.common.js
|
19685
20805
|
var _a44, _b17, PgIntColumnBaseBuilder;
|
19686
20806
|
var init_int_common = __esm({
|
19687
|
-
"../
|
20807
|
+
"../drizzle-orm/dist/pg-core/columns/int.common.js"() {
|
19688
20808
|
"use strict";
|
19689
20809
|
init_entity();
|
19690
20810
|
init_common2();
|
@@ -19728,10 +20848,10 @@ var init_int_common = __esm({
|
|
19728
20848
|
}
|
19729
20849
|
});
|
19730
20850
|
|
19731
|
-
// ../
|
20851
|
+
// ../drizzle-orm/dist/pg-core/columns/bigint.js
|
19732
20852
|
var _a45, _b18, PgBigInt53Builder, _a46, _b19, PgBigInt53, _a47, _b20, PgBigInt64Builder, _a48, _b21, PgBigInt64;
|
19733
20853
|
var init_bigint = __esm({
|
19734
|
-
"../
|
20854
|
+
"../drizzle-orm/dist/pg-core/columns/bigint.js"() {
|
19735
20855
|
"use strict";
|
19736
20856
|
init_entity();
|
19737
20857
|
init_common2();
|
@@ -19784,10 +20904,10 @@ var init_bigint = __esm({
|
|
19784
20904
|
}
|
19785
20905
|
});
|
19786
20906
|
|
19787
|
-
// ../
|
20907
|
+
// ../drizzle-orm/dist/pg-core/columns/bigserial.js
|
19788
20908
|
var _a49, _b22, PgBigSerial53Builder, _a50, _b23, PgBigSerial53, _a51, _b24, PgBigSerial64Builder, _a52, _b25, PgBigSerial64;
|
19789
20909
|
var init_bigserial = __esm({
|
19790
|
-
"../
|
20910
|
+
"../drizzle-orm/dist/pg-core/columns/bigserial.js"() {
|
19791
20911
|
"use strict";
|
19792
20912
|
init_entity();
|
19793
20913
|
init_common2();
|
@@ -19845,10 +20965,10 @@ var init_bigserial = __esm({
|
|
19845
20965
|
}
|
19846
20966
|
});
|
19847
20967
|
|
19848
|
-
// ../
|
20968
|
+
// ../drizzle-orm/dist/pg-core/columns/boolean.js
|
19849
20969
|
var _a53, _b26, PgBooleanBuilder, _a54, _b27, PgBoolean;
|
19850
20970
|
var init_boolean = __esm({
|
19851
|
-
"../
|
20971
|
+
"../drizzle-orm/dist/pg-core/columns/boolean.js"() {
|
19852
20972
|
"use strict";
|
19853
20973
|
init_entity();
|
19854
20974
|
init_common2();
|
@@ -19871,10 +20991,10 @@ var init_boolean = __esm({
|
|
19871
20991
|
}
|
19872
20992
|
});
|
19873
20993
|
|
19874
|
-
// ../
|
20994
|
+
// ../drizzle-orm/dist/pg-core/columns/char.js
|
19875
20995
|
var _a55, _b28, PgCharBuilder, _a56, _b29, PgChar;
|
19876
20996
|
var init_char = __esm({
|
19877
|
-
"../
|
20997
|
+
"../drizzle-orm/dist/pg-core/columns/char.js"() {
|
19878
20998
|
"use strict";
|
19879
20999
|
init_entity();
|
19880
21000
|
init_common2();
|
@@ -19904,10 +21024,10 @@ var init_char = __esm({
|
|
19904
21024
|
}
|
19905
21025
|
});
|
19906
21026
|
|
19907
|
-
// ../
|
21027
|
+
// ../drizzle-orm/dist/pg-core/columns/cidr.js
|
19908
21028
|
var _a57, _b30, PgCidrBuilder, _a58, _b31, PgCidr;
|
19909
21029
|
var init_cidr = __esm({
|
19910
|
-
"../
|
21030
|
+
"../drizzle-orm/dist/pg-core/columns/cidr.js"() {
|
19911
21031
|
"use strict";
|
19912
21032
|
init_entity();
|
19913
21033
|
init_common2();
|
@@ -19930,10 +21050,10 @@ var init_cidr = __esm({
|
|
19930
21050
|
}
|
19931
21051
|
});
|
19932
21052
|
|
19933
|
-
// ../
|
21053
|
+
// ../drizzle-orm/dist/pg-core/columns/custom.js
|
19934
21054
|
var _a59, _b32, PgCustomColumnBuilder, _a60, _b33, PgCustomColumn;
|
19935
21055
|
var init_custom = __esm({
|
19936
|
-
"../
|
21056
|
+
"../drizzle-orm/dist/pg-core/columns/custom.js"() {
|
19937
21057
|
"use strict";
|
19938
21058
|
init_entity();
|
19939
21059
|
init_common2();
|
@@ -19976,10 +21096,10 @@ var init_custom = __esm({
|
|
19976
21096
|
}
|
19977
21097
|
});
|
19978
21098
|
|
19979
|
-
// ../
|
21099
|
+
// ../drizzle-orm/dist/pg-core/columns/date.common.js
|
19980
21100
|
var _a61, _b34, PgDateColumnBaseBuilder;
|
19981
21101
|
var init_date_common = __esm({
|
19982
|
-
"../
|
21102
|
+
"../drizzle-orm/dist/pg-core/columns/date.common.js"() {
|
19983
21103
|
"use strict";
|
19984
21104
|
init_entity();
|
19985
21105
|
init_sql();
|
@@ -19993,10 +21113,10 @@ var init_date_common = __esm({
|
|
19993
21113
|
}
|
19994
21114
|
});
|
19995
21115
|
|
19996
|
-
// ../
|
21116
|
+
// ../drizzle-orm/dist/pg-core/columns/date.js
|
19997
21117
|
var _a62, _b35, PgDateBuilder, _a63, _b36, PgDate, _a64, _b37, PgDateStringBuilder, _a65, _b38, PgDateString;
|
19998
21118
|
var init_date = __esm({
|
19999
|
-
"../
|
21119
|
+
"../drizzle-orm/dist/pg-core/columns/date.js"() {
|
20000
21120
|
"use strict";
|
20001
21121
|
init_entity();
|
20002
21122
|
init_common2();
|
@@ -20045,10 +21165,10 @@ var init_date = __esm({
|
|
20045
21165
|
}
|
20046
21166
|
});
|
20047
21167
|
|
20048
|
-
// ../
|
21168
|
+
// ../drizzle-orm/dist/pg-core/columns/double-precision.js
|
20049
21169
|
var _a66, _b39, PgDoublePrecisionBuilder, _a67, _b40, PgDoublePrecision;
|
20050
21170
|
var init_double_precision = __esm({
|
20051
|
-
"../
|
21171
|
+
"../drizzle-orm/dist/pg-core/columns/double-precision.js"() {
|
20052
21172
|
"use strict";
|
20053
21173
|
init_entity();
|
20054
21174
|
init_common2();
|
@@ -20080,10 +21200,10 @@ var init_double_precision = __esm({
|
|
20080
21200
|
}
|
20081
21201
|
});
|
20082
21202
|
|
20083
|
-
// ../
|
21203
|
+
// ../drizzle-orm/dist/pg-core/columns/inet.js
|
20084
21204
|
var _a68, _b41, PgInetBuilder, _a69, _b42, PgInet;
|
20085
21205
|
var init_inet = __esm({
|
20086
|
-
"../
|
21206
|
+
"../drizzle-orm/dist/pg-core/columns/inet.js"() {
|
20087
21207
|
"use strict";
|
20088
21208
|
init_entity();
|
20089
21209
|
init_common2();
|
@@ -20106,10 +21226,10 @@ var init_inet = __esm({
|
|
20106
21226
|
}
|
20107
21227
|
});
|
20108
21228
|
|
20109
|
-
// ../
|
21229
|
+
// ../drizzle-orm/dist/pg-core/columns/integer.js
|
20110
21230
|
var _a70, _b43, PgIntegerBuilder, _a71, _b44, PgInteger;
|
20111
21231
|
var init_integer = __esm({
|
20112
|
-
"../
|
21232
|
+
"../drizzle-orm/dist/pg-core/columns/integer.js"() {
|
20113
21233
|
"use strict";
|
20114
21234
|
init_entity();
|
20115
21235
|
init_common2();
|
@@ -20139,10 +21259,10 @@ var init_integer = __esm({
|
|
20139
21259
|
}
|
20140
21260
|
});
|
20141
21261
|
|
20142
|
-
// ../
|
21262
|
+
// ../drizzle-orm/dist/pg-core/columns/interval.js
|
20143
21263
|
var _a72, _b45, PgIntervalBuilder, _a73, _b46, PgInterval;
|
20144
21264
|
var init_interval = __esm({
|
20145
|
-
"../
|
21265
|
+
"../drizzle-orm/dist/pg-core/columns/interval.js"() {
|
20146
21266
|
"use strict";
|
20147
21267
|
init_entity();
|
20148
21268
|
init_common2();
|
@@ -20173,10 +21293,10 @@ var init_interval = __esm({
|
|
20173
21293
|
}
|
20174
21294
|
});
|
20175
21295
|
|
20176
|
-
// ../
|
21296
|
+
// ../drizzle-orm/dist/pg-core/columns/json.js
|
20177
21297
|
var _a74, _b47, PgJsonBuilder, _a75, _b48, PgJson;
|
20178
21298
|
var init_json = __esm({
|
20179
|
-
"../
|
21299
|
+
"../drizzle-orm/dist/pg-core/columns/json.js"() {
|
20180
21300
|
"use strict";
|
20181
21301
|
init_entity();
|
20182
21302
|
init_common2();
|
@@ -20215,10 +21335,10 @@ var init_json = __esm({
|
|
20215
21335
|
}
|
20216
21336
|
});
|
20217
21337
|
|
20218
|
-
// ../
|
21338
|
+
// ../drizzle-orm/dist/pg-core/columns/jsonb.js
|
20219
21339
|
var _a76, _b49, PgJsonbBuilder, _a77, _b50, PgJsonb;
|
20220
21340
|
var init_jsonb = __esm({
|
20221
|
-
"../
|
21341
|
+
"../drizzle-orm/dist/pg-core/columns/jsonb.js"() {
|
20222
21342
|
"use strict";
|
20223
21343
|
init_entity();
|
20224
21344
|
init_common2();
|
@@ -20257,10 +21377,10 @@ var init_jsonb = __esm({
|
|
20257
21377
|
}
|
20258
21378
|
});
|
20259
21379
|
|
20260
|
-
// ../
|
21380
|
+
// ../drizzle-orm/dist/pg-core/columns/line.js
|
20261
21381
|
var _a78, _b51, PgLineBuilder, _a79, _b52, PgLineTuple, _a80, _b53, PgLineABCBuilder, _a81, _b54, PgLineABC;
|
20262
21382
|
var init_line = __esm({
|
20263
|
-
"../
|
21383
|
+
"../drizzle-orm/dist/pg-core/columns/line.js"() {
|
20264
21384
|
"use strict";
|
20265
21385
|
init_entity();
|
20266
21386
|
init_common2();
|
@@ -20319,10 +21439,10 @@ var init_line = __esm({
|
|
20319
21439
|
}
|
20320
21440
|
});
|
20321
21441
|
|
20322
|
-
// ../
|
21442
|
+
// ../drizzle-orm/dist/pg-core/columns/macaddr.js
|
20323
21443
|
var _a82, _b55, PgMacaddrBuilder, _a83, _b56, PgMacaddr;
|
20324
21444
|
var init_macaddr = __esm({
|
20325
|
-
"../
|
21445
|
+
"../drizzle-orm/dist/pg-core/columns/macaddr.js"() {
|
20326
21446
|
"use strict";
|
20327
21447
|
init_entity();
|
20328
21448
|
init_common2();
|
@@ -20345,10 +21465,10 @@ var init_macaddr = __esm({
|
|
20345
21465
|
}
|
20346
21466
|
});
|
20347
21467
|
|
20348
|
-
// ../
|
21468
|
+
// ../drizzle-orm/dist/pg-core/columns/macaddr8.js
|
20349
21469
|
var _a84, _b57, PgMacaddr8Builder, _a85, _b58, PgMacaddr8;
|
20350
21470
|
var init_macaddr8 = __esm({
|
20351
|
-
"../
|
21471
|
+
"../drizzle-orm/dist/pg-core/columns/macaddr8.js"() {
|
20352
21472
|
"use strict";
|
20353
21473
|
init_entity();
|
20354
21474
|
init_common2();
|
@@ -20371,10 +21491,10 @@ var init_macaddr8 = __esm({
|
|
20371
21491
|
}
|
20372
21492
|
});
|
20373
21493
|
|
20374
|
-
// ../
|
21494
|
+
// ../drizzle-orm/dist/pg-core/columns/numeric.js
|
20375
21495
|
var _a86, _b59, PgNumericBuilder, _a87, _b60, PgNumeric;
|
20376
21496
|
var init_numeric = __esm({
|
20377
|
-
"../
|
21497
|
+
"../drizzle-orm/dist/pg-core/columns/numeric.js"() {
|
20378
21498
|
"use strict";
|
20379
21499
|
init_entity();
|
20380
21500
|
init_common2();
|
@@ -20412,10 +21532,10 @@ var init_numeric = __esm({
|
|
20412
21532
|
}
|
20413
21533
|
});
|
20414
21534
|
|
20415
|
-
// ../
|
21535
|
+
// ../drizzle-orm/dist/pg-core/columns/point.js
|
20416
21536
|
var _a88, _b61, PgPointTupleBuilder, _a89, _b62, PgPointTuple, _a90, _b63, PgPointObjectBuilder, _a91, _b64, PgPointObject;
|
20417
21537
|
var init_point = __esm({
|
20418
|
-
"../
|
21538
|
+
"../drizzle-orm/dist/pg-core/columns/point.js"() {
|
20419
21539
|
"use strict";
|
20420
21540
|
init_entity();
|
20421
21541
|
init_common2();
|
@@ -20480,7 +21600,7 @@ var init_point = __esm({
|
|
20480
21600
|
}
|
20481
21601
|
});
|
20482
21602
|
|
20483
|
-
// ../
|
21603
|
+
// ../drizzle-orm/dist/pg-core/columns/postgis_extension/utils.js
|
20484
21604
|
function hexToBytes(hex) {
|
20485
21605
|
const bytes = [];
|
20486
21606
|
for (let c = 0; c < hex.length; c += 2) {
|
@@ -20519,15 +21639,15 @@ function parseEWKB(hex) {
|
|
20519
21639
|
throw new Error("Unsupported geometry type");
|
20520
21640
|
}
|
20521
21641
|
var init_utils3 = __esm({
|
20522
|
-
"../
|
21642
|
+
"../drizzle-orm/dist/pg-core/columns/postgis_extension/utils.js"() {
|
20523
21643
|
"use strict";
|
20524
21644
|
}
|
20525
21645
|
});
|
20526
21646
|
|
20527
|
-
// ../
|
21647
|
+
// ../drizzle-orm/dist/pg-core/columns/postgis_extension/geometry.js
|
20528
21648
|
var _a92, _b65, PgGeometryBuilder, _a93, _b66, PgGeometry, _a94, _b67, PgGeometryObjectBuilder, _a95, _b68, PgGeometryObject;
|
20529
21649
|
var init_geometry = __esm({
|
20530
|
-
"../
|
21650
|
+
"../drizzle-orm/dist/pg-core/columns/postgis_extension/geometry.js"() {
|
20531
21651
|
"use strict";
|
20532
21652
|
init_entity();
|
20533
21653
|
init_common2();
|
@@ -20586,10 +21706,10 @@ var init_geometry = __esm({
|
|
20586
21706
|
}
|
20587
21707
|
});
|
20588
21708
|
|
20589
|
-
// ../
|
21709
|
+
// ../drizzle-orm/dist/pg-core/columns/real.js
|
20590
21710
|
var _a96, _b69, PgRealBuilder, _a97, _b70, PgReal;
|
20591
21711
|
var init_real = __esm({
|
20592
|
-
"../
|
21712
|
+
"../drizzle-orm/dist/pg-core/columns/real.js"() {
|
20593
21713
|
"use strict";
|
20594
21714
|
init_entity();
|
20595
21715
|
init_common2();
|
@@ -20622,10 +21742,10 @@ var init_real = __esm({
|
|
20622
21742
|
}
|
20623
21743
|
});
|
20624
21744
|
|
20625
|
-
// ../
|
21745
|
+
// ../drizzle-orm/dist/pg-core/columns/serial.js
|
20626
21746
|
var _a98, _b71, PgSerialBuilder, _a99, _b72, PgSerial;
|
20627
21747
|
var init_serial = __esm({
|
20628
|
-
"../
|
21748
|
+
"../drizzle-orm/dist/pg-core/columns/serial.js"() {
|
20629
21749
|
"use strict";
|
20630
21750
|
init_entity();
|
20631
21751
|
init_common2();
|
@@ -20650,10 +21770,10 @@ var init_serial = __esm({
|
|
20650
21770
|
}
|
20651
21771
|
});
|
20652
21772
|
|
20653
|
-
// ../
|
21773
|
+
// ../drizzle-orm/dist/pg-core/columns/smallint.js
|
20654
21774
|
var _a100, _b73, PgSmallIntBuilder, _a101, _b74, PgSmallInt;
|
20655
21775
|
var init_smallint = __esm({
|
20656
|
-
"../
|
21776
|
+
"../drizzle-orm/dist/pg-core/columns/smallint.js"() {
|
20657
21777
|
"use strict";
|
20658
21778
|
init_entity();
|
20659
21779
|
init_common2();
|
@@ -20686,10 +21806,10 @@ var init_smallint = __esm({
|
|
20686
21806
|
}
|
20687
21807
|
});
|
20688
21808
|
|
20689
|
-
// ../
|
21809
|
+
// ../drizzle-orm/dist/pg-core/columns/smallserial.js
|
20690
21810
|
var _a102, _b75, PgSmallSerialBuilder, _a103, _b76, PgSmallSerial;
|
20691
21811
|
var init_smallserial = __esm({
|
20692
|
-
"../
|
21812
|
+
"../drizzle-orm/dist/pg-core/columns/smallserial.js"() {
|
20693
21813
|
"use strict";
|
20694
21814
|
init_entity();
|
20695
21815
|
init_common2();
|
@@ -20717,10 +21837,10 @@ var init_smallserial = __esm({
|
|
20717
21837
|
}
|
20718
21838
|
});
|
20719
21839
|
|
20720
|
-
// ../
|
21840
|
+
// ../drizzle-orm/dist/pg-core/columns/text.js
|
20721
21841
|
var _a104, _b77, PgTextBuilder, _a105, _b78, PgText;
|
20722
21842
|
var init_text = __esm({
|
20723
|
-
"../
|
21843
|
+
"../drizzle-orm/dist/pg-core/columns/text.js"() {
|
20724
21844
|
"use strict";
|
20725
21845
|
init_entity();
|
20726
21846
|
init_common2();
|
@@ -20748,10 +21868,10 @@ var init_text = __esm({
|
|
20748
21868
|
}
|
20749
21869
|
});
|
20750
21870
|
|
20751
|
-
// ../
|
21871
|
+
// ../drizzle-orm/dist/pg-core/columns/time.js
|
20752
21872
|
var _a106, _b79, PgTimeBuilder, _a107, _b80, PgTime;
|
20753
21873
|
var init_time = __esm({
|
20754
|
-
"../
|
21874
|
+
"../drizzle-orm/dist/pg-core/columns/time.js"() {
|
20755
21875
|
"use strict";
|
20756
21876
|
init_entity();
|
20757
21877
|
init_common2();
|
@@ -20787,10 +21907,10 @@ var init_time = __esm({
|
|
20787
21907
|
}
|
20788
21908
|
});
|
20789
21909
|
|
20790
|
-
// ../
|
21910
|
+
// ../drizzle-orm/dist/pg-core/columns/timestamp.js
|
20791
21911
|
var _a108, _b81, PgTimestampBuilder, _a109, _b82, PgTimestamp, _a110, _b83, PgTimestampStringBuilder, _a111, _b84, PgTimestampString;
|
20792
21912
|
var init_timestamp = __esm({
|
20793
|
-
"../
|
21913
|
+
"../drizzle-orm/dist/pg-core/columns/timestamp.js"() {
|
20794
21914
|
"use strict";
|
20795
21915
|
init_entity();
|
20796
21916
|
init_common2();
|
@@ -20859,10 +21979,10 @@ var init_timestamp = __esm({
|
|
20859
21979
|
}
|
20860
21980
|
});
|
20861
21981
|
|
20862
|
-
// ../
|
21982
|
+
// ../drizzle-orm/dist/pg-core/columns/uuid.js
|
20863
21983
|
var _a112, _b85, PgUUIDBuilder, _a113, _b86, PgUUID;
|
20864
21984
|
var init_uuid = __esm({
|
20865
|
-
"../
|
21985
|
+
"../drizzle-orm/dist/pg-core/columns/uuid.js"() {
|
20866
21986
|
"use strict";
|
20867
21987
|
init_entity();
|
20868
21988
|
init_sql();
|
@@ -20892,10 +22012,10 @@ var init_uuid = __esm({
|
|
20892
22012
|
}
|
20893
22013
|
});
|
20894
22014
|
|
20895
|
-
// ../
|
22015
|
+
// ../drizzle-orm/dist/pg-core/columns/varchar.js
|
20896
22016
|
var _a114, _b87, PgVarcharBuilder, _a115, _b88, PgVarchar;
|
20897
22017
|
var init_varchar = __esm({
|
20898
|
-
"../
|
22018
|
+
"../drizzle-orm/dist/pg-core/columns/varchar.js"() {
|
20899
22019
|
"use strict";
|
20900
22020
|
init_entity();
|
20901
22021
|
init_common2();
|
@@ -20925,10 +22045,10 @@ var init_varchar = __esm({
|
|
20925
22045
|
}
|
20926
22046
|
});
|
20927
22047
|
|
20928
|
-
// ../
|
22048
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/bit.js
|
20929
22049
|
var _a116, _b89, PgBinaryVectorBuilder, _a117, _b90, PgBinaryVector;
|
20930
22050
|
var init_bit = __esm({
|
20931
|
-
"../
|
22051
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/bit.js"() {
|
20932
22052
|
"use strict";
|
20933
22053
|
init_entity();
|
20934
22054
|
init_common2();
|
@@ -20959,10 +22079,10 @@ var init_bit = __esm({
|
|
20959
22079
|
}
|
20960
22080
|
});
|
20961
22081
|
|
20962
|
-
// ../
|
22082
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/halfvec.js
|
20963
22083
|
var _a118, _b91, PgHalfVectorBuilder, _a119, _b92, PgHalfVector;
|
20964
22084
|
var init_halfvec = __esm({
|
20965
|
-
"../
|
22085
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/halfvec.js"() {
|
20966
22086
|
"use strict";
|
20967
22087
|
init_entity();
|
20968
22088
|
init_common2();
|
@@ -20999,10 +22119,10 @@ var init_halfvec = __esm({
|
|
20999
22119
|
}
|
21000
22120
|
});
|
21001
22121
|
|
21002
|
-
// ../
|
22122
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/sparsevec.js
|
21003
22123
|
var _a120, _b93, PgSparseVectorBuilder, _a121, _b94, PgSparseVector;
|
21004
22124
|
var init_sparsevec = __esm({
|
21005
|
-
"../
|
22125
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/sparsevec.js"() {
|
21006
22126
|
"use strict";
|
21007
22127
|
init_entity();
|
21008
22128
|
init_common2();
|
@@ -21033,10 +22153,10 @@ var init_sparsevec = __esm({
|
|
21033
22153
|
}
|
21034
22154
|
});
|
21035
22155
|
|
21036
|
-
// ../
|
22156
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/vector.js
|
21037
22157
|
var _a122, _b95, PgVectorBuilder, _a123, _b96, PgVector;
|
21038
22158
|
var init_vector2 = __esm({
|
21039
|
-
"../
|
22159
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/vector.js"() {
|
21040
22160
|
"use strict";
|
21041
22161
|
init_entity();
|
21042
22162
|
init_common2();
|
@@ -21070,9 +22190,9 @@ var init_vector2 = __esm({
|
|
21070
22190
|
}
|
21071
22191
|
});
|
21072
22192
|
|
21073
|
-
// ../
|
22193
|
+
// ../drizzle-orm/dist/pg-core/columns/index.js
|
21074
22194
|
var init_columns = __esm({
|
21075
|
-
"../
|
22195
|
+
"../drizzle-orm/dist/pg-core/columns/index.js"() {
|
21076
22196
|
"use strict";
|
21077
22197
|
init_bigint();
|
21078
22198
|
init_bigserial();
|
@@ -21111,10 +22231,10 @@ var init_columns = __esm({
|
|
21111
22231
|
}
|
21112
22232
|
});
|
21113
22233
|
|
21114
|
-
// ../
|
22234
|
+
// ../drizzle-orm/dist/pg-core/query-builders/delete.js
|
21115
22235
|
var _a124, _b97, PgDeleteBase;
|
21116
22236
|
var init_delete = __esm({
|
21117
|
-
"../
|
22237
|
+
"../drizzle-orm/dist/pg-core/query-builders/delete.js"() {
|
21118
22238
|
"use strict";
|
21119
22239
|
init_entity();
|
21120
22240
|
init_query_promise();
|
@@ -21196,10 +22316,10 @@ var init_delete = __esm({
|
|
21196
22316
|
}
|
21197
22317
|
});
|
21198
22318
|
|
21199
|
-
// ../
|
22319
|
+
// ../drizzle-orm/dist/pg-core/query-builders/insert.js
|
21200
22320
|
var _a125, PgInsertBuilder, _a126, _b98, PgInsertBase;
|
21201
22321
|
var init_insert = __esm({
|
21202
|
-
"../
|
22322
|
+
"../drizzle-orm/dist/pg-core/query-builders/insert.js"() {
|
21203
22323
|
"use strict";
|
21204
22324
|
init_entity();
|
21205
22325
|
init_query_promise();
|
@@ -21352,10 +22472,10 @@ var init_insert = __esm({
|
|
21352
22472
|
}
|
21353
22473
|
});
|
21354
22474
|
|
21355
|
-
// ../
|
22475
|
+
// ../drizzle-orm/dist/pg-core/view-base.js
|
21356
22476
|
var _a127, _b99, PgViewBase;
|
21357
22477
|
var init_view_base = __esm({
|
21358
|
-
"../
|
22478
|
+
"../drizzle-orm/dist/pg-core/view-base.js"() {
|
21359
22479
|
"use strict";
|
21360
22480
|
init_entity();
|
21361
22481
|
init_sql();
|
@@ -21365,10 +22485,10 @@ var init_view_base = __esm({
|
|
21365
22485
|
}
|
21366
22486
|
});
|
21367
22487
|
|
21368
|
-
// ../
|
22488
|
+
// ../drizzle-orm/dist/pg-core/dialect.js
|
21369
22489
|
var _a128, PgDialect;
|
21370
22490
|
var init_dialect = __esm({
|
21371
|
-
"../
|
22491
|
+
"../drizzle-orm/dist/pg-core/dialect.js"() {
|
21372
22492
|
"use strict";
|
21373
22493
|
init_alias();
|
21374
22494
|
init_column();
|
@@ -22448,10 +23568,10 @@ var init_dialect = __esm({
|
|
22448
23568
|
}
|
22449
23569
|
});
|
22450
23570
|
|
22451
|
-
// ../
|
23571
|
+
// ../drizzle-orm/dist/selection-proxy.js
|
22452
23572
|
var _a129, _SelectionProxyHandler, SelectionProxyHandler;
|
22453
23573
|
var init_selection_proxy = __esm({
|
22454
|
-
"../
|
23574
|
+
"../drizzle-orm/dist/selection-proxy.js"() {
|
22455
23575
|
"use strict";
|
22456
23576
|
init_alias();
|
22457
23577
|
init_column();
|
@@ -22530,10 +23650,10 @@ var init_selection_proxy = __esm({
|
|
22530
23650
|
}
|
22531
23651
|
});
|
22532
23652
|
|
22533
|
-
// ../
|
23653
|
+
// ../drizzle-orm/dist/query-builders/query-builder.js
|
22534
23654
|
var _a130, TypedQueryBuilder;
|
22535
23655
|
var init_query_builder = __esm({
|
22536
|
-
"../
|
23656
|
+
"../drizzle-orm/dist/query-builders/query-builder.js"() {
|
22537
23657
|
"use strict";
|
22538
23658
|
init_entity();
|
22539
23659
|
_a130 = entityKind;
|
@@ -22547,7 +23667,7 @@ var init_query_builder = __esm({
|
|
22547
23667
|
}
|
22548
23668
|
});
|
22549
23669
|
|
22550
|
-
// ../
|
23670
|
+
// ../drizzle-orm/dist/pg-core/query-builders/select.js
|
22551
23671
|
function createSetOperator(type, isAll) {
|
22552
23672
|
return (leftSelect, rightSelect, ...restSelects) => {
|
22553
23673
|
const setOperators = [rightSelect, ...restSelects].map((select) => ({
|
@@ -22567,7 +23687,7 @@ function createSetOperator(type, isAll) {
|
|
22567
23687
|
}
|
22568
23688
|
var _a131, PgSelectBuilder, _a132, _b100, PgSelectQueryBuilderBase, _a133, _b101, PgSelectBase, getPgSetOperators, union, unionAll, intersect, intersectAll, except, exceptAll;
|
22569
23689
|
var init_select2 = __esm({
|
22570
|
-
"../
|
23690
|
+
"../drizzle-orm/dist/pg-core/query-builders/select.js"() {
|
22571
23691
|
"use strict";
|
22572
23692
|
init_entity();
|
22573
23693
|
init_view_base();
|
@@ -23284,10 +24404,10 @@ var init_select2 = __esm({
|
|
23284
24404
|
}
|
23285
24405
|
});
|
23286
24406
|
|
23287
|
-
// ../
|
24407
|
+
// ../drizzle-orm/dist/pg-core/query-builders/query-builder.js
|
23288
24408
|
var _a134, QueryBuilder;
|
23289
24409
|
var init_query_builder2 = __esm({
|
23290
|
-
"../
|
24410
|
+
"../drizzle-orm/dist/pg-core/query-builders/query-builder.js"() {
|
23291
24411
|
"use strict";
|
23292
24412
|
init_entity();
|
23293
24413
|
init_dialect();
|
@@ -23376,10 +24496,10 @@ var init_query_builder2 = __esm({
|
|
23376
24496
|
}
|
23377
24497
|
});
|
23378
24498
|
|
23379
|
-
// ../
|
24499
|
+
// ../drizzle-orm/dist/pg-core/query-builders/refresh-materialized-view.js
|
23380
24500
|
var _a135, _b102, PgRefreshMaterializedView;
|
23381
24501
|
var init_refresh_materialized_view = __esm({
|
23382
|
-
"../
|
24502
|
+
"../drizzle-orm/dist/pg-core/query-builders/refresh-materialized-view.js"() {
|
23383
24503
|
"use strict";
|
23384
24504
|
init_entity();
|
23385
24505
|
init_query_promise();
|
@@ -23433,17 +24553,17 @@ var init_refresh_materialized_view = __esm({
|
|
23433
24553
|
}
|
23434
24554
|
});
|
23435
24555
|
|
23436
|
-
// ../
|
24556
|
+
// ../drizzle-orm/dist/pg-core/query-builders/select.types.js
|
23437
24557
|
var init_select_types = __esm({
|
23438
|
-
"../
|
24558
|
+
"../drizzle-orm/dist/pg-core/query-builders/select.types.js"() {
|
23439
24559
|
"use strict";
|
23440
24560
|
}
|
23441
24561
|
});
|
23442
24562
|
|
23443
|
-
// ../
|
24563
|
+
// ../drizzle-orm/dist/pg-core/query-builders/update.js
|
23444
24564
|
var _a136, PgUpdateBuilder, _a137, _b103, PgUpdateBase;
|
23445
24565
|
var init_update = __esm({
|
23446
|
-
"../
|
24566
|
+
"../drizzle-orm/dist/pg-core/query-builders/update.js"() {
|
23447
24567
|
"use strict";
|
23448
24568
|
init_entity();
|
23449
24569
|
init_query_promise();
|
@@ -23543,9 +24663,9 @@ var init_update = __esm({
|
|
23543
24663
|
}
|
23544
24664
|
});
|
23545
24665
|
|
23546
|
-
// ../
|
24666
|
+
// ../drizzle-orm/dist/pg-core/query-builders/index.js
|
23547
24667
|
var init_query_builders = __esm({
|
23548
|
-
"../
|
24668
|
+
"../drizzle-orm/dist/pg-core/query-builders/index.js"() {
|
23549
24669
|
"use strict";
|
23550
24670
|
init_delete();
|
23551
24671
|
init_insert();
|
@@ -23557,10 +24677,10 @@ var init_query_builders = __esm({
|
|
23557
24677
|
}
|
23558
24678
|
});
|
23559
24679
|
|
23560
|
-
// ../
|
24680
|
+
// ../drizzle-orm/dist/pg-core/query-builders/query.js
|
23561
24681
|
var _a138, RelationalQueryBuilder, _a139, _b104, PgRelationalQuery;
|
23562
24682
|
var init_query = __esm({
|
23563
|
-
"../
|
24683
|
+
"../drizzle-orm/dist/pg-core/query-builders/query.js"() {
|
23564
24684
|
"use strict";
|
23565
24685
|
init_entity();
|
23566
24686
|
init_query_promise();
|
@@ -23675,10 +24795,10 @@ var init_query = __esm({
|
|
23675
24795
|
}
|
23676
24796
|
});
|
23677
24797
|
|
23678
|
-
// ../
|
24798
|
+
// ../drizzle-orm/dist/pg-core/query-builders/raw.js
|
23679
24799
|
var _a140, _b105, PgRaw;
|
23680
24800
|
var init_raw = __esm({
|
23681
|
-
"../
|
24801
|
+
"../drizzle-orm/dist/pg-core/query-builders/raw.js"() {
|
23682
24802
|
"use strict";
|
23683
24803
|
init_entity();
|
23684
24804
|
init_query_promise();
|
@@ -23712,10 +24832,10 @@ var init_raw = __esm({
|
|
23712
24832
|
}
|
23713
24833
|
});
|
23714
24834
|
|
23715
|
-
// ../
|
24835
|
+
// ../drizzle-orm/dist/pg-core/db.js
|
23716
24836
|
var _a141, PgDatabase;
|
23717
24837
|
var init_db = __esm({
|
23718
|
-
"../
|
24838
|
+
"../drizzle-orm/dist/pg-core/db.js"() {
|
23719
24839
|
"use strict";
|
23720
24840
|
init_entity();
|
23721
24841
|
init_query_builders();
|
@@ -23993,10 +25113,10 @@ var init_db = __esm({
|
|
23993
25113
|
}
|
23994
25114
|
});
|
23995
25115
|
|
23996
|
-
// ../
|
25116
|
+
// ../drizzle-orm/dist/pg-core/indexes.js
|
23997
25117
|
var _a142, IndexBuilderOn, _a143, IndexBuilder, _a144, Index2;
|
23998
25118
|
var init_indexes = __esm({
|
23999
|
-
"../
|
25119
|
+
"../drizzle-orm/dist/pg-core/indexes.js"() {
|
24000
25120
|
"use strict";
|
24001
25121
|
init_sql();
|
24002
25122
|
init_entity();
|
@@ -24111,7 +25231,7 @@ var init_indexes = __esm({
|
|
24111
25231
|
}
|
24112
25232
|
});
|
24113
25233
|
|
24114
|
-
// ../
|
25234
|
+
// ../drizzle-orm/dist/pg-core/sequence.js
|
24115
25235
|
function pgSequenceWithSchema(name2, options, schema4) {
|
24116
25236
|
return new PgSequence(name2, options, schema4);
|
24117
25237
|
}
|
@@ -24120,7 +25240,7 @@ function isPgSequence(obj) {
|
|
24120
25240
|
}
|
24121
25241
|
var _a145, PgSequence;
|
24122
25242
|
var init_sequence = __esm({
|
24123
|
-
"../
|
25243
|
+
"../drizzle-orm/dist/pg-core/sequence.js"() {
|
24124
25244
|
"use strict";
|
24125
25245
|
init_entity();
|
24126
25246
|
_a145 = entityKind;
|
@@ -24135,16 +25255,16 @@ var init_sequence = __esm({
|
|
24135
25255
|
}
|
24136
25256
|
});
|
24137
25257
|
|
24138
|
-
// ../
|
25258
|
+
// ../drizzle-orm/dist/pg-core/view-common.js
|
24139
25259
|
var PgViewConfig;
|
24140
25260
|
var init_view_common2 = __esm({
|
24141
|
-
"../
|
25261
|
+
"../drizzle-orm/dist/pg-core/view-common.js"() {
|
24142
25262
|
"use strict";
|
24143
25263
|
PgViewConfig = Symbol.for("drizzle:PgViewConfig");
|
24144
25264
|
}
|
24145
25265
|
});
|
24146
25266
|
|
24147
|
-
// ../
|
25267
|
+
// ../drizzle-orm/dist/pg-core/view.js
|
24148
25268
|
function pgViewWithSchema(name2, selection, schema4) {
|
24149
25269
|
if (selection) {
|
24150
25270
|
return new ManualViewBuilder(name2, selection, schema4);
|
@@ -24159,7 +25279,7 @@ function pgMaterializedViewWithSchema(name2, selection, schema4) {
|
|
24159
25279
|
}
|
24160
25280
|
var _a146, DefaultViewBuilderCore, _a147, _b106, ViewBuilder, _a148, _b107, ManualViewBuilder, _a149, MaterializedViewBuilderCore, _a150, _b108, MaterializedViewBuilder, _a151, _b109, ManualMaterializedViewBuilder, _a152, _b110, _c3, PgView, PgMaterializedViewConfig, _a153, _b111, _c4, PgMaterializedView;
|
24161
25281
|
var init_view = __esm({
|
24162
|
-
"../
|
25282
|
+
"../drizzle-orm/dist/pg-core/view.js"() {
|
24163
25283
|
"use strict";
|
24164
25284
|
init_entity();
|
24165
25285
|
init_selection_proxy();
|
@@ -24386,10 +25506,10 @@ var init_view = __esm({
|
|
24386
25506
|
}
|
24387
25507
|
});
|
24388
25508
|
|
24389
|
-
// ../
|
25509
|
+
// ../drizzle-orm/dist/pg-core/schema.js
|
24390
25510
|
var _a154, PgSchema5;
|
24391
25511
|
var init_schema = __esm({
|
24392
|
-
"../
|
25512
|
+
"../drizzle-orm/dist/pg-core/schema.js"() {
|
24393
25513
|
"use strict";
|
24394
25514
|
init_entity();
|
24395
25515
|
init_sql();
|
@@ -24428,10 +25548,10 @@ var init_schema = __esm({
|
|
24428
25548
|
}
|
24429
25549
|
});
|
24430
25550
|
|
24431
|
-
// ../
|
25551
|
+
// ../drizzle-orm/dist/pg-core/session.js
|
24432
25552
|
var _a155, PgPreparedQuery, _a156, PgSession, _a157, _b112, PgTransaction;
|
24433
25553
|
var init_session = __esm({
|
24434
|
-
"../
|
25554
|
+
"../drizzle-orm/dist/pg-core/session.js"() {
|
24435
25555
|
"use strict";
|
24436
25556
|
init_entity();
|
24437
25557
|
init_errors();
|
@@ -24512,14 +25632,14 @@ var init_session = __esm({
|
|
24512
25632
|
}
|
24513
25633
|
});
|
24514
25634
|
|
24515
|
-
// ../
|
25635
|
+
// ../drizzle-orm/dist/pg-core/subquery.js
|
24516
25636
|
var init_subquery2 = __esm({
|
24517
|
-
"../
|
25637
|
+
"../drizzle-orm/dist/pg-core/subquery.js"() {
|
24518
25638
|
"use strict";
|
24519
25639
|
}
|
24520
25640
|
});
|
24521
25641
|
|
24522
|
-
// ../
|
25642
|
+
// ../drizzle-orm/dist/pg-core/utils.js
|
24523
25643
|
function getTableConfig(table4) {
|
24524
25644
|
const columns = Object.values(table4[Table2.Symbol.Columns]);
|
24525
25645
|
const indexes = [];
|
@@ -24558,7 +25678,7 @@ function getTableConfig(table4) {
|
|
24558
25678
|
};
|
24559
25679
|
}
|
24560
25680
|
var init_utils4 = __esm({
|
24561
|
-
"../
|
25681
|
+
"../drizzle-orm/dist/pg-core/utils.js"() {
|
24562
25682
|
"use strict";
|
24563
25683
|
init_entity();
|
24564
25684
|
init_table2();
|
@@ -24571,17 +25691,17 @@ var init_utils4 = __esm({
|
|
24571
25691
|
}
|
24572
25692
|
});
|
24573
25693
|
|
24574
|
-
// ../
|
25694
|
+
// ../drizzle-orm/dist/pg-core/utils/index.js
|
24575
25695
|
var init_utils5 = __esm({
|
24576
|
-
"../
|
25696
|
+
"../drizzle-orm/dist/pg-core/utils/index.js"() {
|
24577
25697
|
"use strict";
|
24578
25698
|
init_array();
|
24579
25699
|
}
|
24580
25700
|
});
|
24581
25701
|
|
24582
|
-
// ../
|
25702
|
+
// ../drizzle-orm/dist/pg-core/index.js
|
24583
25703
|
var init_pg_core = __esm({
|
24584
|
-
"../
|
25704
|
+
"../drizzle-orm/dist/pg-core/index.js"() {
|
24585
25705
|
"use strict";
|
24586
25706
|
init_alias2();
|
24587
25707
|
init_checks();
|
@@ -24636,16 +25756,41 @@ function minRangeForIdentityBasedOn(columnType) {
|
|
24636
25756
|
function stringFromDatabaseIdentityProperty(field) {
|
24637
25757
|
return typeof field === "string" ? field : typeof field === "undefined" ? void 0 : typeof field === "bigint" ? field.toString() : String(field);
|
24638
25758
|
}
|
25759
|
+
function buildArrayString(array, sqlType) {
|
25760
|
+
sqlType = sqlType.split("[")[0];
|
25761
|
+
const values = array.map((value) => {
|
25762
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
25763
|
+
return value.toString();
|
25764
|
+
} else if (typeof value === "boolean") {
|
25765
|
+
return value ? "true" : "false";
|
25766
|
+
} else if (Array.isArray(value)) {
|
25767
|
+
return buildArrayString(value, sqlType);
|
25768
|
+
} else if (value instanceof Date) {
|
25769
|
+
if (sqlType === "date") {
|
25770
|
+
return `"${value.toISOString().split("T")[0]}"`;
|
25771
|
+
} else if (sqlType === "timestamp") {
|
25772
|
+
return `"${value.toISOString().replace("T", " ").slice(0, 23)}"`;
|
25773
|
+
} else {
|
25774
|
+
return `"${value.toISOString()}"`;
|
25775
|
+
}
|
25776
|
+
} else if (typeof value === "object") {
|
25777
|
+
return `"${JSON.stringify(value).replaceAll('"', '\\"')}"`;
|
25778
|
+
}
|
25779
|
+
return `"${value}"`;
|
25780
|
+
}).join(",");
|
25781
|
+
return `{${values}}`;
|
25782
|
+
}
|
24639
25783
|
var dialect4, indexName, generatePgSnapshot, trimChar, fromDatabase, columnToDefault, defaultForColumn;
|
24640
25784
|
var init_pgSerializer = __esm({
|
24641
25785
|
"src/serializer/pgSerializer.ts"() {
|
24642
25786
|
"use strict";
|
24643
25787
|
init_source();
|
24644
|
-
|
25788
|
+
init_dist();
|
24645
25789
|
init_pg_core();
|
24646
25790
|
init_pg_core();
|
24647
25791
|
init_vector3();
|
24648
25792
|
init_outputs();
|
25793
|
+
init_utils();
|
24649
25794
|
init_serializer();
|
24650
25795
|
dialect4 = new PgDialect();
|
24651
25796
|
indexName = (tableName, columns) => {
|
@@ -24752,6 +25897,11 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
24752
25897
|
} else {
|
24753
25898
|
columnToSet.default = `'${column4.default.toISOString()}'`;
|
24754
25899
|
}
|
25900
|
+
} else if (isPgArrayType(sqlTypeLowered) && Array.isArray(column4.default)) {
|
25901
|
+
columnToSet.default = `'${buildArrayString(
|
25902
|
+
column4.default,
|
25903
|
+
sqlTypeLowered
|
25904
|
+
)}'::${sqlTypeLowered}`;
|
24755
25905
|
} else {
|
24756
25906
|
columnToSet.default = column4.default;
|
24757
25907
|
}
|
@@ -25550,17 +26700,17 @@ var init_selector_ui = __esm({
|
|
25550
26700
|
}
|
25551
26701
|
});
|
25552
26702
|
|
25553
|
-
// ../
|
26703
|
+
// ../drizzle-orm/dist/sqlite-core/alias.js
|
25554
26704
|
var init_alias3 = __esm({
|
25555
|
-
"../
|
26705
|
+
"../drizzle-orm/dist/sqlite-core/alias.js"() {
|
25556
26706
|
"use strict";
|
25557
26707
|
}
|
25558
26708
|
});
|
25559
26709
|
|
25560
|
-
// ../
|
26710
|
+
// ../drizzle-orm/dist/sqlite-core/checks.js
|
25561
26711
|
var _a158, CheckBuilder2, _a159, Check2;
|
25562
26712
|
var init_checks2 = __esm({
|
25563
|
-
"../
|
26713
|
+
"../drizzle-orm/dist/sqlite-core/checks.js"() {
|
25564
26714
|
"use strict";
|
25565
26715
|
init_entity();
|
25566
26716
|
_a158 = entityKind;
|
@@ -25589,7 +26739,7 @@ var init_checks2 = __esm({
|
|
25589
26739
|
}
|
25590
26740
|
});
|
25591
26741
|
|
25592
|
-
// ../
|
26742
|
+
// ../drizzle-orm/dist/sqlite-core/table.js
|
25593
26743
|
function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2) {
|
25594
26744
|
const rawTable = new SQLiteTable(name2, schema4, baseName);
|
25595
26745
|
const builtColumns = Object.fromEntries(
|
@@ -25610,7 +26760,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
|
|
25610
26760
|
}
|
25611
26761
|
var InlineForeignKeys2, _a160, _b113, _c5, _d3, _e2, SQLiteTable, sqliteTable;
|
25612
26762
|
var init_table3 = __esm({
|
25613
|
-
"../
|
26763
|
+
"../drizzle-orm/dist/sqlite-core/table.js"() {
|
25614
26764
|
"use strict";
|
25615
26765
|
init_entity();
|
25616
26766
|
init_table();
|
@@ -25637,10 +26787,10 @@ var init_table3 = __esm({
|
|
25637
26787
|
}
|
25638
26788
|
});
|
25639
26789
|
|
25640
|
-
// ../
|
26790
|
+
// ../drizzle-orm/dist/sqlite-core/foreign-keys.js
|
25641
26791
|
var _a161, ForeignKeyBuilder2, _a162, ForeignKey2;
|
25642
26792
|
var init_foreign_keys2 = __esm({
|
25643
|
-
"../
|
26793
|
+
"../drizzle-orm/dist/sqlite-core/foreign-keys.js"() {
|
25644
26794
|
"use strict";
|
25645
26795
|
init_entity();
|
25646
26796
|
init_table3();
|
@@ -25704,13 +26854,13 @@ var init_foreign_keys2 = __esm({
|
|
25704
26854
|
}
|
25705
26855
|
});
|
25706
26856
|
|
25707
|
-
// ../
|
26857
|
+
// ../drizzle-orm/dist/sqlite-core/unique-constraint.js
|
25708
26858
|
function uniqueKeyName2(table4, columns) {
|
25709
26859
|
return `${table4[SQLiteTable.Symbol.Name]}_${columns.join("_")}_unique`;
|
25710
26860
|
}
|
25711
26861
|
var _a163, UniqueConstraintBuilder2, _a164, UniqueOnConstraintBuilder2, _a165, UniqueConstraint2;
|
25712
26862
|
var init_unique_constraint2 = __esm({
|
25713
|
-
"../
|
26863
|
+
"../drizzle-orm/dist/sqlite-core/unique-constraint.js"() {
|
25714
26864
|
"use strict";
|
25715
26865
|
init_entity();
|
25716
26866
|
init_table3();
|
@@ -25757,10 +26907,10 @@ var init_unique_constraint2 = __esm({
|
|
25757
26907
|
}
|
25758
26908
|
});
|
25759
26909
|
|
25760
|
-
// ../
|
26910
|
+
// ../drizzle-orm/dist/sqlite-core/columns/common.js
|
25761
26911
|
var _a166, _b114, SQLiteColumnBuilder, _a167, _b115, SQLiteColumn;
|
25762
26912
|
var init_common3 = __esm({
|
25763
|
-
"../
|
26913
|
+
"../drizzle-orm/dist/sqlite-core/columns/common.js"() {
|
25764
26914
|
"use strict";
|
25765
26915
|
init_column_builder();
|
25766
26916
|
init_column();
|
@@ -25822,10 +26972,10 @@ var init_common3 = __esm({
|
|
25822
26972
|
}
|
25823
26973
|
});
|
25824
26974
|
|
25825
|
-
// ../
|
26975
|
+
// ../drizzle-orm/dist/sqlite-core/columns/blob.js
|
25826
26976
|
var _a168, _b116, SQLiteBigIntBuilder, _a169, _b117, SQLiteBigInt, _a170, _b118, SQLiteBlobJsonBuilder, _a171, _b119, SQLiteBlobJson, _a172, _b120, SQLiteBlobBufferBuilder, _a173, _b121, SQLiteBlobBuffer;
|
25827
26977
|
var init_blob = __esm({
|
25828
|
-
"../
|
26978
|
+
"../drizzle-orm/dist/sqlite-core/columns/blob.js"() {
|
25829
26979
|
"use strict";
|
25830
26980
|
init_entity();
|
25831
26981
|
init_common3();
|
@@ -25895,10 +27045,10 @@ var init_blob = __esm({
|
|
25895
27045
|
}
|
25896
27046
|
});
|
25897
27047
|
|
25898
|
-
// ../
|
27048
|
+
// ../drizzle-orm/dist/sqlite-core/columns/custom.js
|
25899
27049
|
var _a174, _b122, SQLiteCustomColumnBuilder, _a175, _b123, SQLiteCustomColumn;
|
25900
27050
|
var init_custom2 = __esm({
|
25901
|
-
"../
|
27051
|
+
"../drizzle-orm/dist/sqlite-core/columns/custom.js"() {
|
25902
27052
|
"use strict";
|
25903
27053
|
init_entity();
|
25904
27054
|
init_common3();
|
@@ -25941,10 +27091,10 @@ var init_custom2 = __esm({
|
|
25941
27091
|
}
|
25942
27092
|
});
|
25943
27093
|
|
25944
|
-
// ../
|
27094
|
+
// ../drizzle-orm/dist/sqlite-core/columns/integer.js
|
25945
27095
|
var _a176, _b124, SQLiteBaseIntegerBuilder, _a177, _b125, SQLiteBaseInteger, _a178, _b126, SQLiteIntegerBuilder, _a179, _b127, SQLiteInteger, _a180, _b128, SQLiteTimestampBuilder, _a181, _b129, SQLiteTimestamp, _a182, _b130, SQLiteBooleanBuilder, _a183, _b131, SQLiteBoolean;
|
25946
27096
|
var init_integer2 = __esm({
|
25947
|
-
"../
|
27097
|
+
"../drizzle-orm/dist/sqlite-core/columns/integer.js"() {
|
25948
27098
|
"use strict";
|
25949
27099
|
init_entity();
|
25950
27100
|
init_sql();
|
@@ -26058,10 +27208,10 @@ var init_integer2 = __esm({
|
|
26058
27208
|
}
|
26059
27209
|
});
|
26060
27210
|
|
26061
|
-
// ../
|
27211
|
+
// ../drizzle-orm/dist/sqlite-core/columns/numeric.js
|
26062
27212
|
var _a184, _b132, SQLiteNumericBuilder, _a185, _b133, SQLiteNumeric;
|
26063
27213
|
var init_numeric2 = __esm({
|
26064
|
-
"../
|
27214
|
+
"../drizzle-orm/dist/sqlite-core/columns/numeric.js"() {
|
26065
27215
|
"use strict";
|
26066
27216
|
init_entity();
|
26067
27217
|
init_common3();
|
@@ -26087,10 +27237,10 @@ var init_numeric2 = __esm({
|
|
26087
27237
|
}
|
26088
27238
|
});
|
26089
27239
|
|
26090
|
-
// ../
|
27240
|
+
// ../drizzle-orm/dist/sqlite-core/columns/real.js
|
26091
27241
|
var _a186, _b134, SQLiteRealBuilder, _a187, _b135, SQLiteReal;
|
26092
27242
|
var init_real2 = __esm({
|
26093
|
-
"../
|
27243
|
+
"../drizzle-orm/dist/sqlite-core/columns/real.js"() {
|
26094
27244
|
"use strict";
|
26095
27245
|
init_entity();
|
26096
27246
|
init_common3();
|
@@ -26113,10 +27263,10 @@ var init_real2 = __esm({
|
|
26113
27263
|
}
|
26114
27264
|
});
|
26115
27265
|
|
26116
|
-
// ../
|
27266
|
+
// ../drizzle-orm/dist/sqlite-core/columns/text.js
|
26117
27267
|
var _a188, _b136, SQLiteTextBuilder, _a189, _b137, SQLiteText, _a190, _b138, SQLiteTextJsonBuilder, _a191, _b139, SQLiteTextJson;
|
26118
27268
|
var init_text2 = __esm({
|
26119
|
-
"../
|
27269
|
+
"../drizzle-orm/dist/sqlite-core/columns/text.js"() {
|
26120
27270
|
"use strict";
|
26121
27271
|
init_entity();
|
26122
27272
|
init_common3();
|
@@ -26171,9 +27321,9 @@ var init_text2 = __esm({
|
|
26171
27321
|
}
|
26172
27322
|
});
|
26173
27323
|
|
26174
|
-
// ../
|
27324
|
+
// ../drizzle-orm/dist/sqlite-core/columns/index.js
|
26175
27325
|
var init_columns2 = __esm({
|
26176
|
-
"../
|
27326
|
+
"../drizzle-orm/dist/sqlite-core/columns/index.js"() {
|
26177
27327
|
"use strict";
|
26178
27328
|
init_blob();
|
26179
27329
|
init_common3();
|
@@ -26185,10 +27335,10 @@ var init_columns2 = __esm({
|
|
26185
27335
|
}
|
26186
27336
|
});
|
26187
27337
|
|
26188
|
-
// ../
|
27338
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/delete.js
|
26189
27339
|
var _a192, _b140, SQLiteDeleteBase;
|
26190
27340
|
var init_delete2 = __esm({
|
26191
|
-
"../
|
27341
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/delete.js"() {
|
26192
27342
|
"use strict";
|
26193
27343
|
init_entity();
|
26194
27344
|
init_query_promise();
|
@@ -26284,10 +27434,10 @@ var init_delete2 = __esm({
|
|
26284
27434
|
}
|
26285
27435
|
});
|
26286
27436
|
|
26287
|
-
// ../
|
27437
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/insert.js
|
26288
27438
|
var _a193, SQLiteInsertBuilder, _a194, _b141, SQLiteInsertBase;
|
26289
27439
|
var init_insert2 = __esm({
|
26290
|
-
"../
|
27440
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/insert.js"() {
|
26291
27441
|
"use strict";
|
26292
27442
|
init_entity();
|
26293
27443
|
init_query_promise();
|
@@ -26452,10 +27602,10 @@ var init_insert2 = __esm({
|
|
26452
27602
|
}
|
26453
27603
|
});
|
26454
27604
|
|
26455
|
-
// ../
|
27605
|
+
// ../drizzle-orm/dist/sqlite-core/view-base.js
|
26456
27606
|
var _a195, _b142, SQLiteViewBase;
|
26457
27607
|
var init_view_base2 = __esm({
|
26458
|
-
"../
|
27608
|
+
"../drizzle-orm/dist/sqlite-core/view-base.js"() {
|
26459
27609
|
"use strict";
|
26460
27610
|
init_entity();
|
26461
27611
|
init_sql();
|
@@ -26465,10 +27615,10 @@ var init_view_base2 = __esm({
|
|
26465
27615
|
}
|
26466
27616
|
});
|
26467
27617
|
|
26468
|
-
// ../
|
27618
|
+
// ../drizzle-orm/dist/sqlite-core/dialect.js
|
26469
27619
|
var _a196, SQLiteDialect, _a197, _b143, SQLiteSyncDialect, _a198, _b144, SQLiteAsyncDialect;
|
26470
27620
|
var init_dialect2 = __esm({
|
26471
|
-
"../
|
27621
|
+
"../drizzle-orm/dist/sqlite-core/dialect.js"() {
|
26472
27622
|
"use strict";
|
26473
27623
|
init_alias();
|
26474
27624
|
init_column();
|
@@ -27060,7 +28210,7 @@ var init_dialect2 = __esm({
|
|
27060
28210
|
}
|
27061
28211
|
});
|
27062
28212
|
|
27063
|
-
// ../
|
28213
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/select.js
|
27064
28214
|
function createSetOperator2(type, isAll) {
|
27065
28215
|
return (leftSelect, rightSelect, ...restSelects) => {
|
27066
28216
|
const setOperators = [rightSelect, ...restSelects].map((select) => ({
|
@@ -27080,7 +28230,7 @@ function createSetOperator2(type, isAll) {
|
|
27080
28230
|
}
|
27081
28231
|
var _a199, SQLiteSelectBuilder, _a200, _b145, SQLiteSelectQueryBuilderBase, _a201, _b146, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
|
27082
28232
|
var init_select3 = __esm({
|
27083
|
-
"../
|
28233
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/select.js"() {
|
27084
28234
|
"use strict";
|
27085
28235
|
init_entity();
|
27086
28236
|
init_query_builder();
|
@@ -27693,10 +28843,10 @@ var init_select3 = __esm({
|
|
27693
28843
|
}
|
27694
28844
|
});
|
27695
28845
|
|
27696
|
-
// ../
|
28846
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js
|
27697
28847
|
var _a202, QueryBuilder2;
|
27698
28848
|
var init_query_builder3 = __esm({
|
27699
|
-
"../
|
28849
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js"() {
|
27700
28850
|
"use strict";
|
27701
28851
|
init_entity();
|
27702
28852
|
init_selection_proxy();
|
@@ -27766,17 +28916,17 @@ var init_query_builder3 = __esm({
|
|
27766
28916
|
}
|
27767
28917
|
});
|
27768
28918
|
|
27769
|
-
// ../
|
28919
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/select.types.js
|
27770
28920
|
var init_select_types2 = __esm({
|
27771
|
-
"../
|
28921
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/select.types.js"() {
|
27772
28922
|
"use strict";
|
27773
28923
|
}
|
27774
28924
|
});
|
27775
28925
|
|
27776
|
-
// ../
|
28926
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/update.js
|
27777
28927
|
var _a203, SQLiteUpdateBuilder, _a204, _b147, SQLiteUpdateBase;
|
27778
28928
|
var init_update2 = __esm({
|
27779
|
-
"../
|
28929
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/update.js"() {
|
27780
28930
|
"use strict";
|
27781
28931
|
init_entity();
|
27782
28932
|
init_query_promise();
|
@@ -27894,9 +29044,9 @@ var init_update2 = __esm({
|
|
27894
29044
|
}
|
27895
29045
|
});
|
27896
29046
|
|
27897
|
-
// ../
|
29047
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/index.js
|
27898
29048
|
var init_query_builders2 = __esm({
|
27899
|
-
"../
|
29049
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/index.js"() {
|
27900
29050
|
"use strict";
|
27901
29051
|
init_delete2();
|
27902
29052
|
init_insert2();
|
@@ -27907,10 +29057,10 @@ var init_query_builders2 = __esm({
|
|
27907
29057
|
}
|
27908
29058
|
});
|
27909
29059
|
|
27910
|
-
// ../
|
29060
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/query.js
|
27911
29061
|
var _a205, RelationalQueryBuilder2, _a206, _b148, SQLiteRelationalQuery, _a207, _b149, SQLiteSyncRelationalQuery;
|
27912
29062
|
var init_query2 = __esm({
|
27913
|
-
"../
|
29063
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/query.js"() {
|
27914
29064
|
"use strict";
|
27915
29065
|
init_entity();
|
27916
29066
|
init_query_promise();
|
@@ -28061,10 +29211,10 @@ var init_query2 = __esm({
|
|
28061
29211
|
}
|
28062
29212
|
});
|
28063
29213
|
|
28064
|
-
// ../
|
29214
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/raw.js
|
28065
29215
|
var _a208, _b150, SQLiteRaw;
|
28066
29216
|
var init_raw2 = __esm({
|
28067
|
-
"../
|
29217
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/raw.js"() {
|
28068
29218
|
"use strict";
|
28069
29219
|
init_entity();
|
28070
29220
|
init_query_promise();
|
@@ -28097,10 +29247,10 @@ var init_raw2 = __esm({
|
|
28097
29247
|
}
|
28098
29248
|
});
|
28099
29249
|
|
28100
|
-
// ../
|
29250
|
+
// ../drizzle-orm/dist/sqlite-core/db.js
|
28101
29251
|
var _a209, BaseSQLiteDatabase;
|
28102
29252
|
var init_db2 = __esm({
|
28103
|
-
"../
|
29253
|
+
"../drizzle-orm/dist/sqlite-core/db.js"() {
|
28104
29254
|
"use strict";
|
28105
29255
|
init_entity();
|
28106
29256
|
init_selection_proxy();
|
@@ -28390,10 +29540,10 @@ var init_db2 = __esm({
|
|
28390
29540
|
}
|
28391
29541
|
});
|
28392
29542
|
|
28393
|
-
// ../
|
29543
|
+
// ../drizzle-orm/dist/sqlite-core/indexes.js
|
28394
29544
|
var _a210, IndexBuilderOn2, _a211, IndexBuilder2, _a212, Index4;
|
28395
29545
|
var init_indexes2 = __esm({
|
28396
|
-
"../
|
29546
|
+
"../drizzle-orm/dist/sqlite-core/indexes.js"() {
|
28397
29547
|
"use strict";
|
28398
29548
|
init_entity();
|
28399
29549
|
_a210 = entityKind;
|
@@ -28443,10 +29593,10 @@ var init_indexes2 = __esm({
|
|
28443
29593
|
}
|
28444
29594
|
});
|
28445
29595
|
|
28446
|
-
// ../
|
29596
|
+
// ../drizzle-orm/dist/sqlite-core/primary-keys.js
|
28447
29597
|
var _a213, PrimaryKeyBuilder2, _a214, PrimaryKey2;
|
28448
29598
|
var init_primary_keys2 = __esm({
|
28449
|
-
"../
|
29599
|
+
"../drizzle-orm/dist/sqlite-core/primary-keys.js"() {
|
28450
29600
|
"use strict";
|
28451
29601
|
init_entity();
|
28452
29602
|
init_table3();
|
@@ -28483,10 +29633,10 @@ var init_primary_keys2 = __esm({
|
|
28483
29633
|
}
|
28484
29634
|
});
|
28485
29635
|
|
28486
|
-
// ../
|
29636
|
+
// ../drizzle-orm/dist/sqlite-core/session.js
|
28487
29637
|
var _a215, _b151, ExecuteResultSync, _a216, SQLitePreparedQuery, _a217, SQLiteSession, _a218, _b152, SQLiteTransaction;
|
28488
29638
|
var init_session2 = __esm({
|
28489
|
-
"../
|
29639
|
+
"../drizzle-orm/dist/sqlite-core/session.js"() {
|
28490
29640
|
"use strict";
|
28491
29641
|
init_entity();
|
28492
29642
|
init_errors();
|
@@ -28604,23 +29754,23 @@ var init_session2 = __esm({
|
|
28604
29754
|
}
|
28605
29755
|
});
|
28606
29756
|
|
28607
|
-
// ../
|
29757
|
+
// ../drizzle-orm/dist/sqlite-core/subquery.js
|
28608
29758
|
var init_subquery3 = __esm({
|
28609
|
-
"../
|
29759
|
+
"../drizzle-orm/dist/sqlite-core/subquery.js"() {
|
28610
29760
|
"use strict";
|
28611
29761
|
}
|
28612
29762
|
});
|
28613
29763
|
|
28614
|
-
// ../
|
29764
|
+
// ../drizzle-orm/dist/sqlite-core/view-common.js
|
28615
29765
|
var SQLiteViewConfig;
|
28616
29766
|
var init_view_common3 = __esm({
|
28617
|
-
"../
|
29767
|
+
"../drizzle-orm/dist/sqlite-core/view-common.js"() {
|
28618
29768
|
"use strict";
|
28619
29769
|
SQLiteViewConfig = Symbol.for("drizzle:SQLiteViewConfig");
|
28620
29770
|
}
|
28621
29771
|
});
|
28622
29772
|
|
28623
|
-
// ../
|
29773
|
+
// ../drizzle-orm/dist/sqlite-core/utils.js
|
28624
29774
|
function getTableConfig2(table4) {
|
28625
29775
|
const columns = Object.values(table4[SQLiteTable.Symbol.Columns]);
|
28626
29776
|
const indexes = [];
|
@@ -28657,7 +29807,7 @@ function getTableConfig2(table4) {
|
|
28657
29807
|
};
|
28658
29808
|
}
|
28659
29809
|
var init_utils6 = __esm({
|
28660
|
-
"../
|
29810
|
+
"../drizzle-orm/dist/sqlite-core/utils.js"() {
|
28661
29811
|
"use strict";
|
28662
29812
|
init_entity();
|
28663
29813
|
init_table();
|
@@ -28670,10 +29820,10 @@ var init_utils6 = __esm({
|
|
28670
29820
|
}
|
28671
29821
|
});
|
28672
29822
|
|
28673
|
-
// ../
|
29823
|
+
// ../drizzle-orm/dist/sqlite-core/view.js
|
28674
29824
|
var _a219, ViewBuilderCore, _a220, _b153, ViewBuilder2, _a221, _b154, ManualViewBuilder2, _a222, _b155, _c6, SQLiteView;
|
28675
29825
|
var init_view2 = __esm({
|
28676
|
-
"../
|
29826
|
+
"../drizzle-orm/dist/sqlite-core/view.js"() {
|
28677
29827
|
"use strict";
|
28678
29828
|
init_entity();
|
28679
29829
|
init_selection_proxy();
|
@@ -28775,9 +29925,9 @@ var init_view2 = __esm({
|
|
28775
29925
|
}
|
28776
29926
|
});
|
28777
29927
|
|
28778
|
-
// ../
|
29928
|
+
// ../drizzle-orm/dist/sqlite-core/index.js
|
28779
29929
|
var init_sqlite_core = __esm({
|
28780
|
-
"../
|
29930
|
+
"../drizzle-orm/dist/sqlite-core/index.js"() {
|
28781
29931
|
"use strict";
|
28782
29932
|
init_alias3();
|
28783
29933
|
init_checks2();
|
@@ -28864,7 +30014,7 @@ var init_sqliteSerializer = __esm({
|
|
28864
30014
|
"src/serializer/sqliteSerializer.ts"() {
|
28865
30015
|
"use strict";
|
28866
30016
|
init_source();
|
28867
|
-
|
30017
|
+
init_dist();
|
28868
30018
|
init_sqlite_core();
|
28869
30019
|
init_outputs();
|
28870
30020
|
init_serializer();
|
@@ -29031,7 +30181,7 @@ The unique constraint ${source_default.underline.blue(
|
|
29031
30181
|
primaryKeys.forEach((it) => {
|
29032
30182
|
if (it.columns.length > 1) {
|
29033
30183
|
primaryKeysObject[it.getName()] = {
|
29034
|
-
columns: it.columns.map((it2) => it2.name)
|
30184
|
+
columns: it.columns.map((it2) => it2.name),
|
29035
30185
|
name: it.getName()
|
29036
30186
|
};
|
29037
30187
|
} else {
|
@@ -29156,7 +30306,6 @@ The unique constraint ${source_default.underline.blue(
|
|
29156
30306
|
}
|
29157
30307
|
for (const [key, value] of Object.entries(tableToPk)) {
|
29158
30308
|
if (value.length > 1) {
|
29159
|
-
value.sort();
|
29160
30309
|
result[key].compositePrimaryKeys = {
|
29161
30310
|
[`${key}_${value.join("_")}_pk`]: {
|
29162
30311
|
columns: value,
|
@@ -29277,17 +30426,17 @@ WHERE
|
|
29277
30426
|
}
|
29278
30427
|
});
|
29279
30428
|
|
29280
|
-
// ../
|
30429
|
+
// ../drizzle-orm/dist/mysql-core/alias.js
|
29281
30430
|
var init_alias4 = __esm({
|
29282
|
-
"../
|
30431
|
+
"../drizzle-orm/dist/mysql-core/alias.js"() {
|
29283
30432
|
"use strict";
|
29284
30433
|
}
|
29285
30434
|
});
|
29286
30435
|
|
29287
|
-
// ../
|
30436
|
+
// ../drizzle-orm/dist/mysql-core/checks.js
|
29288
30437
|
var _a223, CheckBuilder3, _a224, Check3;
|
29289
30438
|
var init_checks3 = __esm({
|
29290
|
-
"../
|
30439
|
+
"../drizzle-orm/dist/mysql-core/checks.js"() {
|
29291
30440
|
"use strict";
|
29292
30441
|
init_entity();
|
29293
30442
|
_a223 = entityKind;
|
@@ -29317,7 +30466,7 @@ var init_checks3 = __esm({
|
|
29317
30466
|
}
|
29318
30467
|
});
|
29319
30468
|
|
29320
|
-
// ../
|
30469
|
+
// ../drizzle-orm/dist/mysql-core/table.js
|
29321
30470
|
function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = name2) {
|
29322
30471
|
const rawTable = new MySqlTable(name2, schema4, baseName);
|
29323
30472
|
const builtColumns = Object.fromEntries(
|
@@ -29338,7 +30487,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
|
|
29338
30487
|
}
|
29339
30488
|
var InlineForeignKeys3, _a225, _b156, _c7, _d4, _e3, MySqlTable, mysqlTable;
|
29340
30489
|
var init_table4 = __esm({
|
29341
|
-
"../
|
30490
|
+
"../drizzle-orm/dist/mysql-core/table.js"() {
|
29342
30491
|
"use strict";
|
29343
30492
|
init_entity();
|
29344
30493
|
init_table();
|
@@ -29365,10 +30514,10 @@ var init_table4 = __esm({
|
|
29365
30514
|
}
|
29366
30515
|
});
|
29367
30516
|
|
29368
|
-
// ../
|
30517
|
+
// ../drizzle-orm/dist/mysql-core/foreign-keys.js
|
29369
30518
|
var _a226, ForeignKeyBuilder3, _a227, ForeignKey3;
|
29370
30519
|
var init_foreign_keys3 = __esm({
|
29371
|
-
"../
|
30520
|
+
"../drizzle-orm/dist/mysql-core/foreign-keys.js"() {
|
29372
30521
|
"use strict";
|
29373
30522
|
init_entity();
|
29374
30523
|
init_table4();
|
@@ -29432,13 +30581,13 @@ var init_foreign_keys3 = __esm({
|
|
29432
30581
|
}
|
29433
30582
|
});
|
29434
30583
|
|
29435
|
-
// ../
|
30584
|
+
// ../drizzle-orm/dist/mysql-core/unique-constraint.js
|
29436
30585
|
function uniqueKeyName3(table4, columns) {
|
29437
30586
|
return `${table4[MySqlTable.Symbol.Name]}_${columns.join("_")}_unique`;
|
29438
30587
|
}
|
29439
30588
|
var _a228, UniqueConstraintBuilder3, _a229, UniqueOnConstraintBuilder3, _a230, UniqueConstraint3;
|
29440
30589
|
var init_unique_constraint3 = __esm({
|
29441
|
-
"../
|
30590
|
+
"../drizzle-orm/dist/mysql-core/unique-constraint.js"() {
|
29442
30591
|
"use strict";
|
29443
30592
|
init_entity();
|
29444
30593
|
init_table4();
|
@@ -29486,10 +30635,10 @@ var init_unique_constraint3 = __esm({
|
|
29486
30635
|
}
|
29487
30636
|
});
|
29488
30637
|
|
29489
|
-
// ../
|
30638
|
+
// ../drizzle-orm/dist/mysql-core/columns/common.js
|
29490
30639
|
var _a231, _b157, MySqlColumnBuilder, _a232, _b158, MySqlColumn, _a233, _b159, MySqlColumnBuilderWithAutoIncrement, _a234, _b160, MySqlColumnWithAutoIncrement;
|
29491
30640
|
var init_common4 = __esm({
|
29492
|
-
"../
|
30641
|
+
"../drizzle-orm/dist/mysql-core/columns/common.js"() {
|
29493
30642
|
"use strict";
|
29494
30643
|
init_column_builder();
|
29495
30644
|
init_column();
|
@@ -29570,10 +30719,10 @@ var init_common4 = __esm({
|
|
29570
30719
|
}
|
29571
30720
|
});
|
29572
30721
|
|
29573
|
-
// ../
|
30722
|
+
// ../drizzle-orm/dist/mysql-core/columns/bigint.js
|
29574
30723
|
var _a235, _b161, MySqlBigInt53Builder, _a236, _b162, MySqlBigInt53, _a237, _b163, MySqlBigInt64Builder, _a238, _b164, MySqlBigInt64;
|
29575
30724
|
var init_bigint2 = __esm({
|
29576
|
-
"../
|
30725
|
+
"../drizzle-orm/dist/mysql-core/columns/bigint.js"() {
|
29577
30726
|
"use strict";
|
29578
30727
|
init_entity();
|
29579
30728
|
init_common4();
|
@@ -29630,10 +30779,10 @@ var init_bigint2 = __esm({
|
|
29630
30779
|
}
|
29631
30780
|
});
|
29632
30781
|
|
29633
|
-
// ../
|
30782
|
+
// ../drizzle-orm/dist/mysql-core/columns/binary.js
|
29634
30783
|
var _a239, _b165, MySqlBinaryBuilder, _a240, _b166, MySqlBinary;
|
29635
30784
|
var init_binary = __esm({
|
29636
|
-
"../
|
30785
|
+
"../drizzle-orm/dist/mysql-core/columns/binary.js"() {
|
29637
30786
|
"use strict";
|
29638
30787
|
init_entity();
|
29639
30788
|
init_common4();
|
@@ -29661,10 +30810,10 @@ var init_binary = __esm({
|
|
29661
30810
|
}
|
29662
30811
|
});
|
29663
30812
|
|
29664
|
-
// ../
|
30813
|
+
// ../drizzle-orm/dist/mysql-core/columns/boolean.js
|
29665
30814
|
var _a241, _b167, MySqlBooleanBuilder, _a242, _b168, MySqlBoolean;
|
29666
30815
|
var init_boolean2 = __esm({
|
29667
|
-
"../
|
30816
|
+
"../drizzle-orm/dist/mysql-core/columns/boolean.js"() {
|
29668
30817
|
"use strict";
|
29669
30818
|
init_entity();
|
29670
30819
|
init_common4();
|
@@ -29696,10 +30845,10 @@ var init_boolean2 = __esm({
|
|
29696
30845
|
}
|
29697
30846
|
});
|
29698
30847
|
|
29699
|
-
// ../
|
30848
|
+
// ../drizzle-orm/dist/mysql-core/columns/char.js
|
29700
30849
|
var _a243, _b169, MySqlCharBuilder, _a244, _b170, MySqlChar;
|
29701
30850
|
var init_char2 = __esm({
|
29702
|
-
"../
|
30851
|
+
"../drizzle-orm/dist/mysql-core/columns/char.js"() {
|
29703
30852
|
"use strict";
|
29704
30853
|
init_entity();
|
29705
30854
|
init_common4();
|
@@ -29732,10 +30881,10 @@ var init_char2 = __esm({
|
|
29732
30881
|
}
|
29733
30882
|
});
|
29734
30883
|
|
29735
|
-
// ../
|
30884
|
+
// ../drizzle-orm/dist/mysql-core/columns/custom.js
|
29736
30885
|
var _a245, _b171, MySqlCustomColumnBuilder, _a246, _b172, MySqlCustomColumn;
|
29737
30886
|
var init_custom3 = __esm({
|
29738
|
-
"../
|
30887
|
+
"../drizzle-orm/dist/mysql-core/columns/custom.js"() {
|
29739
30888
|
"use strict";
|
29740
30889
|
init_entity();
|
29741
30890
|
init_common4();
|
@@ -29778,10 +30927,10 @@ var init_custom3 = __esm({
|
|
29778
30927
|
}
|
29779
30928
|
});
|
29780
30929
|
|
29781
|
-
// ../
|
30930
|
+
// ../drizzle-orm/dist/mysql-core/columns/date.js
|
29782
30931
|
var _a247, _b173, MySqlDateBuilder, _a248, _b174, MySqlDate, _a249, _b175, MySqlDateStringBuilder, _a250, _b176, MySqlDateString;
|
29783
30932
|
var init_date2 = __esm({
|
29784
|
-
"../
|
30933
|
+
"../drizzle-orm/dist/mysql-core/columns/date.js"() {
|
29785
30934
|
"use strict";
|
29786
30935
|
init_entity();
|
29787
30936
|
init_common4();
|
@@ -29832,10 +30981,10 @@ var init_date2 = __esm({
|
|
29832
30981
|
}
|
29833
30982
|
});
|
29834
30983
|
|
29835
|
-
// ../
|
30984
|
+
// ../drizzle-orm/dist/mysql-core/columns/datetime.js
|
29836
30985
|
var _a251, _b177, MySqlDateTimeBuilder, _a252, _b178, MySqlDateTime, _a253, _b179, MySqlDateTimeStringBuilder, _a254, _b180, MySqlDateTimeString;
|
29837
30986
|
var init_datetime = __esm({
|
29838
|
-
"../
|
30987
|
+
"../drizzle-orm/dist/mysql-core/columns/datetime.js"() {
|
29839
30988
|
"use strict";
|
29840
30989
|
init_entity();
|
29841
30990
|
init_common4();
|
@@ -29900,10 +31049,10 @@ var init_datetime = __esm({
|
|
29900
31049
|
}
|
29901
31050
|
});
|
29902
31051
|
|
29903
|
-
// ../
|
31052
|
+
// ../drizzle-orm/dist/mysql-core/columns/decimal.js
|
29904
31053
|
var _a255, _b181, MySqlDecimalBuilder, _a256, _b182, MySqlDecimal;
|
29905
31054
|
var init_decimal = __esm({
|
29906
|
-
"../
|
31055
|
+
"../drizzle-orm/dist/mysql-core/columns/decimal.js"() {
|
29907
31056
|
"use strict";
|
29908
31057
|
init_entity();
|
29909
31058
|
init_common4();
|
@@ -29942,10 +31091,10 @@ var init_decimal = __esm({
|
|
29942
31091
|
}
|
29943
31092
|
});
|
29944
31093
|
|
29945
|
-
// ../
|
31094
|
+
// ../drizzle-orm/dist/mysql-core/columns/double.js
|
29946
31095
|
var _a257, _b183, MySqlDoubleBuilder, _a258, _b184, MySqlDouble;
|
29947
31096
|
var init_double = __esm({
|
29948
|
-
"../
|
31097
|
+
"../drizzle-orm/dist/mysql-core/columns/double.js"() {
|
29949
31098
|
"use strict";
|
29950
31099
|
init_entity();
|
29951
31100
|
init_common4();
|
@@ -29981,10 +31130,10 @@ var init_double = __esm({
|
|
29981
31130
|
}
|
29982
31131
|
});
|
29983
31132
|
|
29984
|
-
// ../
|
31133
|
+
// ../drizzle-orm/dist/mysql-core/columns/enum.js
|
29985
31134
|
var _a259, _b185, MySqlEnumColumnBuilder, _a260, _b186, MySqlEnumColumn;
|
29986
31135
|
var init_enum2 = __esm({
|
29987
|
-
"../
|
31136
|
+
"../drizzle-orm/dist/mysql-core/columns/enum.js"() {
|
29988
31137
|
"use strict";
|
29989
31138
|
init_entity();
|
29990
31139
|
init_common4();
|
@@ -30015,10 +31164,10 @@ var init_enum2 = __esm({
|
|
30015
31164
|
}
|
30016
31165
|
});
|
30017
31166
|
|
30018
|
-
// ../
|
31167
|
+
// ../drizzle-orm/dist/mysql-core/columns/float.js
|
30019
31168
|
var _a261, _b187, MySqlFloatBuilder, _a262, _b188, MySqlFloat;
|
30020
31169
|
var init_float = __esm({
|
30021
|
-
"../
|
31170
|
+
"../drizzle-orm/dist/mysql-core/columns/float.js"() {
|
30022
31171
|
"use strict";
|
30023
31172
|
init_entity();
|
30024
31173
|
init_common4();
|
@@ -30041,10 +31190,10 @@ var init_float = __esm({
|
|
30041
31190
|
}
|
30042
31191
|
});
|
30043
31192
|
|
30044
|
-
// ../
|
31193
|
+
// ../drizzle-orm/dist/mysql-core/columns/int.js
|
30045
31194
|
var _a263, _b189, MySqlIntBuilder, _a264, _b190, MySqlInt;
|
30046
31195
|
var init_int = __esm({
|
30047
|
-
"../
|
31196
|
+
"../drizzle-orm/dist/mysql-core/columns/int.js"() {
|
30048
31197
|
"use strict";
|
30049
31198
|
init_entity();
|
30050
31199
|
init_common4();
|
@@ -30074,10 +31223,10 @@ var init_int = __esm({
|
|
30074
31223
|
}
|
30075
31224
|
});
|
30076
31225
|
|
30077
|
-
// ../
|
31226
|
+
// ../drizzle-orm/dist/mysql-core/columns/json.js
|
30078
31227
|
var _a265, _b191, MySqlJsonBuilder, _a266, _b192, MySqlJson;
|
30079
31228
|
var init_json2 = __esm({
|
30080
|
-
"../
|
31229
|
+
"../drizzle-orm/dist/mysql-core/columns/json.js"() {
|
30081
31230
|
"use strict";
|
30082
31231
|
init_entity();
|
30083
31232
|
init_common4();
|
@@ -30103,10 +31252,10 @@ var init_json2 = __esm({
|
|
30103
31252
|
}
|
30104
31253
|
});
|
30105
31254
|
|
30106
|
-
// ../
|
31255
|
+
// ../drizzle-orm/dist/mysql-core/columns/mediumint.js
|
30107
31256
|
var _a267, _b193, MySqlMediumIntBuilder, _a268, _b194, MySqlMediumInt;
|
30108
31257
|
var init_mediumint = __esm({
|
30109
|
-
"../
|
31258
|
+
"../drizzle-orm/dist/mysql-core/columns/mediumint.js"() {
|
30110
31259
|
"use strict";
|
30111
31260
|
init_entity();
|
30112
31261
|
init_common4();
|
@@ -30139,10 +31288,10 @@ var init_mediumint = __esm({
|
|
30139
31288
|
}
|
30140
31289
|
});
|
30141
31290
|
|
30142
|
-
// ../
|
31291
|
+
// ../drizzle-orm/dist/mysql-core/columns/real.js
|
30143
31292
|
var _a269, _b195, MySqlRealBuilder, _a270, _b196, MySqlReal;
|
30144
31293
|
var init_real3 = __esm({
|
30145
|
-
"../
|
31294
|
+
"../drizzle-orm/dist/mysql-core/columns/real.js"() {
|
30146
31295
|
"use strict";
|
30147
31296
|
init_entity();
|
30148
31297
|
init_common4();
|
@@ -30178,10 +31327,10 @@ var init_real3 = __esm({
|
|
30178
31327
|
}
|
30179
31328
|
});
|
30180
31329
|
|
30181
|
-
// ../
|
31330
|
+
// ../drizzle-orm/dist/mysql-core/columns/serial.js
|
30182
31331
|
var _a271, _b197, MySqlSerialBuilder, _a272, _b198, MySqlSerial;
|
30183
31332
|
var init_serial2 = __esm({
|
30184
|
-
"../
|
31333
|
+
"../drizzle-orm/dist/mysql-core/columns/serial.js"() {
|
30185
31334
|
"use strict";
|
30186
31335
|
init_entity();
|
30187
31336
|
init_common4();
|
@@ -30212,10 +31361,10 @@ var init_serial2 = __esm({
|
|
30212
31361
|
}
|
30213
31362
|
});
|
30214
31363
|
|
30215
|
-
// ../
|
31364
|
+
// ../drizzle-orm/dist/mysql-core/columns/smallint.js
|
30216
31365
|
var _a273, _b199, MySqlSmallIntBuilder, _a274, _b200, MySqlSmallInt;
|
30217
31366
|
var init_smallint2 = __esm({
|
30218
|
-
"../
|
31367
|
+
"../drizzle-orm/dist/mysql-core/columns/smallint.js"() {
|
30219
31368
|
"use strict";
|
30220
31369
|
init_entity();
|
30221
31370
|
init_common4();
|
@@ -30248,10 +31397,10 @@ var init_smallint2 = __esm({
|
|
30248
31397
|
}
|
30249
31398
|
});
|
30250
31399
|
|
30251
|
-
// ../
|
31400
|
+
// ../drizzle-orm/dist/mysql-core/columns/text.js
|
30252
31401
|
var _a275, _b201, MySqlTextBuilder, _a276, _b202, MySqlText;
|
30253
31402
|
var init_text3 = __esm({
|
30254
|
-
"../
|
31403
|
+
"../drizzle-orm/dist/mysql-core/columns/text.js"() {
|
30255
31404
|
"use strict";
|
30256
31405
|
init_entity();
|
30257
31406
|
init_common4();
|
@@ -30281,10 +31430,10 @@ var init_text3 = __esm({
|
|
30281
31430
|
}
|
30282
31431
|
});
|
30283
31432
|
|
30284
|
-
// ../
|
31433
|
+
// ../drizzle-orm/dist/mysql-core/columns/time.js
|
30285
31434
|
var _a277, _b203, MySqlTimeBuilder, _a278, _b204, MySqlTime;
|
30286
31435
|
var init_time2 = __esm({
|
30287
|
-
"../
|
31436
|
+
"../drizzle-orm/dist/mysql-core/columns/time.js"() {
|
30288
31437
|
"use strict";
|
30289
31438
|
init_entity();
|
30290
31439
|
init_common4();
|
@@ -30313,10 +31462,10 @@ var init_time2 = __esm({
|
|
30313
31462
|
}
|
30314
31463
|
});
|
30315
31464
|
|
30316
|
-
// ../
|
31465
|
+
// ../drizzle-orm/dist/mysql-core/columns/date.common.js
|
30317
31466
|
var _a279, _b205, MySqlDateColumnBaseBuilder, _a280, _b206, MySqlDateBaseColumn;
|
30318
31467
|
var init_date_common2 = __esm({
|
30319
|
-
"../
|
31468
|
+
"../drizzle-orm/dist/mysql-core/columns/date.common.js"() {
|
30320
31469
|
"use strict";
|
30321
31470
|
init_entity();
|
30322
31471
|
init_sql();
|
@@ -30343,10 +31492,10 @@ var init_date_common2 = __esm({
|
|
30343
31492
|
}
|
30344
31493
|
});
|
30345
31494
|
|
30346
|
-
// ../
|
31495
|
+
// ../drizzle-orm/dist/mysql-core/columns/timestamp.js
|
30347
31496
|
var _a281, _b207, MySqlTimestampBuilder, _a282, _b208, MySqlTimestamp, _a283, _b209, MySqlTimestampStringBuilder, _a284, _b210, MySqlTimestampString;
|
30348
31497
|
var init_timestamp2 = __esm({
|
30349
|
-
"../
|
31498
|
+
"../drizzle-orm/dist/mysql-core/columns/timestamp.js"() {
|
30350
31499
|
"use strict";
|
30351
31500
|
init_entity();
|
30352
31501
|
init_date_common2();
|
@@ -30409,10 +31558,10 @@ var init_timestamp2 = __esm({
|
|
30409
31558
|
}
|
30410
31559
|
});
|
30411
31560
|
|
30412
|
-
// ../
|
31561
|
+
// ../drizzle-orm/dist/mysql-core/columns/tinyint.js
|
30413
31562
|
var _a285, _b211, MySqlTinyIntBuilder, _a286, _b212, MySqlTinyInt;
|
30414
31563
|
var init_tinyint = __esm({
|
30415
|
-
"../
|
31564
|
+
"../drizzle-orm/dist/mysql-core/columns/tinyint.js"() {
|
30416
31565
|
"use strict";
|
30417
31566
|
init_entity();
|
30418
31567
|
init_common4();
|
@@ -30445,10 +31594,10 @@ var init_tinyint = __esm({
|
|
30445
31594
|
}
|
30446
31595
|
});
|
30447
31596
|
|
30448
|
-
// ../
|
31597
|
+
// ../drizzle-orm/dist/mysql-core/columns/varbinary.js
|
30449
31598
|
var _a287, _b213, MySqlVarBinaryBuilder, _a288, _b214, MySqlVarBinary;
|
30450
31599
|
var init_varbinary = __esm({
|
30451
|
-
"../
|
31600
|
+
"../drizzle-orm/dist/mysql-core/columns/varbinary.js"() {
|
30452
31601
|
"use strict";
|
30453
31602
|
init_entity();
|
30454
31603
|
init_common4();
|
@@ -30480,10 +31629,10 @@ var init_varbinary = __esm({
|
|
30480
31629
|
}
|
30481
31630
|
});
|
30482
31631
|
|
30483
|
-
// ../
|
31632
|
+
// ../drizzle-orm/dist/mysql-core/columns/varchar.js
|
30484
31633
|
var _a289, _b215, MySqlVarCharBuilder, _a290, _b216, MySqlVarChar;
|
30485
31634
|
var init_varchar2 = __esm({
|
30486
|
-
"../
|
31635
|
+
"../drizzle-orm/dist/mysql-core/columns/varchar.js"() {
|
30487
31636
|
"use strict";
|
30488
31637
|
init_entity();
|
30489
31638
|
init_common4();
|
@@ -30517,10 +31666,10 @@ var init_varchar2 = __esm({
|
|
30517
31666
|
}
|
30518
31667
|
});
|
30519
31668
|
|
30520
|
-
// ../
|
31669
|
+
// ../drizzle-orm/dist/mysql-core/columns/year.js
|
30521
31670
|
var _a291, _b217, MySqlYearBuilder, _a292, _b218, MySqlYear;
|
30522
31671
|
var init_year = __esm({
|
30523
|
-
"../
|
31672
|
+
"../drizzle-orm/dist/mysql-core/columns/year.js"() {
|
30524
31673
|
"use strict";
|
30525
31674
|
init_entity();
|
30526
31675
|
init_common4();
|
@@ -30543,9 +31692,9 @@ var init_year = __esm({
|
|
30543
31692
|
}
|
30544
31693
|
});
|
30545
31694
|
|
30546
|
-
// ../
|
31695
|
+
// ../drizzle-orm/dist/mysql-core/columns/index.js
|
30547
31696
|
var init_columns3 = __esm({
|
30548
|
-
"../
|
31697
|
+
"../drizzle-orm/dist/mysql-core/columns/index.js"() {
|
30549
31698
|
"use strict";
|
30550
31699
|
init_bigint2();
|
30551
31700
|
init_binary();
|
@@ -30575,10 +31724,10 @@ var init_columns3 = __esm({
|
|
30575
31724
|
}
|
30576
31725
|
});
|
30577
31726
|
|
30578
|
-
// ../
|
31727
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/delete.js
|
30579
31728
|
var _a293, _b219, MySqlDeleteBase;
|
30580
31729
|
var init_delete3 = __esm({
|
30581
|
-
"../
|
31730
|
+
"../drizzle-orm/dist/mysql-core/query-builders/delete.js"() {
|
30582
31731
|
"use strict";
|
30583
31732
|
init_entity();
|
30584
31733
|
init_query_promise();
|
@@ -30656,10 +31805,10 @@ var init_delete3 = __esm({
|
|
30656
31805
|
}
|
30657
31806
|
});
|
30658
31807
|
|
30659
|
-
// ../
|
31808
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/insert.js
|
30660
31809
|
var _a294, MySqlInsertBuilder, _a295, _b220, MySqlInsertBase;
|
30661
31810
|
var init_insert3 = __esm({
|
30662
|
-
"../
|
31811
|
+
"../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
|
30663
31812
|
"use strict";
|
30664
31813
|
init_entity();
|
30665
31814
|
init_query_promise();
|
@@ -30781,10 +31930,10 @@ var init_insert3 = __esm({
|
|
30781
31930
|
}
|
30782
31931
|
});
|
30783
31932
|
|
30784
|
-
// ../
|
31933
|
+
// ../drizzle-orm/dist/mysql-core/view-base.js
|
30785
31934
|
var _a296, _b221, MySqlViewBase;
|
30786
31935
|
var init_view_base3 = __esm({
|
30787
|
-
"../
|
31936
|
+
"../drizzle-orm/dist/mysql-core/view-base.js"() {
|
30788
31937
|
"use strict";
|
30789
31938
|
init_entity();
|
30790
31939
|
init_sql();
|
@@ -30794,10 +31943,10 @@ var init_view_base3 = __esm({
|
|
30794
31943
|
}
|
30795
31944
|
});
|
30796
31945
|
|
30797
|
-
// ../
|
31946
|
+
// ../drizzle-orm/dist/mysql-core/dialect.js
|
30798
31947
|
var _a297, MySqlDialect;
|
30799
31948
|
var init_dialect3 = __esm({
|
30800
|
-
"../
|
31949
|
+
"../drizzle-orm/dist/mysql-core/dialect.js"() {
|
30801
31950
|
"use strict";
|
30802
31951
|
init_alias();
|
30803
31952
|
init_column();
|
@@ -31593,7 +32742,7 @@ var init_dialect3 = __esm({
|
|
31593
32742
|
}
|
31594
32743
|
});
|
31595
32744
|
|
31596
|
-
// ../
|
32745
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/select.js
|
31597
32746
|
function createSetOperator3(type, isAll) {
|
31598
32747
|
return (leftSelect, rightSelect, ...restSelects) => {
|
31599
32748
|
const setOperators = [rightSelect, ...restSelects].map((select) => ({
|
@@ -31613,7 +32762,7 @@ function createSetOperator3(type, isAll) {
|
|
31613
32762
|
}
|
31614
32763
|
var _a298, MySqlSelectBuilder, _a299, _b222, MySqlSelectQueryBuilderBase, _a300, _b223, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
|
31615
32764
|
var init_select4 = __esm({
|
31616
|
-
"../
|
32765
|
+
"../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
|
31617
32766
|
"use strict";
|
31618
32767
|
init_entity();
|
31619
32768
|
init_query_builder();
|
@@ -32317,10 +33466,10 @@ var init_select4 = __esm({
|
|
32317
33466
|
}
|
32318
33467
|
});
|
32319
33468
|
|
32320
|
-
// ../
|
33469
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
|
32321
33470
|
var _a301, QueryBuilder3;
|
32322
33471
|
var init_query_builder4 = __esm({
|
32323
|
-
"../
|
33472
|
+
"../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
|
32324
33473
|
"use strict";
|
32325
33474
|
init_entity();
|
32326
33475
|
init_dialect3();
|
@@ -32390,17 +33539,17 @@ var init_query_builder4 = __esm({
|
|
32390
33539
|
}
|
32391
33540
|
});
|
32392
33541
|
|
32393
|
-
// ../
|
33542
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/select.types.js
|
32394
33543
|
var init_select_types3 = __esm({
|
32395
|
-
"../
|
33544
|
+
"../drizzle-orm/dist/mysql-core/query-builders/select.types.js"() {
|
32396
33545
|
"use strict";
|
32397
33546
|
}
|
32398
33547
|
});
|
32399
33548
|
|
32400
|
-
// ../
|
33549
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/update.js
|
32401
33550
|
var _a302, MySqlUpdateBuilder, _a303, _b224, MySqlUpdateBase;
|
32402
33551
|
var init_update3 = __esm({
|
32403
|
-
"../
|
33552
|
+
"../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
|
32404
33553
|
"use strict";
|
32405
33554
|
init_entity();
|
32406
33555
|
init_query_promise();
|
@@ -32495,9 +33644,9 @@ var init_update3 = __esm({
|
|
32495
33644
|
}
|
32496
33645
|
});
|
32497
33646
|
|
32498
|
-
// ../
|
33647
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/index.js
|
32499
33648
|
var init_query_builders3 = __esm({
|
32500
|
-
"../
|
33649
|
+
"../drizzle-orm/dist/mysql-core/query-builders/index.js"() {
|
32501
33650
|
"use strict";
|
32502
33651
|
init_delete3();
|
32503
33652
|
init_insert3();
|
@@ -32508,10 +33657,10 @@ var init_query_builders3 = __esm({
|
|
32508
33657
|
}
|
32509
33658
|
});
|
32510
33659
|
|
32511
|
-
// ../
|
33660
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/query.js
|
32512
33661
|
var _a304, RelationalQueryBuilder3, _a305, _b225, MySqlRelationalQuery;
|
32513
33662
|
var init_query3 = __esm({
|
32514
|
-
"../
|
33663
|
+
"../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
|
32515
33664
|
"use strict";
|
32516
33665
|
init_entity();
|
32517
33666
|
init_query_promise();
|
@@ -32626,10 +33775,10 @@ var init_query3 = __esm({
|
|
32626
33775
|
}
|
32627
33776
|
});
|
32628
33777
|
|
32629
|
-
// ../
|
33778
|
+
// ../drizzle-orm/dist/mysql-core/db.js
|
32630
33779
|
var _a306, MySqlDatabase;
|
32631
33780
|
var init_db3 = __esm({
|
32632
|
-
"../
|
33781
|
+
"../drizzle-orm/dist/mysql-core/db.js"() {
|
32633
33782
|
"use strict";
|
32634
33783
|
init_entity();
|
32635
33784
|
init_selection_proxy();
|
@@ -32849,10 +33998,10 @@ var init_db3 = __esm({
|
|
32849
33998
|
}
|
32850
33999
|
});
|
32851
34000
|
|
32852
|
-
// ../
|
34001
|
+
// ../drizzle-orm/dist/mysql-core/indexes.js
|
32853
34002
|
var _a307, IndexBuilderOn3, _a308, IndexBuilder3, _a309, Index5;
|
32854
34003
|
var init_indexes3 = __esm({
|
32855
|
-
"../
|
34004
|
+
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
32856
34005
|
"use strict";
|
32857
34006
|
init_entity();
|
32858
34007
|
_a307 = entityKind;
|
@@ -32906,10 +34055,10 @@ var init_indexes3 = __esm({
|
|
32906
34055
|
}
|
32907
34056
|
});
|
32908
34057
|
|
32909
|
-
// ../
|
34058
|
+
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
32910
34059
|
var _a310, PrimaryKeyBuilder3, _a311, PrimaryKey3;
|
32911
34060
|
var init_primary_keys3 = __esm({
|
32912
|
-
"../
|
34061
|
+
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
32913
34062
|
"use strict";
|
32914
34063
|
init_entity();
|
32915
34064
|
init_table4();
|
@@ -32946,16 +34095,16 @@ var init_primary_keys3 = __esm({
|
|
32946
34095
|
}
|
32947
34096
|
});
|
32948
34097
|
|
32949
|
-
// ../
|
34098
|
+
// ../drizzle-orm/dist/mysql-core/view-common.js
|
32950
34099
|
var MySqlViewConfig;
|
32951
34100
|
var init_view_common4 = __esm({
|
32952
|
-
"../
|
34101
|
+
"../drizzle-orm/dist/mysql-core/view-common.js"() {
|
32953
34102
|
"use strict";
|
32954
34103
|
MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
|
32955
34104
|
}
|
32956
34105
|
});
|
32957
34106
|
|
32958
|
-
// ../
|
34107
|
+
// ../drizzle-orm/dist/mysql-core/view.js
|
32959
34108
|
function mysqlViewWithSchema(name2, selection, schema4) {
|
32960
34109
|
if (selection) {
|
32961
34110
|
return new ManualViewBuilder3(name2, selection, schema4);
|
@@ -32964,7 +34113,7 @@ function mysqlViewWithSchema(name2, selection, schema4) {
|
|
32964
34113
|
}
|
32965
34114
|
var _a312, ViewBuilderCore2, _a313, _b226, ViewBuilder3, _a314, _b227, ManualViewBuilder3, _a315, _b228, _c8, MySqlView;
|
32966
34115
|
var init_view3 = __esm({
|
32967
|
-
"../
|
34116
|
+
"../drizzle-orm/dist/mysql-core/view.js"() {
|
32968
34117
|
"use strict";
|
32969
34118
|
init_entity();
|
32970
34119
|
init_selection_proxy();
|
@@ -33082,10 +34231,10 @@ var init_view3 = __esm({
|
|
33082
34231
|
}
|
33083
34232
|
});
|
33084
34233
|
|
33085
|
-
// ../
|
34234
|
+
// ../drizzle-orm/dist/mysql-core/schema.js
|
33086
34235
|
var _a316, MySqlSchema5;
|
33087
34236
|
var init_schema2 = __esm({
|
33088
|
-
"../
|
34237
|
+
"../drizzle-orm/dist/mysql-core/schema.js"() {
|
33089
34238
|
"use strict";
|
33090
34239
|
init_entity();
|
33091
34240
|
init_table4();
|
@@ -33106,10 +34255,10 @@ var init_schema2 = __esm({
|
|
33106
34255
|
}
|
33107
34256
|
});
|
33108
34257
|
|
33109
|
-
// ../
|
34258
|
+
// ../drizzle-orm/dist/mysql-core/session.js
|
33110
34259
|
var _a317, MySqlPreparedQuery, _a318, MySqlSession, _a319, _b229, MySqlTransaction;
|
33111
34260
|
var init_session3 = __esm({
|
33112
|
-
"../
|
34261
|
+
"../drizzle-orm/dist/mysql-core/session.js"() {
|
33113
34262
|
"use strict";
|
33114
34263
|
init_entity();
|
33115
34264
|
init_errors();
|
@@ -33139,7 +34288,7 @@ var init_session3 = __esm({
|
|
33139
34288
|
if (config.isolationLevel) {
|
33140
34289
|
parts.push(`isolation level ${config.isolationLevel}`);
|
33141
34290
|
}
|
33142
|
-
return parts.length ? sql
|
34291
|
+
return parts.length ? sql`set transaction ${sql.raw(parts.join(" "))}` : void 0;
|
33143
34292
|
}
|
33144
34293
|
getStartTransactionSQL(config) {
|
33145
34294
|
const parts = [];
|
@@ -33149,7 +34298,7 @@ var init_session3 = __esm({
|
|
33149
34298
|
if (config.accessMode) {
|
33150
34299
|
parts.push(config.accessMode);
|
33151
34300
|
}
|
33152
|
-
return parts.length ? sql
|
34301
|
+
return parts.length ? sql`start transaction ${sql.raw(parts.join(" "))}` : void 0;
|
33153
34302
|
}
|
33154
34303
|
};
|
33155
34304
|
__publicField(MySqlSession, _a318, "MySqlSession");
|
@@ -33167,14 +34316,14 @@ var init_session3 = __esm({
|
|
33167
34316
|
}
|
33168
34317
|
});
|
33169
34318
|
|
33170
|
-
// ../
|
34319
|
+
// ../drizzle-orm/dist/mysql-core/subquery.js
|
33171
34320
|
var init_subquery4 = __esm({
|
33172
|
-
"../
|
34321
|
+
"../drizzle-orm/dist/mysql-core/subquery.js"() {
|
33173
34322
|
"use strict";
|
33174
34323
|
}
|
33175
34324
|
});
|
33176
34325
|
|
33177
|
-
// ../
|
34326
|
+
// ../drizzle-orm/dist/mysql-core/utils.js
|
33178
34327
|
function getTableConfig3(table4) {
|
33179
34328
|
const columns = Object.values(table4[MySqlTable.Symbol.Columns]);
|
33180
34329
|
const indexes = [];
|
@@ -33215,7 +34364,7 @@ function getTableConfig3(table4) {
|
|
33215
34364
|
};
|
33216
34365
|
}
|
33217
34366
|
var init_utils7 = __esm({
|
33218
|
-
"../
|
34367
|
+
"../drizzle-orm/dist/mysql-core/utils.js"() {
|
33219
34368
|
"use strict";
|
33220
34369
|
init_entity();
|
33221
34370
|
init_table();
|
@@ -33228,9 +34377,9 @@ var init_utils7 = __esm({
|
|
33228
34377
|
}
|
33229
34378
|
});
|
33230
34379
|
|
33231
|
-
// ../
|
34380
|
+
// ../drizzle-orm/dist/mysql-core/index.js
|
33232
34381
|
var init_mysql_core = __esm({
|
33233
|
-
"../
|
34382
|
+
"../drizzle-orm/dist/mysql-core/index.js"() {
|
33234
34383
|
"use strict";
|
33235
34384
|
init_alias4();
|
33236
34385
|
init_checks3();
|
@@ -33275,8 +34424,8 @@ var init_mysqlSerializer = __esm({
|
|
33275
34424
|
"src/serializer/mysqlSerializer.ts"() {
|
33276
34425
|
"use strict";
|
33277
34426
|
init_source();
|
33278
|
-
|
33279
|
-
|
34427
|
+
init_dist();
|
34428
|
+
init_dist();
|
33280
34429
|
init_mysql_core();
|
33281
34430
|
init_mysql_core();
|
33282
34431
|
init_outputs();
|
@@ -33600,7 +34749,7 @@ We have encountered a collision between the index name on columns ${source_defau
|
|
33600
34749
|
onUpdate = true;
|
33601
34750
|
}
|
33602
34751
|
const newColumn = {
|
33603
|
-
default: columnDefault === null ? void 0 : /^-?[\d.]+(?:e-?\d+)?$/.test(columnDefault) && !columnType.startsWith(
|
34752
|
+
default: columnDefault === null ? void 0 : /^-?[\d.]+(?:e-?\d+)?$/.test(columnDefault) && !["decimal", "char", "varchar"].some((type) => columnType.startsWith(type)) ? Number(columnDefault) : isDefaultAnExpression ? clearDefaults(columnDefault, collation) : `'${columnDefault}'`,
|
33604
34753
|
autoincrement: isAutoincrement,
|
33605
34754
|
name: columnName,
|
33606
34755
|
type: changedType,
|
@@ -33828,7 +34977,8 @@ var init_cli = __esm({
|
|
33828
34977
|
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
33829
34978
|
extensionsFilters: literalType("postgis").array().optional(),
|
33830
34979
|
verbose: booleanType().optional(),
|
33831
|
-
strict: booleanType().optional()
|
34980
|
+
strict: booleanType().optional(),
|
34981
|
+
driver: driver.optional()
|
33832
34982
|
}).passthrough();
|
33833
34983
|
pullParams = objectType({
|
33834
34984
|
config: stringType().optional(),
|
@@ -34078,7 +35228,7 @@ var prepareFromExports;
|
|
34078
35228
|
var init_pgImports = __esm({
|
34079
35229
|
"src/serializer/pgImports.ts"() {
|
34080
35230
|
"use strict";
|
34081
|
-
|
35231
|
+
init_dist();
|
34082
35232
|
init_pg_core();
|
34083
35233
|
init_utils8();
|
34084
35234
|
prepareFromExports = (exports2) => {
|
@@ -34117,7 +35267,7 @@ var prepareFromExports2, prepareFromSqliteImports;
|
|
34117
35267
|
var init_sqliteImports = __esm({
|
34118
35268
|
"src/serializer/sqliteImports.ts"() {
|
34119
35269
|
"use strict";
|
34120
|
-
|
35270
|
+
init_dist();
|
34121
35271
|
init_sqlite_core();
|
34122
35272
|
init_utils8();
|
34123
35273
|
prepareFromExports2 = (exports2) => {
|
@@ -34155,7 +35305,7 @@ var prepareFromExports3, prepareFromMySqlImports;
|
|
34155
35305
|
var init_mysqlImports = __esm({
|
34156
35306
|
"src/serializer/mysqlImports.ts"() {
|
34157
35307
|
"use strict";
|
34158
|
-
|
35308
|
+
init_dist();
|
34159
35309
|
init_mysql_core();
|
34160
35310
|
init_utils8();
|
34161
35311
|
prepareFromExports3 = (exports2) => {
|
@@ -34817,6 +35967,37 @@ var updateUpToV6 = (json) => {
|
|
34817
35967
|
enums
|
34818
35968
|
};
|
34819
35969
|
};
|
35970
|
+
var updateUpToV7 = (json) => {
|
35971
|
+
const schema4 = pgSchemaV6.parse(json);
|
35972
|
+
const tables = Object.fromEntries(
|
35973
|
+
Object.entries(schema4.tables).map((it) => {
|
35974
|
+
const table4 = it[1];
|
35975
|
+
const mappedIndexes = Object.fromEntries(
|
35976
|
+
Object.entries(table4.indexes).map((idx) => {
|
35977
|
+
const { columns, ...rest } = idx[1];
|
35978
|
+
const mappedColumns = columns.map((it2) => {
|
35979
|
+
return {
|
35980
|
+
expression: it2,
|
35981
|
+
isExpression: false,
|
35982
|
+
asc: true,
|
35983
|
+
nulls: "last",
|
35984
|
+
opClass: void 0
|
35985
|
+
};
|
35986
|
+
});
|
35987
|
+
return [idx[0], { columns: mappedColumns, with: {}, ...rest }];
|
35988
|
+
})
|
35989
|
+
);
|
35990
|
+
return [it[0], { ...table4, indexes: mappedIndexes }];
|
35991
|
+
})
|
35992
|
+
);
|
35993
|
+
return {
|
35994
|
+
...schema4,
|
35995
|
+
version: "7",
|
35996
|
+
dialect: "postgresql",
|
35997
|
+
sequences: {},
|
35998
|
+
tables
|
35999
|
+
};
|
36000
|
+
};
|
34820
36001
|
|
34821
36002
|
// src/cli/commands/sqliteIntrospect.ts
|
34822
36003
|
var import_hanji6 = __toESM(require_hanji());
|
@@ -34963,284 +36144,8 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
34963
36144
|
return { schema: schema4 };
|
34964
36145
|
};
|
34965
36146
|
|
34966
|
-
// src/cli/commands/sqlitePushUtils.ts
|
34967
|
-
init_source();
|
34968
|
-
init_sqliteSchema();
|
34969
|
-
init_sqlgenerator();
|
34970
|
-
var _moveDataStatements = (tableName, json, dataLoss = false) => {
|
34971
|
-
const statements = [];
|
34972
|
-
statements.push(
|
34973
|
-
new SqliteRenameTableConvertor().convert({
|
34974
|
-
type: "rename_table",
|
34975
|
-
tableNameFrom: tableName,
|
34976
|
-
tableNameTo: `__old_push_${tableName}`,
|
34977
|
-
fromSchema: "",
|
34978
|
-
toSchema: ""
|
34979
|
-
})
|
34980
|
-
);
|
34981
|
-
const tableColumns = Object.values(json.tables[tableName].columns);
|
34982
|
-
const referenceData = Object.values(json.tables[tableName].foreignKeys);
|
34983
|
-
const compositePKs = Object.values(
|
34984
|
-
json.tables[tableName].compositePrimaryKeys
|
34985
|
-
).map((it) => SQLiteSquasher.unsquashPK(it));
|
34986
|
-
const fks = referenceData.map((it) => SQLiteSquasher.unsquashPushFK(it));
|
34987
|
-
statements.push(
|
34988
|
-
new SQLiteCreateTableConvertor().convert({
|
34989
|
-
type: "sqlite_create_table",
|
34990
|
-
tableName,
|
34991
|
-
columns: tableColumns,
|
34992
|
-
referenceData: fks,
|
34993
|
-
compositePKs
|
34994
|
-
})
|
34995
|
-
);
|
34996
|
-
if (!dataLoss) {
|
34997
|
-
statements.push(
|
34998
|
-
`INSERT INTO "${tableName}" SELECT * FROM "__old_push_${tableName}";`
|
34999
|
-
);
|
35000
|
-
}
|
35001
|
-
statements.push(
|
35002
|
-
new SQLiteDropTableConvertor().convert({
|
35003
|
-
type: "drop_table",
|
35004
|
-
tableName: `__old_push_${tableName}`,
|
35005
|
-
schema: ""
|
35006
|
-
})
|
35007
|
-
);
|
35008
|
-
for (const idx of Object.values(json.tables[tableName].indexes)) {
|
35009
|
-
statements.push(
|
35010
|
-
new CreateSqliteIndexConvertor().convert({
|
35011
|
-
type: "create_index",
|
35012
|
-
tableName,
|
35013
|
-
schema: "",
|
35014
|
-
data: idx
|
35015
|
-
})
|
35016
|
-
);
|
35017
|
-
}
|
35018
|
-
return statements;
|
35019
|
-
};
|
35020
|
-
var getOldTableName = (tableName, meta) => {
|
35021
|
-
for (const key of Object.keys(meta.tables)) {
|
35022
|
-
const value = meta.tables[key];
|
35023
|
-
if (`"${tableName}"` === value) {
|
35024
|
-
return key.substring(1, key.length - 1);
|
35025
|
-
}
|
35026
|
-
}
|
35027
|
-
return tableName;
|
35028
|
-
};
|
35029
|
-
var getNewTableName = (tableName, meta) => {
|
35030
|
-
if (typeof meta.tables[`"${tableName}"`] !== "undefined") {
|
35031
|
-
return meta.tables[`"${tableName}"`].substring(
|
35032
|
-
1,
|
35033
|
-
meta.tables[`"${tableName}"`].length - 1
|
35034
|
-
);
|
35035
|
-
}
|
35036
|
-
return tableName;
|
35037
|
-
};
|
35038
|
-
var logSuggestionsAndReturn = async (connection, statements, json1, json2, meta) => {
|
35039
|
-
let shouldAskForApprove = false;
|
35040
|
-
const statementsToExecute = [];
|
35041
|
-
const infoToPrint = [];
|
35042
|
-
const tablesToRemove = [];
|
35043
|
-
const columnsToRemove = [];
|
35044
|
-
const schemasToRemove = [];
|
35045
|
-
const tablesToTruncate = [];
|
35046
|
-
const tablesContext = {};
|
35047
|
-
for (const statement of statements) {
|
35048
|
-
if (statement.type === "drop_table") {
|
35049
|
-
const res = await connection.query(
|
35050
|
-
`select count(*) as count from \`${statement.tableName}\``
|
35051
|
-
);
|
35052
|
-
const count2 = Number(res[0].count);
|
35053
|
-
if (count2 > 0) {
|
35054
|
-
infoToPrint.push(
|
35055
|
-
`\xB7 You're about to delete ${source_default.underline(
|
35056
|
-
statement.tableName
|
35057
|
-
)} table with ${count2} items`
|
35058
|
-
);
|
35059
|
-
tablesToRemove.push(statement.tableName);
|
35060
|
-
shouldAskForApprove = true;
|
35061
|
-
}
|
35062
|
-
const stmnt = fromJson([statement], "sqlite")[0];
|
35063
|
-
statementsToExecute.push(stmnt);
|
35064
|
-
} else if (statement.type === "alter_table_drop_column") {
|
35065
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35066
|
-
const columnIsPartOfPk = Object.values(
|
35067
|
-
json1.tables[newTableName].compositePrimaryKeys
|
35068
|
-
).find((c) => SQLiteSquasher.unsquashPK(c).includes(statement.columnName));
|
35069
|
-
const columnIsPartOfIndex = Object.values(
|
35070
|
-
json1.tables[newTableName].indexes
|
35071
|
-
).find((c) => SQLiteSquasher.unsquashIdx(c).columns.includes(statement.columnName));
|
35072
|
-
const columnIsPk = json1.tables[newTableName].columns[statement.columnName].primaryKey;
|
35073
|
-
const columnIsPartOfFk = Object.values(
|
35074
|
-
json1.tables[newTableName].foreignKeys
|
35075
|
-
).find(
|
35076
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).columnsFrom.includes(
|
35077
|
-
statement.columnName
|
35078
|
-
)
|
35079
|
-
);
|
35080
|
-
const res = await connection.query(
|
35081
|
-
`select count(*) as count from \`${newTableName}\``
|
35082
|
-
);
|
35083
|
-
const count2 = Number(res[0].count);
|
35084
|
-
if (count2 > 0) {
|
35085
|
-
infoToPrint.push(
|
35086
|
-
`\xB7 You're about to delete ${source_default.underline(
|
35087
|
-
statement.columnName
|
35088
|
-
)} column in ${newTableName} table with ${count2} items`
|
35089
|
-
);
|
35090
|
-
columnsToRemove.push(`${newTableName}_${statement.columnName}`);
|
35091
|
-
shouldAskForApprove = true;
|
35092
|
-
}
|
35093
|
-
if (columnIsPk || columnIsPartOfPk || columnIsPartOfIndex || columnIsPartOfFk) {
|
35094
|
-
tablesContext[newTableName] = [
|
35095
|
-
..._moveDataStatements(statement.tableName, json2, true)
|
35096
|
-
];
|
35097
|
-
const tablesReferncingCurrent = [];
|
35098
|
-
for (const table4 of Object.values(json1.tables)) {
|
35099
|
-
const tablesRefs = Object.values(json1.tables[table4.name].foreignKeys).filter(
|
35100
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).tableTo === newTableName
|
35101
|
-
).map((t) => SQLiteSquasher.unsquashPushFK(t).tableFrom);
|
35102
|
-
tablesReferncingCurrent.push(...tablesRefs);
|
35103
|
-
}
|
35104
|
-
const uniqueTableRefs = [...new Set(tablesReferncingCurrent)];
|
35105
|
-
for (const table4 of uniqueTableRefs) {
|
35106
|
-
if (typeof tablesContext[table4] === "undefined") {
|
35107
|
-
tablesContext[table4] = [..._moveDataStatements(table4, json2)];
|
35108
|
-
}
|
35109
|
-
}
|
35110
|
-
} else {
|
35111
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35112
|
-
const stmnt = fromJson([statement], "sqlite")[0];
|
35113
|
-
statementsToExecute.push(stmnt);
|
35114
|
-
}
|
35115
|
-
}
|
35116
|
-
} else if (statement.type === "sqlite_alter_table_add_column") {
|
35117
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35118
|
-
if (statement.column.notNull && !statement.column.default) {
|
35119
|
-
const res = await connection.query(
|
35120
|
-
`select count(*) as count from \`${newTableName}\``
|
35121
|
-
);
|
35122
|
-
const count2 = Number(res[0].count);
|
35123
|
-
if (count2 > 0) {
|
35124
|
-
infoToPrint.push(
|
35125
|
-
`\xB7 You're about to add not-null ${source_default.underline(
|
35126
|
-
statement.column.name
|
35127
|
-
)} column without default value, which contains ${count2} items`
|
35128
|
-
);
|
35129
|
-
tablesToTruncate.push(newTableName);
|
35130
|
-
statementsToExecute.push(`delete from ${newTableName};`);
|
35131
|
-
shouldAskForApprove = true;
|
35132
|
-
}
|
35133
|
-
}
|
35134
|
-
if (statement.column.primaryKey) {
|
35135
|
-
tablesContext[newTableName] = [
|
35136
|
-
..._moveDataStatements(statement.tableName, json2, true)
|
35137
|
-
];
|
35138
|
-
const tablesReferncingCurrent = [];
|
35139
|
-
for (const table4 of Object.values(json1.tables)) {
|
35140
|
-
const tablesRefs = Object.values(json1.tables[table4.name].foreignKeys).filter(
|
35141
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).tableTo === newTableName
|
35142
|
-
).map((t) => SQLiteSquasher.unsquashPushFK(t).tableFrom);
|
35143
|
-
tablesReferncingCurrent.push(...tablesRefs);
|
35144
|
-
}
|
35145
|
-
const uniqueTableRefs = [...new Set(tablesReferncingCurrent)];
|
35146
|
-
for (const table4 of uniqueTableRefs) {
|
35147
|
-
if (typeof tablesContext[table4] === "undefined") {
|
35148
|
-
tablesContext[table4] = [..._moveDataStatements(table4, json2)];
|
35149
|
-
}
|
35150
|
-
}
|
35151
|
-
} else {
|
35152
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35153
|
-
const stmnt = fromJson([statement], "sqlite")[0];
|
35154
|
-
statementsToExecute.push(stmnt);
|
35155
|
-
}
|
35156
|
-
}
|
35157
|
-
} else if (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_pk" || statement.type === "alter_table_alter_column_set_pk") {
|
35158
|
-
if (!(statement.type === "alter_table_alter_column_set_notnull" && statement.columnPk)) {
|
35159
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35160
|
-
if (statement.type === "alter_table_alter_column_set_notnull" && typeof statement.columnDefault === "undefined") {
|
35161
|
-
const res = await connection.query(
|
35162
|
-
`select count(*) as count from \`${newTableName}\``
|
35163
|
-
);
|
35164
|
-
const count2 = Number(res[0].count);
|
35165
|
-
if (count2 > 0) {
|
35166
|
-
infoToPrint.push(
|
35167
|
-
`\xB7 You're about to add not-null constraint to ${source_default.underline(
|
35168
|
-
statement.columnName
|
35169
|
-
)} column without default value, which contains ${count2} items`
|
35170
|
-
);
|
35171
|
-
tablesToTruncate.push(newTableName);
|
35172
|
-
shouldAskForApprove = true;
|
35173
|
-
}
|
35174
|
-
tablesContext[newTableName] = _moveDataStatements(
|
35175
|
-
statement.tableName,
|
35176
|
-
json1,
|
35177
|
-
true
|
35178
|
-
);
|
35179
|
-
} else {
|
35180
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35181
|
-
tablesContext[newTableName] = _moveDataStatements(
|
35182
|
-
statement.tableName,
|
35183
|
-
json1
|
35184
|
-
);
|
35185
|
-
}
|
35186
|
-
}
|
35187
|
-
const tablesReferncingCurrent = [];
|
35188
|
-
for (const table4 of Object.values(json1.tables)) {
|
35189
|
-
const tablesRefs = Object.values(json1.tables[table4.name].foreignKeys).filter(
|
35190
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).tableTo === newTableName
|
35191
|
-
).map((t) => {
|
35192
|
-
return getNewTableName(
|
35193
|
-
SQLiteSquasher.unsquashPushFK(t).tableFrom,
|
35194
|
-
meta
|
35195
|
-
);
|
35196
|
-
});
|
35197
|
-
tablesReferncingCurrent.push(...tablesRefs);
|
35198
|
-
}
|
35199
|
-
const uniqueTableRefs = [...new Set(tablesReferncingCurrent)];
|
35200
|
-
for (const table4 of uniqueTableRefs) {
|
35201
|
-
if (typeof tablesContext[table4] === "undefined") {
|
35202
|
-
tablesContext[table4] = [..._moveDataStatements(table4, json1)];
|
35203
|
-
}
|
35204
|
-
}
|
35205
|
-
}
|
35206
|
-
} else if (statement.type === "create_reference" || statement.type === "delete_reference" || statement.type === "alter_reference") {
|
35207
|
-
const fk4 = SQLiteSquasher.unsquashPushFK(statement.data);
|
35208
|
-
if (typeof tablesContext[statement.tableName] === "undefined") {
|
35209
|
-
tablesContext[statement.tableName] = _moveDataStatements(
|
35210
|
-
statement.tableName,
|
35211
|
-
json2
|
35212
|
-
);
|
35213
|
-
}
|
35214
|
-
} else if (statement.type === "create_composite_pk" || statement.type === "alter_composite_pk" || statement.type === "delete_composite_pk" || statement.type === "create_unique_constraint" || statement.type === "delete_unique_constraint") {
|
35215
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35216
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35217
|
-
tablesContext[newTableName] = _moveDataStatements(
|
35218
|
-
statement.tableName,
|
35219
|
-
json2
|
35220
|
-
);
|
35221
|
-
}
|
35222
|
-
} else {
|
35223
|
-
const stmnt = fromJson([statement], "sqlite");
|
35224
|
-
if (typeof stmnt !== "undefined") {
|
35225
|
-
statementsToExecute.push(...stmnt);
|
35226
|
-
}
|
35227
|
-
}
|
35228
|
-
}
|
35229
|
-
for (const context of Object.values(tablesContext)) {
|
35230
|
-
statementsToExecute.push(...context);
|
35231
|
-
}
|
35232
|
-
return {
|
35233
|
-
statementsToExecute,
|
35234
|
-
shouldAskForApprove,
|
35235
|
-
infoToPrint,
|
35236
|
-
columnsToRemove: [...new Set(columnsToRemove)],
|
35237
|
-
schemasToRemove: [...new Set(schemasToRemove)],
|
35238
|
-
tablesToTruncate: [...new Set(tablesToTruncate)],
|
35239
|
-
tablesToRemove: [...new Set(tablesToRemove)]
|
35240
|
-
};
|
35241
|
-
};
|
35242
|
-
|
35243
36147
|
// src/api.ts
|
36148
|
+
init_sqlitePushUtils();
|
35244
36149
|
init_global();
|
35245
36150
|
init_migrationPreparator();
|
35246
36151
|
init_mysqlSchema();
|
@@ -35287,7 +36192,7 @@ var generateMigration = async (prev, cur) => {
|
|
35287
36192
|
};
|
35288
36193
|
var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
35289
36194
|
const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
35290
|
-
const { sql: sql2 } = await Promise.resolve().then(() => (
|
36195
|
+
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
35291
36196
|
const db = {
|
35292
36197
|
query: async (query, params) => {
|
35293
36198
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -35357,7 +36262,7 @@ var generateSQLiteMigration = async (prev, cur) => {
|
|
35357
36262
|
};
|
35358
36263
|
var pushSQLiteSchema = async (imports, drizzleInstance) => {
|
35359
36264
|
const { applySqliteSnapshotsDiff: applySqliteSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
35360
|
-
const { sql: sql2 } = await Promise.resolve().then(() => (
|
36265
|
+
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
35361
36266
|
const db = {
|
35362
36267
|
query: async (query, params) => {
|
35363
36268
|
const res = drizzleInstance.all(sql2.raw(query));
|
@@ -35434,7 +36339,7 @@ var pushMySQLSchema = async (imports, drizzleInstance, databaseName) => {
|
|
35434
36339
|
const { applyMysqlSnapshotsDiff: applyMysqlSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
35435
36340
|
const { logSuggestionsAndReturn: logSuggestionsAndReturn3 } = await Promise.resolve().then(() => (init_mysqlPushUtils(), mysqlPushUtils_exports));
|
35436
36341
|
const { mysqlPushIntrospect: mysqlPushIntrospect2 } = await Promise.resolve().then(() => (init_mysqlIntrospect(), mysqlIntrospect_exports));
|
35437
|
-
const { sql: sql2 } = await Promise.resolve().then(() => (
|
36342
|
+
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
35438
36343
|
const db = {
|
35439
36344
|
query: async (query, params) => {
|
35440
36345
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -35473,7 +36378,13 @@ var pushMySQLSchema = async (imports, drizzleInstance, databaseName) => {
|
|
35473
36378
|
};
|
35474
36379
|
};
|
35475
36380
|
var upPgSnapshot = (snapshot) => {
|
35476
|
-
|
36381
|
+
if (snapshot.version === "5") {
|
36382
|
+
return updateUpToV7(updateUpToV6(snapshot));
|
36383
|
+
}
|
36384
|
+
if (snapshot.version === "6") {
|
36385
|
+
return updateUpToV7(snapshot);
|
36386
|
+
}
|
36387
|
+
return snapshot;
|
35477
36388
|
};
|
35478
36389
|
// Annotate the CommonJS export names for ESM import in node:
|
35479
36390
|
0 && (module.exports = {
|