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.mjs
CHANGED
@@ -8343,6 +8343,16 @@ var init_sqliteSchema = __esm({
|
|
8343
8343
|
});
|
8344
8344
|
|
8345
8345
|
// src/utils.ts
|
8346
|
+
function isPgArrayType(sqlType) {
|
8347
|
+
return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
|
8348
|
+
}
|
8349
|
+
function findAddedAndRemoved(columnNames1, columnNames2) {
|
8350
|
+
const set1 = new Set(columnNames1);
|
8351
|
+
const set2 = new Set(columnNames2);
|
8352
|
+
const addedColumns = columnNames2.filter((it) => !set1.has(it));
|
8353
|
+
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
8354
|
+
return { addedColumns, removedColumns };
|
8355
|
+
}
|
8346
8356
|
var copy, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey;
|
8347
8357
|
var init_utils = __esm({
|
8348
8358
|
"src/utils.ts"() {
|
@@ -8716,14 +8726,14 @@ var require_heap = __commonJS({
|
|
8716
8726
|
return item;
|
8717
8727
|
};
|
8718
8728
|
heapify = function(array, cmp) {
|
8719
|
-
var i, _i2,
|
8729
|
+
var i, _i2, _j2, _len, _ref, _ref1, _results, _results1;
|
8720
8730
|
if (cmp == null) {
|
8721
8731
|
cmp = defaultCmp;
|
8722
8732
|
}
|
8723
8733
|
_ref1 = function() {
|
8724
8734
|
_results1 = [];
|
8725
|
-
for (var
|
8726
|
-
_results1.push(
|
8735
|
+
for (var _j3 = 0, _ref2 = floor(array.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
|
8736
|
+
_results1.push(_j3);
|
8727
8737
|
}
|
8728
8738
|
return _results1;
|
8729
8739
|
}.apply(this).reverse();
|
@@ -8764,7 +8774,7 @@ var require_heap = __commonJS({
|
|
8764
8774
|
return result.sort(cmp).reverse();
|
8765
8775
|
};
|
8766
8776
|
nsmallest = function(array, n, cmp) {
|
8767
|
-
var elem, i, los, result, _i2,
|
8777
|
+
var elem, i, los, result, _i2, _j2, _len, _ref, _ref1, _results;
|
8768
8778
|
if (cmp == null) {
|
8769
8779
|
cmp = defaultCmp;
|
8770
8780
|
}
|
@@ -8787,7 +8797,7 @@ var require_heap = __commonJS({
|
|
8787
8797
|
}
|
8788
8798
|
heapify(array, cmp);
|
8789
8799
|
_results = [];
|
8790
|
-
for (i =
|
8800
|
+
for (i = _j2 = 0, _ref1 = min2(n, array.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
|
8791
8801
|
_results.push(heappop(array, cmp));
|
8792
8802
|
}
|
8793
8803
|
return _results;
|
@@ -11452,7 +11462,20 @@ var init_jsonDiffer = __esm({
|
|
11452
11462
|
});
|
11453
11463
|
|
11454
11464
|
// src/sqlgenerator.ts
|
11455
|
-
|
11465
|
+
function fromJson(statements, dialect7, action, driver2, json2) {
|
11466
|
+
const result = statements.flatMap((statement) => {
|
11467
|
+
const filtered = convertors.filter((it) => {
|
11468
|
+
return it.can(statement, dialect7, driver2);
|
11469
|
+
});
|
11470
|
+
const convertor = filtered.length === 1 ? filtered[0] : void 0;
|
11471
|
+
if (!convertor) {
|
11472
|
+
return "";
|
11473
|
+
}
|
11474
|
+
return convertor.convert(statement, json2, action);
|
11475
|
+
}).filter((it) => it !== "");
|
11476
|
+
return result;
|
11477
|
+
}
|
11478
|
+
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;
|
11456
11479
|
var init_sqlgenerator = __esm({
|
11457
11480
|
"src/sqlgenerator.ts"() {
|
11458
11481
|
"use strict";
|
@@ -11968,7 +11991,7 @@ var init_sqlgenerator = __esm({
|
|
11968
11991
|
}
|
11969
11992
|
convert(statement) {
|
11970
11993
|
const { tableName, oldColumnName, newColumnName } = statement;
|
11971
|
-
return `ALTER TABLE \`${tableName}\` RENAME COLUMN
|
11994
|
+
return `ALTER TABLE \`${tableName}\` RENAME COLUMN "${oldColumnName}" TO "${newColumnName}";`;
|
11972
11995
|
}
|
11973
11996
|
};
|
11974
11997
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
@@ -12070,8 +12093,8 @@ var init_sqlgenerator = __esm({
|
|
12070
12093
|
}
|
12071
12094
|
};
|
12072
12095
|
SQLiteAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
12073
|
-
can(statement, dialect7) {
|
12074
|
-
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "sqlite";
|
12096
|
+
can(statement, dialect7, driver2) {
|
12097
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect7 === "sqlite" && !driver2;
|
12075
12098
|
}
|
12076
12099
|
convert(statement) {
|
12077
12100
|
return `/*
|
@@ -12382,6 +12405,46 @@ var init_sqlgenerator = __esm({
|
|
12382
12405
|
return `ALTER TABLE \`${statement.tableName}\` DROP PRIMARY KEY`;
|
12383
12406
|
}
|
12384
12407
|
};
|
12408
|
+
LibSQLModifyColumn = class extends Convertor {
|
12409
|
+
can(statement, dialect7, driver2) {
|
12410
|
+
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";
|
12411
|
+
}
|
12412
|
+
convert(statement, json2) {
|
12413
|
+
const { tableName, columnName } = statement;
|
12414
|
+
let columnType = ``;
|
12415
|
+
let columnDefault = "";
|
12416
|
+
let columnNotNull = "";
|
12417
|
+
switch (statement.type) {
|
12418
|
+
case "alter_table_alter_column_set_type":
|
12419
|
+
columnType = ` ${statement.newDataType}`;
|
12420
|
+
columnDefault = statement.columnDefault ? ` DEFAULT ${statement.columnDefault}` : "";
|
12421
|
+
columnNotNull = statement.columnNotNull ? ` NOT NULL` : "";
|
12422
|
+
break;
|
12423
|
+
case "alter_table_alter_column_drop_notnull":
|
12424
|
+
columnType = ` ${statement.newDataType}`;
|
12425
|
+
columnDefault = statement.columnDefault ? ` DEFAULT ${statement.columnDefault}` : "";
|
12426
|
+
columnNotNull = "";
|
12427
|
+
break;
|
12428
|
+
case "alter_table_alter_column_set_notnull":
|
12429
|
+
columnType = ` ${statement.newDataType}`;
|
12430
|
+
columnDefault = statement.columnDefault ? ` DEFAULT ${statement.columnDefault}` : "";
|
12431
|
+
columnNotNull = ` NOT NULL`;
|
12432
|
+
break;
|
12433
|
+
case "alter_table_alter_column_set_default":
|
12434
|
+
columnType = ` ${statement.newDataType}`;
|
12435
|
+
columnDefault = ` DEFAULT ${statement.newDefaultValue}`;
|
12436
|
+
columnNotNull = statement.columnNotNull ? ` NOT NULL` : "";
|
12437
|
+
break;
|
12438
|
+
case "alter_table_alter_column_drop_default":
|
12439
|
+
columnType = ` ${statement.newDataType}`;
|
12440
|
+
columnDefault = "";
|
12441
|
+
columnNotNull = statement.columnNotNull ? ` NOT NULL` : "";
|
12442
|
+
break;
|
12443
|
+
}
|
12444
|
+
columnDefault = columnDefault instanceof Date ? columnDefault.toISOString() : columnDefault;
|
12445
|
+
return `ALTER TABLE \`${tableName}\` ALTER COLUMN "${columnName}" TO "${columnName}"${columnType}${columnNotNull}${columnDefault};`;
|
12446
|
+
}
|
12447
|
+
};
|
12385
12448
|
MySqlModifyColumn = class extends Convertor {
|
12386
12449
|
can(statement, dialect7) {
|
12387
12450
|
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";
|
@@ -12722,8 +12785,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12722
12785
|
}
|
12723
12786
|
};
|
12724
12787
|
SqliteAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
12725
|
-
can(statement, dialect7) {
|
12726
|
-
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "sqlite";
|
12788
|
+
can(statement, dialect7, driver2) {
|
12789
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect7 === "sqlite" && !driver2;
|
12727
12790
|
}
|
12728
12791
|
convert(statement) {
|
12729
12792
|
return `/*
|
@@ -12737,8 +12800,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12737
12800
|
}
|
12738
12801
|
};
|
12739
12802
|
SqliteAlterTableAlterColumnSetAutoincrementConvertor = class extends Convertor {
|
12740
|
-
can(statement, dialect7) {
|
12741
|
-
return statement.type === "alter_table_alter_column_set_autoincrement" && dialect7 === "sqlite";
|
12803
|
+
can(statement, dialect7, driver2) {
|
12804
|
+
return statement.type === "alter_table_alter_column_set_autoincrement" && dialect7 === "sqlite" && !driver2;
|
12742
12805
|
}
|
12743
12806
|
convert(statement) {
|
12744
12807
|
return `/*
|
@@ -12752,8 +12815,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12752
12815
|
}
|
12753
12816
|
};
|
12754
12817
|
SqliteAlterTableAlterColumnDropAutoincrementConvertor = class extends Convertor {
|
12755
|
-
can(statement, dialect7) {
|
12756
|
-
return statement.type === "alter_table_alter_column_drop_autoincrement" && dialect7 === "sqlite";
|
12818
|
+
can(statement, dialect7, driver2) {
|
12819
|
+
return statement.type === "alter_table_alter_column_drop_autoincrement" && dialect7 === "sqlite" && !driver2;
|
12757
12820
|
}
|
12758
12821
|
convert(statement) {
|
12759
12822
|
return `/*
|
@@ -12777,8 +12840,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12777
12840
|
}
|
12778
12841
|
};
|
12779
12842
|
SqliteAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
12780
|
-
can(statement, dialect7) {
|
12781
|
-
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "sqlite";
|
12843
|
+
can(statement, dialect7, driver2) {
|
12844
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect7 === "sqlite" && !driver2;
|
12782
12845
|
}
|
12783
12846
|
convert(statement) {
|
12784
12847
|
return `/*
|
@@ -12822,8 +12885,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12822
12885
|
}
|
12823
12886
|
};
|
12824
12887
|
SqliteCreateForeignKeyConvertor = class extends Convertor {
|
12825
|
-
can(statement, dialect7) {
|
12826
|
-
return statement.type === "create_reference" && dialect7 === "sqlite";
|
12888
|
+
can(statement, dialect7, driver2) {
|
12889
|
+
return statement.type === "create_reference" && dialect7 === "sqlite" && !driver2;
|
12827
12890
|
}
|
12828
12891
|
convert(statement) {
|
12829
12892
|
return `/*
|
@@ -12835,6 +12898,32 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12835
12898
|
*/`;
|
12836
12899
|
}
|
12837
12900
|
};
|
12901
|
+
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
12902
|
+
can(statement, dialect7, driver2) {
|
12903
|
+
return statement.type === "create_reference" && dialect7 === "sqlite" && driver2 === "turso";
|
12904
|
+
}
|
12905
|
+
convert(statement, json2, action) {
|
12906
|
+
const { columnsFrom, columnsTo, tableFrom, onDelete, onUpdate, tableTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
12907
|
+
const { columnDefault, columnNotNull, columnType, isMulticolumn } = statement;
|
12908
|
+
if (isMulticolumn) {
|
12909
|
+
return `/*
|
12910
|
+
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
|
12911
|
+
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
|
12912
|
+
https://www.sqlite.org/lang_altertable.html
|
12913
|
+
|
12914
|
+
Due to that we don't generate migration automatically and it has to be done manually
|
12915
|
+
*/`;
|
12916
|
+
}
|
12917
|
+
const onDeleteStatement = onDelete ? ` ON DELETE ${onDelete}` : "";
|
12918
|
+
const onUpdateStatement = onUpdate ? ` ON UPDATE ${onUpdate}` : "";
|
12919
|
+
const columnsDefaultValue = columnDefault ? ` DEFAULT ${columnDefault}` : "";
|
12920
|
+
const columnNotNullValue = columnNotNull ? ` NOT NULL` : "";
|
12921
|
+
const columnTypeValue = columnType ? ` ${columnType}` : "";
|
12922
|
+
const columnFrom = columnsFrom[0];
|
12923
|
+
const columnTo = columnsTo[0];
|
12924
|
+
return `ALTER TABLE \`${tableFrom}\` ALTER COLUMN "${columnFrom}" TO "${columnFrom}"${columnTypeValue}${columnNotNullValue}${columnsDefaultValue} REFERENCES ${tableTo}(${columnTo})${onDeleteStatement}${onUpdateStatement};`;
|
12925
|
+
}
|
12926
|
+
};
|
12838
12927
|
MySqlCreateForeignKeyConvertor = class extends Convertor {
|
12839
12928
|
can(statement, dialect7) {
|
12840
12929
|
return statement.type === "create_reference" && dialect7 === "mysql";
|
@@ -12908,8 +12997,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12908
12997
|
}
|
12909
12998
|
};
|
12910
12999
|
SqliteDeleteForeignKeyConvertor = class extends Convertor {
|
12911
|
-
can(statement, dialect7) {
|
12912
|
-
return statement.type === "delete_reference" && dialect7 === "sqlite";
|
13000
|
+
can(statement, dialect7, driver2) {
|
13001
|
+
return statement.type === "delete_reference" && dialect7 === "sqlite" && !driver2;
|
12913
13002
|
}
|
12914
13003
|
convert(statement) {
|
12915
13004
|
return `/*
|
@@ -12921,6 +13010,29 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
12921
13010
|
*/`;
|
12922
13011
|
}
|
12923
13012
|
};
|
13013
|
+
LibSQLDeleteForeignKeyConvertor = class extends Convertor {
|
13014
|
+
can(statement, dialect7, driver2) {
|
13015
|
+
return statement.type === "delete_reference" && dialect7 === "sqlite" && driver2 === "turso";
|
13016
|
+
}
|
13017
|
+
convert(statement, json2, action) {
|
13018
|
+
const { columnsFrom, tableFrom } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
13019
|
+
const { columnDefault, columnNotNull, columnType, isMulticolumn } = statement;
|
13020
|
+
if (isMulticolumn) {
|
13021
|
+
return `/*
|
13022
|
+
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
|
13023
|
+
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
|
13024
|
+
https://www.sqlite.org/lang_altertable.html
|
13025
|
+
|
13026
|
+
Due to that we don't generate migration automatically and it has to be done manually
|
13027
|
+
*/`;
|
13028
|
+
}
|
13029
|
+
const columnsDefaultValue = columnDefault ? ` DEFAULT ${columnDefault}` : "";
|
13030
|
+
const columnNotNullValue = columnNotNull ? ` NOT NULL` : "";
|
13031
|
+
const columnTypeValue = columnType ? ` ${columnType}` : "";
|
13032
|
+
const columnFrom = columnsFrom[0];
|
13033
|
+
return `ALTER TABLE \`${tableFrom}\` ALTER COLUMN "${columnFrom}" TO "${columnFrom}"${columnTypeValue}${columnNotNullValue}${columnsDefaultValue};`;
|
13034
|
+
}
|
13035
|
+
};
|
12924
13036
|
MySqlDeleteForeignKeyConvertor = class extends Convertor {
|
12925
13037
|
can(statement, dialect7) {
|
12926
13038
|
return statement.type === "delete_reference" && dialect7 === "mysql";
|
@@ -13084,10 +13196,90 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13084
13196
|
return `DROP INDEX \`${name2}\` ON \`${statement.tableName}\`;`;
|
13085
13197
|
}
|
13086
13198
|
};
|
13199
|
+
SQLiteRecreateTableConvertor = class extends Convertor {
|
13200
|
+
can(statement, dialect7, driver2) {
|
13201
|
+
return statement.type === "recreate_table" && dialect7 === "sqlite" && !driver2;
|
13202
|
+
}
|
13203
|
+
convert(statement) {
|
13204
|
+
const { tableName, columns, compositePKs, referenceData } = statement;
|
13205
|
+
const columnNames = columns.map((it) => `"${it.name}"`).join(", ");
|
13206
|
+
const sqlStatements = [];
|
13207
|
+
sqlStatements.push(
|
13208
|
+
new SqliteRenameTableConvertor().convert({
|
13209
|
+
fromSchema: "",
|
13210
|
+
tableNameFrom: tableName,
|
13211
|
+
tableNameTo: `__old__generate_${tableName}`,
|
13212
|
+
toSchema: "",
|
13213
|
+
type: "rename_table"
|
13214
|
+
})
|
13215
|
+
);
|
13216
|
+
sqlStatements.push(
|
13217
|
+
new SQLiteCreateTableConvertor().convert({
|
13218
|
+
type: "sqlite_create_table",
|
13219
|
+
tableName,
|
13220
|
+
columns,
|
13221
|
+
referenceData,
|
13222
|
+
compositePKs
|
13223
|
+
})
|
13224
|
+
);
|
13225
|
+
sqlStatements.push(
|
13226
|
+
`INSERT INTO \`${tableName}\`(${columnNames}) SELECT ${columnNames} FROM \`__old__generate_${tableName}\`;`
|
13227
|
+
);
|
13228
|
+
sqlStatements.push(
|
13229
|
+
new SQLiteDropTableConvertor().convert({
|
13230
|
+
type: "drop_table",
|
13231
|
+
tableName: `__old__generate_${tableName}`,
|
13232
|
+
schema: ""
|
13233
|
+
})
|
13234
|
+
);
|
13235
|
+
return sqlStatements;
|
13236
|
+
}
|
13237
|
+
};
|
13238
|
+
LibSQLRecreateTableConvertor = class extends Convertor {
|
13239
|
+
can(statement, dialect7, driver2) {
|
13240
|
+
return statement.type === "recreate_table" && dialect7 === "sqlite" && driver2 === "turso";
|
13241
|
+
}
|
13242
|
+
convert(statement) {
|
13243
|
+
const { tableName, columns, compositePKs, referenceData } = statement;
|
13244
|
+
const columnNames = columns.map((it) => `"${it.name}"`).join(", ");
|
13245
|
+
const sqlStatements = [];
|
13246
|
+
sqlStatements.push(
|
13247
|
+
new SqliteRenameTableConvertor().convert({
|
13248
|
+
fromSchema: "",
|
13249
|
+
tableNameFrom: tableName,
|
13250
|
+
tableNameTo: `__old__generate_${tableName}`,
|
13251
|
+
toSchema: "",
|
13252
|
+
type: "rename_table"
|
13253
|
+
})
|
13254
|
+
);
|
13255
|
+
sqlStatements.push(
|
13256
|
+
new SQLiteCreateTableConvertor().convert({
|
13257
|
+
type: "sqlite_create_table",
|
13258
|
+
tableName,
|
13259
|
+
columns,
|
13260
|
+
referenceData,
|
13261
|
+
compositePKs
|
13262
|
+
})
|
13263
|
+
);
|
13264
|
+
sqlStatements.push(
|
13265
|
+
`INSERT INTO \`${tableName}\`(${columnNames}) SELECT ${columnNames} FROM \`__old__generate_${tableName}\`;`
|
13266
|
+
);
|
13267
|
+
sqlStatements.push(
|
13268
|
+
new SQLiteDropTableConvertor().convert({
|
13269
|
+
type: "drop_table",
|
13270
|
+
tableName: `__old__generate_${tableName}`,
|
13271
|
+
schema: ""
|
13272
|
+
})
|
13273
|
+
);
|
13274
|
+
return sqlStatements;
|
13275
|
+
}
|
13276
|
+
};
|
13087
13277
|
convertors = [];
|
13088
13278
|
convertors.push(new PgCreateTableConvertor());
|
13089
13279
|
convertors.push(new MySqlCreateTableConvertor());
|
13090
13280
|
convertors.push(new SQLiteCreateTableConvertor());
|
13281
|
+
convertors.push(new SQLiteRecreateTableConvertor());
|
13282
|
+
convertors.push(new LibSQLRecreateTableConvertor());
|
13091
13283
|
convertors.push(new CreateTypeEnumConvertor());
|
13092
13284
|
convertors.push(new CreatePgSequenceConvertor());
|
13093
13285
|
convertors.push(new DropPgSequenceConvertor());
|
@@ -13135,6 +13327,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13135
13327
|
convertors.push(new SqliteAlterTableAlterColumnAlterGeneratedConvertor());
|
13136
13328
|
convertors.push(new SqliteAlterTableAlterColumnSetExpressionConvertor());
|
13137
13329
|
convertors.push(new MySqlModifyColumn());
|
13330
|
+
convertors.push(new LibSQLModifyColumn());
|
13138
13331
|
convertors.push(new PgCreateForeignKeyConvertor());
|
13139
13332
|
convertors.push(new MySqlCreateForeignKeyConvertor());
|
13140
13333
|
convertors.push(new PgAlterForeignKeyConvertor());
|
@@ -13149,7 +13342,9 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13149
13342
|
convertors.push(new SQLiteAlterTableAlterColumnSetTypeConvertor());
|
13150
13343
|
convertors.push(new SqliteAlterForeignKeyConvertor());
|
13151
13344
|
convertors.push(new SqliteDeleteForeignKeyConvertor());
|
13345
|
+
convertors.push(new LibSQLDeleteForeignKeyConvertor());
|
13152
13346
|
convertors.push(new SqliteCreateForeignKeyConvertor());
|
13347
|
+
convertors.push(new LibSQLCreateForeignKeyConvertor());
|
13153
13348
|
convertors.push(new SQLiteAlterTableAddUniqueConstraintConvertor());
|
13154
13349
|
convertors.push(new SQLiteAlterTableDropUniqueConstraintConvertor());
|
13155
13350
|
convertors.push(new PgAlterTableAlterColumnDropGenerated());
|
@@ -13172,19 +13367,6 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13172
13367
|
convertors.push(new MySqlAlterTableCreateCompositePrimaryKeyConvertor());
|
13173
13368
|
convertors.push(new MySqlAlterTableAddPk());
|
13174
13369
|
convertors.push(new MySqlAlterTableAlterCompositePrimaryKeyConvertor());
|
13175
|
-
fromJson = (statements, dialect7) => {
|
13176
|
-
const result = statements.flatMap((statement) => {
|
13177
|
-
const filtered = convertors.filter((it) => {
|
13178
|
-
return it.can(statement, dialect7);
|
13179
|
-
});
|
13180
|
-
const convertor = filtered.length === 1 ? filtered[0] : void 0;
|
13181
|
-
if (!convertor) {
|
13182
|
-
return "";
|
13183
|
-
}
|
13184
|
-
return convertor.convert(statement);
|
13185
|
-
}).filter((it) => it !== "");
|
13186
|
-
return result;
|
13187
|
-
};
|
13188
13370
|
https: `
|
13189
13371
|
create table users (
|
13190
13372
|
id int,
|
@@ -13211,12 +13393,237 @@ drop type __venum;
|
|
13211
13393
|
}
|
13212
13394
|
});
|
13213
13395
|
|
13396
|
+
// src/cli/commands/sqlitePushUtils.ts
|
13397
|
+
var _moveDataStatements, getOldTableName, getNewTableName, logSuggestionsAndReturn;
|
13398
|
+
var init_sqlitePushUtils = __esm({
|
13399
|
+
"src/cli/commands/sqlitePushUtils.ts"() {
|
13400
|
+
"use strict";
|
13401
|
+
init_source();
|
13402
|
+
init_sqliteSchema();
|
13403
|
+
init_sqlgenerator();
|
13404
|
+
init_utils();
|
13405
|
+
_moveDataStatements = (tableName, json, dataLoss = false) => {
|
13406
|
+
const statements = [];
|
13407
|
+
statements.push(
|
13408
|
+
new SqliteRenameTableConvertor().convert({
|
13409
|
+
type: "rename_table",
|
13410
|
+
tableNameFrom: tableName,
|
13411
|
+
tableNameTo: `__old_push_${tableName}`,
|
13412
|
+
fromSchema: "",
|
13413
|
+
toSchema: ""
|
13414
|
+
})
|
13415
|
+
);
|
13416
|
+
const tableColumns = Object.values(json.tables[tableName].columns);
|
13417
|
+
const referenceData = Object.values(json.tables[tableName].foreignKeys);
|
13418
|
+
const compositePKs = Object.values(
|
13419
|
+
json.tables[tableName].compositePrimaryKeys
|
13420
|
+
).map((it) => SQLiteSquasher.unsquashPK(it));
|
13421
|
+
const fks = referenceData.map((it) => SQLiteSquasher.unsquashPushFK(it));
|
13422
|
+
statements.push(
|
13423
|
+
new SQLiteCreateTableConvertor().convert({
|
13424
|
+
type: "sqlite_create_table",
|
13425
|
+
tableName,
|
13426
|
+
columns: tableColumns,
|
13427
|
+
referenceData: fks,
|
13428
|
+
compositePKs
|
13429
|
+
})
|
13430
|
+
);
|
13431
|
+
if (!dataLoss) {
|
13432
|
+
const columns = Object.keys(json.tables[tableName].columns).map(
|
13433
|
+
(c) => `"${c}"`
|
13434
|
+
);
|
13435
|
+
statements.push(
|
13436
|
+
`INSERT INTO \`${tableName}\`(${columns.join(
|
13437
|
+
", "
|
13438
|
+
)}) SELECT (${columns.join(", ")}) FROM \`__old_push_${tableName}\`;`
|
13439
|
+
);
|
13440
|
+
}
|
13441
|
+
statements.push(
|
13442
|
+
new SQLiteDropTableConvertor().convert({
|
13443
|
+
type: "drop_table",
|
13444
|
+
tableName: `__old_push_${tableName}`,
|
13445
|
+
schema: ""
|
13446
|
+
})
|
13447
|
+
);
|
13448
|
+
for (const idx of Object.values(json.tables[tableName].indexes)) {
|
13449
|
+
statements.push(
|
13450
|
+
new CreateSqliteIndexConvertor().convert({
|
13451
|
+
type: "create_index",
|
13452
|
+
tableName,
|
13453
|
+
schema: "",
|
13454
|
+
data: idx
|
13455
|
+
})
|
13456
|
+
);
|
13457
|
+
}
|
13458
|
+
return statements;
|
13459
|
+
};
|
13460
|
+
getOldTableName = (tableName, meta) => {
|
13461
|
+
for (const key of Object.keys(meta.tables)) {
|
13462
|
+
const value = meta.tables[key];
|
13463
|
+
if (`"${tableName}"` === value) {
|
13464
|
+
return key.substring(1, key.length - 1);
|
13465
|
+
}
|
13466
|
+
}
|
13467
|
+
return tableName;
|
13468
|
+
};
|
13469
|
+
getNewTableName = (tableName, meta) => {
|
13470
|
+
if (typeof meta.tables[`"${tableName}"`] !== "undefined") {
|
13471
|
+
return meta.tables[`"${tableName}"`].substring(
|
13472
|
+
1,
|
13473
|
+
meta.tables[`"${tableName}"`].length - 1
|
13474
|
+
);
|
13475
|
+
}
|
13476
|
+
return tableName;
|
13477
|
+
};
|
13478
|
+
logSuggestionsAndReturn = async (connection, statements, json1, json2, meta) => {
|
13479
|
+
let shouldAskForApprove = false;
|
13480
|
+
const statementsToExecute = [];
|
13481
|
+
const infoToPrint = [];
|
13482
|
+
const tablesToRemove = [];
|
13483
|
+
const columnsToRemove = [];
|
13484
|
+
const schemasToRemove = [];
|
13485
|
+
const tablesToTruncate = [];
|
13486
|
+
for (const statement of statements) {
|
13487
|
+
if (statement.type === "drop_table") {
|
13488
|
+
const res = await connection.query(
|
13489
|
+
`select count(*) as count from \`${statement.tableName}\``
|
13490
|
+
);
|
13491
|
+
const count2 = Number(res[0].count);
|
13492
|
+
if (count2 > 0) {
|
13493
|
+
infoToPrint.push(
|
13494
|
+
`\xB7 You're about to delete ${source_default.underline(
|
13495
|
+
statement.tableName
|
13496
|
+
)} table with ${count2} items`
|
13497
|
+
);
|
13498
|
+
tablesToRemove.push(statement.tableName);
|
13499
|
+
shouldAskForApprove = true;
|
13500
|
+
}
|
13501
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13502
|
+
statementsToExecute.push(
|
13503
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13504
|
+
);
|
13505
|
+
} else if (statement.type === "alter_table_drop_column") {
|
13506
|
+
const tableName = statement.tableName;
|
13507
|
+
const columnName = statement.columnName;
|
13508
|
+
const res = await connection.query(
|
13509
|
+
`select count(\`${tableName}\`.\`${columnName}\`) as count from \`${tableName}\``
|
13510
|
+
);
|
13511
|
+
const count2 = Number(res[0].count);
|
13512
|
+
if (count2 > 0) {
|
13513
|
+
infoToPrint.push(
|
13514
|
+
`\xB7 You're about to delete ${source_default.underline(
|
13515
|
+
columnName
|
13516
|
+
)} column in ${tableName} table with ${count2} items`
|
13517
|
+
);
|
13518
|
+
columnsToRemove.push(`${tableName}_${statement.columnName}`);
|
13519
|
+
shouldAskForApprove = true;
|
13520
|
+
}
|
13521
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13522
|
+
statementsToExecute.push(
|
13523
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13524
|
+
);
|
13525
|
+
} else if (statement.type === "sqlite_alter_table_add_column" && (statement.column.notNull && !statement.column.default)) {
|
13526
|
+
const tableName = statement.tableName;
|
13527
|
+
const columnName = statement.column.name;
|
13528
|
+
const res = await connection.query(
|
13529
|
+
`select count(*) as count from \`${tableName}\``
|
13530
|
+
);
|
13531
|
+
const count2 = Number(res[0].count);
|
13532
|
+
if (count2 > 0) {
|
13533
|
+
infoToPrint.push(
|
13534
|
+
`\xB7 You're about to add not-null ${source_default.underline(
|
13535
|
+
columnName
|
13536
|
+
)} column without default value, which contains ${count2} items`
|
13537
|
+
);
|
13538
|
+
tablesToTruncate.push(tableName);
|
13539
|
+
statementsToExecute.push(`delete from ${tableName};`);
|
13540
|
+
shouldAskForApprove = true;
|
13541
|
+
}
|
13542
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13543
|
+
statementsToExecute.push(
|
13544
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13545
|
+
);
|
13546
|
+
} else if (statement.type === "recreate_table") {
|
13547
|
+
const tableName = statement.tableName;
|
13548
|
+
const oldTableName = getOldTableName(tableName, meta);
|
13549
|
+
const prevColumnNames = Object.keys(json1.tables[oldTableName].columns);
|
13550
|
+
const currentColumnNames = Object.keys(json2.tables[tableName].columns);
|
13551
|
+
const { removedColumns, addedColumns } = findAddedAndRemoved(
|
13552
|
+
prevColumnNames,
|
13553
|
+
currentColumnNames
|
13554
|
+
);
|
13555
|
+
if (removedColumns.length) {
|
13556
|
+
for (const removedColumn of removedColumns) {
|
13557
|
+
const res = await connection.query(
|
13558
|
+
`select count(\`${tableName}\`.\`${removedColumn}\`) as count from \`${tableName}\``
|
13559
|
+
);
|
13560
|
+
const count2 = Number(res[0].count);
|
13561
|
+
if (count2 > 0) {
|
13562
|
+
infoToPrint.push(
|
13563
|
+
`\xB7 You're about to delete ${source_default.underline(
|
13564
|
+
removedColumn
|
13565
|
+
)} column in ${tableName} table with ${count2} items`
|
13566
|
+
);
|
13567
|
+
columnsToRemove.push(removedColumn);
|
13568
|
+
shouldAskForApprove = true;
|
13569
|
+
}
|
13570
|
+
}
|
13571
|
+
}
|
13572
|
+
if (addedColumns.length) {
|
13573
|
+
for (const addedColumn of addedColumns) {
|
13574
|
+
const [res] = await connection.query(
|
13575
|
+
`select count(*) as count from \`${tableName}\``
|
13576
|
+
);
|
13577
|
+
const columnConf = json2.tables[tableName].columns[addedColumn];
|
13578
|
+
const count2 = Number(res.count);
|
13579
|
+
if (count2 > 0 && columnConf.notNull && !columnConf.default) {
|
13580
|
+
infoToPrint.push(
|
13581
|
+
`\xB7 You're about to add not-null ${source_default.underline(
|
13582
|
+
addedColumn
|
13583
|
+
)} column without default value to table, which contains ${count2} items`
|
13584
|
+
);
|
13585
|
+
shouldAskForApprove = true;
|
13586
|
+
tablesToTruncate.push(tableName);
|
13587
|
+
}
|
13588
|
+
}
|
13589
|
+
}
|
13590
|
+
statementsToExecute.push(..._moveDataStatements(tableName, json2));
|
13591
|
+
const tablesReferencingCurrent = [];
|
13592
|
+
for (const table4 of Object.values(json2.tables)) {
|
13593
|
+
const tablesRefs = Object.values(json2.tables[table4.name].foreignKeys).filter((t) => SQLiteSquasher.unsquashPushFK(t).tableTo === tableName).map((it) => SQLiteSquasher.unsquashPushFK(it).tableFrom);
|
13594
|
+
tablesReferencingCurrent.push(...tablesRefs);
|
13595
|
+
}
|
13596
|
+
const uniqueTableRefs = [...new Set(tablesReferencingCurrent)];
|
13597
|
+
for (const table4 of uniqueTableRefs) {
|
13598
|
+
statementsToExecute.push(..._moveDataStatements(table4, json2));
|
13599
|
+
}
|
13600
|
+
} else {
|
13601
|
+
const fromJsonStatement = fromJson([statement], "sqlite", "push");
|
13602
|
+
statementsToExecute.push(
|
13603
|
+
...Array.isArray(fromJsonStatement) ? fromJsonStatement : [fromJsonStatement]
|
13604
|
+
);
|
13605
|
+
}
|
13606
|
+
}
|
13607
|
+
return {
|
13608
|
+
statementsToExecute,
|
13609
|
+
shouldAskForApprove,
|
13610
|
+
infoToPrint,
|
13611
|
+
columnsToRemove: [...new Set(columnsToRemove)],
|
13612
|
+
schemasToRemove: [...new Set(schemasToRemove)],
|
13613
|
+
tablesToTruncate: [...new Set(tablesToTruncate)],
|
13614
|
+
tablesToRemove: [...new Set(tablesToRemove)]
|
13615
|
+
};
|
13616
|
+
};
|
13617
|
+
}
|
13618
|
+
});
|
13619
|
+
|
13214
13620
|
// src/jsonStatements.ts
|
13215
|
-
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;
|
13621
|
+
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;
|
13216
13622
|
var init_jsonStatements = __esm({
|
13217
13623
|
"src/jsonStatements.ts"() {
|
13218
13624
|
"use strict";
|
13219
13625
|
init_source();
|
13626
|
+
init_sqlitePushUtils();
|
13220
13627
|
init_views();
|
13221
13628
|
init_mysqlSchema();
|
13222
13629
|
init_pgSchema();
|
@@ -14000,6 +14407,49 @@ var init_jsonStatements = __esm({
|
|
14000
14407
|
const columnPk = json2.tables[tableName].columns[columnName].primaryKey;
|
14001
14408
|
const columnGenerated = json2.tables[tableName].columns[columnName].generated;
|
14002
14409
|
const compositePk = json2.tables[tableName].compositePrimaryKeys[`${tableName}_${columnName}`];
|
14410
|
+
if (column4.autoincrement?.type === "added") {
|
14411
|
+
statements.push({
|
14412
|
+
type: "alter_table_alter_column_set_autoincrement",
|
14413
|
+
tableName,
|
14414
|
+
columnName,
|
14415
|
+
schema: schema4,
|
14416
|
+
newDataType: columnType,
|
14417
|
+
columnDefault,
|
14418
|
+
columnOnUpdate,
|
14419
|
+
columnNotNull,
|
14420
|
+
columnAutoIncrement,
|
14421
|
+
columnPk
|
14422
|
+
});
|
14423
|
+
}
|
14424
|
+
if (column4.autoincrement?.type === "changed") {
|
14425
|
+
const type = column4.autoincrement.new ? "alter_table_alter_column_set_autoincrement" : "alter_table_alter_column_drop_autoincrement";
|
14426
|
+
statements.push({
|
14427
|
+
type,
|
14428
|
+
tableName,
|
14429
|
+
columnName,
|
14430
|
+
schema: schema4,
|
14431
|
+
newDataType: columnType,
|
14432
|
+
columnDefault,
|
14433
|
+
columnOnUpdate,
|
14434
|
+
columnNotNull,
|
14435
|
+
columnAutoIncrement,
|
14436
|
+
columnPk
|
14437
|
+
});
|
14438
|
+
}
|
14439
|
+
if (column4.autoincrement?.type === "deleted") {
|
14440
|
+
statements.push({
|
14441
|
+
type: "alter_table_alter_column_drop_autoincrement",
|
14442
|
+
tableName,
|
14443
|
+
columnName,
|
14444
|
+
schema: schema4,
|
14445
|
+
newDataType: columnType,
|
14446
|
+
columnDefault,
|
14447
|
+
columnOnUpdate,
|
14448
|
+
columnNotNull,
|
14449
|
+
columnAutoIncrement,
|
14450
|
+
columnPk
|
14451
|
+
});
|
14452
|
+
}
|
14003
14453
|
if (typeof column4.name !== "string") {
|
14004
14454
|
statements.push({
|
14005
14455
|
type: "alter_table_rename_column",
|
@@ -14263,33 +14713,111 @@ var init_jsonStatements = __esm({
|
|
14263
14713
|
};
|
14264
14714
|
});
|
14265
14715
|
};
|
14266
|
-
|
14716
|
+
prepareLibSQLCreateReferencesJson = (tableName, schema4, foreignKeys, json2, action) => {
|
14267
14717
|
return Object.values(foreignKeys).map((fkData) => {
|
14718
|
+
const { columnsFrom, tableFrom, columnsTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(fkData) : SQLiteSquasher.unsquashFK(fkData);
|
14719
|
+
let isMulticolumn = false;
|
14720
|
+
if (columnsFrom.length > 1 || columnsTo.length > 1) {
|
14721
|
+
isMulticolumn = true;
|
14722
|
+
return {
|
14723
|
+
type: "create_reference",
|
14724
|
+
tableName,
|
14725
|
+
data: fkData,
|
14726
|
+
schema: schema4,
|
14727
|
+
isMulticolumn
|
14728
|
+
};
|
14729
|
+
}
|
14730
|
+
const columnFrom = columnsFrom[0];
|
14731
|
+
const {
|
14732
|
+
notNull: columnNotNull,
|
14733
|
+
default: columnDefault,
|
14734
|
+
type: columnType
|
14735
|
+
} = json2.tables[tableFrom].columns[columnFrom];
|
14268
14736
|
return {
|
14269
|
-
type: "
|
14737
|
+
type: "create_reference",
|
14270
14738
|
tableName,
|
14271
14739
|
data: fkData,
|
14272
|
-
schema: schema4
|
14740
|
+
schema: schema4,
|
14741
|
+
columnNotNull,
|
14742
|
+
columnDefault,
|
14743
|
+
columnType
|
14273
14744
|
};
|
14274
14745
|
});
|
14275
14746
|
};
|
14276
|
-
|
14277
|
-
|
14278
|
-
|
14279
|
-
stmts.push({
|
14747
|
+
prepareDropReferencesJson = (tableName, schema4, foreignKeys) => {
|
14748
|
+
return Object.values(foreignKeys).map((fkData) => {
|
14749
|
+
return {
|
14280
14750
|
type: "delete_reference",
|
14281
14751
|
tableName,
|
14282
|
-
|
14283
|
-
|
14284
|
-
}
|
14285
|
-
stmts.push({
|
14286
|
-
type: "create_reference",
|
14287
|
-
tableName,
|
14288
|
-
schema: schema4,
|
14289
|
-
data: val.__new
|
14290
|
-
});
|
14752
|
+
data: fkData,
|
14753
|
+
schema: schema4
|
14754
|
+
};
|
14291
14755
|
});
|
14292
|
-
|
14756
|
+
};
|
14757
|
+
prepareLibSQLDropReferencesJson = (tableName, schema4, foreignKeys, json2, meta, action) => {
|
14758
|
+
const statements = Object.values(foreignKeys).map((fkData) => {
|
14759
|
+
const { columnsFrom, tableFrom, columnsTo, name: name2, tableTo, onDelete, onUpdate } = action === "push" ? SQLiteSquasher.unsquashPushFK(fkData) : SQLiteSquasher.unsquashFK(fkData);
|
14760
|
+
const keys = Object.keys(json2.tables[tableName].columns);
|
14761
|
+
const filtered = columnsFrom.filter((it) => keys.includes(it));
|
14762
|
+
const fullDrop = filtered.length === 0;
|
14763
|
+
if (fullDrop) return;
|
14764
|
+
let isMulticolumn = false;
|
14765
|
+
if (columnsFrom.length > 1 || columnsTo.length > 1) {
|
14766
|
+
isMulticolumn = true;
|
14767
|
+
return {
|
14768
|
+
type: "delete_reference",
|
14769
|
+
tableName,
|
14770
|
+
data: fkData,
|
14771
|
+
schema: schema4,
|
14772
|
+
isMulticolumn
|
14773
|
+
};
|
14774
|
+
}
|
14775
|
+
const columnFrom = columnsFrom[0];
|
14776
|
+
const newTableName = getNewTableName(tableFrom, meta);
|
14777
|
+
const {
|
14778
|
+
notNull: columnNotNull,
|
14779
|
+
default: columnDefault,
|
14780
|
+
type: columnType
|
14781
|
+
} = json2.tables[newTableName].columns[columnFrom];
|
14782
|
+
const fkToSquash = {
|
14783
|
+
columnsFrom,
|
14784
|
+
columnsTo,
|
14785
|
+
name: name2,
|
14786
|
+
tableFrom: newTableName,
|
14787
|
+
tableTo,
|
14788
|
+
onDelete,
|
14789
|
+
onUpdate
|
14790
|
+
};
|
14791
|
+
const foreignKey = action === "push" ? SQLiteSquasher.squashPushFK(fkToSquash) : SQLiteSquasher.squashFK(fkToSquash);
|
14792
|
+
return {
|
14793
|
+
type: "delete_reference",
|
14794
|
+
tableName,
|
14795
|
+
data: foreignKey,
|
14796
|
+
schema: schema4,
|
14797
|
+
columnNotNull,
|
14798
|
+
columnDefault,
|
14799
|
+
columnType
|
14800
|
+
};
|
14801
|
+
});
|
14802
|
+
return statements.filter((it) => it);
|
14803
|
+
};
|
14804
|
+
prepareAlterReferencesJson = (tableName, schema4, foreignKeys) => {
|
14805
|
+
const stmts = [];
|
14806
|
+
Object.values(foreignKeys).map((val) => {
|
14807
|
+
stmts.push({
|
14808
|
+
type: "delete_reference",
|
14809
|
+
tableName,
|
14810
|
+
schema: schema4,
|
14811
|
+
data: val.__old
|
14812
|
+
});
|
14813
|
+
stmts.push({
|
14814
|
+
type: "create_reference",
|
14815
|
+
tableName,
|
14816
|
+
schema: schema4,
|
14817
|
+
data: val.__new
|
14818
|
+
});
|
14819
|
+
});
|
14820
|
+
return stmts;
|
14293
14821
|
};
|
14294
14822
|
prepareDropIndexesJson = (tableName, schema4, indexes) => {
|
14295
14823
|
return Object.values(indexes).map((indexData) => {
|
@@ -14426,10 +14954,298 @@ var init_jsonStatements = __esm({
|
|
14426
14954
|
}
|
14427
14955
|
});
|
14428
14956
|
|
14957
|
+
// src/statementCombiner.ts
|
14958
|
+
var prepareLibSQLRecreateTable, prepareSQLiteRecreateTable, libSQLCombineStatements, sqliteCombineStatements;
|
14959
|
+
var init_statementCombiner = __esm({
|
14960
|
+
"src/statementCombiner.ts"() {
|
14961
|
+
"use strict";
|
14962
|
+
init_jsonStatements();
|
14963
|
+
init_sqliteSchema();
|
14964
|
+
prepareLibSQLRecreateTable = (table4, action) => {
|
14965
|
+
const { name: name2, columns, uniqueConstraints, indexes } = table4;
|
14966
|
+
const composites = Object.values(table4.compositePrimaryKeys).map(
|
14967
|
+
(it) => SQLiteSquasher.unsquashPK(it)
|
14968
|
+
);
|
14969
|
+
const references2 = Object.values(table4.foreignKeys);
|
14970
|
+
const fks = references2.map(
|
14971
|
+
(it) => action === "push" ? SQLiteSquasher.unsquashPushFK(it) : SQLiteSquasher.unsquashFK(it)
|
14972
|
+
);
|
14973
|
+
const statements = [
|
14974
|
+
{
|
14975
|
+
type: "recreate_table",
|
14976
|
+
tableName: name2,
|
14977
|
+
columns: Object.values(columns),
|
14978
|
+
compositePKs: composites,
|
14979
|
+
referenceData: fks,
|
14980
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
14981
|
+
}
|
14982
|
+
];
|
14983
|
+
if (Object.keys(indexes).length) {
|
14984
|
+
statements.push(...prepareCreateIndexesJson(name2, "", indexes));
|
14985
|
+
}
|
14986
|
+
return statements;
|
14987
|
+
};
|
14988
|
+
prepareSQLiteRecreateTable = (table4, action) => {
|
14989
|
+
const { name: name2, columns, uniqueConstraints, indexes } = table4;
|
14990
|
+
const composites = Object.values(table4.compositePrimaryKeys).map(
|
14991
|
+
(it) => SQLiteSquasher.unsquashPK(it)
|
14992
|
+
);
|
14993
|
+
const references2 = Object.values(table4.foreignKeys);
|
14994
|
+
const fks = references2.map(
|
14995
|
+
(it) => action === "push" ? SQLiteSquasher.unsquashPushFK(it) : SQLiteSquasher.unsquashFK(it)
|
14996
|
+
);
|
14997
|
+
const statements = [
|
14998
|
+
{
|
14999
|
+
type: "recreate_table",
|
15000
|
+
tableName: name2,
|
15001
|
+
columns: Object.values(columns),
|
15002
|
+
compositePKs: composites,
|
15003
|
+
referenceData: fks,
|
15004
|
+
uniqueConstraints: Object.values(uniqueConstraints)
|
15005
|
+
}
|
15006
|
+
];
|
15007
|
+
if (Object.keys(indexes).length) {
|
15008
|
+
statements.push(...prepareCreateIndexesJson(name2, "", indexes));
|
15009
|
+
}
|
15010
|
+
return statements;
|
15011
|
+
};
|
15012
|
+
libSQLCombineStatements = (statements, json2, action) => {
|
15013
|
+
const newStatements = {};
|
15014
|
+
for (const statement of statements) {
|
15015
|
+
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") {
|
15016
|
+
const tableName2 = statement.tableName;
|
15017
|
+
const statementsForTable2 = newStatements[tableName2];
|
15018
|
+
if (!statementsForTable2) {
|
15019
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15020
|
+
continue;
|
15021
|
+
}
|
15022
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15023
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15024
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15025
|
+
if (wasRename) {
|
15026
|
+
newStatements[tableName2].push(...preparedStatements);
|
15027
|
+
} else {
|
15028
|
+
newStatements[tableName2] = preparedStatements;
|
15029
|
+
}
|
15030
|
+
continue;
|
15031
|
+
}
|
15032
|
+
continue;
|
15033
|
+
}
|
15034
|
+
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") {
|
15035
|
+
const { tableName: tableName2, columnName, columnPk } = statement;
|
15036
|
+
const columnIsPartOfUniqueIndex = Object.values(
|
15037
|
+
json2.tables[tableName2].indexes
|
15038
|
+
).some((it) => {
|
15039
|
+
const unsquashIndex = SQLiteSquasher.unsquashIdx(it);
|
15040
|
+
return unsquashIndex.columns.includes(columnName) && unsquashIndex.isUnique;
|
15041
|
+
});
|
15042
|
+
const columnIsPartOfForeignKey = Object.values(
|
15043
|
+
json2.tables[tableName2].foreignKeys
|
15044
|
+
).some((it) => {
|
15045
|
+
const unsquashFk = action === "push" ? SQLiteSquasher.unsquashPushFK(it) : SQLiteSquasher.unsquashFK(it);
|
15046
|
+
return unsquashFk.columnsFrom.includes(columnName);
|
15047
|
+
});
|
15048
|
+
const statementsForTable2 = newStatements[tableName2];
|
15049
|
+
if (!statementsForTable2 && (columnIsPartOfUniqueIndex || columnIsPartOfForeignKey || columnPk)) {
|
15050
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15051
|
+
continue;
|
15052
|
+
}
|
15053
|
+
if (statementsForTable2 && (columnIsPartOfUniqueIndex || columnIsPartOfForeignKey || columnPk)) {
|
15054
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15055
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15056
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15057
|
+
if (wasRename) {
|
15058
|
+
newStatements[tableName2].push(...preparedStatements);
|
15059
|
+
} else {
|
15060
|
+
newStatements[tableName2] = preparedStatements;
|
15061
|
+
}
|
15062
|
+
}
|
15063
|
+
continue;
|
15064
|
+
}
|
15065
|
+
if (statementsForTable2 && !(columnIsPartOfUniqueIndex || columnIsPartOfForeignKey || columnPk)) {
|
15066
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15067
|
+
newStatements[tableName2].push(statement);
|
15068
|
+
}
|
15069
|
+
continue;
|
15070
|
+
}
|
15071
|
+
newStatements[tableName2] = [statement];
|
15072
|
+
continue;
|
15073
|
+
}
|
15074
|
+
if (statement.type === "create_reference") {
|
15075
|
+
const tableName2 = statement.tableName;
|
15076
|
+
const data = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
15077
|
+
const statementsForTable2 = newStatements[tableName2];
|
15078
|
+
if (!statementsForTable2) {
|
15079
|
+
newStatements[tableName2] = statement.isMulticolumn ? prepareLibSQLRecreateTable(json2.tables[tableName2], action) : newStatements[tableName2] = [statement];
|
15080
|
+
continue;
|
15081
|
+
}
|
15082
|
+
if (!statement.isMulticolumn && statementsForTable2.some(
|
15083
|
+
(st) => st.type === "sqlite_alter_table_add_column" && st.column.name === data.columnsFrom[0]
|
15084
|
+
)) {
|
15085
|
+
continue;
|
15086
|
+
}
|
15087
|
+
if (statement.isMulticolumn) {
|
15088
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15089
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15090
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15091
|
+
if (wasRename) {
|
15092
|
+
newStatements[tableName2].push(...preparedStatements);
|
15093
|
+
} else {
|
15094
|
+
newStatements[tableName2] = preparedStatements;
|
15095
|
+
}
|
15096
|
+
continue;
|
15097
|
+
}
|
15098
|
+
continue;
|
15099
|
+
}
|
15100
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15101
|
+
newStatements[tableName2].push(statement);
|
15102
|
+
}
|
15103
|
+
continue;
|
15104
|
+
}
|
15105
|
+
if (statement.type === "delete_reference") {
|
15106
|
+
const tableName2 = statement.tableName;
|
15107
|
+
const statementsForTable2 = newStatements[tableName2];
|
15108
|
+
if (!statementsForTable2) {
|
15109
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15110
|
+
continue;
|
15111
|
+
}
|
15112
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15113
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15114
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15115
|
+
if (wasRename) {
|
15116
|
+
newStatements[tableName2].push(...preparedStatements);
|
15117
|
+
} else {
|
15118
|
+
newStatements[tableName2] = preparedStatements;
|
15119
|
+
}
|
15120
|
+
continue;
|
15121
|
+
}
|
15122
|
+
continue;
|
15123
|
+
}
|
15124
|
+
if (statement.type === "sqlite_alter_table_add_column" && statement.column.primaryKey) {
|
15125
|
+
const tableName2 = statement.tableName;
|
15126
|
+
const statementsForTable2 = newStatements[tableName2];
|
15127
|
+
if (!statementsForTable2) {
|
15128
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15129
|
+
continue;
|
15130
|
+
}
|
15131
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15132
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15133
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15134
|
+
if (wasRename) {
|
15135
|
+
newStatements[tableName2].push(...preparedStatements);
|
15136
|
+
} else {
|
15137
|
+
newStatements[tableName2] = preparedStatements;
|
15138
|
+
}
|
15139
|
+
continue;
|
15140
|
+
}
|
15141
|
+
continue;
|
15142
|
+
}
|
15143
|
+
const tableName = statement.type === "rename_table" ? statement.tableNameTo : statement.tableName;
|
15144
|
+
const statementsForTable = newStatements[tableName];
|
15145
|
+
if (!statementsForTable) {
|
15146
|
+
newStatements[tableName] = [statement];
|
15147
|
+
continue;
|
15148
|
+
}
|
15149
|
+
if (!statementsForTable.some(({ type }) => type === "recreate_table")) {
|
15150
|
+
newStatements[tableName].push(statement);
|
15151
|
+
}
|
15152
|
+
}
|
15153
|
+
const combinedStatements = Object.values(newStatements).flat();
|
15154
|
+
const renamedTables = combinedStatements.filter((it) => it.type === "rename_table");
|
15155
|
+
const renamedColumns = combinedStatements.filter((it) => it.type === "alter_table_rename_column");
|
15156
|
+
const rest = combinedStatements.filter((it) => it.type !== "rename_table" && it.type !== "alter_table_rename_column");
|
15157
|
+
return [...renamedTables, ...renamedColumns, ...rest];
|
15158
|
+
};
|
15159
|
+
sqliteCombineStatements = (statements, json2, action) => {
|
15160
|
+
const newStatements = {};
|
15161
|
+
for (const statement of statements) {
|
15162
|
+
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") {
|
15163
|
+
const tableName2 = statement.tableName;
|
15164
|
+
const statementsForTable2 = newStatements[tableName2];
|
15165
|
+
if (!statementsForTable2) {
|
15166
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15167
|
+
continue;
|
15168
|
+
}
|
15169
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15170
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15171
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15172
|
+
if (wasRename) {
|
15173
|
+
newStatements[tableName2].push(...preparedStatements);
|
15174
|
+
} else {
|
15175
|
+
newStatements[tableName2] = preparedStatements;
|
15176
|
+
}
|
15177
|
+
continue;
|
15178
|
+
}
|
15179
|
+
continue;
|
15180
|
+
}
|
15181
|
+
if (statement.type === "sqlite_alter_table_add_column" && statement.column.primaryKey) {
|
15182
|
+
const tableName2 = statement.tableName;
|
15183
|
+
const statementsForTable2 = newStatements[tableName2];
|
15184
|
+
if (!statementsForTable2) {
|
15185
|
+
newStatements[tableName2] = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15186
|
+
continue;
|
15187
|
+
}
|
15188
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15189
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15190
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15191
|
+
if (wasRename) {
|
15192
|
+
newStatements[tableName2].push(...preparedStatements);
|
15193
|
+
} else {
|
15194
|
+
newStatements[tableName2] = preparedStatements;
|
15195
|
+
}
|
15196
|
+
continue;
|
15197
|
+
}
|
15198
|
+
continue;
|
15199
|
+
}
|
15200
|
+
if (statement.type === "create_reference") {
|
15201
|
+
const tableName2 = statement.tableName;
|
15202
|
+
const data = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
15203
|
+
const statementsForTable2 = newStatements[tableName2];
|
15204
|
+
if (!statementsForTable2) {
|
15205
|
+
newStatements[tableName2] = prepareSQLiteRecreateTable(json2.tables[tableName2], action);
|
15206
|
+
continue;
|
15207
|
+
}
|
15208
|
+
if (data.columnsFrom.length === 1 && statementsForTable2.some(
|
15209
|
+
(st) => st.type === "sqlite_alter_table_add_column" && st.column.name === data.columnsFrom[0]
|
15210
|
+
)) {
|
15211
|
+
continue;
|
15212
|
+
}
|
15213
|
+
if (!statementsForTable2.some(({ type }) => type === "recreate_table")) {
|
15214
|
+
const wasRename = statementsForTable2.some(({ type }) => type === "rename_table");
|
15215
|
+
const preparedStatements = prepareLibSQLRecreateTable(json2.tables[tableName2], action);
|
15216
|
+
if (wasRename) {
|
15217
|
+
newStatements[tableName2].push(...preparedStatements);
|
15218
|
+
} else {
|
15219
|
+
newStatements[tableName2] = preparedStatements;
|
15220
|
+
}
|
15221
|
+
continue;
|
15222
|
+
}
|
15223
|
+
continue;
|
15224
|
+
}
|
15225
|
+
const tableName = statement.type === "rename_table" ? statement.tableNameTo : statement.tableName;
|
15226
|
+
const statementsForTable = newStatements[tableName];
|
15227
|
+
if (!statementsForTable) {
|
15228
|
+
newStatements[tableName] = [statement];
|
15229
|
+
continue;
|
15230
|
+
}
|
15231
|
+
if (!statementsForTable.some(({ type }) => type === "recreate_table")) {
|
15232
|
+
newStatements[tableName].push(statement);
|
15233
|
+
}
|
15234
|
+
}
|
15235
|
+
const combinedStatements = Object.values(newStatements).flat();
|
15236
|
+
const renamedTables = combinedStatements.filter((it) => it.type === "rename_table");
|
15237
|
+
const renamedColumns = combinedStatements.filter((it) => it.type === "alter_table_rename_column");
|
15238
|
+
const rest = combinedStatements.filter((it) => it.type !== "rename_table" && it.type !== "alter_table_rename_column");
|
15239
|
+
return [...renamedTables, ...renamedColumns, ...rest];
|
15240
|
+
};
|
15241
|
+
}
|
15242
|
+
});
|
15243
|
+
|
14429
15244
|
// src/snapshotsDiffer.ts
|
14430
15245
|
var snapshotsDiffer_exports = {};
|
14431
15246
|
__export(snapshotsDiffer_exports, {
|
14432
15247
|
alteredTableScheme: () => alteredTableScheme,
|
15248
|
+
applyLibSQLSnapshotsDiff: () => applyLibSQLSnapshotsDiff,
|
14433
15249
|
applyMysqlSnapshotsDiff: () => applyMysqlSnapshotsDiff,
|
14434
15250
|
applyPgSnapshotsDiff: () => applyPgSnapshotsDiff,
|
14435
15251
|
applySqliteSnapshotsDiff: () => applySqliteSnapshotsDiff,
|
@@ -14439,7 +15255,7 @@ __export(snapshotsDiffer_exports, {
|
|
14439
15255
|
makePatched: () => makePatched,
|
14440
15256
|
makeSelfOrPatched: () => makeSelfOrPatched
|
14441
15257
|
});
|
14442
|
-
var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema, alteredColumnSchema, enumSchema2, changedEnumSchema, tableScheme, alteredTableScheme, diffResultScheme, diffResultSchemeMysql, diffResultSchemeSQLite, schemaChangeFor, nameChangeFor, nameSchemaChangeFor, columnChangeFor, applyPgSnapshotsDiff, applyMysqlSnapshotsDiff, applySqliteSnapshotsDiff;
|
15258
|
+
var makeChanged, makeSelfOrChanged, makePatched, makeSelfOrPatched, columnSchema, alteredColumnSchema, enumSchema2, changedEnumSchema, tableScheme, alteredTableScheme, diffResultScheme, diffResultSchemeMysql, diffResultSchemeSQLite, schemaChangeFor, nameChangeFor, nameSchemaChangeFor, columnChangeFor, applyPgSnapshotsDiff, applyMysqlSnapshotsDiff, applySqliteSnapshotsDiff, applyLibSQLSnapshotsDiff;
|
14443
15259
|
var init_snapshotsDiffer = __esm({
|
14444
15260
|
"src/snapshotsDiffer.ts"() {
|
14445
15261
|
"use strict";
|
@@ -14451,6 +15267,7 @@ var init_snapshotsDiffer = __esm({
|
|
14451
15267
|
init_mysqlSchema();
|
14452
15268
|
init_pgSchema();
|
14453
15269
|
init_sqliteSchema();
|
15270
|
+
init_statementCombiner();
|
14454
15271
|
init_utils();
|
14455
15272
|
makeChanged = (schema4) => {
|
14456
15273
|
return objectType({
|
@@ -15368,9 +16185,308 @@ var init_snapshotsDiffer = __esm({
|
|
15368
16185
|
);
|
15369
16186
|
alteredCompositePKs = prepareAlterCompositePrimaryKeyMySql(
|
15370
16187
|
it.name,
|
15371
|
-
it.alteredCompositePKs,
|
15372
|
-
prevFull,
|
15373
|
-
curFull
|
16188
|
+
it.alteredCompositePKs,
|
16189
|
+
prevFull,
|
16190
|
+
curFull
|
16191
|
+
);
|
16192
|
+
let addedUniqueConstraints = [];
|
16193
|
+
let deletedUniqueConstraints = [];
|
16194
|
+
let alteredUniqueConstraints = [];
|
16195
|
+
addedUniqueConstraints = prepareAddUniqueConstraintPg(
|
16196
|
+
it.name,
|
16197
|
+
it.schema,
|
16198
|
+
it.addedUniqueConstraints
|
16199
|
+
);
|
16200
|
+
deletedUniqueConstraints = prepareDeleteUniqueConstraintPg(
|
16201
|
+
it.name,
|
16202
|
+
it.schema,
|
16203
|
+
it.deletedUniqueConstraints
|
16204
|
+
);
|
16205
|
+
if (it.alteredUniqueConstraints) {
|
16206
|
+
const added = {};
|
16207
|
+
const deleted = {};
|
16208
|
+
for (const k of Object.keys(it.alteredUniqueConstraints)) {
|
16209
|
+
added[k] = it.alteredUniqueConstraints[k].__new;
|
16210
|
+
deleted[k] = it.alteredUniqueConstraints[k].__old;
|
16211
|
+
}
|
16212
|
+
addedUniqueConstraints.push(
|
16213
|
+
...prepareAddUniqueConstraintPg(it.name, it.schema, added)
|
16214
|
+
);
|
16215
|
+
deletedUniqueConstraints.push(
|
16216
|
+
...prepareDeleteUniqueConstraintPg(it.name, it.schema, deleted)
|
16217
|
+
);
|
16218
|
+
}
|
16219
|
+
jsonAddedCompositePKs.push(...addedCompositePKs);
|
16220
|
+
jsonDeletedCompositePKs.push(...deletedCompositePKs);
|
16221
|
+
jsonAlteredCompositePKs.push(...alteredCompositePKs);
|
16222
|
+
jsonAddedUniqueConstraints.push(...addedUniqueConstraints);
|
16223
|
+
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
16224
|
+
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
16225
|
+
});
|
16226
|
+
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
16227
|
+
const tableName = it.tableName;
|
16228
|
+
const schema4 = it.schema;
|
16229
|
+
return {
|
16230
|
+
from: { schema: schema4, table: tableName, column: it.oldColumnName },
|
16231
|
+
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
16232
|
+
};
|
16233
|
+
});
|
16234
|
+
const jsonTableAlternations = alteredTables.map((it) => {
|
16235
|
+
return prepareAlterColumnsMysql(
|
16236
|
+
it.name,
|
16237
|
+
it.schema,
|
16238
|
+
it.altered,
|
16239
|
+
json1,
|
16240
|
+
json2,
|
16241
|
+
action
|
16242
|
+
);
|
16243
|
+
}).flat();
|
16244
|
+
const jsonCreateIndexesForAllAlteredTables = alteredTables.map((it) => {
|
16245
|
+
return prepareCreateIndexesJson(
|
16246
|
+
it.name,
|
16247
|
+
it.schema,
|
16248
|
+
it.addedIndexes || {},
|
16249
|
+
curFull.internal
|
16250
|
+
);
|
16251
|
+
}).flat();
|
16252
|
+
const jsonDropIndexesForAllAlteredTables = alteredTables.map((it) => {
|
16253
|
+
return prepareDropIndexesJson(
|
16254
|
+
it.name,
|
16255
|
+
it.schema,
|
16256
|
+
it.deletedIndexes || {}
|
16257
|
+
);
|
16258
|
+
}).flat();
|
16259
|
+
alteredTables.forEach((it) => {
|
16260
|
+
const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
|
16261
|
+
(current, item) => {
|
16262
|
+
current[item] = it.alteredIndexes[item].__old;
|
16263
|
+
return current;
|
16264
|
+
},
|
16265
|
+
{}
|
16266
|
+
);
|
16267
|
+
const createdIndexes = Object.keys(it.alteredIndexes).reduce(
|
16268
|
+
(current, item) => {
|
16269
|
+
current[item] = it.alteredIndexes[item].__new;
|
16270
|
+
return current;
|
16271
|
+
},
|
16272
|
+
{}
|
16273
|
+
);
|
16274
|
+
jsonCreateIndexesForAllAlteredTables.push(
|
16275
|
+
...prepareCreateIndexesJson(it.name, it.schema, createdIndexes || {})
|
16276
|
+
);
|
16277
|
+
jsonDropIndexesForAllAlteredTables.push(
|
16278
|
+
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
16279
|
+
);
|
16280
|
+
});
|
16281
|
+
const jsonCreateReferencesForCreatedTables = createdTables.map((it) => {
|
16282
|
+
return prepareCreateReferencesJson(it.name, it.schema, it.foreignKeys);
|
16283
|
+
}).flat();
|
16284
|
+
const jsonReferencesForAllAlteredTables = alteredTables.map((it) => {
|
16285
|
+
const forAdded = prepareCreateReferencesJson(
|
16286
|
+
it.name,
|
16287
|
+
it.schema,
|
16288
|
+
it.addedForeignKeys
|
16289
|
+
);
|
16290
|
+
const forAltered = prepareDropReferencesJson(
|
16291
|
+
it.name,
|
16292
|
+
it.schema,
|
16293
|
+
it.deletedForeignKeys
|
16294
|
+
);
|
16295
|
+
const alteredFKs = prepareAlterReferencesJson(
|
16296
|
+
it.name,
|
16297
|
+
it.schema,
|
16298
|
+
it.alteredForeignKeys
|
16299
|
+
);
|
16300
|
+
return [...forAdded, ...forAltered, ...alteredFKs];
|
16301
|
+
}).flat();
|
16302
|
+
const jsonCreatedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
16303
|
+
(t) => t.type === "create_reference"
|
16304
|
+
);
|
16305
|
+
const jsonDroppedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
16306
|
+
(t) => t.type === "delete_reference"
|
16307
|
+
);
|
16308
|
+
const jsonMySqlCreateTables = createdTables.map((it) => {
|
16309
|
+
return prepareMySqlCreateTableJson(
|
16310
|
+
it,
|
16311
|
+
curFull,
|
16312
|
+
curFull.internal
|
16313
|
+
);
|
16314
|
+
});
|
16315
|
+
jsonStatements.push(...jsonMySqlCreateTables);
|
16316
|
+
jsonStatements.push(...jsonDropTables);
|
16317
|
+
jsonStatements.push(...jsonRenameTables);
|
16318
|
+
jsonStatements.push(...jsonRenameColumnsStatements);
|
16319
|
+
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
16320
|
+
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
16321
|
+
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
16322
|
+
jsonStatements.push(...jsonDeletedCompositePKs);
|
16323
|
+
jsonStatements.push(...jsonTableAlternations);
|
16324
|
+
jsonStatements.push(...jsonAddedCompositePKs);
|
16325
|
+
jsonStatements.push(...jsonAddedUniqueConstraints);
|
16326
|
+
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
16327
|
+
jsonStatements.push(...jsonAddColumnsStatemets);
|
16328
|
+
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
16329
|
+
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
16330
|
+
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
16331
|
+
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
16332
|
+
jsonStatements.push(...jsonDropColumnsStatemets);
|
16333
|
+
jsonStatements.push(...jsonAlteredCompositePKs);
|
16334
|
+
jsonStatements.push(...jsonAddedUniqueConstraints);
|
16335
|
+
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
16336
|
+
const sqlStatements = fromJson(jsonStatements, "mysql");
|
16337
|
+
const uniqueSqlStatements = [];
|
16338
|
+
sqlStatements.forEach((ss) => {
|
16339
|
+
if (!uniqueSqlStatements.includes(ss)) {
|
16340
|
+
uniqueSqlStatements.push(ss);
|
16341
|
+
}
|
16342
|
+
});
|
16343
|
+
const rTables = renamedTables.map((it) => {
|
16344
|
+
return { from: it.from, to: it.to };
|
16345
|
+
});
|
16346
|
+
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
16347
|
+
return {
|
16348
|
+
statements: jsonStatements,
|
16349
|
+
sqlStatements: uniqueSqlStatements,
|
16350
|
+
_meta
|
16351
|
+
};
|
16352
|
+
};
|
16353
|
+
applySqliteSnapshotsDiff = async (json1, json2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
|
16354
|
+
const tablesDiff = diffSchemasOrTables(json1.tables, json2.tables);
|
16355
|
+
const {
|
16356
|
+
created: createdTables,
|
16357
|
+
deleted: deletedTables,
|
16358
|
+
renamed: renamedTables
|
16359
|
+
} = await tablesResolver2({
|
16360
|
+
created: tablesDiff.added,
|
16361
|
+
deleted: tablesDiff.deleted
|
16362
|
+
});
|
16363
|
+
const tablesPatchedSnap1 = copy(json1);
|
16364
|
+
tablesPatchedSnap1.tables = mapEntries(tablesPatchedSnap1.tables, (_2, it) => {
|
16365
|
+
const { name: name2 } = nameChangeFor(it, renamedTables);
|
16366
|
+
it.name = name2;
|
16367
|
+
return [name2, it];
|
16368
|
+
});
|
16369
|
+
const res = diffColumns(tablesPatchedSnap1.tables, json2.tables);
|
16370
|
+
const columnRenames = [];
|
16371
|
+
const columnCreates = [];
|
16372
|
+
const columnDeletes = [];
|
16373
|
+
for (let entry of Object.values(res)) {
|
16374
|
+
const { renamed, created, deleted } = await columnsResolver2({
|
16375
|
+
tableName: entry.name,
|
16376
|
+
schema: entry.schema,
|
16377
|
+
deleted: entry.columns.deleted,
|
16378
|
+
created: entry.columns.added
|
16379
|
+
});
|
16380
|
+
if (created.length > 0) {
|
16381
|
+
columnCreates.push({
|
16382
|
+
table: entry.name,
|
16383
|
+
columns: created
|
16384
|
+
});
|
16385
|
+
}
|
16386
|
+
if (deleted.length > 0) {
|
16387
|
+
columnDeletes.push({
|
16388
|
+
table: entry.name,
|
16389
|
+
columns: deleted
|
16390
|
+
});
|
16391
|
+
}
|
16392
|
+
if (renamed.length > 0) {
|
16393
|
+
columnRenames.push({
|
16394
|
+
table: entry.name,
|
16395
|
+
renames: renamed
|
16396
|
+
});
|
16397
|
+
}
|
16398
|
+
}
|
16399
|
+
const columnRenamesDict = columnRenames.reduce(
|
16400
|
+
(acc, it) => {
|
16401
|
+
acc[it.table] = it.renames;
|
16402
|
+
return acc;
|
16403
|
+
},
|
16404
|
+
{}
|
16405
|
+
);
|
16406
|
+
const columnsPatchedSnap1 = copy(tablesPatchedSnap1);
|
16407
|
+
columnsPatchedSnap1.tables = mapEntries(
|
16408
|
+
columnsPatchedSnap1.tables,
|
16409
|
+
(tableKey2, tableValue) => {
|
16410
|
+
const patchedColumns = mapKeys(
|
16411
|
+
tableValue.columns,
|
16412
|
+
(columnKey, column4) => {
|
16413
|
+
const rens = columnRenamesDict[tableValue.name] || [];
|
16414
|
+
const newName = columnChangeFor(columnKey, rens);
|
16415
|
+
column4.name = newName;
|
16416
|
+
return newName;
|
16417
|
+
}
|
16418
|
+
);
|
16419
|
+
tableValue.columns = patchedColumns;
|
16420
|
+
return [tableKey2, tableValue];
|
16421
|
+
}
|
16422
|
+
);
|
16423
|
+
const diffResult = applyJsonDiff(columnsPatchedSnap1, json2);
|
16424
|
+
const typedResult = diffResultSchemeSQLite.parse(diffResult);
|
16425
|
+
const tablesMap = {};
|
16426
|
+
typedResult.alteredTablesWithColumns.forEach((obj) => {
|
16427
|
+
tablesMap[obj.name] = obj;
|
16428
|
+
});
|
16429
|
+
const jsonCreateTables = createdTables.map((it) => {
|
16430
|
+
return prepareSQLiteCreateTable(it, action);
|
16431
|
+
});
|
16432
|
+
const jsonCreateIndexesForCreatedTables = createdTables.map((it) => {
|
16433
|
+
return prepareCreateIndexesJson(
|
16434
|
+
it.name,
|
16435
|
+
it.schema,
|
16436
|
+
it.indexes,
|
16437
|
+
curFull.internal
|
16438
|
+
);
|
16439
|
+
}).flat();
|
16440
|
+
const jsonDropTables = deletedTables.map((it) => {
|
16441
|
+
return prepareDropTableJson(it);
|
16442
|
+
});
|
16443
|
+
const jsonRenameTables = renamedTables.map((it) => {
|
16444
|
+
return prepareRenameTableJson(it.from, it.to);
|
16445
|
+
});
|
16446
|
+
const jsonRenameColumnsStatements = columnRenames.map((it) => prepareRenameColumns(it.table, "", it.renames)).flat();
|
16447
|
+
const jsonDropColumnsStatemets = columnDeletes.map((it) => _prepareDropColumns(it.table, "", it.columns)).flat();
|
16448
|
+
const jsonAddColumnsStatemets = columnCreates.map((it) => {
|
16449
|
+
return _prepareSqliteAddColumns(
|
16450
|
+
it.table,
|
16451
|
+
it.columns,
|
16452
|
+
tablesMap[it.table] && tablesMap[it.table].addedForeignKeys ? Object.values(tablesMap[it.table].addedForeignKeys) : []
|
16453
|
+
);
|
16454
|
+
}).flat();
|
16455
|
+
const allAltered = typedResult.alteredTablesWithColumns;
|
16456
|
+
const jsonAddedCompositePKs = [];
|
16457
|
+
const jsonDeletedCompositePKs = [];
|
16458
|
+
const jsonAlteredCompositePKs = [];
|
16459
|
+
const jsonAddedUniqueConstraints = [];
|
16460
|
+
const jsonDeletedUniqueConstraints = [];
|
16461
|
+
const jsonAlteredUniqueConstraints = [];
|
16462
|
+
allAltered.forEach((it) => {
|
16463
|
+
let addedColumns = [];
|
16464
|
+
for (const addedPkName of Object.keys(it.addedCompositePKs)) {
|
16465
|
+
const addedPkColumns = it.addedCompositePKs[addedPkName];
|
16466
|
+
addedColumns = SQLiteSquasher.unsquashPK(addedPkColumns);
|
16467
|
+
}
|
16468
|
+
let deletedColumns = [];
|
16469
|
+
for (const deletedPkName of Object.keys(it.deletedCompositePKs)) {
|
16470
|
+
const deletedPkColumns = it.deletedCompositePKs[deletedPkName];
|
16471
|
+
deletedColumns = SQLiteSquasher.unsquashPK(deletedPkColumns);
|
16472
|
+
}
|
16473
|
+
const doPerformDeleteAndCreate = JSON.stringify(addedColumns) !== JSON.stringify(deletedColumns);
|
16474
|
+
let addedCompositePKs = [];
|
16475
|
+
let deletedCompositePKs = [];
|
16476
|
+
let alteredCompositePKs = [];
|
16477
|
+
if (doPerformDeleteAndCreate) {
|
16478
|
+
addedCompositePKs = prepareAddCompositePrimaryKeySqlite(
|
16479
|
+
it.name,
|
16480
|
+
it.addedCompositePKs
|
16481
|
+
);
|
16482
|
+
deletedCompositePKs = prepareDeleteCompositePrimaryKeySqlite(
|
16483
|
+
it.name,
|
16484
|
+
it.deletedCompositePKs
|
16485
|
+
);
|
16486
|
+
}
|
16487
|
+
alteredCompositePKs = prepareAlterCompositePrimaryKeySqlite(
|
16488
|
+
it.name,
|
16489
|
+
it.alteredCompositePKs
|
15374
16490
|
);
|
15375
16491
|
let addedUniqueConstraints = [];
|
15376
16492
|
let deletedUniqueConstraints = [];
|
@@ -15414,17 +16530,10 @@ var init_snapshotsDiffer = __esm({
|
|
15414
16530
|
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
15415
16531
|
};
|
15416
16532
|
});
|
15417
|
-
const jsonTableAlternations =
|
15418
|
-
return
|
15419
|
-
it.name,
|
15420
|
-
it.schema,
|
15421
|
-
it.altered,
|
15422
|
-
json1,
|
15423
|
-
json2,
|
15424
|
-
action
|
15425
|
-
);
|
16533
|
+
const jsonTableAlternations = allAltered.map((it) => {
|
16534
|
+
return prepareSqliteAlterColumns(it.name, it.schema, it.altered, json2);
|
15426
16535
|
}).flat();
|
15427
|
-
const jsonCreateIndexesForAllAlteredTables =
|
16536
|
+
const jsonCreateIndexesForAllAlteredTables = allAltered.map((it) => {
|
15428
16537
|
return prepareCreateIndexesJson(
|
15429
16538
|
it.name,
|
15430
16539
|
it.schema,
|
@@ -15432,14 +16541,14 @@ var init_snapshotsDiffer = __esm({
|
|
15432
16541
|
curFull.internal
|
15433
16542
|
);
|
15434
16543
|
}).flat();
|
15435
|
-
const jsonDropIndexesForAllAlteredTables =
|
16544
|
+
const jsonDropIndexesForAllAlteredTables = allAltered.map((it) => {
|
15436
16545
|
return prepareDropIndexesJson(
|
15437
16546
|
it.name,
|
15438
16547
|
it.schema,
|
15439
16548
|
it.deletedIndexes || {}
|
15440
16549
|
);
|
15441
16550
|
}).flat();
|
15442
|
-
|
16551
|
+
allAltered.forEach((it) => {
|
15443
16552
|
const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
|
15444
16553
|
(current, item) => {
|
15445
16554
|
current[item] = it.alteredIndexes[item].__old;
|
@@ -15455,16 +16564,18 @@ var init_snapshotsDiffer = __esm({
|
|
15455
16564
|
{}
|
15456
16565
|
);
|
15457
16566
|
jsonCreateIndexesForAllAlteredTables.push(
|
15458
|
-
...prepareCreateIndexesJson(
|
16567
|
+
...prepareCreateIndexesJson(
|
16568
|
+
it.name,
|
16569
|
+
it.schema,
|
16570
|
+
createdIndexes || {},
|
16571
|
+
curFull.internal
|
16572
|
+
)
|
15459
16573
|
);
|
15460
16574
|
jsonDropIndexesForAllAlteredTables.push(
|
15461
16575
|
...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
|
15462
16576
|
);
|
15463
16577
|
});
|
15464
|
-
const
|
15465
|
-
return prepareCreateReferencesJson(it.name, it.schema, it.foreignKeys);
|
15466
|
-
}).flat();
|
15467
|
-
const jsonReferencesForAllAlteredTables = alteredTables.map((it) => {
|
16578
|
+
const jsonReferencesForAllAlteredTables = allAltered.map((it) => {
|
15468
16579
|
const forAdded = prepareCreateReferencesJson(
|
15469
16580
|
it.name,
|
15470
16581
|
it.schema,
|
@@ -15488,35 +16599,25 @@ var init_snapshotsDiffer = __esm({
|
|
15488
16599
|
const jsonDroppedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
15489
16600
|
(t) => t.type === "delete_reference"
|
15490
16601
|
);
|
15491
|
-
const
|
15492
|
-
|
15493
|
-
it,
|
15494
|
-
curFull,
|
15495
|
-
curFull.internal
|
15496
|
-
);
|
15497
|
-
});
|
15498
|
-
jsonStatements.push(...jsonMySqlCreateTables);
|
16602
|
+
const jsonStatements = [];
|
16603
|
+
jsonStatements.push(...jsonCreateTables);
|
15499
16604
|
jsonStatements.push(...jsonDropTables);
|
15500
16605
|
jsonStatements.push(...jsonRenameTables);
|
15501
16606
|
jsonStatements.push(...jsonRenameColumnsStatements);
|
15502
|
-
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
15503
16607
|
jsonStatements.push(...jsonDroppedReferencesForAlteredTables);
|
15504
16608
|
jsonStatements.push(...jsonDropIndexesForAllAlteredTables);
|
15505
16609
|
jsonStatements.push(...jsonDeletedCompositePKs);
|
15506
16610
|
jsonStatements.push(...jsonTableAlternations);
|
15507
16611
|
jsonStatements.push(...jsonAddedCompositePKs);
|
15508
|
-
jsonStatements.push(...jsonAddedUniqueConstraints);
|
15509
|
-
jsonStatements.push(...jsonDeletedUniqueConstraints);
|
15510
16612
|
jsonStatements.push(...jsonAddColumnsStatemets);
|
15511
|
-
jsonStatements.push(...jsonCreateReferencesForCreatedTables);
|
15512
16613
|
jsonStatements.push(...jsonCreateIndexesForCreatedTables);
|
15513
|
-
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
15514
16614
|
jsonStatements.push(...jsonCreateIndexesForAllAlteredTables);
|
16615
|
+
jsonStatements.push(...jsonCreatedReferencesForAlteredTables);
|
15515
16616
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
15516
16617
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
15517
|
-
jsonStatements.push(...jsonAddedUniqueConstraints);
|
15518
16618
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
15519
|
-
const
|
16619
|
+
const combinedJsonStatements = sqliteCombineStatements(jsonStatements, json2, action);
|
16620
|
+
const sqlStatements = fromJson(combinedJsonStatements, "sqlite");
|
15520
16621
|
const uniqueSqlStatements = [];
|
15521
16622
|
sqlStatements.forEach((ss) => {
|
15522
16623
|
if (!uniqueSqlStatements.includes(ss)) {
|
@@ -15528,12 +16629,12 @@ var init_snapshotsDiffer = __esm({
|
|
15528
16629
|
});
|
15529
16630
|
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
15530
16631
|
return {
|
15531
|
-
statements:
|
16632
|
+
statements: combinedJsonStatements,
|
15532
16633
|
sqlStatements: uniqueSqlStatements,
|
15533
16634
|
_meta
|
15534
16635
|
};
|
15535
16636
|
};
|
15536
|
-
|
16637
|
+
applyLibSQLSnapshotsDiff = async (json1, json2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
|
15537
16638
|
const tablesDiff = diffSchemasOrTables(json1.tables, json2.tables);
|
15538
16639
|
const {
|
15539
16640
|
created: createdTables,
|
@@ -15635,6 +16736,18 @@ var init_snapshotsDiffer = __esm({
|
|
15635
16736
|
tablesMap[it.table] && tablesMap[it.table].addedForeignKeys ? Object.values(tablesMap[it.table].addedForeignKeys) : []
|
15636
16737
|
);
|
15637
16738
|
}).flat();
|
16739
|
+
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
16740
|
+
const tableName = it.tableName;
|
16741
|
+
const schema4 = it.schema;
|
16742
|
+
return {
|
16743
|
+
from: { schema: schema4, table: tableName, column: it.oldColumnName },
|
16744
|
+
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
16745
|
+
};
|
16746
|
+
});
|
16747
|
+
const rTables = renamedTables.map((it) => {
|
16748
|
+
return { from: it.from, to: it.to };
|
16749
|
+
});
|
16750
|
+
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
15638
16751
|
const allAltered = typedResult.alteredTablesWithColumns;
|
15639
16752
|
const jsonAddedCompositePKs = [];
|
15640
16753
|
const jsonDeletedCompositePKs = [];
|
@@ -15705,14 +16818,6 @@ var init_snapshotsDiffer = __esm({
|
|
15705
16818
|
jsonDeletedUniqueConstraints.push(...deletedUniqueConstraints);
|
15706
16819
|
jsonAlteredUniqueConstraints.push(...alteredUniqueConstraints);
|
15707
16820
|
});
|
15708
|
-
const rColumns = jsonRenameColumnsStatements.map((it) => {
|
15709
|
-
const tableName = it.tableName;
|
15710
|
-
const schema4 = it.schema;
|
15711
|
-
return {
|
15712
|
-
from: { schema: schema4, table: tableName, column: it.oldColumnName },
|
15713
|
-
to: { schema: schema4, table: tableName, column: it.newColumnName }
|
15714
|
-
};
|
15715
|
-
});
|
15716
16821
|
const jsonTableAlternations = allAltered.map((it) => {
|
15717
16822
|
return prepareSqliteAlterColumns(it.name, it.schema, it.altered, json2);
|
15718
16823
|
}).flat();
|
@@ -15759,21 +16864,22 @@ var init_snapshotsDiffer = __esm({
|
|
15759
16864
|
);
|
15760
16865
|
});
|
15761
16866
|
const jsonReferencesForAllAlteredTables = allAltered.map((it) => {
|
15762
|
-
const forAdded =
|
15763
|
-
it.name,
|
15764
|
-
it.schema,
|
15765
|
-
it.addedForeignKeys
|
15766
|
-
);
|
15767
|
-
const forAltered = prepareDropReferencesJson(
|
16867
|
+
const forAdded = prepareLibSQLCreateReferencesJson(
|
15768
16868
|
it.name,
|
15769
16869
|
it.schema,
|
15770
|
-
it.
|
16870
|
+
it.addedForeignKeys,
|
16871
|
+
json2,
|
16872
|
+
action
|
15771
16873
|
);
|
15772
|
-
const
|
16874
|
+
const forAltered = prepareLibSQLDropReferencesJson(
|
15773
16875
|
it.name,
|
15774
16876
|
it.schema,
|
15775
|
-
it.
|
16877
|
+
it.deletedForeignKeys,
|
16878
|
+
json2,
|
16879
|
+
_meta,
|
16880
|
+
action
|
15776
16881
|
);
|
16882
|
+
const alteredFKs = prepareAlterReferencesJson(it.name, it.schema, it.alteredForeignKeys);
|
15777
16883
|
return [...forAdded, ...forAltered, ...alteredFKs];
|
15778
16884
|
}).flat();
|
15779
16885
|
const jsonCreatedReferencesForAlteredTables = jsonReferencesForAllAlteredTables.filter(
|
@@ -15799,19 +16905,22 @@ var init_snapshotsDiffer = __esm({
|
|
15799
16905
|
jsonStatements.push(...jsonDropColumnsStatemets);
|
15800
16906
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
15801
16907
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
15802
|
-
const
|
16908
|
+
const combinedJsonStatements = libSQLCombineStatements(jsonStatements, json2, action);
|
16909
|
+
const sqlStatements = fromJson(
|
16910
|
+
combinedJsonStatements,
|
16911
|
+
"sqlite",
|
16912
|
+
action,
|
16913
|
+
"turso",
|
16914
|
+
json2
|
16915
|
+
);
|
15803
16916
|
const uniqueSqlStatements = [];
|
15804
16917
|
sqlStatements.forEach((ss) => {
|
15805
16918
|
if (!uniqueSqlStatements.includes(ss)) {
|
15806
16919
|
uniqueSqlStatements.push(ss);
|
15807
16920
|
}
|
15808
16921
|
});
|
15809
|
-
const rTables = renamedTables.map((it) => {
|
15810
|
-
return { from: it.from, to: it.to };
|
15811
|
-
});
|
15812
|
-
const _meta = prepareMigrationMeta([], rTables, rColumns);
|
15813
16922
|
return {
|
15814
|
-
statements:
|
16923
|
+
statements: combinedJsonStatements,
|
15815
16924
|
sqlStatements: uniqueSqlStatements,
|
15816
16925
|
_meta
|
15817
16926
|
};
|
@@ -17277,7 +18386,7 @@ var init_mjs = __esm({
|
|
17277
18386
|
}
|
17278
18387
|
});
|
17279
18388
|
|
17280
|
-
// ../
|
18389
|
+
// ../drizzle-orm/dist/entity.js
|
17281
18390
|
function is(value, type) {
|
17282
18391
|
if (!value || typeof value !== "object") {
|
17283
18392
|
return false;
|
@@ -17303,17 +18412,17 @@ function is(value, type) {
|
|
17303
18412
|
}
|
17304
18413
|
var entityKind, hasOwnEntityKind;
|
17305
18414
|
var init_entity = __esm({
|
17306
|
-
"../
|
18415
|
+
"../drizzle-orm/dist/entity.js"() {
|
17307
18416
|
"use strict";
|
17308
18417
|
entityKind = Symbol.for("drizzle:entityKind");
|
17309
18418
|
hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
17310
18419
|
}
|
17311
18420
|
});
|
17312
18421
|
|
17313
|
-
// ../
|
18422
|
+
// ../drizzle-orm/dist/column.js
|
17314
18423
|
var _a, Column2;
|
17315
18424
|
var init_column = __esm({
|
17316
|
-
"../
|
18425
|
+
"../drizzle-orm/dist/column.js"() {
|
17317
18426
|
"use strict";
|
17318
18427
|
init_entity();
|
17319
18428
|
_a = entityKind;
|
@@ -17367,10 +18476,10 @@ var init_column = __esm({
|
|
17367
18476
|
}
|
17368
18477
|
});
|
17369
18478
|
|
17370
|
-
// ../
|
18479
|
+
// ../drizzle-orm/dist/column-builder.js
|
17371
18480
|
var _a2, ColumnBuilder;
|
17372
18481
|
var init_column_builder = __esm({
|
17373
|
-
"../
|
18482
|
+
"../drizzle-orm/dist/column-builder.js"() {
|
17374
18483
|
"use strict";
|
17375
18484
|
init_entity();
|
17376
18485
|
_a2 = entityKind;
|
@@ -17472,7 +18581,7 @@ var init_column_builder = __esm({
|
|
17472
18581
|
}
|
17473
18582
|
});
|
17474
18583
|
|
17475
|
-
// ../
|
18584
|
+
// ../drizzle-orm/dist/table.js
|
17476
18585
|
function isTable(table4) {
|
17477
18586
|
return typeof table4 === "object" && table4 !== null && IsDrizzleTable in table4;
|
17478
18587
|
}
|
@@ -17482,9 +18591,9 @@ function getTableName(table4) {
|
|
17482
18591
|
function getTableUniqueName(table4) {
|
17483
18592
|
return `${table4[Schema] ?? "public"}.${table4[TableName]}`;
|
17484
18593
|
}
|
17485
|
-
var TableName, Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a3, _b, _c, _d, _e, _f, _g, _h, _i, Table2;
|
18594
|
+
var TableName, Schema, Columns, ExtraConfigColumns, OriginalName, BaseName, IsAlias, ExtraConfigBuilder, IsDrizzleTable, _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, Table2;
|
17486
18595
|
var init_table = __esm({
|
17487
|
-
"../
|
18596
|
+
"../drizzle-orm/dist/table.js"() {
|
17488
18597
|
"use strict";
|
17489
18598
|
init_entity();
|
17490
18599
|
TableName = Symbol.for("drizzle:Name");
|
@@ -17496,32 +18605,34 @@ var init_table = __esm({
|
|
17496
18605
|
IsAlias = Symbol.for("drizzle:IsAlias");
|
17497
18606
|
ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
17498
18607
|
IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
17499
|
-
|
18608
|
+
_j = entityKind, _i = TableName, _h = OriginalName, _g = Schema, _f = Columns, _e = ExtraConfigColumns, _d = BaseName, _c = IsAlias, _b = IsDrizzleTable, _a3 = ExtraConfigBuilder;
|
17500
18609
|
Table2 = class {
|
17501
18610
|
constructor(name2, schema4, baseName) {
|
17502
18611
|
/**
|
17503
18612
|
* @internal
|
17504
18613
|
* Can be changed if the table is aliased.
|
17505
18614
|
*/
|
17506
|
-
__publicField(this,
|
18615
|
+
__publicField(this, _i);
|
17507
18616
|
/**
|
17508
18617
|
* @internal
|
17509
18618
|
* Used to store the original name of the table, before any aliasing.
|
17510
18619
|
*/
|
18620
|
+
__publicField(this, _h);
|
18621
|
+
/** @internal */
|
17511
18622
|
__publicField(this, _g);
|
17512
18623
|
/** @internal */
|
17513
18624
|
__publicField(this, _f);
|
17514
18625
|
/** @internal */
|
17515
18626
|
__publicField(this, _e);
|
17516
|
-
/** @internal */
|
17517
|
-
__publicField(this, _d);
|
17518
18627
|
/**
|
17519
18628
|
* @internal
|
17520
18629
|
* Used to store the table name before the transformation via the `tableCreator` functions.
|
17521
18630
|
*/
|
17522
|
-
__publicField(this,
|
18631
|
+
__publicField(this, _d);
|
18632
|
+
/** @internal */
|
18633
|
+
__publicField(this, _c, false);
|
17523
18634
|
/** @internal */
|
17524
|
-
__publicField(this, _b,
|
18635
|
+
__publicField(this, _b, true);
|
17525
18636
|
/** @internal */
|
17526
18637
|
__publicField(this, _a3);
|
17527
18638
|
this[TableName] = this[OriginalName] = name2;
|
@@ -17529,7 +18640,7 @@ var init_table = __esm({
|
|
17529
18640
|
this[BaseName] = baseName;
|
17530
18641
|
}
|
17531
18642
|
};
|
17532
|
-
__publicField(Table2,
|
18643
|
+
__publicField(Table2, _j, "Table");
|
17533
18644
|
/** @internal */
|
17534
18645
|
__publicField(Table2, "Symbol", {
|
17535
18646
|
Name: TableName,
|
@@ -17544,7 +18655,7 @@ var init_table = __esm({
|
|
17544
18655
|
}
|
17545
18656
|
});
|
17546
18657
|
|
17547
|
-
// ../
|
18658
|
+
// ../drizzle-orm/dist/pg-core/table.js
|
17548
18659
|
function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name2) {
|
17549
18660
|
const rawTable = new PgTable(name2, schema4, baseName);
|
17550
18661
|
const builtColumns = Object.fromEntries(
|
@@ -17572,7 +18683,7 @@ function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name
|
|
17572
18683
|
}
|
17573
18684
|
var InlineForeignKeys, _a4, _b2, _c2, _d2, PgTable, pgTable;
|
17574
18685
|
var init_table2 = __esm({
|
17575
|
-
"../
|
18686
|
+
"../drizzle-orm/dist/pg-core/table.js"() {
|
17576
18687
|
"use strict";
|
17577
18688
|
init_entity();
|
17578
18689
|
init_table();
|
@@ -17597,10 +18708,10 @@ var init_table2 = __esm({
|
|
17597
18708
|
}
|
17598
18709
|
});
|
17599
18710
|
|
17600
|
-
// ../
|
18711
|
+
// ../drizzle-orm/dist/pg-core/foreign-keys.js
|
17601
18712
|
var _a5, ForeignKeyBuilder, _a6, ForeignKey;
|
17602
18713
|
var init_foreign_keys = __esm({
|
17603
|
-
"../
|
18714
|
+
"../drizzle-orm/dist/pg-core/foreign-keys.js"() {
|
17604
18715
|
"use strict";
|
17605
18716
|
init_entity();
|
17606
18717
|
init_table2();
|
@@ -17664,23 +18775,23 @@ var init_foreign_keys = __esm({
|
|
17664
18775
|
}
|
17665
18776
|
});
|
17666
18777
|
|
17667
|
-
// ../
|
18778
|
+
// ../drizzle-orm/dist/tracing-utils.js
|
17668
18779
|
function iife(fn, ...args) {
|
17669
18780
|
return fn(...args);
|
17670
18781
|
}
|
17671
18782
|
var init_tracing_utils = __esm({
|
17672
|
-
"../
|
18783
|
+
"../drizzle-orm/dist/tracing-utils.js"() {
|
17673
18784
|
"use strict";
|
17674
18785
|
}
|
17675
18786
|
});
|
17676
18787
|
|
17677
|
-
// ../
|
18788
|
+
// ../drizzle-orm/dist/pg-core/unique-constraint.js
|
17678
18789
|
function uniqueKeyName(table4, columns) {
|
17679
18790
|
return `${table4[PgTable.Symbol.Name]}_${columns.join("_")}_unique`;
|
17680
18791
|
}
|
17681
18792
|
var _a7, UniqueConstraintBuilder, _a8, UniqueOnConstraintBuilder, _a9, UniqueConstraint;
|
17682
18793
|
var init_unique_constraint = __esm({
|
17683
|
-
"../
|
18794
|
+
"../drizzle-orm/dist/pg-core/unique-constraint.js"() {
|
17684
18795
|
"use strict";
|
17685
18796
|
init_entity();
|
17686
18797
|
init_table2();
|
@@ -17735,7 +18846,7 @@ var init_unique_constraint = __esm({
|
|
17735
18846
|
}
|
17736
18847
|
});
|
17737
18848
|
|
17738
|
-
// ../
|
18849
|
+
// ../drizzle-orm/dist/pg-core/utils/array.js
|
17739
18850
|
function parsePgArrayValue(arrayString, startFrom, inQuotes) {
|
17740
18851
|
for (let i = startFrom; i < arrayString.length; i++) {
|
17741
18852
|
const char = arrayString[i];
|
@@ -17811,15 +18922,15 @@ function makePgArray(array) {
|
|
17811
18922
|
}).join(",")}}`;
|
17812
18923
|
}
|
17813
18924
|
var init_array = __esm({
|
17814
|
-
"../
|
18925
|
+
"../drizzle-orm/dist/pg-core/utils/array.js"() {
|
17815
18926
|
"use strict";
|
17816
18927
|
}
|
17817
18928
|
});
|
17818
18929
|
|
17819
|
-
// ../
|
18930
|
+
// ../drizzle-orm/dist/pg-core/columns/common.js
|
17820
18931
|
var _a10, _b3, PgColumnBuilder, _a11, _b4, PgColumn, _a12, _b5, ExtraConfigColumn, _a13, IndexedColumn, _a14, _b6, PgArrayBuilder, _a15, _b7, _PgArray, PgArray;
|
17821
18932
|
var init_common2 = __esm({
|
17822
|
-
"../
|
18933
|
+
"../drizzle-orm/dist/pg-core/columns/common.js"() {
|
17823
18934
|
"use strict";
|
17824
18935
|
init_column_builder();
|
17825
18936
|
init_column();
|
@@ -18020,7 +19131,7 @@ var init_common2 = __esm({
|
|
18020
19131
|
}
|
18021
19132
|
});
|
18022
19133
|
|
18023
|
-
// ../
|
19134
|
+
// ../drizzle-orm/dist/pg-core/columns/enum.js
|
18024
19135
|
function isPgEnum(obj) {
|
18025
19136
|
return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
|
18026
19137
|
}
|
@@ -18038,7 +19149,7 @@ function pgEnumWithSchema(enumName, values, schema4) {
|
|
18038
19149
|
}
|
18039
19150
|
var isPgEnumSym, _a16, _b8, PgEnumColumnBuilder, _a17, _b9, PgEnumColumn;
|
18040
19151
|
var init_enum = __esm({
|
18041
|
-
"../
|
19152
|
+
"../drizzle-orm/dist/pg-core/columns/enum.js"() {
|
18042
19153
|
"use strict";
|
18043
19154
|
init_entity();
|
18044
19155
|
init_common2();
|
@@ -18072,10 +19183,10 @@ var init_enum = __esm({
|
|
18072
19183
|
}
|
18073
19184
|
});
|
18074
19185
|
|
18075
|
-
// ../
|
19186
|
+
// ../drizzle-orm/dist/subquery.js
|
18076
19187
|
var _a18, Subquery, _a19, _b10, WithSubquery;
|
18077
19188
|
var init_subquery = __esm({
|
18078
|
-
"../
|
19189
|
+
"../drizzle-orm/dist/subquery.js"() {
|
18079
19190
|
"use strict";
|
18080
19191
|
init_entity();
|
18081
19192
|
_a18 = entityKind;
|
@@ -18100,19 +19211,19 @@ var init_subquery = __esm({
|
|
18100
19211
|
}
|
18101
19212
|
});
|
18102
19213
|
|
18103
|
-
// ../
|
19214
|
+
// ../drizzle-orm/dist/version.js
|
18104
19215
|
var version;
|
18105
19216
|
var init_version = __esm({
|
18106
|
-
"../
|
19217
|
+
"../drizzle-orm/dist/version.js"() {
|
18107
19218
|
"use strict";
|
18108
|
-
version = "0.
|
19219
|
+
version = "0.33.0";
|
18109
19220
|
}
|
18110
19221
|
});
|
18111
19222
|
|
18112
|
-
// ../
|
19223
|
+
// ../drizzle-orm/dist/tracing.js
|
18113
19224
|
var otel, rawTracer, tracer;
|
18114
19225
|
var init_tracing = __esm({
|
18115
|
-
"../
|
19226
|
+
"../drizzle-orm/dist/tracing.js"() {
|
18116
19227
|
"use strict";
|
18117
19228
|
init_tracing_utils();
|
18118
19229
|
init_version();
|
@@ -18150,16 +19261,16 @@ var init_tracing = __esm({
|
|
18150
19261
|
}
|
18151
19262
|
});
|
18152
19263
|
|
18153
|
-
// ../
|
19264
|
+
// ../drizzle-orm/dist/view-common.js
|
18154
19265
|
var ViewBaseConfig;
|
18155
19266
|
var init_view_common = __esm({
|
18156
|
-
"../
|
19267
|
+
"../drizzle-orm/dist/view-common.js"() {
|
18157
19268
|
"use strict";
|
18158
19269
|
ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
18159
19270
|
}
|
18160
19271
|
});
|
18161
19272
|
|
18162
|
-
// ../
|
19273
|
+
// ../drizzle-orm/dist/sql/sql.js
|
18163
19274
|
function isSQLWrapper(value) {
|
18164
19275
|
return value !== null && value !== void 0 && typeof value.getSQL === "function";
|
18165
19276
|
}
|
@@ -18207,12 +19318,18 @@ function fillPlaceholders(params, values) {
|
|
18207
19318
|
}
|
18208
19319
|
return values[p.name];
|
18209
19320
|
}
|
19321
|
+
if (is(p, Param) && is(p.value, Placeholder)) {
|
19322
|
+
if (!(p.value.name in values)) {
|
19323
|
+
throw new Error(`No value for placeholder "${p.value.name}" was provided`);
|
19324
|
+
}
|
19325
|
+
return p.encoder.mapToDriverValue(values[p.value.name]);
|
19326
|
+
}
|
18210
19327
|
return p;
|
18211
19328
|
});
|
18212
19329
|
}
|
18213
19330
|
var _a20, FakePrimitiveParam, _a21, StringChunk, _a22, _SQL, SQL, _a23, Name, noopDecoder, noopEncoder, noopMapper, _a24, Param, _a25, Placeholder, _a26, _b11, View;
|
18214
19331
|
var init_sql = __esm({
|
18215
|
-
"../
|
19332
|
+
"../drizzle-orm/dist/sql/sql.js"() {
|
18216
19333
|
"use strict";
|
18217
19334
|
init_entity();
|
18218
19335
|
init_enum();
|
@@ -18320,6 +19437,9 @@ var init_sql = __esm({
|
|
18320
19437
|
};
|
18321
19438
|
}
|
18322
19439
|
if (is(chunk, Param)) {
|
19440
|
+
if (is(chunk.value, Placeholder)) {
|
19441
|
+
return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
|
19442
|
+
}
|
18323
19443
|
const mappedValue = chunk.value === null ? null : chunk.encoder.mapToDriverValue(chunk.value);
|
18324
19444
|
if (is(mappedValue, _SQL)) {
|
18325
19445
|
return this.buildQueryFromSourceParams([mappedValue], config);
|
@@ -18327,7 +19447,7 @@ var init_sql = __esm({
|
|
18327
19447
|
if (inlineParams) {
|
18328
19448
|
return { sql: this.mapInlineParam(mappedValue, config), params: [] };
|
18329
19449
|
}
|
18330
|
-
let typings;
|
19450
|
+
let typings = ["none"];
|
18331
19451
|
if (prepareTyping) {
|
18332
19452
|
typings = [prepareTyping(chunk.encoder)];
|
18333
19453
|
}
|
@@ -18369,7 +19489,7 @@ var init_sql = __esm({
|
|
18369
19489
|
if (inlineParams) {
|
18370
19490
|
return { sql: this.mapInlineParam(chunk, config), params: [] };
|
18371
19491
|
}
|
18372
|
-
return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk] };
|
19492
|
+
return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
|
18373
19493
|
}));
|
18374
19494
|
}
|
18375
19495
|
mapInlineParam(chunk, { escapeString }) {
|
@@ -18558,7 +19678,7 @@ var init_sql = __esm({
|
|
18558
19678
|
}
|
18559
19679
|
});
|
18560
19680
|
|
18561
|
-
// ../
|
19681
|
+
// ../drizzle-orm/dist/alias.js
|
18562
19682
|
function aliasedTable(table4, tableAlias) {
|
18563
19683
|
return new Proxy(table4, new TableAliasProxyHandler(tableAlias, false));
|
18564
19684
|
}
|
@@ -18590,7 +19710,7 @@ function mapColumnsInSQLToAlias(query, alias) {
|
|
18590
19710
|
}
|
18591
19711
|
var _a27, ColumnAliasProxyHandler, _a28, TableAliasProxyHandler, _a29, RelationTableAliasProxyHandler;
|
18592
19712
|
var init_alias = __esm({
|
18593
|
-
"../
|
19713
|
+
"../drizzle-orm/dist/alias.js"() {
|
18594
19714
|
"use strict";
|
18595
19715
|
init_column();
|
18596
19716
|
init_entity();
|
@@ -18671,10 +19791,10 @@ var init_alias = __esm({
|
|
18671
19791
|
}
|
18672
19792
|
});
|
18673
19793
|
|
18674
|
-
// ../
|
19794
|
+
// ../drizzle-orm/dist/errors.js
|
18675
19795
|
var _a30, _b12, DrizzleError, _a31, _b13, TransactionRollbackError;
|
18676
19796
|
var init_errors = __esm({
|
18677
|
-
"../
|
19797
|
+
"../drizzle-orm/dist/errors.js"() {
|
18678
19798
|
"use strict";
|
18679
19799
|
init_entity();
|
18680
19800
|
DrizzleError = class extends (_b12 = Error, _a30 = entityKind, _b12) {
|
@@ -18694,7 +19814,7 @@ var init_errors = __esm({
|
|
18694
19814
|
}
|
18695
19815
|
});
|
18696
19816
|
|
18697
|
-
// ../
|
19817
|
+
// ../drizzle-orm/dist/sql/expressions/conditions.js
|
18698
19818
|
function bindIfParam(value, column4) {
|
18699
19819
|
if (isDriverValueEncoder(column4) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column2) && !is(value, Table2) && !is(value, View)) {
|
18700
19820
|
return new Param(value, column4);
|
@@ -18822,7 +19942,7 @@ function arrayOverlaps(column4, values) {
|
|
18822
19942
|
}
|
18823
19943
|
var eq, ne, gt, gte, lt, lte;
|
18824
19944
|
var init_conditions = __esm({
|
18825
|
-
"../
|
19945
|
+
"../drizzle-orm/dist/sql/expressions/conditions.js"() {
|
18826
19946
|
"use strict";
|
18827
19947
|
init_column();
|
18828
19948
|
init_entity();
|
@@ -18849,7 +19969,7 @@ var init_conditions = __esm({
|
|
18849
19969
|
}
|
18850
19970
|
});
|
18851
19971
|
|
18852
|
-
// ../
|
19972
|
+
// ../drizzle-orm/dist/sql/expressions/select.js
|
18853
19973
|
function asc(column4) {
|
18854
19974
|
return sql`${column4} asc`;
|
18855
19975
|
}
|
@@ -18857,33 +19977,33 @@ function desc(column4) {
|
|
18857
19977
|
return sql`${column4} desc`;
|
18858
19978
|
}
|
18859
19979
|
var init_select = __esm({
|
18860
|
-
"../
|
19980
|
+
"../drizzle-orm/dist/sql/expressions/select.js"() {
|
18861
19981
|
"use strict";
|
18862
19982
|
init_sql();
|
18863
19983
|
}
|
18864
19984
|
});
|
18865
19985
|
|
18866
|
-
// ../
|
19986
|
+
// ../drizzle-orm/dist/sql/expressions/index.js
|
18867
19987
|
var init_expressions = __esm({
|
18868
|
-
"../
|
19988
|
+
"../drizzle-orm/dist/sql/expressions/index.js"() {
|
18869
19989
|
"use strict";
|
18870
19990
|
init_conditions();
|
18871
19991
|
init_select();
|
18872
19992
|
}
|
18873
19993
|
});
|
18874
19994
|
|
18875
|
-
// ../
|
19995
|
+
// ../drizzle-orm/dist/expressions.js
|
18876
19996
|
var init_expressions2 = __esm({
|
18877
|
-
"../
|
19997
|
+
"../drizzle-orm/dist/expressions.js"() {
|
18878
19998
|
"use strict";
|
18879
19999
|
init_expressions();
|
18880
20000
|
}
|
18881
20001
|
});
|
18882
20002
|
|
18883
|
-
// ../
|
20003
|
+
// ../drizzle-orm/dist/logger.js
|
18884
20004
|
var _a32, ConsoleLogWriter, _a33, DefaultLogger, _a34, NoopLogger;
|
18885
20005
|
var init_logger = __esm({
|
18886
|
-
"../
|
20006
|
+
"../drizzle-orm/dist/logger.js"() {
|
18887
20007
|
"use strict";
|
18888
20008
|
init_entity();
|
18889
20009
|
_a32 = entityKind;
|
@@ -18921,17 +20041,17 @@ var init_logger = __esm({
|
|
18921
20041
|
}
|
18922
20042
|
});
|
18923
20043
|
|
18924
|
-
// ../
|
20044
|
+
// ../drizzle-orm/dist/operations.js
|
18925
20045
|
var init_operations = __esm({
|
18926
|
-
"../
|
20046
|
+
"../drizzle-orm/dist/operations.js"() {
|
18927
20047
|
"use strict";
|
18928
20048
|
}
|
18929
20049
|
});
|
18930
20050
|
|
18931
|
-
// ../
|
20051
|
+
// ../drizzle-orm/dist/query-promise.js
|
18932
20052
|
var _a35, _b14, QueryPromise;
|
18933
20053
|
var init_query_promise = __esm({
|
18934
|
-
"../
|
20054
|
+
"../drizzle-orm/dist/query-promise.js"() {
|
18935
20055
|
"use strict";
|
18936
20056
|
init_entity();
|
18937
20057
|
_b14 = entityKind, _a35 = Symbol.toStringTag;
|
@@ -18962,10 +20082,10 @@ var init_query_promise = __esm({
|
|
18962
20082
|
}
|
18963
20083
|
});
|
18964
20084
|
|
18965
|
-
// ../
|
20085
|
+
// ../drizzle-orm/dist/pg-core/primary-keys.js
|
18966
20086
|
var _a36, PrimaryKeyBuilder, _a37, PrimaryKey;
|
18967
20087
|
var init_primary_keys = __esm({
|
18968
|
-
"../
|
20088
|
+
"../drizzle-orm/dist/pg-core/primary-keys.js"() {
|
18969
20089
|
"use strict";
|
18970
20090
|
init_entity();
|
18971
20091
|
init_table2();
|
@@ -19002,7 +20122,7 @@ var init_primary_keys = __esm({
|
|
19002
20122
|
}
|
19003
20123
|
});
|
19004
20124
|
|
19005
|
-
// ../
|
20125
|
+
// ../drizzle-orm/dist/relations.js
|
19006
20126
|
function getOperators() {
|
19007
20127
|
return {
|
19008
20128
|
and,
|
@@ -19223,7 +20343,7 @@ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelect
|
|
19223
20343
|
}
|
19224
20344
|
var _a38, Relation, _a39, Relations, _a40, _b15, _One, One, _a41, _b16, _Many, Many;
|
19225
20345
|
var init_relations = __esm({
|
19226
|
-
"../
|
20346
|
+
"../drizzle-orm/dist/relations.js"() {
|
19227
20347
|
"use strict";
|
19228
20348
|
init_table();
|
19229
20349
|
init_column();
|
@@ -19290,7 +20410,7 @@ var init_relations = __esm({
|
|
19290
20410
|
}
|
19291
20411
|
});
|
19292
20412
|
|
19293
|
-
// ../
|
20413
|
+
// ../drizzle-orm/dist/sql/functions/aggregate.js
|
19294
20414
|
function count(expression) {
|
19295
20415
|
return sql`count(${expression || sql.raw("*")})`.mapWith(Number);
|
19296
20416
|
}
|
@@ -19316,7 +20436,7 @@ function min(expression) {
|
|
19316
20436
|
return sql`min(${expression})`.mapWith(is(expression, Column2) ? expression : String);
|
19317
20437
|
}
|
19318
20438
|
var init_aggregate = __esm({
|
19319
|
-
"../
|
20439
|
+
"../drizzle-orm/dist/sql/functions/aggregate.js"() {
|
19320
20440
|
"use strict";
|
19321
20441
|
init_column();
|
19322
20442
|
init_entity();
|
@@ -19324,7 +20444,7 @@ var init_aggregate = __esm({
|
|
19324
20444
|
}
|
19325
20445
|
});
|
19326
20446
|
|
19327
|
-
// ../
|
20447
|
+
// ../drizzle-orm/dist/sql/functions/vector.js
|
19328
20448
|
function toSql(value) {
|
19329
20449
|
return JSON.stringify(value);
|
19330
20450
|
}
|
@@ -19365,24 +20485,24 @@ function jaccardDistance(column4, value) {
|
|
19365
20485
|
return sql`${column4} <%> ${value}`;
|
19366
20486
|
}
|
19367
20487
|
var init_vector = __esm({
|
19368
|
-
"../
|
20488
|
+
"../drizzle-orm/dist/sql/functions/vector.js"() {
|
19369
20489
|
"use strict";
|
19370
20490
|
init_sql();
|
19371
20491
|
}
|
19372
20492
|
});
|
19373
20493
|
|
19374
|
-
// ../
|
20494
|
+
// ../drizzle-orm/dist/sql/functions/index.js
|
19375
20495
|
var init_functions = __esm({
|
19376
|
-
"../
|
20496
|
+
"../drizzle-orm/dist/sql/functions/index.js"() {
|
19377
20497
|
"use strict";
|
19378
20498
|
init_aggregate();
|
19379
20499
|
init_vector();
|
19380
20500
|
}
|
19381
20501
|
});
|
19382
20502
|
|
19383
|
-
// ../
|
20503
|
+
// ../drizzle-orm/dist/sql/index.js
|
19384
20504
|
var init_sql2 = __esm({
|
19385
|
-
"../
|
20505
|
+
"../drizzle-orm/dist/sql/index.js"() {
|
19386
20506
|
"use strict";
|
19387
20507
|
init_expressions();
|
19388
20508
|
init_functions();
|
@@ -19390,7 +20510,7 @@ var init_sql2 = __esm({
|
|
19390
20510
|
}
|
19391
20511
|
});
|
19392
20512
|
|
19393
|
-
// ../
|
20513
|
+
// ../drizzle-orm/dist/utils.js
|
19394
20514
|
function mapResultRow(columns, row, joinsNotNullableMap) {
|
19395
20515
|
const nullifyMap = {};
|
19396
20516
|
const result = columns.reduce(
|
@@ -19498,7 +20618,7 @@ function getTableLikeName(table4) {
|
|
19498
20618
|
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];
|
19499
20619
|
}
|
19500
20620
|
var init_utils2 = __esm({
|
19501
|
-
"../
|
20621
|
+
"../drizzle-orm/dist/utils.js"() {
|
19502
20622
|
"use strict";
|
19503
20623
|
init_column();
|
19504
20624
|
init_entity();
|
@@ -19509,9 +20629,9 @@ var init_utils2 = __esm({
|
|
19509
20629
|
}
|
19510
20630
|
});
|
19511
20631
|
|
19512
|
-
// ../
|
19513
|
-
var
|
19514
|
-
__export(
|
20632
|
+
// ../drizzle-orm/dist/index.js
|
20633
|
+
var dist_exports = {};
|
20634
|
+
__export(dist_exports, {
|
19515
20635
|
BaseName: () => BaseName,
|
19516
20636
|
Column: () => Column2,
|
19517
20637
|
ColumnAliasProxyHandler: () => ColumnAliasProxyHandler,
|
@@ -19625,8 +20745,8 @@ __export(drizzle_orm_exports, {
|
|
19625
20745
|
sum: () => sum,
|
19626
20746
|
sumDistinct: () => sumDistinct
|
19627
20747
|
});
|
19628
|
-
var
|
19629
|
-
"../
|
20748
|
+
var init_dist = __esm({
|
20749
|
+
"../drizzle-orm/dist/index.js"() {
|
19630
20750
|
"use strict";
|
19631
20751
|
init_alias();
|
19632
20752
|
init_column_builder();
|
@@ -19646,17 +20766,17 @@ var init_drizzle_orm = __esm({
|
|
19646
20766
|
}
|
19647
20767
|
});
|
19648
20768
|
|
19649
|
-
// ../
|
20769
|
+
// ../drizzle-orm/dist/pg-core/alias.js
|
19650
20770
|
var init_alias2 = __esm({
|
19651
|
-
"../
|
20771
|
+
"../drizzle-orm/dist/pg-core/alias.js"() {
|
19652
20772
|
"use strict";
|
19653
20773
|
}
|
19654
20774
|
});
|
19655
20775
|
|
19656
|
-
// ../
|
20776
|
+
// ../drizzle-orm/dist/pg-core/checks.js
|
19657
20777
|
var _a42, CheckBuilder, _a43, Check;
|
19658
20778
|
var init_checks = __esm({
|
19659
|
-
"../
|
20779
|
+
"../drizzle-orm/dist/pg-core/checks.js"() {
|
19660
20780
|
"use strict";
|
19661
20781
|
init_entity();
|
19662
20782
|
_a42 = entityKind;
|
@@ -19686,10 +20806,10 @@ var init_checks = __esm({
|
|
19686
20806
|
}
|
19687
20807
|
});
|
19688
20808
|
|
19689
|
-
// ../
|
20809
|
+
// ../drizzle-orm/dist/pg-core/columns/int.common.js
|
19690
20810
|
var _a44, _b17, PgIntColumnBaseBuilder;
|
19691
20811
|
var init_int_common = __esm({
|
19692
|
-
"../
|
20812
|
+
"../drizzle-orm/dist/pg-core/columns/int.common.js"() {
|
19693
20813
|
"use strict";
|
19694
20814
|
init_entity();
|
19695
20815
|
init_common2();
|
@@ -19733,10 +20853,10 @@ var init_int_common = __esm({
|
|
19733
20853
|
}
|
19734
20854
|
});
|
19735
20855
|
|
19736
|
-
// ../
|
20856
|
+
// ../drizzle-orm/dist/pg-core/columns/bigint.js
|
19737
20857
|
var _a45, _b18, PgBigInt53Builder, _a46, _b19, PgBigInt53, _a47, _b20, PgBigInt64Builder, _a48, _b21, PgBigInt64;
|
19738
20858
|
var init_bigint = __esm({
|
19739
|
-
"../
|
20859
|
+
"../drizzle-orm/dist/pg-core/columns/bigint.js"() {
|
19740
20860
|
"use strict";
|
19741
20861
|
init_entity();
|
19742
20862
|
init_common2();
|
@@ -19789,10 +20909,10 @@ var init_bigint = __esm({
|
|
19789
20909
|
}
|
19790
20910
|
});
|
19791
20911
|
|
19792
|
-
// ../
|
20912
|
+
// ../drizzle-orm/dist/pg-core/columns/bigserial.js
|
19793
20913
|
var _a49, _b22, PgBigSerial53Builder, _a50, _b23, PgBigSerial53, _a51, _b24, PgBigSerial64Builder, _a52, _b25, PgBigSerial64;
|
19794
20914
|
var init_bigserial = __esm({
|
19795
|
-
"../
|
20915
|
+
"../drizzle-orm/dist/pg-core/columns/bigserial.js"() {
|
19796
20916
|
"use strict";
|
19797
20917
|
init_entity();
|
19798
20918
|
init_common2();
|
@@ -19850,10 +20970,10 @@ var init_bigserial = __esm({
|
|
19850
20970
|
}
|
19851
20971
|
});
|
19852
20972
|
|
19853
|
-
// ../
|
20973
|
+
// ../drizzle-orm/dist/pg-core/columns/boolean.js
|
19854
20974
|
var _a53, _b26, PgBooleanBuilder, _a54, _b27, PgBoolean;
|
19855
20975
|
var init_boolean = __esm({
|
19856
|
-
"../
|
20976
|
+
"../drizzle-orm/dist/pg-core/columns/boolean.js"() {
|
19857
20977
|
"use strict";
|
19858
20978
|
init_entity();
|
19859
20979
|
init_common2();
|
@@ -19876,10 +20996,10 @@ var init_boolean = __esm({
|
|
19876
20996
|
}
|
19877
20997
|
});
|
19878
20998
|
|
19879
|
-
// ../
|
20999
|
+
// ../drizzle-orm/dist/pg-core/columns/char.js
|
19880
21000
|
var _a55, _b28, PgCharBuilder, _a56, _b29, PgChar;
|
19881
21001
|
var init_char = __esm({
|
19882
|
-
"../
|
21002
|
+
"../drizzle-orm/dist/pg-core/columns/char.js"() {
|
19883
21003
|
"use strict";
|
19884
21004
|
init_entity();
|
19885
21005
|
init_common2();
|
@@ -19909,10 +21029,10 @@ var init_char = __esm({
|
|
19909
21029
|
}
|
19910
21030
|
});
|
19911
21031
|
|
19912
|
-
// ../
|
21032
|
+
// ../drizzle-orm/dist/pg-core/columns/cidr.js
|
19913
21033
|
var _a57, _b30, PgCidrBuilder, _a58, _b31, PgCidr;
|
19914
21034
|
var init_cidr = __esm({
|
19915
|
-
"../
|
21035
|
+
"../drizzle-orm/dist/pg-core/columns/cidr.js"() {
|
19916
21036
|
"use strict";
|
19917
21037
|
init_entity();
|
19918
21038
|
init_common2();
|
@@ -19935,10 +21055,10 @@ var init_cidr = __esm({
|
|
19935
21055
|
}
|
19936
21056
|
});
|
19937
21057
|
|
19938
|
-
// ../
|
21058
|
+
// ../drizzle-orm/dist/pg-core/columns/custom.js
|
19939
21059
|
var _a59, _b32, PgCustomColumnBuilder, _a60, _b33, PgCustomColumn;
|
19940
21060
|
var init_custom = __esm({
|
19941
|
-
"../
|
21061
|
+
"../drizzle-orm/dist/pg-core/columns/custom.js"() {
|
19942
21062
|
"use strict";
|
19943
21063
|
init_entity();
|
19944
21064
|
init_common2();
|
@@ -19981,10 +21101,10 @@ var init_custom = __esm({
|
|
19981
21101
|
}
|
19982
21102
|
});
|
19983
21103
|
|
19984
|
-
// ../
|
21104
|
+
// ../drizzle-orm/dist/pg-core/columns/date.common.js
|
19985
21105
|
var _a61, _b34, PgDateColumnBaseBuilder;
|
19986
21106
|
var init_date_common = __esm({
|
19987
|
-
"../
|
21107
|
+
"../drizzle-orm/dist/pg-core/columns/date.common.js"() {
|
19988
21108
|
"use strict";
|
19989
21109
|
init_entity();
|
19990
21110
|
init_sql();
|
@@ -19998,10 +21118,10 @@ var init_date_common = __esm({
|
|
19998
21118
|
}
|
19999
21119
|
});
|
20000
21120
|
|
20001
|
-
// ../
|
21121
|
+
// ../drizzle-orm/dist/pg-core/columns/date.js
|
20002
21122
|
var _a62, _b35, PgDateBuilder, _a63, _b36, PgDate, _a64, _b37, PgDateStringBuilder, _a65, _b38, PgDateString;
|
20003
21123
|
var init_date = __esm({
|
20004
|
-
"../
|
21124
|
+
"../drizzle-orm/dist/pg-core/columns/date.js"() {
|
20005
21125
|
"use strict";
|
20006
21126
|
init_entity();
|
20007
21127
|
init_common2();
|
@@ -20050,10 +21170,10 @@ var init_date = __esm({
|
|
20050
21170
|
}
|
20051
21171
|
});
|
20052
21172
|
|
20053
|
-
// ../
|
21173
|
+
// ../drizzle-orm/dist/pg-core/columns/double-precision.js
|
20054
21174
|
var _a66, _b39, PgDoublePrecisionBuilder, _a67, _b40, PgDoublePrecision;
|
20055
21175
|
var init_double_precision = __esm({
|
20056
|
-
"../
|
21176
|
+
"../drizzle-orm/dist/pg-core/columns/double-precision.js"() {
|
20057
21177
|
"use strict";
|
20058
21178
|
init_entity();
|
20059
21179
|
init_common2();
|
@@ -20085,10 +21205,10 @@ var init_double_precision = __esm({
|
|
20085
21205
|
}
|
20086
21206
|
});
|
20087
21207
|
|
20088
|
-
// ../
|
21208
|
+
// ../drizzle-orm/dist/pg-core/columns/inet.js
|
20089
21209
|
var _a68, _b41, PgInetBuilder, _a69, _b42, PgInet;
|
20090
21210
|
var init_inet = __esm({
|
20091
|
-
"../
|
21211
|
+
"../drizzle-orm/dist/pg-core/columns/inet.js"() {
|
20092
21212
|
"use strict";
|
20093
21213
|
init_entity();
|
20094
21214
|
init_common2();
|
@@ -20111,10 +21231,10 @@ var init_inet = __esm({
|
|
20111
21231
|
}
|
20112
21232
|
});
|
20113
21233
|
|
20114
|
-
// ../
|
21234
|
+
// ../drizzle-orm/dist/pg-core/columns/integer.js
|
20115
21235
|
var _a70, _b43, PgIntegerBuilder, _a71, _b44, PgInteger;
|
20116
21236
|
var init_integer = __esm({
|
20117
|
-
"../
|
21237
|
+
"../drizzle-orm/dist/pg-core/columns/integer.js"() {
|
20118
21238
|
"use strict";
|
20119
21239
|
init_entity();
|
20120
21240
|
init_common2();
|
@@ -20144,10 +21264,10 @@ var init_integer = __esm({
|
|
20144
21264
|
}
|
20145
21265
|
});
|
20146
21266
|
|
20147
|
-
// ../
|
21267
|
+
// ../drizzle-orm/dist/pg-core/columns/interval.js
|
20148
21268
|
var _a72, _b45, PgIntervalBuilder, _a73, _b46, PgInterval;
|
20149
21269
|
var init_interval = __esm({
|
20150
|
-
"../
|
21270
|
+
"../drizzle-orm/dist/pg-core/columns/interval.js"() {
|
20151
21271
|
"use strict";
|
20152
21272
|
init_entity();
|
20153
21273
|
init_common2();
|
@@ -20178,10 +21298,10 @@ var init_interval = __esm({
|
|
20178
21298
|
}
|
20179
21299
|
});
|
20180
21300
|
|
20181
|
-
// ../
|
21301
|
+
// ../drizzle-orm/dist/pg-core/columns/json.js
|
20182
21302
|
var _a74, _b47, PgJsonBuilder, _a75, _b48, PgJson;
|
20183
21303
|
var init_json = __esm({
|
20184
|
-
"../
|
21304
|
+
"../drizzle-orm/dist/pg-core/columns/json.js"() {
|
20185
21305
|
"use strict";
|
20186
21306
|
init_entity();
|
20187
21307
|
init_common2();
|
@@ -20220,10 +21340,10 @@ var init_json = __esm({
|
|
20220
21340
|
}
|
20221
21341
|
});
|
20222
21342
|
|
20223
|
-
// ../
|
21343
|
+
// ../drizzle-orm/dist/pg-core/columns/jsonb.js
|
20224
21344
|
var _a76, _b49, PgJsonbBuilder, _a77, _b50, PgJsonb;
|
20225
21345
|
var init_jsonb = __esm({
|
20226
|
-
"../
|
21346
|
+
"../drizzle-orm/dist/pg-core/columns/jsonb.js"() {
|
20227
21347
|
"use strict";
|
20228
21348
|
init_entity();
|
20229
21349
|
init_common2();
|
@@ -20262,10 +21382,10 @@ var init_jsonb = __esm({
|
|
20262
21382
|
}
|
20263
21383
|
});
|
20264
21384
|
|
20265
|
-
// ../
|
21385
|
+
// ../drizzle-orm/dist/pg-core/columns/line.js
|
20266
21386
|
var _a78, _b51, PgLineBuilder, _a79, _b52, PgLineTuple, _a80, _b53, PgLineABCBuilder, _a81, _b54, PgLineABC;
|
20267
21387
|
var init_line = __esm({
|
20268
|
-
"../
|
21388
|
+
"../drizzle-orm/dist/pg-core/columns/line.js"() {
|
20269
21389
|
"use strict";
|
20270
21390
|
init_entity();
|
20271
21391
|
init_common2();
|
@@ -20324,10 +21444,10 @@ var init_line = __esm({
|
|
20324
21444
|
}
|
20325
21445
|
});
|
20326
21446
|
|
20327
|
-
// ../
|
21447
|
+
// ../drizzle-orm/dist/pg-core/columns/macaddr.js
|
20328
21448
|
var _a82, _b55, PgMacaddrBuilder, _a83, _b56, PgMacaddr;
|
20329
21449
|
var init_macaddr = __esm({
|
20330
|
-
"../
|
21450
|
+
"../drizzle-orm/dist/pg-core/columns/macaddr.js"() {
|
20331
21451
|
"use strict";
|
20332
21452
|
init_entity();
|
20333
21453
|
init_common2();
|
@@ -20350,10 +21470,10 @@ var init_macaddr = __esm({
|
|
20350
21470
|
}
|
20351
21471
|
});
|
20352
21472
|
|
20353
|
-
// ../
|
21473
|
+
// ../drizzle-orm/dist/pg-core/columns/macaddr8.js
|
20354
21474
|
var _a84, _b57, PgMacaddr8Builder, _a85, _b58, PgMacaddr8;
|
20355
21475
|
var init_macaddr8 = __esm({
|
20356
|
-
"../
|
21476
|
+
"../drizzle-orm/dist/pg-core/columns/macaddr8.js"() {
|
20357
21477
|
"use strict";
|
20358
21478
|
init_entity();
|
20359
21479
|
init_common2();
|
@@ -20376,10 +21496,10 @@ var init_macaddr8 = __esm({
|
|
20376
21496
|
}
|
20377
21497
|
});
|
20378
21498
|
|
20379
|
-
// ../
|
21499
|
+
// ../drizzle-orm/dist/pg-core/columns/numeric.js
|
20380
21500
|
var _a86, _b59, PgNumericBuilder, _a87, _b60, PgNumeric;
|
20381
21501
|
var init_numeric = __esm({
|
20382
|
-
"../
|
21502
|
+
"../drizzle-orm/dist/pg-core/columns/numeric.js"() {
|
20383
21503
|
"use strict";
|
20384
21504
|
init_entity();
|
20385
21505
|
init_common2();
|
@@ -20417,10 +21537,10 @@ var init_numeric = __esm({
|
|
20417
21537
|
}
|
20418
21538
|
});
|
20419
21539
|
|
20420
|
-
// ../
|
21540
|
+
// ../drizzle-orm/dist/pg-core/columns/point.js
|
20421
21541
|
var _a88, _b61, PgPointTupleBuilder, _a89, _b62, PgPointTuple, _a90, _b63, PgPointObjectBuilder, _a91, _b64, PgPointObject;
|
20422
21542
|
var init_point = __esm({
|
20423
|
-
"../
|
21543
|
+
"../drizzle-orm/dist/pg-core/columns/point.js"() {
|
20424
21544
|
"use strict";
|
20425
21545
|
init_entity();
|
20426
21546
|
init_common2();
|
@@ -20485,7 +21605,7 @@ var init_point = __esm({
|
|
20485
21605
|
}
|
20486
21606
|
});
|
20487
21607
|
|
20488
|
-
// ../
|
21608
|
+
// ../drizzle-orm/dist/pg-core/columns/postgis_extension/utils.js
|
20489
21609
|
function hexToBytes(hex) {
|
20490
21610
|
const bytes = [];
|
20491
21611
|
for (let c = 0; c < hex.length; c += 2) {
|
@@ -20524,15 +21644,15 @@ function parseEWKB(hex) {
|
|
20524
21644
|
throw new Error("Unsupported geometry type");
|
20525
21645
|
}
|
20526
21646
|
var init_utils3 = __esm({
|
20527
|
-
"../
|
21647
|
+
"../drizzle-orm/dist/pg-core/columns/postgis_extension/utils.js"() {
|
20528
21648
|
"use strict";
|
20529
21649
|
}
|
20530
21650
|
});
|
20531
21651
|
|
20532
|
-
// ../
|
21652
|
+
// ../drizzle-orm/dist/pg-core/columns/postgis_extension/geometry.js
|
20533
21653
|
var _a92, _b65, PgGeometryBuilder, _a93, _b66, PgGeometry, _a94, _b67, PgGeometryObjectBuilder, _a95, _b68, PgGeometryObject;
|
20534
21654
|
var init_geometry = __esm({
|
20535
|
-
"../
|
21655
|
+
"../drizzle-orm/dist/pg-core/columns/postgis_extension/geometry.js"() {
|
20536
21656
|
"use strict";
|
20537
21657
|
init_entity();
|
20538
21658
|
init_common2();
|
@@ -20591,10 +21711,10 @@ var init_geometry = __esm({
|
|
20591
21711
|
}
|
20592
21712
|
});
|
20593
21713
|
|
20594
|
-
// ../
|
21714
|
+
// ../drizzle-orm/dist/pg-core/columns/real.js
|
20595
21715
|
var _a96, _b69, PgRealBuilder, _a97, _b70, PgReal;
|
20596
21716
|
var init_real = __esm({
|
20597
|
-
"../
|
21717
|
+
"../drizzle-orm/dist/pg-core/columns/real.js"() {
|
20598
21718
|
"use strict";
|
20599
21719
|
init_entity();
|
20600
21720
|
init_common2();
|
@@ -20627,10 +21747,10 @@ var init_real = __esm({
|
|
20627
21747
|
}
|
20628
21748
|
});
|
20629
21749
|
|
20630
|
-
// ../
|
21750
|
+
// ../drizzle-orm/dist/pg-core/columns/serial.js
|
20631
21751
|
var _a98, _b71, PgSerialBuilder, _a99, _b72, PgSerial;
|
20632
21752
|
var init_serial = __esm({
|
20633
|
-
"../
|
21753
|
+
"../drizzle-orm/dist/pg-core/columns/serial.js"() {
|
20634
21754
|
"use strict";
|
20635
21755
|
init_entity();
|
20636
21756
|
init_common2();
|
@@ -20655,10 +21775,10 @@ var init_serial = __esm({
|
|
20655
21775
|
}
|
20656
21776
|
});
|
20657
21777
|
|
20658
|
-
// ../
|
21778
|
+
// ../drizzle-orm/dist/pg-core/columns/smallint.js
|
20659
21779
|
var _a100, _b73, PgSmallIntBuilder, _a101, _b74, PgSmallInt;
|
20660
21780
|
var init_smallint = __esm({
|
20661
|
-
"../
|
21781
|
+
"../drizzle-orm/dist/pg-core/columns/smallint.js"() {
|
20662
21782
|
"use strict";
|
20663
21783
|
init_entity();
|
20664
21784
|
init_common2();
|
@@ -20691,10 +21811,10 @@ var init_smallint = __esm({
|
|
20691
21811
|
}
|
20692
21812
|
});
|
20693
21813
|
|
20694
|
-
// ../
|
21814
|
+
// ../drizzle-orm/dist/pg-core/columns/smallserial.js
|
20695
21815
|
var _a102, _b75, PgSmallSerialBuilder, _a103, _b76, PgSmallSerial;
|
20696
21816
|
var init_smallserial = __esm({
|
20697
|
-
"../
|
21817
|
+
"../drizzle-orm/dist/pg-core/columns/smallserial.js"() {
|
20698
21818
|
"use strict";
|
20699
21819
|
init_entity();
|
20700
21820
|
init_common2();
|
@@ -20722,10 +21842,10 @@ var init_smallserial = __esm({
|
|
20722
21842
|
}
|
20723
21843
|
});
|
20724
21844
|
|
20725
|
-
// ../
|
21845
|
+
// ../drizzle-orm/dist/pg-core/columns/text.js
|
20726
21846
|
var _a104, _b77, PgTextBuilder, _a105, _b78, PgText;
|
20727
21847
|
var init_text = __esm({
|
20728
|
-
"../
|
21848
|
+
"../drizzle-orm/dist/pg-core/columns/text.js"() {
|
20729
21849
|
"use strict";
|
20730
21850
|
init_entity();
|
20731
21851
|
init_common2();
|
@@ -20753,10 +21873,10 @@ var init_text = __esm({
|
|
20753
21873
|
}
|
20754
21874
|
});
|
20755
21875
|
|
20756
|
-
// ../
|
21876
|
+
// ../drizzle-orm/dist/pg-core/columns/time.js
|
20757
21877
|
var _a106, _b79, PgTimeBuilder, _a107, _b80, PgTime;
|
20758
21878
|
var init_time = __esm({
|
20759
|
-
"../
|
21879
|
+
"../drizzle-orm/dist/pg-core/columns/time.js"() {
|
20760
21880
|
"use strict";
|
20761
21881
|
init_entity();
|
20762
21882
|
init_common2();
|
@@ -20792,10 +21912,10 @@ var init_time = __esm({
|
|
20792
21912
|
}
|
20793
21913
|
});
|
20794
21914
|
|
20795
|
-
// ../
|
21915
|
+
// ../drizzle-orm/dist/pg-core/columns/timestamp.js
|
20796
21916
|
var _a108, _b81, PgTimestampBuilder, _a109, _b82, PgTimestamp, _a110, _b83, PgTimestampStringBuilder, _a111, _b84, PgTimestampString;
|
20797
21917
|
var init_timestamp = __esm({
|
20798
|
-
"../
|
21918
|
+
"../drizzle-orm/dist/pg-core/columns/timestamp.js"() {
|
20799
21919
|
"use strict";
|
20800
21920
|
init_entity();
|
20801
21921
|
init_common2();
|
@@ -20864,10 +21984,10 @@ var init_timestamp = __esm({
|
|
20864
21984
|
}
|
20865
21985
|
});
|
20866
21986
|
|
20867
|
-
// ../
|
21987
|
+
// ../drizzle-orm/dist/pg-core/columns/uuid.js
|
20868
21988
|
var _a112, _b85, PgUUIDBuilder, _a113, _b86, PgUUID;
|
20869
21989
|
var init_uuid = __esm({
|
20870
|
-
"../
|
21990
|
+
"../drizzle-orm/dist/pg-core/columns/uuid.js"() {
|
20871
21991
|
"use strict";
|
20872
21992
|
init_entity();
|
20873
21993
|
init_sql();
|
@@ -20897,10 +22017,10 @@ var init_uuid = __esm({
|
|
20897
22017
|
}
|
20898
22018
|
});
|
20899
22019
|
|
20900
|
-
// ../
|
22020
|
+
// ../drizzle-orm/dist/pg-core/columns/varchar.js
|
20901
22021
|
var _a114, _b87, PgVarcharBuilder, _a115, _b88, PgVarchar;
|
20902
22022
|
var init_varchar = __esm({
|
20903
|
-
"../
|
22023
|
+
"../drizzle-orm/dist/pg-core/columns/varchar.js"() {
|
20904
22024
|
"use strict";
|
20905
22025
|
init_entity();
|
20906
22026
|
init_common2();
|
@@ -20930,10 +22050,10 @@ var init_varchar = __esm({
|
|
20930
22050
|
}
|
20931
22051
|
});
|
20932
22052
|
|
20933
|
-
// ../
|
22053
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/bit.js
|
20934
22054
|
var _a116, _b89, PgBinaryVectorBuilder, _a117, _b90, PgBinaryVector;
|
20935
22055
|
var init_bit = __esm({
|
20936
|
-
"../
|
22056
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/bit.js"() {
|
20937
22057
|
"use strict";
|
20938
22058
|
init_entity();
|
20939
22059
|
init_common2();
|
@@ -20964,10 +22084,10 @@ var init_bit = __esm({
|
|
20964
22084
|
}
|
20965
22085
|
});
|
20966
22086
|
|
20967
|
-
// ../
|
22087
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/halfvec.js
|
20968
22088
|
var _a118, _b91, PgHalfVectorBuilder, _a119, _b92, PgHalfVector;
|
20969
22089
|
var init_halfvec = __esm({
|
20970
|
-
"../
|
22090
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/halfvec.js"() {
|
20971
22091
|
"use strict";
|
20972
22092
|
init_entity();
|
20973
22093
|
init_common2();
|
@@ -21004,10 +22124,10 @@ var init_halfvec = __esm({
|
|
21004
22124
|
}
|
21005
22125
|
});
|
21006
22126
|
|
21007
|
-
// ../
|
22127
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/sparsevec.js
|
21008
22128
|
var _a120, _b93, PgSparseVectorBuilder, _a121, _b94, PgSparseVector;
|
21009
22129
|
var init_sparsevec = __esm({
|
21010
|
-
"../
|
22130
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/sparsevec.js"() {
|
21011
22131
|
"use strict";
|
21012
22132
|
init_entity();
|
21013
22133
|
init_common2();
|
@@ -21038,10 +22158,10 @@ var init_sparsevec = __esm({
|
|
21038
22158
|
}
|
21039
22159
|
});
|
21040
22160
|
|
21041
|
-
// ../
|
22161
|
+
// ../drizzle-orm/dist/pg-core/columns/vector_extension/vector.js
|
21042
22162
|
var _a122, _b95, PgVectorBuilder, _a123, _b96, PgVector;
|
21043
22163
|
var init_vector2 = __esm({
|
21044
|
-
"../
|
22164
|
+
"../drizzle-orm/dist/pg-core/columns/vector_extension/vector.js"() {
|
21045
22165
|
"use strict";
|
21046
22166
|
init_entity();
|
21047
22167
|
init_common2();
|
@@ -21075,9 +22195,9 @@ var init_vector2 = __esm({
|
|
21075
22195
|
}
|
21076
22196
|
});
|
21077
22197
|
|
21078
|
-
// ../
|
22198
|
+
// ../drizzle-orm/dist/pg-core/columns/index.js
|
21079
22199
|
var init_columns = __esm({
|
21080
|
-
"../
|
22200
|
+
"../drizzle-orm/dist/pg-core/columns/index.js"() {
|
21081
22201
|
"use strict";
|
21082
22202
|
init_bigint();
|
21083
22203
|
init_bigserial();
|
@@ -21116,10 +22236,10 @@ var init_columns = __esm({
|
|
21116
22236
|
}
|
21117
22237
|
});
|
21118
22238
|
|
21119
|
-
// ../
|
22239
|
+
// ../drizzle-orm/dist/pg-core/query-builders/delete.js
|
21120
22240
|
var _a124, _b97, PgDeleteBase;
|
21121
22241
|
var init_delete = __esm({
|
21122
|
-
"../
|
22242
|
+
"../drizzle-orm/dist/pg-core/query-builders/delete.js"() {
|
21123
22243
|
"use strict";
|
21124
22244
|
init_entity();
|
21125
22245
|
init_query_promise();
|
@@ -21201,10 +22321,10 @@ var init_delete = __esm({
|
|
21201
22321
|
}
|
21202
22322
|
});
|
21203
22323
|
|
21204
|
-
// ../
|
22324
|
+
// ../drizzle-orm/dist/pg-core/query-builders/insert.js
|
21205
22325
|
var _a125, PgInsertBuilder, _a126, _b98, PgInsertBase;
|
21206
22326
|
var init_insert = __esm({
|
21207
|
-
"../
|
22327
|
+
"../drizzle-orm/dist/pg-core/query-builders/insert.js"() {
|
21208
22328
|
"use strict";
|
21209
22329
|
init_entity();
|
21210
22330
|
init_query_promise();
|
@@ -21357,10 +22477,10 @@ var init_insert = __esm({
|
|
21357
22477
|
}
|
21358
22478
|
});
|
21359
22479
|
|
21360
|
-
// ../
|
22480
|
+
// ../drizzle-orm/dist/pg-core/view-base.js
|
21361
22481
|
var _a127, _b99, PgViewBase;
|
21362
22482
|
var init_view_base = __esm({
|
21363
|
-
"../
|
22483
|
+
"../drizzle-orm/dist/pg-core/view-base.js"() {
|
21364
22484
|
"use strict";
|
21365
22485
|
init_entity();
|
21366
22486
|
init_sql();
|
@@ -21370,10 +22490,10 @@ var init_view_base = __esm({
|
|
21370
22490
|
}
|
21371
22491
|
});
|
21372
22492
|
|
21373
|
-
// ../
|
22493
|
+
// ../drizzle-orm/dist/pg-core/dialect.js
|
21374
22494
|
var _a128, PgDialect;
|
21375
22495
|
var init_dialect = __esm({
|
21376
|
-
"../
|
22496
|
+
"../drizzle-orm/dist/pg-core/dialect.js"() {
|
21377
22497
|
"use strict";
|
21378
22498
|
init_alias();
|
21379
22499
|
init_column();
|
@@ -22453,10 +23573,10 @@ var init_dialect = __esm({
|
|
22453
23573
|
}
|
22454
23574
|
});
|
22455
23575
|
|
22456
|
-
// ../
|
23576
|
+
// ../drizzle-orm/dist/selection-proxy.js
|
22457
23577
|
var _a129, _SelectionProxyHandler, SelectionProxyHandler;
|
22458
23578
|
var init_selection_proxy = __esm({
|
22459
|
-
"../
|
23579
|
+
"../drizzle-orm/dist/selection-proxy.js"() {
|
22460
23580
|
"use strict";
|
22461
23581
|
init_alias();
|
22462
23582
|
init_column();
|
@@ -22535,10 +23655,10 @@ var init_selection_proxy = __esm({
|
|
22535
23655
|
}
|
22536
23656
|
});
|
22537
23657
|
|
22538
|
-
// ../
|
23658
|
+
// ../drizzle-orm/dist/query-builders/query-builder.js
|
22539
23659
|
var _a130, TypedQueryBuilder;
|
22540
23660
|
var init_query_builder = __esm({
|
22541
|
-
"../
|
23661
|
+
"../drizzle-orm/dist/query-builders/query-builder.js"() {
|
22542
23662
|
"use strict";
|
22543
23663
|
init_entity();
|
22544
23664
|
_a130 = entityKind;
|
@@ -22552,7 +23672,7 @@ var init_query_builder = __esm({
|
|
22552
23672
|
}
|
22553
23673
|
});
|
22554
23674
|
|
22555
|
-
// ../
|
23675
|
+
// ../drizzle-orm/dist/pg-core/query-builders/select.js
|
22556
23676
|
function createSetOperator(type, isAll) {
|
22557
23677
|
return (leftSelect, rightSelect, ...restSelects) => {
|
22558
23678
|
const setOperators = [rightSelect, ...restSelects].map((select) => ({
|
@@ -22572,7 +23692,7 @@ function createSetOperator(type, isAll) {
|
|
22572
23692
|
}
|
22573
23693
|
var _a131, PgSelectBuilder, _a132, _b100, PgSelectQueryBuilderBase, _a133, _b101, PgSelectBase, getPgSetOperators, union, unionAll, intersect, intersectAll, except, exceptAll;
|
22574
23694
|
var init_select2 = __esm({
|
22575
|
-
"../
|
23695
|
+
"../drizzle-orm/dist/pg-core/query-builders/select.js"() {
|
22576
23696
|
"use strict";
|
22577
23697
|
init_entity();
|
22578
23698
|
init_view_base();
|
@@ -23289,10 +24409,10 @@ var init_select2 = __esm({
|
|
23289
24409
|
}
|
23290
24410
|
});
|
23291
24411
|
|
23292
|
-
// ../
|
24412
|
+
// ../drizzle-orm/dist/pg-core/query-builders/query-builder.js
|
23293
24413
|
var _a134, QueryBuilder;
|
23294
24414
|
var init_query_builder2 = __esm({
|
23295
|
-
"../
|
24415
|
+
"../drizzle-orm/dist/pg-core/query-builders/query-builder.js"() {
|
23296
24416
|
"use strict";
|
23297
24417
|
init_entity();
|
23298
24418
|
init_dialect();
|
@@ -23381,10 +24501,10 @@ var init_query_builder2 = __esm({
|
|
23381
24501
|
}
|
23382
24502
|
});
|
23383
24503
|
|
23384
|
-
// ../
|
24504
|
+
// ../drizzle-orm/dist/pg-core/query-builders/refresh-materialized-view.js
|
23385
24505
|
var _a135, _b102, PgRefreshMaterializedView;
|
23386
24506
|
var init_refresh_materialized_view = __esm({
|
23387
|
-
"../
|
24507
|
+
"../drizzle-orm/dist/pg-core/query-builders/refresh-materialized-view.js"() {
|
23388
24508
|
"use strict";
|
23389
24509
|
init_entity();
|
23390
24510
|
init_query_promise();
|
@@ -23438,17 +24558,17 @@ var init_refresh_materialized_view = __esm({
|
|
23438
24558
|
}
|
23439
24559
|
});
|
23440
24560
|
|
23441
|
-
// ../
|
24561
|
+
// ../drizzle-orm/dist/pg-core/query-builders/select.types.js
|
23442
24562
|
var init_select_types = __esm({
|
23443
|
-
"../
|
24563
|
+
"../drizzle-orm/dist/pg-core/query-builders/select.types.js"() {
|
23444
24564
|
"use strict";
|
23445
24565
|
}
|
23446
24566
|
});
|
23447
24567
|
|
23448
|
-
// ../
|
24568
|
+
// ../drizzle-orm/dist/pg-core/query-builders/update.js
|
23449
24569
|
var _a136, PgUpdateBuilder, _a137, _b103, PgUpdateBase;
|
23450
24570
|
var init_update = __esm({
|
23451
|
-
"../
|
24571
|
+
"../drizzle-orm/dist/pg-core/query-builders/update.js"() {
|
23452
24572
|
"use strict";
|
23453
24573
|
init_entity();
|
23454
24574
|
init_query_promise();
|
@@ -23548,9 +24668,9 @@ var init_update = __esm({
|
|
23548
24668
|
}
|
23549
24669
|
});
|
23550
24670
|
|
23551
|
-
// ../
|
24671
|
+
// ../drizzle-orm/dist/pg-core/query-builders/index.js
|
23552
24672
|
var init_query_builders = __esm({
|
23553
|
-
"../
|
24673
|
+
"../drizzle-orm/dist/pg-core/query-builders/index.js"() {
|
23554
24674
|
"use strict";
|
23555
24675
|
init_delete();
|
23556
24676
|
init_insert();
|
@@ -23562,10 +24682,10 @@ var init_query_builders = __esm({
|
|
23562
24682
|
}
|
23563
24683
|
});
|
23564
24684
|
|
23565
|
-
// ../
|
24685
|
+
// ../drizzle-orm/dist/pg-core/query-builders/query.js
|
23566
24686
|
var _a138, RelationalQueryBuilder, _a139, _b104, PgRelationalQuery;
|
23567
24687
|
var init_query = __esm({
|
23568
|
-
"../
|
24688
|
+
"../drizzle-orm/dist/pg-core/query-builders/query.js"() {
|
23569
24689
|
"use strict";
|
23570
24690
|
init_entity();
|
23571
24691
|
init_query_promise();
|
@@ -23680,10 +24800,10 @@ var init_query = __esm({
|
|
23680
24800
|
}
|
23681
24801
|
});
|
23682
24802
|
|
23683
|
-
// ../
|
24803
|
+
// ../drizzle-orm/dist/pg-core/query-builders/raw.js
|
23684
24804
|
var _a140, _b105, PgRaw;
|
23685
24805
|
var init_raw = __esm({
|
23686
|
-
"../
|
24806
|
+
"../drizzle-orm/dist/pg-core/query-builders/raw.js"() {
|
23687
24807
|
"use strict";
|
23688
24808
|
init_entity();
|
23689
24809
|
init_query_promise();
|
@@ -23717,10 +24837,10 @@ var init_raw = __esm({
|
|
23717
24837
|
}
|
23718
24838
|
});
|
23719
24839
|
|
23720
|
-
// ../
|
24840
|
+
// ../drizzle-orm/dist/pg-core/db.js
|
23721
24841
|
var _a141, PgDatabase;
|
23722
24842
|
var init_db = __esm({
|
23723
|
-
"../
|
24843
|
+
"../drizzle-orm/dist/pg-core/db.js"() {
|
23724
24844
|
"use strict";
|
23725
24845
|
init_entity();
|
23726
24846
|
init_query_builders();
|
@@ -23998,10 +25118,10 @@ var init_db = __esm({
|
|
23998
25118
|
}
|
23999
25119
|
});
|
24000
25120
|
|
24001
|
-
// ../
|
25121
|
+
// ../drizzle-orm/dist/pg-core/indexes.js
|
24002
25122
|
var _a142, IndexBuilderOn, _a143, IndexBuilder, _a144, Index2;
|
24003
25123
|
var init_indexes = __esm({
|
24004
|
-
"../
|
25124
|
+
"../drizzle-orm/dist/pg-core/indexes.js"() {
|
24005
25125
|
"use strict";
|
24006
25126
|
init_sql();
|
24007
25127
|
init_entity();
|
@@ -24116,7 +25236,7 @@ var init_indexes = __esm({
|
|
24116
25236
|
}
|
24117
25237
|
});
|
24118
25238
|
|
24119
|
-
// ../
|
25239
|
+
// ../drizzle-orm/dist/pg-core/sequence.js
|
24120
25240
|
function pgSequenceWithSchema(name2, options, schema4) {
|
24121
25241
|
return new PgSequence(name2, options, schema4);
|
24122
25242
|
}
|
@@ -24125,7 +25245,7 @@ function isPgSequence(obj) {
|
|
24125
25245
|
}
|
24126
25246
|
var _a145, PgSequence;
|
24127
25247
|
var init_sequence = __esm({
|
24128
|
-
"../
|
25248
|
+
"../drizzle-orm/dist/pg-core/sequence.js"() {
|
24129
25249
|
"use strict";
|
24130
25250
|
init_entity();
|
24131
25251
|
_a145 = entityKind;
|
@@ -24140,16 +25260,16 @@ var init_sequence = __esm({
|
|
24140
25260
|
}
|
24141
25261
|
});
|
24142
25262
|
|
24143
|
-
// ../
|
25263
|
+
// ../drizzle-orm/dist/pg-core/view-common.js
|
24144
25264
|
var PgViewConfig;
|
24145
25265
|
var init_view_common2 = __esm({
|
24146
|
-
"../
|
25266
|
+
"../drizzle-orm/dist/pg-core/view-common.js"() {
|
24147
25267
|
"use strict";
|
24148
25268
|
PgViewConfig = Symbol.for("drizzle:PgViewConfig");
|
24149
25269
|
}
|
24150
25270
|
});
|
24151
25271
|
|
24152
|
-
// ../
|
25272
|
+
// ../drizzle-orm/dist/pg-core/view.js
|
24153
25273
|
function pgViewWithSchema(name2, selection, schema4) {
|
24154
25274
|
if (selection) {
|
24155
25275
|
return new ManualViewBuilder(name2, selection, schema4);
|
@@ -24164,7 +25284,7 @@ function pgMaterializedViewWithSchema(name2, selection, schema4) {
|
|
24164
25284
|
}
|
24165
25285
|
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;
|
24166
25286
|
var init_view = __esm({
|
24167
|
-
"../
|
25287
|
+
"../drizzle-orm/dist/pg-core/view.js"() {
|
24168
25288
|
"use strict";
|
24169
25289
|
init_entity();
|
24170
25290
|
init_selection_proxy();
|
@@ -24391,10 +25511,10 @@ var init_view = __esm({
|
|
24391
25511
|
}
|
24392
25512
|
});
|
24393
25513
|
|
24394
|
-
// ../
|
25514
|
+
// ../drizzle-orm/dist/pg-core/schema.js
|
24395
25515
|
var _a154, PgSchema5;
|
24396
25516
|
var init_schema = __esm({
|
24397
|
-
"../
|
25517
|
+
"../drizzle-orm/dist/pg-core/schema.js"() {
|
24398
25518
|
"use strict";
|
24399
25519
|
init_entity();
|
24400
25520
|
init_sql();
|
@@ -24433,10 +25553,10 @@ var init_schema = __esm({
|
|
24433
25553
|
}
|
24434
25554
|
});
|
24435
25555
|
|
24436
|
-
// ../
|
25556
|
+
// ../drizzle-orm/dist/pg-core/session.js
|
24437
25557
|
var _a155, PgPreparedQuery, _a156, PgSession, _a157, _b112, PgTransaction;
|
24438
25558
|
var init_session = __esm({
|
24439
|
-
"../
|
25559
|
+
"../drizzle-orm/dist/pg-core/session.js"() {
|
24440
25560
|
"use strict";
|
24441
25561
|
init_entity();
|
24442
25562
|
init_errors();
|
@@ -24517,14 +25637,14 @@ var init_session = __esm({
|
|
24517
25637
|
}
|
24518
25638
|
});
|
24519
25639
|
|
24520
|
-
// ../
|
25640
|
+
// ../drizzle-orm/dist/pg-core/subquery.js
|
24521
25641
|
var init_subquery2 = __esm({
|
24522
|
-
"../
|
25642
|
+
"../drizzle-orm/dist/pg-core/subquery.js"() {
|
24523
25643
|
"use strict";
|
24524
25644
|
}
|
24525
25645
|
});
|
24526
25646
|
|
24527
|
-
// ../
|
25647
|
+
// ../drizzle-orm/dist/pg-core/utils.js
|
24528
25648
|
function getTableConfig(table4) {
|
24529
25649
|
const columns = Object.values(table4[Table2.Symbol.Columns]);
|
24530
25650
|
const indexes = [];
|
@@ -24563,7 +25683,7 @@ function getTableConfig(table4) {
|
|
24563
25683
|
};
|
24564
25684
|
}
|
24565
25685
|
var init_utils4 = __esm({
|
24566
|
-
"../
|
25686
|
+
"../drizzle-orm/dist/pg-core/utils.js"() {
|
24567
25687
|
"use strict";
|
24568
25688
|
init_entity();
|
24569
25689
|
init_table2();
|
@@ -24576,17 +25696,17 @@ var init_utils4 = __esm({
|
|
24576
25696
|
}
|
24577
25697
|
});
|
24578
25698
|
|
24579
|
-
// ../
|
25699
|
+
// ../drizzle-orm/dist/pg-core/utils/index.js
|
24580
25700
|
var init_utils5 = __esm({
|
24581
|
-
"../
|
25701
|
+
"../drizzle-orm/dist/pg-core/utils/index.js"() {
|
24582
25702
|
"use strict";
|
24583
25703
|
init_array();
|
24584
25704
|
}
|
24585
25705
|
});
|
24586
25706
|
|
24587
|
-
// ../
|
25707
|
+
// ../drizzle-orm/dist/pg-core/index.js
|
24588
25708
|
var init_pg_core = __esm({
|
24589
|
-
"../
|
25709
|
+
"../drizzle-orm/dist/pg-core/index.js"() {
|
24590
25710
|
"use strict";
|
24591
25711
|
init_alias2();
|
24592
25712
|
init_checks();
|
@@ -24641,16 +25761,41 @@ function minRangeForIdentityBasedOn(columnType) {
|
|
24641
25761
|
function stringFromDatabaseIdentityProperty(field) {
|
24642
25762
|
return typeof field === "string" ? field : typeof field === "undefined" ? void 0 : typeof field === "bigint" ? field.toString() : String(field);
|
24643
25763
|
}
|
25764
|
+
function buildArrayString(array, sqlType) {
|
25765
|
+
sqlType = sqlType.split("[")[0];
|
25766
|
+
const values = array.map((value) => {
|
25767
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
25768
|
+
return value.toString();
|
25769
|
+
} else if (typeof value === "boolean") {
|
25770
|
+
return value ? "true" : "false";
|
25771
|
+
} else if (Array.isArray(value)) {
|
25772
|
+
return buildArrayString(value, sqlType);
|
25773
|
+
} else if (value instanceof Date) {
|
25774
|
+
if (sqlType === "date") {
|
25775
|
+
return `"${value.toISOString().split("T")[0]}"`;
|
25776
|
+
} else if (sqlType === "timestamp") {
|
25777
|
+
return `"${value.toISOString().replace("T", " ").slice(0, 23)}"`;
|
25778
|
+
} else {
|
25779
|
+
return `"${value.toISOString()}"`;
|
25780
|
+
}
|
25781
|
+
} else if (typeof value === "object") {
|
25782
|
+
return `"${JSON.stringify(value).replaceAll('"', '\\"')}"`;
|
25783
|
+
}
|
25784
|
+
return `"${value}"`;
|
25785
|
+
}).join(",");
|
25786
|
+
return `{${values}}`;
|
25787
|
+
}
|
24644
25788
|
var dialect4, indexName, generatePgSnapshot, trimChar, fromDatabase, columnToDefault, defaultForColumn;
|
24645
25789
|
var init_pgSerializer = __esm({
|
24646
25790
|
"src/serializer/pgSerializer.ts"() {
|
24647
25791
|
"use strict";
|
24648
25792
|
init_source();
|
24649
|
-
|
25793
|
+
init_dist();
|
24650
25794
|
init_pg_core();
|
24651
25795
|
init_pg_core();
|
24652
25796
|
init_vector3();
|
24653
25797
|
init_outputs();
|
25798
|
+
init_utils();
|
24654
25799
|
init_serializer();
|
24655
25800
|
dialect4 = new PgDialect();
|
24656
25801
|
indexName = (tableName, columns) => {
|
@@ -24757,6 +25902,11 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
24757
25902
|
} else {
|
24758
25903
|
columnToSet.default = `'${column4.default.toISOString()}'`;
|
24759
25904
|
}
|
25905
|
+
} else if (isPgArrayType(sqlTypeLowered) && Array.isArray(column4.default)) {
|
25906
|
+
columnToSet.default = `'${buildArrayString(
|
25907
|
+
column4.default,
|
25908
|
+
sqlTypeLowered
|
25909
|
+
)}'::${sqlTypeLowered}`;
|
24760
25910
|
} else {
|
24761
25911
|
columnToSet.default = column4.default;
|
24762
25912
|
}
|
@@ -25555,17 +26705,17 @@ var init_selector_ui = __esm({
|
|
25555
26705
|
}
|
25556
26706
|
});
|
25557
26707
|
|
25558
|
-
// ../
|
26708
|
+
// ../drizzle-orm/dist/sqlite-core/alias.js
|
25559
26709
|
var init_alias3 = __esm({
|
25560
|
-
"../
|
26710
|
+
"../drizzle-orm/dist/sqlite-core/alias.js"() {
|
25561
26711
|
"use strict";
|
25562
26712
|
}
|
25563
26713
|
});
|
25564
26714
|
|
25565
|
-
// ../
|
26715
|
+
// ../drizzle-orm/dist/sqlite-core/checks.js
|
25566
26716
|
var _a158, CheckBuilder2, _a159, Check2;
|
25567
26717
|
var init_checks2 = __esm({
|
25568
|
-
"../
|
26718
|
+
"../drizzle-orm/dist/sqlite-core/checks.js"() {
|
25569
26719
|
"use strict";
|
25570
26720
|
init_entity();
|
25571
26721
|
_a158 = entityKind;
|
@@ -25594,7 +26744,7 @@ var init_checks2 = __esm({
|
|
25594
26744
|
}
|
25595
26745
|
});
|
25596
26746
|
|
25597
|
-
// ../
|
26747
|
+
// ../drizzle-orm/dist/sqlite-core/table.js
|
25598
26748
|
function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2) {
|
25599
26749
|
const rawTable = new SQLiteTable(name2, schema4, baseName);
|
25600
26750
|
const builtColumns = Object.fromEntries(
|
@@ -25615,7 +26765,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
|
|
25615
26765
|
}
|
25616
26766
|
var InlineForeignKeys2, _a160, _b113, _c5, _d3, _e2, SQLiteTable, sqliteTable;
|
25617
26767
|
var init_table3 = __esm({
|
25618
|
-
"../
|
26768
|
+
"../drizzle-orm/dist/sqlite-core/table.js"() {
|
25619
26769
|
"use strict";
|
25620
26770
|
init_entity();
|
25621
26771
|
init_table();
|
@@ -25642,10 +26792,10 @@ var init_table3 = __esm({
|
|
25642
26792
|
}
|
25643
26793
|
});
|
25644
26794
|
|
25645
|
-
// ../
|
26795
|
+
// ../drizzle-orm/dist/sqlite-core/foreign-keys.js
|
25646
26796
|
var _a161, ForeignKeyBuilder2, _a162, ForeignKey2;
|
25647
26797
|
var init_foreign_keys2 = __esm({
|
25648
|
-
"../
|
26798
|
+
"../drizzle-orm/dist/sqlite-core/foreign-keys.js"() {
|
25649
26799
|
"use strict";
|
25650
26800
|
init_entity();
|
25651
26801
|
init_table3();
|
@@ -25709,13 +26859,13 @@ var init_foreign_keys2 = __esm({
|
|
25709
26859
|
}
|
25710
26860
|
});
|
25711
26861
|
|
25712
|
-
// ../
|
26862
|
+
// ../drizzle-orm/dist/sqlite-core/unique-constraint.js
|
25713
26863
|
function uniqueKeyName2(table4, columns) {
|
25714
26864
|
return `${table4[SQLiteTable.Symbol.Name]}_${columns.join("_")}_unique`;
|
25715
26865
|
}
|
25716
26866
|
var _a163, UniqueConstraintBuilder2, _a164, UniqueOnConstraintBuilder2, _a165, UniqueConstraint2;
|
25717
26867
|
var init_unique_constraint2 = __esm({
|
25718
|
-
"../
|
26868
|
+
"../drizzle-orm/dist/sqlite-core/unique-constraint.js"() {
|
25719
26869
|
"use strict";
|
25720
26870
|
init_entity();
|
25721
26871
|
init_table3();
|
@@ -25762,10 +26912,10 @@ var init_unique_constraint2 = __esm({
|
|
25762
26912
|
}
|
25763
26913
|
});
|
25764
26914
|
|
25765
|
-
// ../
|
26915
|
+
// ../drizzle-orm/dist/sqlite-core/columns/common.js
|
25766
26916
|
var _a166, _b114, SQLiteColumnBuilder, _a167, _b115, SQLiteColumn;
|
25767
26917
|
var init_common3 = __esm({
|
25768
|
-
"../
|
26918
|
+
"../drizzle-orm/dist/sqlite-core/columns/common.js"() {
|
25769
26919
|
"use strict";
|
25770
26920
|
init_column_builder();
|
25771
26921
|
init_column();
|
@@ -25827,10 +26977,10 @@ var init_common3 = __esm({
|
|
25827
26977
|
}
|
25828
26978
|
});
|
25829
26979
|
|
25830
|
-
// ../
|
26980
|
+
// ../drizzle-orm/dist/sqlite-core/columns/blob.js
|
25831
26981
|
var _a168, _b116, SQLiteBigIntBuilder, _a169, _b117, SQLiteBigInt, _a170, _b118, SQLiteBlobJsonBuilder, _a171, _b119, SQLiteBlobJson, _a172, _b120, SQLiteBlobBufferBuilder, _a173, _b121, SQLiteBlobBuffer;
|
25832
26982
|
var init_blob = __esm({
|
25833
|
-
"../
|
26983
|
+
"../drizzle-orm/dist/sqlite-core/columns/blob.js"() {
|
25834
26984
|
"use strict";
|
25835
26985
|
init_entity();
|
25836
26986
|
init_common3();
|
@@ -25900,10 +27050,10 @@ var init_blob = __esm({
|
|
25900
27050
|
}
|
25901
27051
|
});
|
25902
27052
|
|
25903
|
-
// ../
|
27053
|
+
// ../drizzle-orm/dist/sqlite-core/columns/custom.js
|
25904
27054
|
var _a174, _b122, SQLiteCustomColumnBuilder, _a175, _b123, SQLiteCustomColumn;
|
25905
27055
|
var init_custom2 = __esm({
|
25906
|
-
"../
|
27056
|
+
"../drizzle-orm/dist/sqlite-core/columns/custom.js"() {
|
25907
27057
|
"use strict";
|
25908
27058
|
init_entity();
|
25909
27059
|
init_common3();
|
@@ -25946,10 +27096,10 @@ var init_custom2 = __esm({
|
|
25946
27096
|
}
|
25947
27097
|
});
|
25948
27098
|
|
25949
|
-
// ../
|
27099
|
+
// ../drizzle-orm/dist/sqlite-core/columns/integer.js
|
25950
27100
|
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;
|
25951
27101
|
var init_integer2 = __esm({
|
25952
|
-
"../
|
27102
|
+
"../drizzle-orm/dist/sqlite-core/columns/integer.js"() {
|
25953
27103
|
"use strict";
|
25954
27104
|
init_entity();
|
25955
27105
|
init_sql();
|
@@ -26063,10 +27213,10 @@ var init_integer2 = __esm({
|
|
26063
27213
|
}
|
26064
27214
|
});
|
26065
27215
|
|
26066
|
-
// ../
|
27216
|
+
// ../drizzle-orm/dist/sqlite-core/columns/numeric.js
|
26067
27217
|
var _a184, _b132, SQLiteNumericBuilder, _a185, _b133, SQLiteNumeric;
|
26068
27218
|
var init_numeric2 = __esm({
|
26069
|
-
"../
|
27219
|
+
"../drizzle-orm/dist/sqlite-core/columns/numeric.js"() {
|
26070
27220
|
"use strict";
|
26071
27221
|
init_entity();
|
26072
27222
|
init_common3();
|
@@ -26092,10 +27242,10 @@ var init_numeric2 = __esm({
|
|
26092
27242
|
}
|
26093
27243
|
});
|
26094
27244
|
|
26095
|
-
// ../
|
27245
|
+
// ../drizzle-orm/dist/sqlite-core/columns/real.js
|
26096
27246
|
var _a186, _b134, SQLiteRealBuilder, _a187, _b135, SQLiteReal;
|
26097
27247
|
var init_real2 = __esm({
|
26098
|
-
"../
|
27248
|
+
"../drizzle-orm/dist/sqlite-core/columns/real.js"() {
|
26099
27249
|
"use strict";
|
26100
27250
|
init_entity();
|
26101
27251
|
init_common3();
|
@@ -26118,10 +27268,10 @@ var init_real2 = __esm({
|
|
26118
27268
|
}
|
26119
27269
|
});
|
26120
27270
|
|
26121
|
-
// ../
|
27271
|
+
// ../drizzle-orm/dist/sqlite-core/columns/text.js
|
26122
27272
|
var _a188, _b136, SQLiteTextBuilder, _a189, _b137, SQLiteText, _a190, _b138, SQLiteTextJsonBuilder, _a191, _b139, SQLiteTextJson;
|
26123
27273
|
var init_text2 = __esm({
|
26124
|
-
"../
|
27274
|
+
"../drizzle-orm/dist/sqlite-core/columns/text.js"() {
|
26125
27275
|
"use strict";
|
26126
27276
|
init_entity();
|
26127
27277
|
init_common3();
|
@@ -26176,9 +27326,9 @@ var init_text2 = __esm({
|
|
26176
27326
|
}
|
26177
27327
|
});
|
26178
27328
|
|
26179
|
-
// ../
|
27329
|
+
// ../drizzle-orm/dist/sqlite-core/columns/index.js
|
26180
27330
|
var init_columns2 = __esm({
|
26181
|
-
"../
|
27331
|
+
"../drizzle-orm/dist/sqlite-core/columns/index.js"() {
|
26182
27332
|
"use strict";
|
26183
27333
|
init_blob();
|
26184
27334
|
init_common3();
|
@@ -26190,10 +27340,10 @@ var init_columns2 = __esm({
|
|
26190
27340
|
}
|
26191
27341
|
});
|
26192
27342
|
|
26193
|
-
// ../
|
27343
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/delete.js
|
26194
27344
|
var _a192, _b140, SQLiteDeleteBase;
|
26195
27345
|
var init_delete2 = __esm({
|
26196
|
-
"../
|
27346
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/delete.js"() {
|
26197
27347
|
"use strict";
|
26198
27348
|
init_entity();
|
26199
27349
|
init_query_promise();
|
@@ -26289,10 +27439,10 @@ var init_delete2 = __esm({
|
|
26289
27439
|
}
|
26290
27440
|
});
|
26291
27441
|
|
26292
|
-
// ../
|
27442
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/insert.js
|
26293
27443
|
var _a193, SQLiteInsertBuilder, _a194, _b141, SQLiteInsertBase;
|
26294
27444
|
var init_insert2 = __esm({
|
26295
|
-
"../
|
27445
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/insert.js"() {
|
26296
27446
|
"use strict";
|
26297
27447
|
init_entity();
|
26298
27448
|
init_query_promise();
|
@@ -26457,10 +27607,10 @@ var init_insert2 = __esm({
|
|
26457
27607
|
}
|
26458
27608
|
});
|
26459
27609
|
|
26460
|
-
// ../
|
27610
|
+
// ../drizzle-orm/dist/sqlite-core/view-base.js
|
26461
27611
|
var _a195, _b142, SQLiteViewBase;
|
26462
27612
|
var init_view_base2 = __esm({
|
26463
|
-
"../
|
27613
|
+
"../drizzle-orm/dist/sqlite-core/view-base.js"() {
|
26464
27614
|
"use strict";
|
26465
27615
|
init_entity();
|
26466
27616
|
init_sql();
|
@@ -26470,10 +27620,10 @@ var init_view_base2 = __esm({
|
|
26470
27620
|
}
|
26471
27621
|
});
|
26472
27622
|
|
26473
|
-
// ../
|
27623
|
+
// ../drizzle-orm/dist/sqlite-core/dialect.js
|
26474
27624
|
var _a196, SQLiteDialect, _a197, _b143, SQLiteSyncDialect, _a198, _b144, SQLiteAsyncDialect;
|
26475
27625
|
var init_dialect2 = __esm({
|
26476
|
-
"../
|
27626
|
+
"../drizzle-orm/dist/sqlite-core/dialect.js"() {
|
26477
27627
|
"use strict";
|
26478
27628
|
init_alias();
|
26479
27629
|
init_column();
|
@@ -27065,7 +28215,7 @@ var init_dialect2 = __esm({
|
|
27065
28215
|
}
|
27066
28216
|
});
|
27067
28217
|
|
27068
|
-
// ../
|
28218
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/select.js
|
27069
28219
|
function createSetOperator2(type, isAll) {
|
27070
28220
|
return (leftSelect, rightSelect, ...restSelects) => {
|
27071
28221
|
const setOperators = [rightSelect, ...restSelects].map((select) => ({
|
@@ -27085,7 +28235,7 @@ function createSetOperator2(type, isAll) {
|
|
27085
28235
|
}
|
27086
28236
|
var _a199, SQLiteSelectBuilder, _a200, _b145, SQLiteSelectQueryBuilderBase, _a201, _b146, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
|
27087
28237
|
var init_select3 = __esm({
|
27088
|
-
"../
|
28238
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/select.js"() {
|
27089
28239
|
"use strict";
|
27090
28240
|
init_entity();
|
27091
28241
|
init_query_builder();
|
@@ -27698,10 +28848,10 @@ var init_select3 = __esm({
|
|
27698
28848
|
}
|
27699
28849
|
});
|
27700
28850
|
|
27701
|
-
// ../
|
28851
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js
|
27702
28852
|
var _a202, QueryBuilder2;
|
27703
28853
|
var init_query_builder3 = __esm({
|
27704
|
-
"../
|
28854
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js"() {
|
27705
28855
|
"use strict";
|
27706
28856
|
init_entity();
|
27707
28857
|
init_selection_proxy();
|
@@ -27771,17 +28921,17 @@ var init_query_builder3 = __esm({
|
|
27771
28921
|
}
|
27772
28922
|
});
|
27773
28923
|
|
27774
|
-
// ../
|
28924
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/select.types.js
|
27775
28925
|
var init_select_types2 = __esm({
|
27776
|
-
"../
|
28926
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/select.types.js"() {
|
27777
28927
|
"use strict";
|
27778
28928
|
}
|
27779
28929
|
});
|
27780
28930
|
|
27781
|
-
// ../
|
28931
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/update.js
|
27782
28932
|
var _a203, SQLiteUpdateBuilder, _a204, _b147, SQLiteUpdateBase;
|
27783
28933
|
var init_update2 = __esm({
|
27784
|
-
"../
|
28934
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/update.js"() {
|
27785
28935
|
"use strict";
|
27786
28936
|
init_entity();
|
27787
28937
|
init_query_promise();
|
@@ -27899,9 +29049,9 @@ var init_update2 = __esm({
|
|
27899
29049
|
}
|
27900
29050
|
});
|
27901
29051
|
|
27902
|
-
// ../
|
29052
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/index.js
|
27903
29053
|
var init_query_builders2 = __esm({
|
27904
|
-
"../
|
29054
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/index.js"() {
|
27905
29055
|
"use strict";
|
27906
29056
|
init_delete2();
|
27907
29057
|
init_insert2();
|
@@ -27912,10 +29062,10 @@ var init_query_builders2 = __esm({
|
|
27912
29062
|
}
|
27913
29063
|
});
|
27914
29064
|
|
27915
|
-
// ../
|
29065
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/query.js
|
27916
29066
|
var _a205, RelationalQueryBuilder2, _a206, _b148, SQLiteRelationalQuery, _a207, _b149, SQLiteSyncRelationalQuery;
|
27917
29067
|
var init_query2 = __esm({
|
27918
|
-
"../
|
29068
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/query.js"() {
|
27919
29069
|
"use strict";
|
27920
29070
|
init_entity();
|
27921
29071
|
init_query_promise();
|
@@ -28066,10 +29216,10 @@ var init_query2 = __esm({
|
|
28066
29216
|
}
|
28067
29217
|
});
|
28068
29218
|
|
28069
|
-
// ../
|
29219
|
+
// ../drizzle-orm/dist/sqlite-core/query-builders/raw.js
|
28070
29220
|
var _a208, _b150, SQLiteRaw;
|
28071
29221
|
var init_raw2 = __esm({
|
28072
|
-
"../
|
29222
|
+
"../drizzle-orm/dist/sqlite-core/query-builders/raw.js"() {
|
28073
29223
|
"use strict";
|
28074
29224
|
init_entity();
|
28075
29225
|
init_query_promise();
|
@@ -28102,10 +29252,10 @@ var init_raw2 = __esm({
|
|
28102
29252
|
}
|
28103
29253
|
});
|
28104
29254
|
|
28105
|
-
// ../
|
29255
|
+
// ../drizzle-orm/dist/sqlite-core/db.js
|
28106
29256
|
var _a209, BaseSQLiteDatabase;
|
28107
29257
|
var init_db2 = __esm({
|
28108
|
-
"../
|
29258
|
+
"../drizzle-orm/dist/sqlite-core/db.js"() {
|
28109
29259
|
"use strict";
|
28110
29260
|
init_entity();
|
28111
29261
|
init_selection_proxy();
|
@@ -28395,10 +29545,10 @@ var init_db2 = __esm({
|
|
28395
29545
|
}
|
28396
29546
|
});
|
28397
29547
|
|
28398
|
-
// ../
|
29548
|
+
// ../drizzle-orm/dist/sqlite-core/indexes.js
|
28399
29549
|
var _a210, IndexBuilderOn2, _a211, IndexBuilder2, _a212, Index4;
|
28400
29550
|
var init_indexes2 = __esm({
|
28401
|
-
"../
|
29551
|
+
"../drizzle-orm/dist/sqlite-core/indexes.js"() {
|
28402
29552
|
"use strict";
|
28403
29553
|
init_entity();
|
28404
29554
|
_a210 = entityKind;
|
@@ -28448,10 +29598,10 @@ var init_indexes2 = __esm({
|
|
28448
29598
|
}
|
28449
29599
|
});
|
28450
29600
|
|
28451
|
-
// ../
|
29601
|
+
// ../drizzle-orm/dist/sqlite-core/primary-keys.js
|
28452
29602
|
var _a213, PrimaryKeyBuilder2, _a214, PrimaryKey2;
|
28453
29603
|
var init_primary_keys2 = __esm({
|
28454
|
-
"../
|
29604
|
+
"../drizzle-orm/dist/sqlite-core/primary-keys.js"() {
|
28455
29605
|
"use strict";
|
28456
29606
|
init_entity();
|
28457
29607
|
init_table3();
|
@@ -28488,10 +29638,10 @@ var init_primary_keys2 = __esm({
|
|
28488
29638
|
}
|
28489
29639
|
});
|
28490
29640
|
|
28491
|
-
// ../
|
29641
|
+
// ../drizzle-orm/dist/sqlite-core/session.js
|
28492
29642
|
var _a215, _b151, ExecuteResultSync, _a216, SQLitePreparedQuery, _a217, SQLiteSession, _a218, _b152, SQLiteTransaction;
|
28493
29643
|
var init_session2 = __esm({
|
28494
|
-
"../
|
29644
|
+
"../drizzle-orm/dist/sqlite-core/session.js"() {
|
28495
29645
|
"use strict";
|
28496
29646
|
init_entity();
|
28497
29647
|
init_errors();
|
@@ -28609,23 +29759,23 @@ var init_session2 = __esm({
|
|
28609
29759
|
}
|
28610
29760
|
});
|
28611
29761
|
|
28612
|
-
// ../
|
29762
|
+
// ../drizzle-orm/dist/sqlite-core/subquery.js
|
28613
29763
|
var init_subquery3 = __esm({
|
28614
|
-
"../
|
29764
|
+
"../drizzle-orm/dist/sqlite-core/subquery.js"() {
|
28615
29765
|
"use strict";
|
28616
29766
|
}
|
28617
29767
|
});
|
28618
29768
|
|
28619
|
-
// ../
|
29769
|
+
// ../drizzle-orm/dist/sqlite-core/view-common.js
|
28620
29770
|
var SQLiteViewConfig;
|
28621
29771
|
var init_view_common3 = __esm({
|
28622
|
-
"../
|
29772
|
+
"../drizzle-orm/dist/sqlite-core/view-common.js"() {
|
28623
29773
|
"use strict";
|
28624
29774
|
SQLiteViewConfig = Symbol.for("drizzle:SQLiteViewConfig");
|
28625
29775
|
}
|
28626
29776
|
});
|
28627
29777
|
|
28628
|
-
// ../
|
29778
|
+
// ../drizzle-orm/dist/sqlite-core/utils.js
|
28629
29779
|
function getTableConfig2(table4) {
|
28630
29780
|
const columns = Object.values(table4[SQLiteTable.Symbol.Columns]);
|
28631
29781
|
const indexes = [];
|
@@ -28662,7 +29812,7 @@ function getTableConfig2(table4) {
|
|
28662
29812
|
};
|
28663
29813
|
}
|
28664
29814
|
var init_utils6 = __esm({
|
28665
|
-
"../
|
29815
|
+
"../drizzle-orm/dist/sqlite-core/utils.js"() {
|
28666
29816
|
"use strict";
|
28667
29817
|
init_entity();
|
28668
29818
|
init_table();
|
@@ -28675,10 +29825,10 @@ var init_utils6 = __esm({
|
|
28675
29825
|
}
|
28676
29826
|
});
|
28677
29827
|
|
28678
|
-
// ../
|
29828
|
+
// ../drizzle-orm/dist/sqlite-core/view.js
|
28679
29829
|
var _a219, ViewBuilderCore, _a220, _b153, ViewBuilder2, _a221, _b154, ManualViewBuilder2, _a222, _b155, _c6, SQLiteView;
|
28680
29830
|
var init_view2 = __esm({
|
28681
|
-
"../
|
29831
|
+
"../drizzle-orm/dist/sqlite-core/view.js"() {
|
28682
29832
|
"use strict";
|
28683
29833
|
init_entity();
|
28684
29834
|
init_selection_proxy();
|
@@ -28780,9 +29930,9 @@ var init_view2 = __esm({
|
|
28780
29930
|
}
|
28781
29931
|
});
|
28782
29932
|
|
28783
|
-
// ../
|
29933
|
+
// ../drizzle-orm/dist/sqlite-core/index.js
|
28784
29934
|
var init_sqlite_core = __esm({
|
28785
|
-
"../
|
29935
|
+
"../drizzle-orm/dist/sqlite-core/index.js"() {
|
28786
29936
|
"use strict";
|
28787
29937
|
init_alias3();
|
28788
29938
|
init_checks2();
|
@@ -28869,7 +30019,7 @@ var init_sqliteSerializer = __esm({
|
|
28869
30019
|
"src/serializer/sqliteSerializer.ts"() {
|
28870
30020
|
"use strict";
|
28871
30021
|
init_source();
|
28872
|
-
|
30022
|
+
init_dist();
|
28873
30023
|
init_sqlite_core();
|
28874
30024
|
init_outputs();
|
28875
30025
|
init_serializer();
|
@@ -29036,7 +30186,7 @@ The unique constraint ${source_default.underline.blue(
|
|
29036
30186
|
primaryKeys.forEach((it) => {
|
29037
30187
|
if (it.columns.length > 1) {
|
29038
30188
|
primaryKeysObject[it.getName()] = {
|
29039
|
-
columns: it.columns.map((it2) => it2.name)
|
30189
|
+
columns: it.columns.map((it2) => it2.name),
|
29040
30190
|
name: it.getName()
|
29041
30191
|
};
|
29042
30192
|
} else {
|
@@ -29161,7 +30311,6 @@ The unique constraint ${source_default.underline.blue(
|
|
29161
30311
|
}
|
29162
30312
|
for (const [key, value] of Object.entries(tableToPk)) {
|
29163
30313
|
if (value.length > 1) {
|
29164
|
-
value.sort();
|
29165
30314
|
result[key].compositePrimaryKeys = {
|
29166
30315
|
[`${key}_${value.join("_")}_pk`]: {
|
29167
30316
|
columns: value,
|
@@ -29282,17 +30431,17 @@ WHERE
|
|
29282
30431
|
}
|
29283
30432
|
});
|
29284
30433
|
|
29285
|
-
// ../
|
30434
|
+
// ../drizzle-orm/dist/mysql-core/alias.js
|
29286
30435
|
var init_alias4 = __esm({
|
29287
|
-
"../
|
30436
|
+
"../drizzle-orm/dist/mysql-core/alias.js"() {
|
29288
30437
|
"use strict";
|
29289
30438
|
}
|
29290
30439
|
});
|
29291
30440
|
|
29292
|
-
// ../
|
30441
|
+
// ../drizzle-orm/dist/mysql-core/checks.js
|
29293
30442
|
var _a223, CheckBuilder3, _a224, Check3;
|
29294
30443
|
var init_checks3 = __esm({
|
29295
|
-
"../
|
30444
|
+
"../drizzle-orm/dist/mysql-core/checks.js"() {
|
29296
30445
|
"use strict";
|
29297
30446
|
init_entity();
|
29298
30447
|
_a223 = entityKind;
|
@@ -29322,7 +30471,7 @@ var init_checks3 = __esm({
|
|
29322
30471
|
}
|
29323
30472
|
});
|
29324
30473
|
|
29325
|
-
// ../
|
30474
|
+
// ../drizzle-orm/dist/mysql-core/table.js
|
29326
30475
|
function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = name2) {
|
29327
30476
|
const rawTable = new MySqlTable(name2, schema4, baseName);
|
29328
30477
|
const builtColumns = Object.fromEntries(
|
@@ -29343,7 +30492,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
|
|
29343
30492
|
}
|
29344
30493
|
var InlineForeignKeys3, _a225, _b156, _c7, _d4, _e3, MySqlTable, mysqlTable;
|
29345
30494
|
var init_table4 = __esm({
|
29346
|
-
"../
|
30495
|
+
"../drizzle-orm/dist/mysql-core/table.js"() {
|
29347
30496
|
"use strict";
|
29348
30497
|
init_entity();
|
29349
30498
|
init_table();
|
@@ -29370,10 +30519,10 @@ var init_table4 = __esm({
|
|
29370
30519
|
}
|
29371
30520
|
});
|
29372
30521
|
|
29373
|
-
// ../
|
30522
|
+
// ../drizzle-orm/dist/mysql-core/foreign-keys.js
|
29374
30523
|
var _a226, ForeignKeyBuilder3, _a227, ForeignKey3;
|
29375
30524
|
var init_foreign_keys3 = __esm({
|
29376
|
-
"../
|
30525
|
+
"../drizzle-orm/dist/mysql-core/foreign-keys.js"() {
|
29377
30526
|
"use strict";
|
29378
30527
|
init_entity();
|
29379
30528
|
init_table4();
|
@@ -29437,13 +30586,13 @@ var init_foreign_keys3 = __esm({
|
|
29437
30586
|
}
|
29438
30587
|
});
|
29439
30588
|
|
29440
|
-
// ../
|
30589
|
+
// ../drizzle-orm/dist/mysql-core/unique-constraint.js
|
29441
30590
|
function uniqueKeyName3(table4, columns) {
|
29442
30591
|
return `${table4[MySqlTable.Symbol.Name]}_${columns.join("_")}_unique`;
|
29443
30592
|
}
|
29444
30593
|
var _a228, UniqueConstraintBuilder3, _a229, UniqueOnConstraintBuilder3, _a230, UniqueConstraint3;
|
29445
30594
|
var init_unique_constraint3 = __esm({
|
29446
|
-
"../
|
30595
|
+
"../drizzle-orm/dist/mysql-core/unique-constraint.js"() {
|
29447
30596
|
"use strict";
|
29448
30597
|
init_entity();
|
29449
30598
|
init_table4();
|
@@ -29491,10 +30640,10 @@ var init_unique_constraint3 = __esm({
|
|
29491
30640
|
}
|
29492
30641
|
});
|
29493
30642
|
|
29494
|
-
// ../
|
30643
|
+
// ../drizzle-orm/dist/mysql-core/columns/common.js
|
29495
30644
|
var _a231, _b157, MySqlColumnBuilder, _a232, _b158, MySqlColumn, _a233, _b159, MySqlColumnBuilderWithAutoIncrement, _a234, _b160, MySqlColumnWithAutoIncrement;
|
29496
30645
|
var init_common4 = __esm({
|
29497
|
-
"../
|
30646
|
+
"../drizzle-orm/dist/mysql-core/columns/common.js"() {
|
29498
30647
|
"use strict";
|
29499
30648
|
init_column_builder();
|
29500
30649
|
init_column();
|
@@ -29575,10 +30724,10 @@ var init_common4 = __esm({
|
|
29575
30724
|
}
|
29576
30725
|
});
|
29577
30726
|
|
29578
|
-
// ../
|
30727
|
+
// ../drizzle-orm/dist/mysql-core/columns/bigint.js
|
29579
30728
|
var _a235, _b161, MySqlBigInt53Builder, _a236, _b162, MySqlBigInt53, _a237, _b163, MySqlBigInt64Builder, _a238, _b164, MySqlBigInt64;
|
29580
30729
|
var init_bigint2 = __esm({
|
29581
|
-
"../
|
30730
|
+
"../drizzle-orm/dist/mysql-core/columns/bigint.js"() {
|
29582
30731
|
"use strict";
|
29583
30732
|
init_entity();
|
29584
30733
|
init_common4();
|
@@ -29635,10 +30784,10 @@ var init_bigint2 = __esm({
|
|
29635
30784
|
}
|
29636
30785
|
});
|
29637
30786
|
|
29638
|
-
// ../
|
30787
|
+
// ../drizzle-orm/dist/mysql-core/columns/binary.js
|
29639
30788
|
var _a239, _b165, MySqlBinaryBuilder, _a240, _b166, MySqlBinary;
|
29640
30789
|
var init_binary = __esm({
|
29641
|
-
"../
|
30790
|
+
"../drizzle-orm/dist/mysql-core/columns/binary.js"() {
|
29642
30791
|
"use strict";
|
29643
30792
|
init_entity();
|
29644
30793
|
init_common4();
|
@@ -29666,10 +30815,10 @@ var init_binary = __esm({
|
|
29666
30815
|
}
|
29667
30816
|
});
|
29668
30817
|
|
29669
|
-
// ../
|
30818
|
+
// ../drizzle-orm/dist/mysql-core/columns/boolean.js
|
29670
30819
|
var _a241, _b167, MySqlBooleanBuilder, _a242, _b168, MySqlBoolean;
|
29671
30820
|
var init_boolean2 = __esm({
|
29672
|
-
"../
|
30821
|
+
"../drizzle-orm/dist/mysql-core/columns/boolean.js"() {
|
29673
30822
|
"use strict";
|
29674
30823
|
init_entity();
|
29675
30824
|
init_common4();
|
@@ -29701,10 +30850,10 @@ var init_boolean2 = __esm({
|
|
29701
30850
|
}
|
29702
30851
|
});
|
29703
30852
|
|
29704
|
-
// ../
|
30853
|
+
// ../drizzle-orm/dist/mysql-core/columns/char.js
|
29705
30854
|
var _a243, _b169, MySqlCharBuilder, _a244, _b170, MySqlChar;
|
29706
30855
|
var init_char2 = __esm({
|
29707
|
-
"../
|
30856
|
+
"../drizzle-orm/dist/mysql-core/columns/char.js"() {
|
29708
30857
|
"use strict";
|
29709
30858
|
init_entity();
|
29710
30859
|
init_common4();
|
@@ -29737,10 +30886,10 @@ var init_char2 = __esm({
|
|
29737
30886
|
}
|
29738
30887
|
});
|
29739
30888
|
|
29740
|
-
// ../
|
30889
|
+
// ../drizzle-orm/dist/mysql-core/columns/custom.js
|
29741
30890
|
var _a245, _b171, MySqlCustomColumnBuilder, _a246, _b172, MySqlCustomColumn;
|
29742
30891
|
var init_custom3 = __esm({
|
29743
|
-
"../
|
30892
|
+
"../drizzle-orm/dist/mysql-core/columns/custom.js"() {
|
29744
30893
|
"use strict";
|
29745
30894
|
init_entity();
|
29746
30895
|
init_common4();
|
@@ -29783,10 +30932,10 @@ var init_custom3 = __esm({
|
|
29783
30932
|
}
|
29784
30933
|
});
|
29785
30934
|
|
29786
|
-
// ../
|
30935
|
+
// ../drizzle-orm/dist/mysql-core/columns/date.js
|
29787
30936
|
var _a247, _b173, MySqlDateBuilder, _a248, _b174, MySqlDate, _a249, _b175, MySqlDateStringBuilder, _a250, _b176, MySqlDateString;
|
29788
30937
|
var init_date2 = __esm({
|
29789
|
-
"../
|
30938
|
+
"../drizzle-orm/dist/mysql-core/columns/date.js"() {
|
29790
30939
|
"use strict";
|
29791
30940
|
init_entity();
|
29792
30941
|
init_common4();
|
@@ -29837,10 +30986,10 @@ var init_date2 = __esm({
|
|
29837
30986
|
}
|
29838
30987
|
});
|
29839
30988
|
|
29840
|
-
// ../
|
30989
|
+
// ../drizzle-orm/dist/mysql-core/columns/datetime.js
|
29841
30990
|
var _a251, _b177, MySqlDateTimeBuilder, _a252, _b178, MySqlDateTime, _a253, _b179, MySqlDateTimeStringBuilder, _a254, _b180, MySqlDateTimeString;
|
29842
30991
|
var init_datetime = __esm({
|
29843
|
-
"../
|
30992
|
+
"../drizzle-orm/dist/mysql-core/columns/datetime.js"() {
|
29844
30993
|
"use strict";
|
29845
30994
|
init_entity();
|
29846
30995
|
init_common4();
|
@@ -29905,10 +31054,10 @@ var init_datetime = __esm({
|
|
29905
31054
|
}
|
29906
31055
|
});
|
29907
31056
|
|
29908
|
-
// ../
|
31057
|
+
// ../drizzle-orm/dist/mysql-core/columns/decimal.js
|
29909
31058
|
var _a255, _b181, MySqlDecimalBuilder, _a256, _b182, MySqlDecimal;
|
29910
31059
|
var init_decimal = __esm({
|
29911
|
-
"../
|
31060
|
+
"../drizzle-orm/dist/mysql-core/columns/decimal.js"() {
|
29912
31061
|
"use strict";
|
29913
31062
|
init_entity();
|
29914
31063
|
init_common4();
|
@@ -29947,10 +31096,10 @@ var init_decimal = __esm({
|
|
29947
31096
|
}
|
29948
31097
|
});
|
29949
31098
|
|
29950
|
-
// ../
|
31099
|
+
// ../drizzle-orm/dist/mysql-core/columns/double.js
|
29951
31100
|
var _a257, _b183, MySqlDoubleBuilder, _a258, _b184, MySqlDouble;
|
29952
31101
|
var init_double = __esm({
|
29953
|
-
"../
|
31102
|
+
"../drizzle-orm/dist/mysql-core/columns/double.js"() {
|
29954
31103
|
"use strict";
|
29955
31104
|
init_entity();
|
29956
31105
|
init_common4();
|
@@ -29986,10 +31135,10 @@ var init_double = __esm({
|
|
29986
31135
|
}
|
29987
31136
|
});
|
29988
31137
|
|
29989
|
-
// ../
|
31138
|
+
// ../drizzle-orm/dist/mysql-core/columns/enum.js
|
29990
31139
|
var _a259, _b185, MySqlEnumColumnBuilder, _a260, _b186, MySqlEnumColumn;
|
29991
31140
|
var init_enum2 = __esm({
|
29992
|
-
"../
|
31141
|
+
"../drizzle-orm/dist/mysql-core/columns/enum.js"() {
|
29993
31142
|
"use strict";
|
29994
31143
|
init_entity();
|
29995
31144
|
init_common4();
|
@@ -30020,10 +31169,10 @@ var init_enum2 = __esm({
|
|
30020
31169
|
}
|
30021
31170
|
});
|
30022
31171
|
|
30023
|
-
// ../
|
31172
|
+
// ../drizzle-orm/dist/mysql-core/columns/float.js
|
30024
31173
|
var _a261, _b187, MySqlFloatBuilder, _a262, _b188, MySqlFloat;
|
30025
31174
|
var init_float = __esm({
|
30026
|
-
"../
|
31175
|
+
"../drizzle-orm/dist/mysql-core/columns/float.js"() {
|
30027
31176
|
"use strict";
|
30028
31177
|
init_entity();
|
30029
31178
|
init_common4();
|
@@ -30046,10 +31195,10 @@ var init_float = __esm({
|
|
30046
31195
|
}
|
30047
31196
|
});
|
30048
31197
|
|
30049
|
-
// ../
|
31198
|
+
// ../drizzle-orm/dist/mysql-core/columns/int.js
|
30050
31199
|
var _a263, _b189, MySqlIntBuilder, _a264, _b190, MySqlInt;
|
30051
31200
|
var init_int = __esm({
|
30052
|
-
"../
|
31201
|
+
"../drizzle-orm/dist/mysql-core/columns/int.js"() {
|
30053
31202
|
"use strict";
|
30054
31203
|
init_entity();
|
30055
31204
|
init_common4();
|
@@ -30079,10 +31228,10 @@ var init_int = __esm({
|
|
30079
31228
|
}
|
30080
31229
|
});
|
30081
31230
|
|
30082
|
-
// ../
|
31231
|
+
// ../drizzle-orm/dist/mysql-core/columns/json.js
|
30083
31232
|
var _a265, _b191, MySqlJsonBuilder, _a266, _b192, MySqlJson;
|
30084
31233
|
var init_json2 = __esm({
|
30085
|
-
"../
|
31234
|
+
"../drizzle-orm/dist/mysql-core/columns/json.js"() {
|
30086
31235
|
"use strict";
|
30087
31236
|
init_entity();
|
30088
31237
|
init_common4();
|
@@ -30108,10 +31257,10 @@ var init_json2 = __esm({
|
|
30108
31257
|
}
|
30109
31258
|
});
|
30110
31259
|
|
30111
|
-
// ../
|
31260
|
+
// ../drizzle-orm/dist/mysql-core/columns/mediumint.js
|
30112
31261
|
var _a267, _b193, MySqlMediumIntBuilder, _a268, _b194, MySqlMediumInt;
|
30113
31262
|
var init_mediumint = __esm({
|
30114
|
-
"../
|
31263
|
+
"../drizzle-orm/dist/mysql-core/columns/mediumint.js"() {
|
30115
31264
|
"use strict";
|
30116
31265
|
init_entity();
|
30117
31266
|
init_common4();
|
@@ -30144,10 +31293,10 @@ var init_mediumint = __esm({
|
|
30144
31293
|
}
|
30145
31294
|
});
|
30146
31295
|
|
30147
|
-
// ../
|
31296
|
+
// ../drizzle-orm/dist/mysql-core/columns/real.js
|
30148
31297
|
var _a269, _b195, MySqlRealBuilder, _a270, _b196, MySqlReal;
|
30149
31298
|
var init_real3 = __esm({
|
30150
|
-
"../
|
31299
|
+
"../drizzle-orm/dist/mysql-core/columns/real.js"() {
|
30151
31300
|
"use strict";
|
30152
31301
|
init_entity();
|
30153
31302
|
init_common4();
|
@@ -30183,10 +31332,10 @@ var init_real3 = __esm({
|
|
30183
31332
|
}
|
30184
31333
|
});
|
30185
31334
|
|
30186
|
-
// ../
|
31335
|
+
// ../drizzle-orm/dist/mysql-core/columns/serial.js
|
30187
31336
|
var _a271, _b197, MySqlSerialBuilder, _a272, _b198, MySqlSerial;
|
30188
31337
|
var init_serial2 = __esm({
|
30189
|
-
"../
|
31338
|
+
"../drizzle-orm/dist/mysql-core/columns/serial.js"() {
|
30190
31339
|
"use strict";
|
30191
31340
|
init_entity();
|
30192
31341
|
init_common4();
|
@@ -30217,10 +31366,10 @@ var init_serial2 = __esm({
|
|
30217
31366
|
}
|
30218
31367
|
});
|
30219
31368
|
|
30220
|
-
// ../
|
31369
|
+
// ../drizzle-orm/dist/mysql-core/columns/smallint.js
|
30221
31370
|
var _a273, _b199, MySqlSmallIntBuilder, _a274, _b200, MySqlSmallInt;
|
30222
31371
|
var init_smallint2 = __esm({
|
30223
|
-
"../
|
31372
|
+
"../drizzle-orm/dist/mysql-core/columns/smallint.js"() {
|
30224
31373
|
"use strict";
|
30225
31374
|
init_entity();
|
30226
31375
|
init_common4();
|
@@ -30253,10 +31402,10 @@ var init_smallint2 = __esm({
|
|
30253
31402
|
}
|
30254
31403
|
});
|
30255
31404
|
|
30256
|
-
// ../
|
31405
|
+
// ../drizzle-orm/dist/mysql-core/columns/text.js
|
30257
31406
|
var _a275, _b201, MySqlTextBuilder, _a276, _b202, MySqlText;
|
30258
31407
|
var init_text3 = __esm({
|
30259
|
-
"../
|
31408
|
+
"../drizzle-orm/dist/mysql-core/columns/text.js"() {
|
30260
31409
|
"use strict";
|
30261
31410
|
init_entity();
|
30262
31411
|
init_common4();
|
@@ -30286,10 +31435,10 @@ var init_text3 = __esm({
|
|
30286
31435
|
}
|
30287
31436
|
});
|
30288
31437
|
|
30289
|
-
// ../
|
31438
|
+
// ../drizzle-orm/dist/mysql-core/columns/time.js
|
30290
31439
|
var _a277, _b203, MySqlTimeBuilder, _a278, _b204, MySqlTime;
|
30291
31440
|
var init_time2 = __esm({
|
30292
|
-
"../
|
31441
|
+
"../drizzle-orm/dist/mysql-core/columns/time.js"() {
|
30293
31442
|
"use strict";
|
30294
31443
|
init_entity();
|
30295
31444
|
init_common4();
|
@@ -30318,10 +31467,10 @@ var init_time2 = __esm({
|
|
30318
31467
|
}
|
30319
31468
|
});
|
30320
31469
|
|
30321
|
-
// ../
|
31470
|
+
// ../drizzle-orm/dist/mysql-core/columns/date.common.js
|
30322
31471
|
var _a279, _b205, MySqlDateColumnBaseBuilder, _a280, _b206, MySqlDateBaseColumn;
|
30323
31472
|
var init_date_common2 = __esm({
|
30324
|
-
"../
|
31473
|
+
"../drizzle-orm/dist/mysql-core/columns/date.common.js"() {
|
30325
31474
|
"use strict";
|
30326
31475
|
init_entity();
|
30327
31476
|
init_sql();
|
@@ -30348,10 +31497,10 @@ var init_date_common2 = __esm({
|
|
30348
31497
|
}
|
30349
31498
|
});
|
30350
31499
|
|
30351
|
-
// ../
|
31500
|
+
// ../drizzle-orm/dist/mysql-core/columns/timestamp.js
|
30352
31501
|
var _a281, _b207, MySqlTimestampBuilder, _a282, _b208, MySqlTimestamp, _a283, _b209, MySqlTimestampStringBuilder, _a284, _b210, MySqlTimestampString;
|
30353
31502
|
var init_timestamp2 = __esm({
|
30354
|
-
"../
|
31503
|
+
"../drizzle-orm/dist/mysql-core/columns/timestamp.js"() {
|
30355
31504
|
"use strict";
|
30356
31505
|
init_entity();
|
30357
31506
|
init_date_common2();
|
@@ -30414,10 +31563,10 @@ var init_timestamp2 = __esm({
|
|
30414
31563
|
}
|
30415
31564
|
});
|
30416
31565
|
|
30417
|
-
// ../
|
31566
|
+
// ../drizzle-orm/dist/mysql-core/columns/tinyint.js
|
30418
31567
|
var _a285, _b211, MySqlTinyIntBuilder, _a286, _b212, MySqlTinyInt;
|
30419
31568
|
var init_tinyint = __esm({
|
30420
|
-
"../
|
31569
|
+
"../drizzle-orm/dist/mysql-core/columns/tinyint.js"() {
|
30421
31570
|
"use strict";
|
30422
31571
|
init_entity();
|
30423
31572
|
init_common4();
|
@@ -30450,10 +31599,10 @@ var init_tinyint = __esm({
|
|
30450
31599
|
}
|
30451
31600
|
});
|
30452
31601
|
|
30453
|
-
// ../
|
31602
|
+
// ../drizzle-orm/dist/mysql-core/columns/varbinary.js
|
30454
31603
|
var _a287, _b213, MySqlVarBinaryBuilder, _a288, _b214, MySqlVarBinary;
|
30455
31604
|
var init_varbinary = __esm({
|
30456
|
-
"../
|
31605
|
+
"../drizzle-orm/dist/mysql-core/columns/varbinary.js"() {
|
30457
31606
|
"use strict";
|
30458
31607
|
init_entity();
|
30459
31608
|
init_common4();
|
@@ -30485,10 +31634,10 @@ var init_varbinary = __esm({
|
|
30485
31634
|
}
|
30486
31635
|
});
|
30487
31636
|
|
30488
|
-
// ../
|
31637
|
+
// ../drizzle-orm/dist/mysql-core/columns/varchar.js
|
30489
31638
|
var _a289, _b215, MySqlVarCharBuilder, _a290, _b216, MySqlVarChar;
|
30490
31639
|
var init_varchar2 = __esm({
|
30491
|
-
"../
|
31640
|
+
"../drizzle-orm/dist/mysql-core/columns/varchar.js"() {
|
30492
31641
|
"use strict";
|
30493
31642
|
init_entity();
|
30494
31643
|
init_common4();
|
@@ -30522,10 +31671,10 @@ var init_varchar2 = __esm({
|
|
30522
31671
|
}
|
30523
31672
|
});
|
30524
31673
|
|
30525
|
-
// ../
|
31674
|
+
// ../drizzle-orm/dist/mysql-core/columns/year.js
|
30526
31675
|
var _a291, _b217, MySqlYearBuilder, _a292, _b218, MySqlYear;
|
30527
31676
|
var init_year = __esm({
|
30528
|
-
"../
|
31677
|
+
"../drizzle-orm/dist/mysql-core/columns/year.js"() {
|
30529
31678
|
"use strict";
|
30530
31679
|
init_entity();
|
30531
31680
|
init_common4();
|
@@ -30548,9 +31697,9 @@ var init_year = __esm({
|
|
30548
31697
|
}
|
30549
31698
|
});
|
30550
31699
|
|
30551
|
-
// ../
|
31700
|
+
// ../drizzle-orm/dist/mysql-core/columns/index.js
|
30552
31701
|
var init_columns3 = __esm({
|
30553
|
-
"../
|
31702
|
+
"../drizzle-orm/dist/mysql-core/columns/index.js"() {
|
30554
31703
|
"use strict";
|
30555
31704
|
init_bigint2();
|
30556
31705
|
init_binary();
|
@@ -30580,10 +31729,10 @@ var init_columns3 = __esm({
|
|
30580
31729
|
}
|
30581
31730
|
});
|
30582
31731
|
|
30583
|
-
// ../
|
31732
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/delete.js
|
30584
31733
|
var _a293, _b219, MySqlDeleteBase;
|
30585
31734
|
var init_delete3 = __esm({
|
30586
|
-
"../
|
31735
|
+
"../drizzle-orm/dist/mysql-core/query-builders/delete.js"() {
|
30587
31736
|
"use strict";
|
30588
31737
|
init_entity();
|
30589
31738
|
init_query_promise();
|
@@ -30661,10 +31810,10 @@ var init_delete3 = __esm({
|
|
30661
31810
|
}
|
30662
31811
|
});
|
30663
31812
|
|
30664
|
-
// ../
|
31813
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/insert.js
|
30665
31814
|
var _a294, MySqlInsertBuilder, _a295, _b220, MySqlInsertBase;
|
30666
31815
|
var init_insert3 = __esm({
|
30667
|
-
"../
|
31816
|
+
"../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
|
30668
31817
|
"use strict";
|
30669
31818
|
init_entity();
|
30670
31819
|
init_query_promise();
|
@@ -30786,10 +31935,10 @@ var init_insert3 = __esm({
|
|
30786
31935
|
}
|
30787
31936
|
});
|
30788
31937
|
|
30789
|
-
// ../
|
31938
|
+
// ../drizzle-orm/dist/mysql-core/view-base.js
|
30790
31939
|
var _a296, _b221, MySqlViewBase;
|
30791
31940
|
var init_view_base3 = __esm({
|
30792
|
-
"../
|
31941
|
+
"../drizzle-orm/dist/mysql-core/view-base.js"() {
|
30793
31942
|
"use strict";
|
30794
31943
|
init_entity();
|
30795
31944
|
init_sql();
|
@@ -30799,10 +31948,10 @@ var init_view_base3 = __esm({
|
|
30799
31948
|
}
|
30800
31949
|
});
|
30801
31950
|
|
30802
|
-
// ../
|
31951
|
+
// ../drizzle-orm/dist/mysql-core/dialect.js
|
30803
31952
|
var _a297, MySqlDialect;
|
30804
31953
|
var init_dialect3 = __esm({
|
30805
|
-
"../
|
31954
|
+
"../drizzle-orm/dist/mysql-core/dialect.js"() {
|
30806
31955
|
"use strict";
|
30807
31956
|
init_alias();
|
30808
31957
|
init_column();
|
@@ -31598,7 +32747,7 @@ var init_dialect3 = __esm({
|
|
31598
32747
|
}
|
31599
32748
|
});
|
31600
32749
|
|
31601
|
-
// ../
|
32750
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/select.js
|
31602
32751
|
function createSetOperator3(type, isAll) {
|
31603
32752
|
return (leftSelect, rightSelect, ...restSelects) => {
|
31604
32753
|
const setOperators = [rightSelect, ...restSelects].map((select) => ({
|
@@ -31618,7 +32767,7 @@ function createSetOperator3(type, isAll) {
|
|
31618
32767
|
}
|
31619
32768
|
var _a298, MySqlSelectBuilder, _a299, _b222, MySqlSelectQueryBuilderBase, _a300, _b223, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
|
31620
32769
|
var init_select4 = __esm({
|
31621
|
-
"../
|
32770
|
+
"../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
|
31622
32771
|
"use strict";
|
31623
32772
|
init_entity();
|
31624
32773
|
init_query_builder();
|
@@ -32322,10 +33471,10 @@ var init_select4 = __esm({
|
|
32322
33471
|
}
|
32323
33472
|
});
|
32324
33473
|
|
32325
|
-
// ../
|
33474
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
|
32326
33475
|
var _a301, QueryBuilder3;
|
32327
33476
|
var init_query_builder4 = __esm({
|
32328
|
-
"../
|
33477
|
+
"../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
|
32329
33478
|
"use strict";
|
32330
33479
|
init_entity();
|
32331
33480
|
init_dialect3();
|
@@ -32395,17 +33544,17 @@ var init_query_builder4 = __esm({
|
|
32395
33544
|
}
|
32396
33545
|
});
|
32397
33546
|
|
32398
|
-
// ../
|
33547
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/select.types.js
|
32399
33548
|
var init_select_types3 = __esm({
|
32400
|
-
"../
|
33549
|
+
"../drizzle-orm/dist/mysql-core/query-builders/select.types.js"() {
|
32401
33550
|
"use strict";
|
32402
33551
|
}
|
32403
33552
|
});
|
32404
33553
|
|
32405
|
-
// ../
|
33554
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/update.js
|
32406
33555
|
var _a302, MySqlUpdateBuilder, _a303, _b224, MySqlUpdateBase;
|
32407
33556
|
var init_update3 = __esm({
|
32408
|
-
"../
|
33557
|
+
"../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
|
32409
33558
|
"use strict";
|
32410
33559
|
init_entity();
|
32411
33560
|
init_query_promise();
|
@@ -32500,9 +33649,9 @@ var init_update3 = __esm({
|
|
32500
33649
|
}
|
32501
33650
|
});
|
32502
33651
|
|
32503
|
-
// ../
|
33652
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/index.js
|
32504
33653
|
var init_query_builders3 = __esm({
|
32505
|
-
"../
|
33654
|
+
"../drizzle-orm/dist/mysql-core/query-builders/index.js"() {
|
32506
33655
|
"use strict";
|
32507
33656
|
init_delete3();
|
32508
33657
|
init_insert3();
|
@@ -32513,10 +33662,10 @@ var init_query_builders3 = __esm({
|
|
32513
33662
|
}
|
32514
33663
|
});
|
32515
33664
|
|
32516
|
-
// ../
|
33665
|
+
// ../drizzle-orm/dist/mysql-core/query-builders/query.js
|
32517
33666
|
var _a304, RelationalQueryBuilder3, _a305, _b225, MySqlRelationalQuery;
|
32518
33667
|
var init_query3 = __esm({
|
32519
|
-
"../
|
33668
|
+
"../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
|
32520
33669
|
"use strict";
|
32521
33670
|
init_entity();
|
32522
33671
|
init_query_promise();
|
@@ -32631,10 +33780,10 @@ var init_query3 = __esm({
|
|
32631
33780
|
}
|
32632
33781
|
});
|
32633
33782
|
|
32634
|
-
// ../
|
33783
|
+
// ../drizzle-orm/dist/mysql-core/db.js
|
32635
33784
|
var _a306, MySqlDatabase;
|
32636
33785
|
var init_db3 = __esm({
|
32637
|
-
"../
|
33786
|
+
"../drizzle-orm/dist/mysql-core/db.js"() {
|
32638
33787
|
"use strict";
|
32639
33788
|
init_entity();
|
32640
33789
|
init_selection_proxy();
|
@@ -32854,10 +34003,10 @@ var init_db3 = __esm({
|
|
32854
34003
|
}
|
32855
34004
|
});
|
32856
34005
|
|
32857
|
-
// ../
|
34006
|
+
// ../drizzle-orm/dist/mysql-core/indexes.js
|
32858
34007
|
var _a307, IndexBuilderOn3, _a308, IndexBuilder3, _a309, Index5;
|
32859
34008
|
var init_indexes3 = __esm({
|
32860
|
-
"../
|
34009
|
+
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
32861
34010
|
"use strict";
|
32862
34011
|
init_entity();
|
32863
34012
|
_a307 = entityKind;
|
@@ -32911,10 +34060,10 @@ var init_indexes3 = __esm({
|
|
32911
34060
|
}
|
32912
34061
|
});
|
32913
34062
|
|
32914
|
-
// ../
|
34063
|
+
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
32915
34064
|
var _a310, PrimaryKeyBuilder3, _a311, PrimaryKey3;
|
32916
34065
|
var init_primary_keys3 = __esm({
|
32917
|
-
"../
|
34066
|
+
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
32918
34067
|
"use strict";
|
32919
34068
|
init_entity();
|
32920
34069
|
init_table4();
|
@@ -32951,16 +34100,16 @@ var init_primary_keys3 = __esm({
|
|
32951
34100
|
}
|
32952
34101
|
});
|
32953
34102
|
|
32954
|
-
// ../
|
34103
|
+
// ../drizzle-orm/dist/mysql-core/view-common.js
|
32955
34104
|
var MySqlViewConfig;
|
32956
34105
|
var init_view_common4 = __esm({
|
32957
|
-
"../
|
34106
|
+
"../drizzle-orm/dist/mysql-core/view-common.js"() {
|
32958
34107
|
"use strict";
|
32959
34108
|
MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
|
32960
34109
|
}
|
32961
34110
|
});
|
32962
34111
|
|
32963
|
-
// ../
|
34112
|
+
// ../drizzle-orm/dist/mysql-core/view.js
|
32964
34113
|
function mysqlViewWithSchema(name2, selection, schema4) {
|
32965
34114
|
if (selection) {
|
32966
34115
|
return new ManualViewBuilder3(name2, selection, schema4);
|
@@ -32969,7 +34118,7 @@ function mysqlViewWithSchema(name2, selection, schema4) {
|
|
32969
34118
|
}
|
32970
34119
|
var _a312, ViewBuilderCore2, _a313, _b226, ViewBuilder3, _a314, _b227, ManualViewBuilder3, _a315, _b228, _c8, MySqlView;
|
32971
34120
|
var init_view3 = __esm({
|
32972
|
-
"../
|
34121
|
+
"../drizzle-orm/dist/mysql-core/view.js"() {
|
32973
34122
|
"use strict";
|
32974
34123
|
init_entity();
|
32975
34124
|
init_selection_proxy();
|
@@ -33087,10 +34236,10 @@ var init_view3 = __esm({
|
|
33087
34236
|
}
|
33088
34237
|
});
|
33089
34238
|
|
33090
|
-
// ../
|
34239
|
+
// ../drizzle-orm/dist/mysql-core/schema.js
|
33091
34240
|
var _a316, MySqlSchema5;
|
33092
34241
|
var init_schema2 = __esm({
|
33093
|
-
"../
|
34242
|
+
"../drizzle-orm/dist/mysql-core/schema.js"() {
|
33094
34243
|
"use strict";
|
33095
34244
|
init_entity();
|
33096
34245
|
init_table4();
|
@@ -33111,10 +34260,10 @@ var init_schema2 = __esm({
|
|
33111
34260
|
}
|
33112
34261
|
});
|
33113
34262
|
|
33114
|
-
// ../
|
34263
|
+
// ../drizzle-orm/dist/mysql-core/session.js
|
33115
34264
|
var _a317, MySqlPreparedQuery, _a318, MySqlSession, _a319, _b229, MySqlTransaction;
|
33116
34265
|
var init_session3 = __esm({
|
33117
|
-
"../
|
34266
|
+
"../drizzle-orm/dist/mysql-core/session.js"() {
|
33118
34267
|
"use strict";
|
33119
34268
|
init_entity();
|
33120
34269
|
init_errors();
|
@@ -33144,7 +34293,7 @@ var init_session3 = __esm({
|
|
33144
34293
|
if (config.isolationLevel) {
|
33145
34294
|
parts.push(`isolation level ${config.isolationLevel}`);
|
33146
34295
|
}
|
33147
|
-
return parts.length ? sql
|
34296
|
+
return parts.length ? sql`set transaction ${sql.raw(parts.join(" "))}` : void 0;
|
33148
34297
|
}
|
33149
34298
|
getStartTransactionSQL(config) {
|
33150
34299
|
const parts = [];
|
@@ -33154,7 +34303,7 @@ var init_session3 = __esm({
|
|
33154
34303
|
if (config.accessMode) {
|
33155
34304
|
parts.push(config.accessMode);
|
33156
34305
|
}
|
33157
|
-
return parts.length ? sql
|
34306
|
+
return parts.length ? sql`start transaction ${sql.raw(parts.join(" "))}` : void 0;
|
33158
34307
|
}
|
33159
34308
|
};
|
33160
34309
|
__publicField(MySqlSession, _a318, "MySqlSession");
|
@@ -33172,14 +34321,14 @@ var init_session3 = __esm({
|
|
33172
34321
|
}
|
33173
34322
|
});
|
33174
34323
|
|
33175
|
-
// ../
|
34324
|
+
// ../drizzle-orm/dist/mysql-core/subquery.js
|
33176
34325
|
var init_subquery4 = __esm({
|
33177
|
-
"../
|
34326
|
+
"../drizzle-orm/dist/mysql-core/subquery.js"() {
|
33178
34327
|
"use strict";
|
33179
34328
|
}
|
33180
34329
|
});
|
33181
34330
|
|
33182
|
-
// ../
|
34331
|
+
// ../drizzle-orm/dist/mysql-core/utils.js
|
33183
34332
|
function getTableConfig3(table4) {
|
33184
34333
|
const columns = Object.values(table4[MySqlTable.Symbol.Columns]);
|
33185
34334
|
const indexes = [];
|
@@ -33220,7 +34369,7 @@ function getTableConfig3(table4) {
|
|
33220
34369
|
};
|
33221
34370
|
}
|
33222
34371
|
var init_utils7 = __esm({
|
33223
|
-
"../
|
34372
|
+
"../drizzle-orm/dist/mysql-core/utils.js"() {
|
33224
34373
|
"use strict";
|
33225
34374
|
init_entity();
|
33226
34375
|
init_table();
|
@@ -33233,9 +34382,9 @@ var init_utils7 = __esm({
|
|
33233
34382
|
}
|
33234
34383
|
});
|
33235
34384
|
|
33236
|
-
// ../
|
34385
|
+
// ../drizzle-orm/dist/mysql-core/index.js
|
33237
34386
|
var init_mysql_core = __esm({
|
33238
|
-
"../
|
34387
|
+
"../drizzle-orm/dist/mysql-core/index.js"() {
|
33239
34388
|
"use strict";
|
33240
34389
|
init_alias4();
|
33241
34390
|
init_checks3();
|
@@ -33280,8 +34429,8 @@ var init_mysqlSerializer = __esm({
|
|
33280
34429
|
"src/serializer/mysqlSerializer.ts"() {
|
33281
34430
|
"use strict";
|
33282
34431
|
init_source();
|
33283
|
-
|
33284
|
-
|
34432
|
+
init_dist();
|
34433
|
+
init_dist();
|
33285
34434
|
init_mysql_core();
|
33286
34435
|
init_mysql_core();
|
33287
34436
|
init_outputs();
|
@@ -33605,7 +34754,7 @@ We have encountered a collision between the index name on columns ${source_defau
|
|
33605
34754
|
onUpdate = true;
|
33606
34755
|
}
|
33607
34756
|
const newColumn = {
|
33608
|
-
default: columnDefault === null ? void 0 : /^-?[\d.]+(?:e-?\d+)?$/.test(columnDefault) && !columnType.startsWith(
|
34757
|
+
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}'`,
|
33609
34758
|
autoincrement: isAutoincrement,
|
33610
34759
|
name: columnName,
|
33611
34760
|
type: changedType,
|
@@ -33833,7 +34982,8 @@ var init_cli = __esm({
|
|
33833
34982
|
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
33834
34983
|
extensionsFilters: literalType("postgis").array().optional(),
|
33835
34984
|
verbose: booleanType().optional(),
|
33836
|
-
strict: booleanType().optional()
|
34985
|
+
strict: booleanType().optional(),
|
34986
|
+
driver: driver.optional()
|
33837
34987
|
}).passthrough();
|
33838
34988
|
pullParams = objectType({
|
33839
34989
|
config: stringType().optional(),
|
@@ -34083,7 +35233,7 @@ var prepareFromExports;
|
|
34083
35233
|
var init_pgImports = __esm({
|
34084
35234
|
"src/serializer/pgImports.ts"() {
|
34085
35235
|
"use strict";
|
34086
|
-
|
35236
|
+
init_dist();
|
34087
35237
|
init_pg_core();
|
34088
35238
|
init_utils8();
|
34089
35239
|
prepareFromExports = (exports) => {
|
@@ -34122,7 +35272,7 @@ var prepareFromExports2, prepareFromSqliteImports;
|
|
34122
35272
|
var init_sqliteImports = __esm({
|
34123
35273
|
"src/serializer/sqliteImports.ts"() {
|
34124
35274
|
"use strict";
|
34125
|
-
|
35275
|
+
init_dist();
|
34126
35276
|
init_sqlite_core();
|
34127
35277
|
init_utils8();
|
34128
35278
|
prepareFromExports2 = (exports) => {
|
@@ -34160,7 +35310,7 @@ var prepareFromExports3, prepareFromMySqlImports;
|
|
34160
35310
|
var init_mysqlImports = __esm({
|
34161
35311
|
"src/serializer/mysqlImports.ts"() {
|
34162
35312
|
"use strict";
|
34163
|
-
|
35313
|
+
init_dist();
|
34164
35314
|
init_mysql_core();
|
34165
35315
|
init_utils8();
|
34166
35316
|
prepareFromExports3 = (exports) => {
|
@@ -34808,6 +35958,37 @@ var updateUpToV6 = (json) => {
|
|
34808
35958
|
enums
|
34809
35959
|
};
|
34810
35960
|
};
|
35961
|
+
var updateUpToV7 = (json) => {
|
35962
|
+
const schema4 = pgSchemaV6.parse(json);
|
35963
|
+
const tables = Object.fromEntries(
|
35964
|
+
Object.entries(schema4.tables).map((it) => {
|
35965
|
+
const table4 = it[1];
|
35966
|
+
const mappedIndexes = Object.fromEntries(
|
35967
|
+
Object.entries(table4.indexes).map((idx) => {
|
35968
|
+
const { columns, ...rest } = idx[1];
|
35969
|
+
const mappedColumns = columns.map((it2) => {
|
35970
|
+
return {
|
35971
|
+
expression: it2,
|
35972
|
+
isExpression: false,
|
35973
|
+
asc: true,
|
35974
|
+
nulls: "last",
|
35975
|
+
opClass: void 0
|
35976
|
+
};
|
35977
|
+
});
|
35978
|
+
return [idx[0], { columns: mappedColumns, with: {}, ...rest }];
|
35979
|
+
})
|
35980
|
+
);
|
35981
|
+
return [it[0], { ...table4, indexes: mappedIndexes }];
|
35982
|
+
})
|
35983
|
+
);
|
35984
|
+
return {
|
35985
|
+
...schema4,
|
35986
|
+
version: "7",
|
35987
|
+
dialect: "postgresql",
|
35988
|
+
sequences: {},
|
35989
|
+
tables
|
35990
|
+
};
|
35991
|
+
};
|
34811
35992
|
|
34812
35993
|
// src/cli/commands/sqliteIntrospect.ts
|
34813
35994
|
var import_hanji6 = __toESM(require_hanji());
|
@@ -34954,284 +36135,8 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
34954
36135
|
return { schema: schema4 };
|
34955
36136
|
};
|
34956
36137
|
|
34957
|
-
// src/cli/commands/sqlitePushUtils.ts
|
34958
|
-
init_source();
|
34959
|
-
init_sqliteSchema();
|
34960
|
-
init_sqlgenerator();
|
34961
|
-
var _moveDataStatements = (tableName, json, dataLoss = false) => {
|
34962
|
-
const statements = [];
|
34963
|
-
statements.push(
|
34964
|
-
new SqliteRenameTableConvertor().convert({
|
34965
|
-
type: "rename_table",
|
34966
|
-
tableNameFrom: tableName,
|
34967
|
-
tableNameTo: `__old_push_${tableName}`,
|
34968
|
-
fromSchema: "",
|
34969
|
-
toSchema: ""
|
34970
|
-
})
|
34971
|
-
);
|
34972
|
-
const tableColumns = Object.values(json.tables[tableName].columns);
|
34973
|
-
const referenceData = Object.values(json.tables[tableName].foreignKeys);
|
34974
|
-
const compositePKs = Object.values(
|
34975
|
-
json.tables[tableName].compositePrimaryKeys
|
34976
|
-
).map((it) => SQLiteSquasher.unsquashPK(it));
|
34977
|
-
const fks = referenceData.map((it) => SQLiteSquasher.unsquashPushFK(it));
|
34978
|
-
statements.push(
|
34979
|
-
new SQLiteCreateTableConvertor().convert({
|
34980
|
-
type: "sqlite_create_table",
|
34981
|
-
tableName,
|
34982
|
-
columns: tableColumns,
|
34983
|
-
referenceData: fks,
|
34984
|
-
compositePKs
|
34985
|
-
})
|
34986
|
-
);
|
34987
|
-
if (!dataLoss) {
|
34988
|
-
statements.push(
|
34989
|
-
`INSERT INTO "${tableName}" SELECT * FROM "__old_push_${tableName}";`
|
34990
|
-
);
|
34991
|
-
}
|
34992
|
-
statements.push(
|
34993
|
-
new SQLiteDropTableConvertor().convert({
|
34994
|
-
type: "drop_table",
|
34995
|
-
tableName: `__old_push_${tableName}`,
|
34996
|
-
schema: ""
|
34997
|
-
})
|
34998
|
-
);
|
34999
|
-
for (const idx of Object.values(json.tables[tableName].indexes)) {
|
35000
|
-
statements.push(
|
35001
|
-
new CreateSqliteIndexConvertor().convert({
|
35002
|
-
type: "create_index",
|
35003
|
-
tableName,
|
35004
|
-
schema: "",
|
35005
|
-
data: idx
|
35006
|
-
})
|
35007
|
-
);
|
35008
|
-
}
|
35009
|
-
return statements;
|
35010
|
-
};
|
35011
|
-
var getOldTableName = (tableName, meta) => {
|
35012
|
-
for (const key of Object.keys(meta.tables)) {
|
35013
|
-
const value = meta.tables[key];
|
35014
|
-
if (`"${tableName}"` === value) {
|
35015
|
-
return key.substring(1, key.length - 1);
|
35016
|
-
}
|
35017
|
-
}
|
35018
|
-
return tableName;
|
35019
|
-
};
|
35020
|
-
var getNewTableName = (tableName, meta) => {
|
35021
|
-
if (typeof meta.tables[`"${tableName}"`] !== "undefined") {
|
35022
|
-
return meta.tables[`"${tableName}"`].substring(
|
35023
|
-
1,
|
35024
|
-
meta.tables[`"${tableName}"`].length - 1
|
35025
|
-
);
|
35026
|
-
}
|
35027
|
-
return tableName;
|
35028
|
-
};
|
35029
|
-
var logSuggestionsAndReturn = async (connection, statements, json1, json2, meta) => {
|
35030
|
-
let shouldAskForApprove = false;
|
35031
|
-
const statementsToExecute = [];
|
35032
|
-
const infoToPrint = [];
|
35033
|
-
const tablesToRemove = [];
|
35034
|
-
const columnsToRemove = [];
|
35035
|
-
const schemasToRemove = [];
|
35036
|
-
const tablesToTruncate = [];
|
35037
|
-
const tablesContext = {};
|
35038
|
-
for (const statement of statements) {
|
35039
|
-
if (statement.type === "drop_table") {
|
35040
|
-
const res = await connection.query(
|
35041
|
-
`select count(*) as count from \`${statement.tableName}\``
|
35042
|
-
);
|
35043
|
-
const count2 = Number(res[0].count);
|
35044
|
-
if (count2 > 0) {
|
35045
|
-
infoToPrint.push(
|
35046
|
-
`\xB7 You're about to delete ${source_default.underline(
|
35047
|
-
statement.tableName
|
35048
|
-
)} table with ${count2} items`
|
35049
|
-
);
|
35050
|
-
tablesToRemove.push(statement.tableName);
|
35051
|
-
shouldAskForApprove = true;
|
35052
|
-
}
|
35053
|
-
const stmnt = fromJson([statement], "sqlite")[0];
|
35054
|
-
statementsToExecute.push(stmnt);
|
35055
|
-
} else if (statement.type === "alter_table_drop_column") {
|
35056
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35057
|
-
const columnIsPartOfPk = Object.values(
|
35058
|
-
json1.tables[newTableName].compositePrimaryKeys
|
35059
|
-
).find((c) => SQLiteSquasher.unsquashPK(c).includes(statement.columnName));
|
35060
|
-
const columnIsPartOfIndex = Object.values(
|
35061
|
-
json1.tables[newTableName].indexes
|
35062
|
-
).find((c) => SQLiteSquasher.unsquashIdx(c).columns.includes(statement.columnName));
|
35063
|
-
const columnIsPk = json1.tables[newTableName].columns[statement.columnName].primaryKey;
|
35064
|
-
const columnIsPartOfFk = Object.values(
|
35065
|
-
json1.tables[newTableName].foreignKeys
|
35066
|
-
).find(
|
35067
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).columnsFrom.includes(
|
35068
|
-
statement.columnName
|
35069
|
-
)
|
35070
|
-
);
|
35071
|
-
const res = await connection.query(
|
35072
|
-
`select count(*) as count from \`${newTableName}\``
|
35073
|
-
);
|
35074
|
-
const count2 = Number(res[0].count);
|
35075
|
-
if (count2 > 0) {
|
35076
|
-
infoToPrint.push(
|
35077
|
-
`\xB7 You're about to delete ${source_default.underline(
|
35078
|
-
statement.columnName
|
35079
|
-
)} column in ${newTableName} table with ${count2} items`
|
35080
|
-
);
|
35081
|
-
columnsToRemove.push(`${newTableName}_${statement.columnName}`);
|
35082
|
-
shouldAskForApprove = true;
|
35083
|
-
}
|
35084
|
-
if (columnIsPk || columnIsPartOfPk || columnIsPartOfIndex || columnIsPartOfFk) {
|
35085
|
-
tablesContext[newTableName] = [
|
35086
|
-
..._moveDataStatements(statement.tableName, json2, true)
|
35087
|
-
];
|
35088
|
-
const tablesReferncingCurrent = [];
|
35089
|
-
for (const table4 of Object.values(json1.tables)) {
|
35090
|
-
const tablesRefs = Object.values(json1.tables[table4.name].foreignKeys).filter(
|
35091
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).tableTo === newTableName
|
35092
|
-
).map((t) => SQLiteSquasher.unsquashPushFK(t).tableFrom);
|
35093
|
-
tablesReferncingCurrent.push(...tablesRefs);
|
35094
|
-
}
|
35095
|
-
const uniqueTableRefs = [...new Set(tablesReferncingCurrent)];
|
35096
|
-
for (const table4 of uniqueTableRefs) {
|
35097
|
-
if (typeof tablesContext[table4] === "undefined") {
|
35098
|
-
tablesContext[table4] = [..._moveDataStatements(table4, json2)];
|
35099
|
-
}
|
35100
|
-
}
|
35101
|
-
} else {
|
35102
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35103
|
-
const stmnt = fromJson([statement], "sqlite")[0];
|
35104
|
-
statementsToExecute.push(stmnt);
|
35105
|
-
}
|
35106
|
-
}
|
35107
|
-
} else if (statement.type === "sqlite_alter_table_add_column") {
|
35108
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35109
|
-
if (statement.column.notNull && !statement.column.default) {
|
35110
|
-
const res = await connection.query(
|
35111
|
-
`select count(*) as count from \`${newTableName}\``
|
35112
|
-
);
|
35113
|
-
const count2 = Number(res[0].count);
|
35114
|
-
if (count2 > 0) {
|
35115
|
-
infoToPrint.push(
|
35116
|
-
`\xB7 You're about to add not-null ${source_default.underline(
|
35117
|
-
statement.column.name
|
35118
|
-
)} column without default value, which contains ${count2} items`
|
35119
|
-
);
|
35120
|
-
tablesToTruncate.push(newTableName);
|
35121
|
-
statementsToExecute.push(`delete from ${newTableName};`);
|
35122
|
-
shouldAskForApprove = true;
|
35123
|
-
}
|
35124
|
-
}
|
35125
|
-
if (statement.column.primaryKey) {
|
35126
|
-
tablesContext[newTableName] = [
|
35127
|
-
..._moveDataStatements(statement.tableName, json2, true)
|
35128
|
-
];
|
35129
|
-
const tablesReferncingCurrent = [];
|
35130
|
-
for (const table4 of Object.values(json1.tables)) {
|
35131
|
-
const tablesRefs = Object.values(json1.tables[table4.name].foreignKeys).filter(
|
35132
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).tableTo === newTableName
|
35133
|
-
).map((t) => SQLiteSquasher.unsquashPushFK(t).tableFrom);
|
35134
|
-
tablesReferncingCurrent.push(...tablesRefs);
|
35135
|
-
}
|
35136
|
-
const uniqueTableRefs = [...new Set(tablesReferncingCurrent)];
|
35137
|
-
for (const table4 of uniqueTableRefs) {
|
35138
|
-
if (typeof tablesContext[table4] === "undefined") {
|
35139
|
-
tablesContext[table4] = [..._moveDataStatements(table4, json2)];
|
35140
|
-
}
|
35141
|
-
}
|
35142
|
-
} else {
|
35143
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35144
|
-
const stmnt = fromJson([statement], "sqlite")[0];
|
35145
|
-
statementsToExecute.push(stmnt);
|
35146
|
-
}
|
35147
|
-
}
|
35148
|
-
} 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") {
|
35149
|
-
if (!(statement.type === "alter_table_alter_column_set_notnull" && statement.columnPk)) {
|
35150
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35151
|
-
if (statement.type === "alter_table_alter_column_set_notnull" && typeof statement.columnDefault === "undefined") {
|
35152
|
-
const res = await connection.query(
|
35153
|
-
`select count(*) as count from \`${newTableName}\``
|
35154
|
-
);
|
35155
|
-
const count2 = Number(res[0].count);
|
35156
|
-
if (count2 > 0) {
|
35157
|
-
infoToPrint.push(
|
35158
|
-
`\xB7 You're about to add not-null constraint to ${source_default.underline(
|
35159
|
-
statement.columnName
|
35160
|
-
)} column without default value, which contains ${count2} items`
|
35161
|
-
);
|
35162
|
-
tablesToTruncate.push(newTableName);
|
35163
|
-
shouldAskForApprove = true;
|
35164
|
-
}
|
35165
|
-
tablesContext[newTableName] = _moveDataStatements(
|
35166
|
-
statement.tableName,
|
35167
|
-
json1,
|
35168
|
-
true
|
35169
|
-
);
|
35170
|
-
} else {
|
35171
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35172
|
-
tablesContext[newTableName] = _moveDataStatements(
|
35173
|
-
statement.tableName,
|
35174
|
-
json1
|
35175
|
-
);
|
35176
|
-
}
|
35177
|
-
}
|
35178
|
-
const tablesReferncingCurrent = [];
|
35179
|
-
for (const table4 of Object.values(json1.tables)) {
|
35180
|
-
const tablesRefs = Object.values(json1.tables[table4.name].foreignKeys).filter(
|
35181
|
-
(t) => SQLiteSquasher.unsquashPushFK(t).tableTo === newTableName
|
35182
|
-
).map((t) => {
|
35183
|
-
return getNewTableName(
|
35184
|
-
SQLiteSquasher.unsquashPushFK(t).tableFrom,
|
35185
|
-
meta
|
35186
|
-
);
|
35187
|
-
});
|
35188
|
-
tablesReferncingCurrent.push(...tablesRefs);
|
35189
|
-
}
|
35190
|
-
const uniqueTableRefs = [...new Set(tablesReferncingCurrent)];
|
35191
|
-
for (const table4 of uniqueTableRefs) {
|
35192
|
-
if (typeof tablesContext[table4] === "undefined") {
|
35193
|
-
tablesContext[table4] = [..._moveDataStatements(table4, json1)];
|
35194
|
-
}
|
35195
|
-
}
|
35196
|
-
}
|
35197
|
-
} else if (statement.type === "create_reference" || statement.type === "delete_reference" || statement.type === "alter_reference") {
|
35198
|
-
const fk4 = SQLiteSquasher.unsquashPushFK(statement.data);
|
35199
|
-
if (typeof tablesContext[statement.tableName] === "undefined") {
|
35200
|
-
tablesContext[statement.tableName] = _moveDataStatements(
|
35201
|
-
statement.tableName,
|
35202
|
-
json2
|
35203
|
-
);
|
35204
|
-
}
|
35205
|
-
} 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") {
|
35206
|
-
const newTableName = getOldTableName(statement.tableName, meta);
|
35207
|
-
if (typeof tablesContext[newTableName] === "undefined") {
|
35208
|
-
tablesContext[newTableName] = _moveDataStatements(
|
35209
|
-
statement.tableName,
|
35210
|
-
json2
|
35211
|
-
);
|
35212
|
-
}
|
35213
|
-
} else {
|
35214
|
-
const stmnt = fromJson([statement], "sqlite");
|
35215
|
-
if (typeof stmnt !== "undefined") {
|
35216
|
-
statementsToExecute.push(...stmnt);
|
35217
|
-
}
|
35218
|
-
}
|
35219
|
-
}
|
35220
|
-
for (const context of Object.values(tablesContext)) {
|
35221
|
-
statementsToExecute.push(...context);
|
35222
|
-
}
|
35223
|
-
return {
|
35224
|
-
statementsToExecute,
|
35225
|
-
shouldAskForApprove,
|
35226
|
-
infoToPrint,
|
35227
|
-
columnsToRemove: [...new Set(columnsToRemove)],
|
35228
|
-
schemasToRemove: [...new Set(schemasToRemove)],
|
35229
|
-
tablesToTruncate: [...new Set(tablesToTruncate)],
|
35230
|
-
tablesToRemove: [...new Set(tablesToRemove)]
|
35231
|
-
};
|
35232
|
-
};
|
35233
|
-
|
35234
36138
|
// src/api.ts
|
36139
|
+
init_sqlitePushUtils();
|
35235
36140
|
init_global();
|
35236
36141
|
init_migrationPreparator();
|
35237
36142
|
init_mysqlSchema();
|
@@ -35278,7 +36183,7 @@ var generateMigration = async (prev, cur) => {
|
|
35278
36183
|
};
|
35279
36184
|
var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
35280
36185
|
const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
35281
|
-
const { sql: sql2 } = await Promise.resolve().then(() => (
|
36186
|
+
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
35282
36187
|
const db = {
|
35283
36188
|
query: async (query, params) => {
|
35284
36189
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -35348,7 +36253,7 @@ var generateSQLiteMigration = async (prev, cur) => {
|
|
35348
36253
|
};
|
35349
36254
|
var pushSQLiteSchema = async (imports, drizzleInstance) => {
|
35350
36255
|
const { applySqliteSnapshotsDiff: applySqliteSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
35351
|
-
const { sql: sql2 } = await Promise.resolve().then(() => (
|
36256
|
+
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
35352
36257
|
const db = {
|
35353
36258
|
query: async (query, params) => {
|
35354
36259
|
const res = drizzleInstance.all(sql2.raw(query));
|
@@ -35425,7 +36330,7 @@ var pushMySQLSchema = async (imports, drizzleInstance, databaseName) => {
|
|
35425
36330
|
const { applyMysqlSnapshotsDiff: applyMysqlSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
35426
36331
|
const { logSuggestionsAndReturn: logSuggestionsAndReturn3 } = await Promise.resolve().then(() => (init_mysqlPushUtils(), mysqlPushUtils_exports));
|
35427
36332
|
const { mysqlPushIntrospect: mysqlPushIntrospect2 } = await Promise.resolve().then(() => (init_mysqlIntrospect(), mysqlIntrospect_exports));
|
35428
|
-
const { sql: sql2 } = await Promise.resolve().then(() => (
|
36333
|
+
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
35429
36334
|
const db = {
|
35430
36335
|
query: async (query, params) => {
|
35431
36336
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -35464,7 +36369,13 @@ var pushMySQLSchema = async (imports, drizzleInstance, databaseName) => {
|
|
35464
36369
|
};
|
35465
36370
|
};
|
35466
36371
|
var upPgSnapshot = (snapshot) => {
|
35467
|
-
|
36372
|
+
if (snapshot.version === "5") {
|
36373
|
+
return updateUpToV7(updateUpToV6(snapshot));
|
36374
|
+
}
|
36375
|
+
if (snapshot.version === "6") {
|
36376
|
+
return updateUpToV7(snapshot);
|
36377
|
+
}
|
36378
|
+
return snapshot;
|
35468
36379
|
};
|
35469
36380
|
export {
|
35470
36381
|
generateDrizzleJson,
|