drizzle-kit 0.29.1 → 0.30.0-3256029
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.js +91 -59
- package/api.mjs +91 -59
- package/bin.cjs +12 -21
- package/package.json +1 -1
package/api.js
CHANGED
@@ -5695,8 +5695,8 @@ var init_lib = __esm({
|
|
5695
5695
|
unknownKeys: "strict",
|
5696
5696
|
...message !== void 0 ? {
|
5697
5697
|
errorMap: (issue, ctx) => {
|
5698
|
-
var _a413, _b303,
|
5699
|
-
const defaultError = (
|
5698
|
+
var _a413, _b303, _c14, _d6;
|
5699
|
+
const defaultError = (_c14 = (_b303 = (_a413 = this._def).errorMap) === null || _b303 === void 0 ? void 0 : _b303.call(_a413, issue, ctx).message) !== null && _c14 !== void 0 ? _c14 : ctx.defaultError;
|
5700
5700
|
if (issue.code === "unrecognized_keys")
|
5701
5701
|
return {
|
5702
5702
|
message: (_d6 = errorUtil.errToObj(message).message) !== null && _d6 !== void 0 ? _d6 : defaultError
|
@@ -12331,7 +12331,7 @@ var init_sqlgenerator = __esm({
|
|
12331
12331
|
const { tableName, schema: schema5, columns, compositePKs, uniqueConstraints, checkConstraints, policies, isRLSEnabled } = st;
|
12332
12332
|
let statement = "";
|
12333
12333
|
const name2 = schema5 ? `"${schema5}"."${tableName}"` : `"${tableName}"`;
|
12334
|
-
statement += `CREATE TABLE
|
12334
|
+
statement += `CREATE TABLE ${name2} (
|
12335
12335
|
`;
|
12336
12336
|
for (let i = 0; i < columns.length; i++) {
|
12337
12337
|
const column5 = columns[i];
|
@@ -13169,7 +13169,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
13169
13169
|
convert(statement) {
|
13170
13170
|
const { tableName, columnName, schema: schema5 } = statement;
|
13171
13171
|
const tableNameWithSchema = schema5 ? `"${schema5}"."${tableName}"` : `"${tableName}"`;
|
13172
|
-
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN
|
13172
|
+
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN "${columnName}";`;
|
13173
13173
|
}
|
13174
13174
|
};
|
13175
13175
|
MySqlAlterTableDropColumnConvertor = class extends Convertor {
|
@@ -13590,7 +13590,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
13590
13590
|
for (const table5 of Object.values(json22.tables)) {
|
13591
13591
|
for (const index5 of Object.values(table5.indexes)) {
|
13592
13592
|
const unsquashed = SQLiteSquasher.unsquashIdx(index5);
|
13593
|
-
sqlStatements.push(`DROP INDEX
|
13593
|
+
sqlStatements.push(`DROP INDEX "${unsquashed.name}";`);
|
13594
13594
|
indexes.push({ ...unsquashed, tableName: table5.name });
|
13595
13595
|
}
|
13596
13596
|
}
|
@@ -14104,13 +14104,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14104
14104
|
const toColumnsString = columnsTo.map((it) => `"${it}"`).join(",");
|
14105
14105
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${tableFrom}"` : `"${tableFrom}"`;
|
14106
14106
|
const tableToNameWithSchema = schemaTo ? `"${schemaTo}"."${tableTo}"` : `"${tableTo}"`;
|
14107
|
-
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name2}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
14108
|
-
|
14109
|
-
sql2 += " " + alterStatement + ";\n";
|
14110
|
-
sql2 += "EXCEPTION\n";
|
14111
|
-
sql2 += " WHEN duplicate_object THEN null;\n";
|
14112
|
-
sql2 += "END $$;\n";
|
14113
|
-
return sql2;
|
14107
|
+
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name2}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
14108
|
+
return alterStatement;
|
14114
14109
|
}
|
14115
14110
|
};
|
14116
14111
|
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
@@ -14167,12 +14162,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14167
14162
|
const toColumnsString = newFk.columnsTo.map((it) => `"${it}"`).join(",");
|
14168
14163
|
const tableFromNameWithSchema = oldFk.schemaTo ? `"${oldFk.schemaTo}"."${oldFk.tableFrom}"` : `"${oldFk.tableFrom}"`;
|
14169
14164
|
const tableToNameWithSchema = newFk.schemaTo ? `"${newFk.schemaTo}"."${newFk.tableFrom}"` : `"${newFk.tableFrom}"`;
|
14170
|
-
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
14171
|
-
sql2 +=
|
14172
|
-
sql2 += " " + alterStatement + ";\n";
|
14173
|
-
sql2 += "EXCEPTION\n";
|
14174
|
-
sql2 += " WHEN duplicate_object THEN null;\n";
|
14175
|
-
sql2 += "END $$;\n";
|
14165
|
+
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
14166
|
+
sql2 += alterStatement;
|
14176
14167
|
return sql2;
|
14177
14168
|
}
|
14178
14169
|
};
|
@@ -14228,7 +14219,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14228
14219
|
reversedString = reversedString.slice(0, -1);
|
14229
14220
|
return reversedString;
|
14230
14221
|
}
|
14231
|
-
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""}
|
14222
|
+
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""} "${name2}" ON ${tableNameWithSchema} USING ${method} (${value})${Object.keys(withMap).length !== 0 ? ` WITH (${reverseLogic(withMap)})` : ""}${where ? ` WHERE ${where}` : ""};`;
|
14232
14223
|
}
|
14233
14224
|
};
|
14234
14225
|
CreateMySqlIndexConvertor = class extends Convertor {
|
@@ -14283,7 +14274,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14283
14274
|
}
|
14284
14275
|
convert(statement) {
|
14285
14276
|
const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
|
14286
|
-
return `DROP INDEX
|
14277
|
+
return `DROP INDEX "${name2}";`;
|
14287
14278
|
}
|
14288
14279
|
};
|
14289
14280
|
PgCreateSchemaConvertor = class extends Convertor {
|
@@ -14354,7 +14345,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14354
14345
|
}
|
14355
14346
|
convert(statement) {
|
14356
14347
|
const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
|
14357
|
-
return `DROP INDEX
|
14348
|
+
return `DROP INDEX \`${name2}\`;`;
|
14358
14349
|
}
|
14359
14350
|
};
|
14360
14351
|
MySqlDropIndexConvertor = class extends Convertor {
|
@@ -21983,7 +21974,7 @@ var version;
|
|
21983
21974
|
var init_version = __esm({
|
21984
21975
|
"../drizzle-orm/dist/version.js"() {
|
21985
21976
|
"use strict";
|
21986
|
-
version = "0.
|
21977
|
+
version = "0.38.0";
|
21987
21978
|
}
|
21988
21979
|
});
|
21989
21980
|
|
@@ -22168,7 +22159,10 @@ function fillPlaceholders(params, values) {
|
|
22168
22159
|
return p;
|
22169
22160
|
});
|
22170
22161
|
}
|
22171
|
-
|
22162
|
+
function isView(view4) {
|
22163
|
+
return typeof view4 === "object" && view4 !== null && IsDrizzleView in view4;
|
22164
|
+
}
|
22165
|
+
var _a19, FakePrimitiveParam, _a20, StringChunk, _a21, _SQL, SQL, _a22, Name, noopDecoder, noopEncoder, noopMapper, _a23, Param, _a24, Placeholder, IsDrizzleView, _a25, _b10, _c2, View3;
|
22172
22166
|
var init_sql = __esm({
|
22173
22167
|
"../drizzle-orm/dist/sql/sql.js"() {
|
22174
22168
|
"use strict";
|
@@ -22493,11 +22487,14 @@ var init_sql = __esm({
|
|
22493
22487
|
}
|
22494
22488
|
};
|
22495
22489
|
__publicField(Placeholder, _a24, "Placeholder");
|
22496
|
-
|
22490
|
+
IsDrizzleView = Symbol.for("drizzle:IsDrizzleView");
|
22491
|
+
_c2 = entityKind, _b10 = ViewBaseConfig, _a25 = IsDrizzleView;
|
22497
22492
|
View3 = class {
|
22498
22493
|
constructor({ name: name2, schema: schema5, selectedFields, query }) {
|
22499
22494
|
/** @internal */
|
22500
|
-
__publicField(this,
|
22495
|
+
__publicField(this, _b10);
|
22496
|
+
/** @internal */
|
22497
|
+
__publicField(this, _a25, true);
|
22501
22498
|
this[ViewBaseConfig] = {
|
22502
22499
|
name: name2,
|
22503
22500
|
originalName: name2,
|
@@ -22512,7 +22509,7 @@ var init_sql = __esm({
|
|
22512
22509
|
return new SQL([this]);
|
22513
22510
|
}
|
22514
22511
|
};
|
22515
|
-
__publicField(View3,
|
22512
|
+
__publicField(View3, _c2, "View");
|
22516
22513
|
Column2.prototype.getSQL = function() {
|
22517
22514
|
return new SQL([this]);
|
22518
22515
|
};
|
@@ -23033,6 +23030,9 @@ function applyMixins(baseClass, extendedClasses) {
|
|
23033
23030
|
function getTableColumns(table5) {
|
23034
23031
|
return table5[Table2.Symbol.Columns];
|
23035
23032
|
}
|
23033
|
+
function getViewSelectedFields(view4) {
|
23034
|
+
return view4[ViewBaseConfig].selectedFields;
|
23035
|
+
}
|
23036
23036
|
function getTableLikeName(table5) {
|
23037
23037
|
return is(table5, Subquery) ? table5._.alias : is(table5, View3) ? table5[ViewBaseConfig].name : is(table5, SQL) ? void 0 : table5[Table2.Symbol.IsAlias] ? table5[Table2.Symbol.Name] : table5[Table2.Symbol.BaseName];
|
23038
23038
|
}
|
@@ -23327,7 +23327,10 @@ var init_char = __esm({
|
|
23327
23327
|
}
|
23328
23328
|
/** @internal */
|
23329
23329
|
build(table5) {
|
23330
|
-
return new PgChar(
|
23330
|
+
return new PgChar(
|
23331
|
+
table5,
|
23332
|
+
this.config
|
23333
|
+
);
|
23331
23334
|
}
|
23332
23335
|
};
|
23333
23336
|
__publicField(PgCharBuilder, _a46, "PgCharBuilder");
|
@@ -24459,7 +24462,10 @@ var init_varchar = __esm({
|
|
24459
24462
|
}
|
24460
24463
|
/** @internal */
|
24461
24464
|
build(table5) {
|
24462
|
-
return new PgVarchar(
|
24465
|
+
return new PgVarchar(
|
24466
|
+
table5,
|
24467
|
+
this.config
|
24468
|
+
);
|
24463
24469
|
}
|
24464
24470
|
};
|
24465
24471
|
__publicField(PgVarcharBuilder, _a105, "PgVarcharBuilder");
|
@@ -24619,7 +24625,10 @@ var init_vector = __esm({
|
|
24619
24625
|
}
|
24620
24626
|
/** @internal */
|
24621
24627
|
build(table5) {
|
24622
|
-
return new PgVector(
|
24628
|
+
return new PgVector(
|
24629
|
+
table5,
|
24630
|
+
this.config
|
24631
|
+
);
|
24623
24632
|
}
|
24624
24633
|
};
|
24625
24634
|
__publicField(PgVectorBuilder, _a113, "PgVectorBuilder");
|
@@ -24751,7 +24760,7 @@ function pgTableWithSchema(name2, columns, extraConfig, schema5, baseName = name
|
|
24751
24760
|
}
|
24752
24761
|
});
|
24753
24762
|
}
|
24754
|
-
var InlineForeignKeys, EnableRLS, _a115, _b94,
|
24763
|
+
var InlineForeignKeys, EnableRLS, _a115, _b94, _c3, _d2, _e2, PgTable, pgTable;
|
24755
24764
|
var init_table2 = __esm({
|
24756
24765
|
"../drizzle-orm/dist/pg-core/table.js"() {
|
24757
24766
|
"use strict";
|
@@ -24760,11 +24769,11 @@ var init_table2 = __esm({
|
|
24760
24769
|
init_all();
|
24761
24770
|
InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
|
24762
24771
|
EnableRLS = Symbol.for("drizzle:EnableRLS");
|
24763
|
-
PgTable = class extends (_e2 = Table2, _d2 = entityKind,
|
24772
|
+
PgTable = class extends (_e2 = Table2, _d2 = entityKind, _c3 = InlineForeignKeys, _b94 = EnableRLS, _a115 = Table2.Symbol.ExtraConfigBuilder, _e2) {
|
24764
24773
|
constructor() {
|
24765
24774
|
super(...arguments);
|
24766
24775
|
/**@internal */
|
24767
|
-
__publicField(this,
|
24776
|
+
__publicField(this, _c3, []);
|
24768
24777
|
/** @internal */
|
24769
24778
|
__publicField(this, _b94, false);
|
24770
24779
|
/** @internal */
|
@@ -25279,6 +25288,7 @@ __export(dist_exports, {
|
|
25279
25288
|
getTableLikeName: () => getTableLikeName,
|
25280
25289
|
getTableName: () => getTableName,
|
25281
25290
|
getTableUniqueName: () => getTableUniqueName,
|
25291
|
+
getViewSelectedFields: () => getViewSelectedFields,
|
25282
25292
|
gt: () => gt,
|
25283
25293
|
gte: () => gte,
|
25284
25294
|
hammingDistance: () => hammingDistance,
|
@@ -25294,6 +25304,7 @@ __export(dist_exports, {
|
|
25294
25304
|
isNull: () => isNull,
|
25295
25305
|
isSQLWrapper: () => isSQLWrapper,
|
25296
25306
|
isTable: () => isTable,
|
25307
|
+
isView: () => isView,
|
25297
25308
|
jaccardDistance: () => jaccardDistance,
|
25298
25309
|
l1Distance: () => l1Distance,
|
25299
25310
|
l2Distance: () => l2Distance,
|
@@ -28143,13 +28154,13 @@ var init_query_builders = __esm({
|
|
28143
28154
|
});
|
28144
28155
|
|
28145
28156
|
// ../drizzle-orm/dist/pg-core/query-builders/count.js
|
28146
|
-
var _a139, _b104,
|
28157
|
+
var _a139, _b104, _c4, _PgCountBuilder, PgCountBuilder;
|
28147
28158
|
var init_count = __esm({
|
28148
28159
|
"../drizzle-orm/dist/pg-core/query-builders/count.js"() {
|
28149
28160
|
"use strict";
|
28150
28161
|
init_entity();
|
28151
28162
|
init_sql();
|
28152
|
-
_PgCountBuilder = class _PgCountBuilder extends (
|
28163
|
+
_PgCountBuilder = class _PgCountBuilder extends (_c4 = SQL, _b104 = entityKind, _a139 = Symbol.toStringTag, _c4) {
|
28153
28164
|
constructor(params) {
|
28154
28165
|
super(_PgCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
28155
28166
|
__publicField(this, "sql");
|
@@ -28888,7 +28899,7 @@ function isPgView(obj) {
|
|
28888
28899
|
function isPgMaterializedView(obj) {
|
28889
28900
|
return is(obj, PgMaterializedView);
|
28890
28901
|
}
|
28891
|
-
var _a150, DefaultViewBuilderCore, _a151, _b107, ViewBuilder, _a152, _b108, ManualViewBuilder, _a153, MaterializedViewBuilderCore, _a154, _b109, MaterializedViewBuilder, _a155, _b110, ManualMaterializedViewBuilder, _a156, _b111,
|
28902
|
+
var _a150, DefaultViewBuilderCore, _a151, _b107, ViewBuilder, _a152, _b108, ManualViewBuilder, _a153, MaterializedViewBuilderCore, _a154, _b109, MaterializedViewBuilder, _a155, _b110, ManualMaterializedViewBuilder, _a156, _b111, _c5, PgView2, PgMaterializedViewConfig, _a157, _b112, _c6, PgMaterializedView;
|
28892
28903
|
var init_view = __esm({
|
28893
28904
|
"../drizzle-orm/dist/pg-core/view.js"() {
|
28894
28905
|
"use strict";
|
@@ -29098,7 +29109,7 @@ var init_view = __esm({
|
|
29098
29109
|
}
|
29099
29110
|
};
|
29100
29111
|
__publicField(ManualMaterializedViewBuilder, _a155, "PgManualMaterializedViewBuilder");
|
29101
|
-
PgView2 = class extends (
|
29112
|
+
PgView2 = class extends (_c5 = PgViewBase, _b111 = entityKind, _a156 = PgViewConfig, _c5) {
|
29102
29113
|
constructor({ pgConfig, config }) {
|
29103
29114
|
super(config);
|
29104
29115
|
__publicField(this, _a156);
|
@@ -29111,7 +29122,7 @@ var init_view = __esm({
|
|
29111
29122
|
};
|
29112
29123
|
__publicField(PgView2, _b111, "PgView");
|
29113
29124
|
PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
|
29114
|
-
PgMaterializedView = class extends (
|
29125
|
+
PgMaterializedView = class extends (_c6 = PgViewBase, _b112 = entityKind, _a157 = PgMaterializedViewConfig, _c6) {
|
29115
29126
|
constructor({ pgConfig, config }) {
|
29116
29127
|
super(config);
|
29117
29128
|
__publicField(this, _a157);
|
@@ -31659,7 +31670,10 @@ var init_text2 = __esm({
|
|
31659
31670
|
}
|
31660
31671
|
/** @internal */
|
31661
31672
|
build(table5) {
|
31662
|
-
return new SQLiteText(
|
31673
|
+
return new SQLiteText(
|
31674
|
+
table5,
|
31675
|
+
this.config
|
31676
|
+
);
|
31663
31677
|
}
|
31664
31678
|
};
|
31665
31679
|
__publicField(SQLiteTextBuilder, _a191, "SQLiteTextBuilder");
|
@@ -31760,7 +31774,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema5, baseName = name2)
|
|
31760
31774
|
}
|
31761
31775
|
return table5;
|
31762
31776
|
}
|
31763
|
-
var InlineForeignKeys2, _a195, _b140,
|
31777
|
+
var InlineForeignKeys2, _a195, _b140, _c7, _d3, _e3, SQLiteTable, sqliteTable;
|
31764
31778
|
var init_table3 = __esm({
|
31765
31779
|
"../drizzle-orm/dist/sqlite-core/table.js"() {
|
31766
31780
|
"use strict";
|
@@ -31768,11 +31782,11 @@ var init_table3 = __esm({
|
|
31768
31782
|
init_table();
|
31769
31783
|
init_all2();
|
31770
31784
|
InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
31771
|
-
SQLiteTable = class extends (_e3 = Table2, _d3 = entityKind,
|
31785
|
+
SQLiteTable = class extends (_e3 = Table2, _d3 = entityKind, _c7 = Table2.Symbol.Columns, _b140 = InlineForeignKeys2, _a195 = Table2.Symbol.ExtraConfigBuilder, _e3) {
|
31772
31786
|
constructor() {
|
31773
31787
|
super(...arguments);
|
31774
31788
|
/** @internal */
|
31775
|
-
__publicField(this,
|
31789
|
+
__publicField(this, _c7);
|
31776
31790
|
/** @internal */
|
31777
31791
|
__publicField(this, _b140, []);
|
31778
31792
|
/** @internal */
|
@@ -33640,13 +33654,13 @@ var init_query_builders2 = __esm({
|
|
33640
33654
|
});
|
33641
33655
|
|
33642
33656
|
// ../drizzle-orm/dist/sqlite-core/query-builders/count.js
|
33643
|
-
var _a209, _b149,
|
33657
|
+
var _a209, _b149, _c8, _SQLiteCountBuilder, SQLiteCountBuilder;
|
33644
33658
|
var init_count2 = __esm({
|
33645
33659
|
"../drizzle-orm/dist/sqlite-core/query-builders/count.js"() {
|
33646
33660
|
"use strict";
|
33647
33661
|
init_entity();
|
33648
33662
|
init_sql();
|
33649
|
-
_SQLiteCountBuilder = class _SQLiteCountBuilder extends (
|
33663
|
+
_SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c8 = SQL, _b149 = entityKind, _a209 = Symbol.toStringTag, _c8) {
|
33650
33664
|
constructor(params) {
|
33651
33665
|
super(_SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
33652
33666
|
__publicField(this, "sql");
|
@@ -34418,7 +34432,8 @@ function getTableConfig2(table5) {
|
|
34418
34432
|
const extraConfigBuilder = table5[SQLiteTable.Symbol.ExtraConfigBuilder];
|
34419
34433
|
if (extraConfigBuilder !== void 0) {
|
34420
34434
|
const extraConfig = extraConfigBuilder(table5[SQLiteTable.Symbol.Columns]);
|
34421
|
-
|
34435
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
34436
|
+
for (const builder of Object.values(extraValues)) {
|
34422
34437
|
if (is(builder, IndexBuilder2)) {
|
34423
34438
|
indexes.push(builder.build(table5));
|
34424
34439
|
} else if (is(builder, CheckBuilder2)) {
|
@@ -36315,6 +36330,18 @@ function text3(a, b = {}) {
|
|
36315
36330
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36316
36331
|
return new MySqlTextBuilder(name2, "text", config);
|
36317
36332
|
}
|
36333
|
+
function tinytext(a, b = {}) {
|
36334
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36335
|
+
return new MySqlTextBuilder(name2, "tinytext", config);
|
36336
|
+
}
|
36337
|
+
function mediumtext(a, b = {}) {
|
36338
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36339
|
+
return new MySqlTextBuilder(name2, "mediumtext", config);
|
36340
|
+
}
|
36341
|
+
function longtext(a, b = {}) {
|
36342
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36343
|
+
return new MySqlTextBuilder(name2, "longtext", config);
|
36344
|
+
}
|
36318
36345
|
var _a279, _b202, MySqlTextBuilder, _a280, _b203, MySqlText;
|
36319
36346
|
var init_text3 = __esm({
|
36320
36347
|
"../drizzle-orm/dist/mysql-core/columns/text.js"() {
|
@@ -36674,13 +36701,13 @@ var init_columns3 = __esm({
|
|
36674
36701
|
});
|
36675
36702
|
|
36676
36703
|
// ../drizzle-orm/dist/mysql-core/query-builders/count.js
|
36677
|
-
var _a297, _b220,
|
36704
|
+
var _a297, _b220, _c9, _MySqlCountBuilder, MySqlCountBuilder;
|
36678
36705
|
var init_count3 = __esm({
|
36679
36706
|
"../drizzle-orm/dist/mysql-core/query-builders/count.js"() {
|
36680
36707
|
"use strict";
|
36681
36708
|
init_entity();
|
36682
36709
|
init_sql();
|
36683
|
-
_MySqlCountBuilder = class _MySqlCountBuilder extends (
|
36710
|
+
_MySqlCountBuilder = class _MySqlCountBuilder extends (_c9 = SQL, _b220 = entityKind, _a297 = Symbol.toStringTag, _c9) {
|
36684
36711
|
constructor(params) {
|
36685
36712
|
super(_MySqlCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
36686
36713
|
__publicField(this, "sql");
|
@@ -36856,7 +36883,10 @@ function getMySqlColumnBuilders() {
|
|
36856
36883
|
tinyint,
|
36857
36884
|
varbinary,
|
36858
36885
|
varchar: varchar2,
|
36859
|
-
year
|
36886
|
+
year,
|
36887
|
+
longtext,
|
36888
|
+
mediumtext,
|
36889
|
+
tinytext
|
36860
36890
|
};
|
36861
36891
|
}
|
36862
36892
|
var init_all3 = __esm({
|
@@ -36910,7 +36940,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema5, baseName = n
|
|
36910
36940
|
}
|
36911
36941
|
return table5;
|
36912
36942
|
}
|
36913
|
-
var InlineForeignKeys3, _a299, _b222,
|
36943
|
+
var InlineForeignKeys3, _a299, _b222, _c10, _d4, _e4, MySqlTable, mysqlTable;
|
36914
36944
|
var init_table4 = __esm({
|
36915
36945
|
"../drizzle-orm/dist/mysql-core/table.js"() {
|
36916
36946
|
"use strict";
|
@@ -36918,11 +36948,11 @@ var init_table4 = __esm({
|
|
36918
36948
|
init_table();
|
36919
36949
|
init_all3();
|
36920
36950
|
InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
|
36921
|
-
MySqlTable = class extends (_e4 = Table2, _d4 = entityKind,
|
36951
|
+
MySqlTable = class extends (_e4 = Table2, _d4 = entityKind, _c10 = Table2.Symbol.Columns, _b222 = InlineForeignKeys3, _a299 = Table2.Symbol.ExtraConfigBuilder, _e4) {
|
36922
36952
|
constructor() {
|
36923
36953
|
super(...arguments);
|
36924
36954
|
/** @internal */
|
36925
|
-
__publicField(this,
|
36955
|
+
__publicField(this, _c10);
|
36926
36956
|
/** @internal */
|
36927
36957
|
__publicField(this, _b222, []);
|
36928
36958
|
/** @internal */
|
@@ -39309,7 +39339,7 @@ function mysqlViewWithSchema(name2, selection, schema5) {
|
|
39309
39339
|
}
|
39310
39340
|
return new ViewBuilder3(name2, schema5);
|
39311
39341
|
}
|
39312
|
-
var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231,
|
39342
|
+
var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231, _c11, MySqlView2;
|
39313
39343
|
var init_view3 = __esm({
|
39314
39344
|
"../drizzle-orm/dist/mysql-core/view.js"() {
|
39315
39345
|
"use strict";
|
@@ -39414,7 +39444,7 @@ var init_view3 = __esm({
|
|
39414
39444
|
}
|
39415
39445
|
};
|
39416
39446
|
__publicField(ManualViewBuilder3, _a320, "MySqlManualViewBuilder");
|
39417
|
-
MySqlView2 = class extends (
|
39447
|
+
MySqlView2 = class extends (_c11 = MySqlViewBase, _b231 = entityKind, _a321 = MySqlViewConfig, _c11) {
|
39418
39448
|
constructor({ mysqlConfig, config }) {
|
39419
39449
|
super(config);
|
39420
39450
|
__publicField(this, _a321);
|
@@ -39537,7 +39567,8 @@ function getTableConfig3(table5) {
|
|
39537
39567
|
const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
|
39538
39568
|
if (extraConfigBuilder !== void 0) {
|
39539
39569
|
const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
|
39540
|
-
|
39570
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
39571
|
+
for (const builder of Object.values(extraValues)) {
|
39541
39572
|
if (is(builder, IndexBuilder3)) {
|
39542
39573
|
indexes.push(builder.build(table5));
|
39543
39574
|
} else if (is(builder, CheckBuilder3)) {
|
@@ -42069,13 +42100,13 @@ var init_columns4 = __esm({
|
|
42069
42100
|
});
|
42070
42101
|
|
42071
42102
|
// ../drizzle-orm/dist/singlestore-core/query-builders/count.js
|
42072
|
-
var _a391, _b295,
|
42103
|
+
var _a391, _b295, _c12, _SingleStoreCountBuilder, SingleStoreCountBuilder;
|
42073
42104
|
var init_count4 = __esm({
|
42074
42105
|
"../drizzle-orm/dist/singlestore-core/query-builders/count.js"() {
|
42075
42106
|
"use strict";
|
42076
42107
|
init_entity();
|
42077
42108
|
init_sql();
|
42078
|
-
_SingleStoreCountBuilder = class _SingleStoreCountBuilder extends (
|
42109
|
+
_SingleStoreCountBuilder = class _SingleStoreCountBuilder extends (_c12 = SQL, _b295 = entityKind, _a391 = Symbol.toStringTag, _c12) {
|
42079
42110
|
constructor(params) {
|
42080
42111
|
super(_SingleStoreCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
42081
42112
|
__publicField(this, "sql");
|
@@ -42429,14 +42460,14 @@ function singlestoreTableWithSchema(name2, columns, extraConfig, schema5, baseNa
|
|
42429
42460
|
}
|
42430
42461
|
return table5;
|
42431
42462
|
}
|
42432
|
-
var _a395, _b298,
|
42463
|
+
var _a395, _b298, _c13, _d5, SingleStoreTable;
|
42433
42464
|
var init_table5 = __esm({
|
42434
42465
|
"../drizzle-orm/dist/singlestore-core/table.js"() {
|
42435
42466
|
"use strict";
|
42436
42467
|
init_entity();
|
42437
42468
|
init_table();
|
42438
42469
|
init_all4();
|
42439
|
-
SingleStoreTable = class extends (_d5 = Table2,
|
42470
|
+
SingleStoreTable = class extends (_d5 = Table2, _c13 = entityKind, _b298 = Table2.Symbol.Columns, _a395 = Table2.Symbol.ExtraConfigBuilder, _d5) {
|
42440
42471
|
constructor() {
|
42441
42472
|
super(...arguments);
|
42442
42473
|
/** @internal */
|
@@ -42445,7 +42476,7 @@ var init_table5 = __esm({
|
|
42445
42476
|
__publicField(this, _a395);
|
42446
42477
|
}
|
42447
42478
|
};
|
42448
|
-
__publicField(SingleStoreTable,
|
42479
|
+
__publicField(SingleStoreTable, _c13, "SingleStoreTable");
|
42449
42480
|
/** @internal */
|
42450
42481
|
__publicField(SingleStoreTable, "Symbol", Object.assign({}, Table2.Symbol, {}));
|
42451
42482
|
}
|
@@ -44344,7 +44375,8 @@ function getTableConfig4(table5) {
|
|
44344
44375
|
const extraConfigBuilder = table5[SingleStoreTable.Symbol.ExtraConfigBuilder];
|
44345
44376
|
if (extraConfigBuilder !== void 0) {
|
44346
44377
|
const extraConfig = extraConfigBuilder(table5[SingleStoreTable.Symbol.Columns]);
|
44347
|
-
|
44378
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
44379
|
+
for (const builder of Object.values(extraValues)) {
|
44348
44380
|
if (is(builder, IndexBuilder4)) {
|
44349
44381
|
indexes.push(builder.build(table5));
|
44350
44382
|
} else if (is(builder, UniqueConstraintBuilder4)) {
|
package/api.mjs
CHANGED
@@ -5700,8 +5700,8 @@ var init_lib = __esm({
|
|
5700
5700
|
unknownKeys: "strict",
|
5701
5701
|
...message !== void 0 ? {
|
5702
5702
|
errorMap: (issue, ctx) => {
|
5703
|
-
var _a413, _b303,
|
5704
|
-
const defaultError = (
|
5703
|
+
var _a413, _b303, _c14, _d6;
|
5704
|
+
const defaultError = (_c14 = (_b303 = (_a413 = this._def).errorMap) === null || _b303 === void 0 ? void 0 : _b303.call(_a413, issue, ctx).message) !== null && _c14 !== void 0 ? _c14 : ctx.defaultError;
|
5705
5705
|
if (issue.code === "unrecognized_keys")
|
5706
5706
|
return {
|
5707
5707
|
message: (_d6 = errorUtil.errToObj(message).message) !== null && _d6 !== void 0 ? _d6 : defaultError
|
@@ -12336,7 +12336,7 @@ var init_sqlgenerator = __esm({
|
|
12336
12336
|
const { tableName, schema: schema5, columns, compositePKs, uniqueConstraints, checkConstraints, policies, isRLSEnabled } = st;
|
12337
12337
|
let statement = "";
|
12338
12338
|
const name2 = schema5 ? `"${schema5}"."${tableName}"` : `"${tableName}"`;
|
12339
|
-
statement += `CREATE TABLE
|
12339
|
+
statement += `CREATE TABLE ${name2} (
|
12340
12340
|
`;
|
12341
12341
|
for (let i = 0; i < columns.length; i++) {
|
12342
12342
|
const column5 = columns[i];
|
@@ -13174,7 +13174,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
13174
13174
|
convert(statement) {
|
13175
13175
|
const { tableName, columnName, schema: schema5 } = statement;
|
13176
13176
|
const tableNameWithSchema = schema5 ? `"${schema5}"."${tableName}"` : `"${tableName}"`;
|
13177
|
-
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN
|
13177
|
+
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN "${columnName}";`;
|
13178
13178
|
}
|
13179
13179
|
};
|
13180
13180
|
MySqlAlterTableDropColumnConvertor = class extends Convertor {
|
@@ -13595,7 +13595,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
13595
13595
|
for (const table5 of Object.values(json22.tables)) {
|
13596
13596
|
for (const index5 of Object.values(table5.indexes)) {
|
13597
13597
|
const unsquashed = SQLiteSquasher.unsquashIdx(index5);
|
13598
|
-
sqlStatements.push(`DROP INDEX
|
13598
|
+
sqlStatements.push(`DROP INDEX "${unsquashed.name}";`);
|
13599
13599
|
indexes.push({ ...unsquashed, tableName: table5.name });
|
13600
13600
|
}
|
13601
13601
|
}
|
@@ -14109,13 +14109,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14109
14109
|
const toColumnsString = columnsTo.map((it) => `"${it}"`).join(",");
|
14110
14110
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${tableFrom}"` : `"${tableFrom}"`;
|
14111
14111
|
const tableToNameWithSchema = schemaTo ? `"${schemaTo}"."${tableTo}"` : `"${tableTo}"`;
|
14112
|
-
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name2}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
14113
|
-
|
14114
|
-
sql2 += " " + alterStatement + ";\n";
|
14115
|
-
sql2 += "EXCEPTION\n";
|
14116
|
-
sql2 += " WHEN duplicate_object THEN null;\n";
|
14117
|
-
sql2 += "END $$;\n";
|
14118
|
-
return sql2;
|
14112
|
+
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name2}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
14113
|
+
return alterStatement;
|
14119
14114
|
}
|
14120
14115
|
};
|
14121
14116
|
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
@@ -14172,12 +14167,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14172
14167
|
const toColumnsString = newFk.columnsTo.map((it) => `"${it}"`).join(",");
|
14173
14168
|
const tableFromNameWithSchema = oldFk.schemaTo ? `"${oldFk.schemaTo}"."${oldFk.tableFrom}"` : `"${oldFk.tableFrom}"`;
|
14174
14169
|
const tableToNameWithSchema = newFk.schemaTo ? `"${newFk.schemaTo}"."${newFk.tableFrom}"` : `"${newFk.tableFrom}"`;
|
14175
|
-
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
14176
|
-
sql2 +=
|
14177
|
-
sql2 += " " + alterStatement + ";\n";
|
14178
|
-
sql2 += "EXCEPTION\n";
|
14179
|
-
sql2 += " WHEN duplicate_object THEN null;\n";
|
14180
|
-
sql2 += "END $$;\n";
|
14170
|
+
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
14171
|
+
sql2 += alterStatement;
|
14181
14172
|
return sql2;
|
14182
14173
|
}
|
14183
14174
|
};
|
@@ -14233,7 +14224,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14233
14224
|
reversedString = reversedString.slice(0, -1);
|
14234
14225
|
return reversedString;
|
14235
14226
|
}
|
14236
|
-
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""}
|
14227
|
+
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""} "${name2}" ON ${tableNameWithSchema} USING ${method} (${value})${Object.keys(withMap).length !== 0 ? ` WITH (${reverseLogic(withMap)})` : ""}${where ? ` WHERE ${where}` : ""};`;
|
14237
14228
|
}
|
14238
14229
|
};
|
14239
14230
|
CreateMySqlIndexConvertor = class extends Convertor {
|
@@ -14288,7 +14279,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14288
14279
|
}
|
14289
14280
|
convert(statement) {
|
14290
14281
|
const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
|
14291
|
-
return `DROP INDEX
|
14282
|
+
return `DROP INDEX "${name2}";`;
|
14292
14283
|
}
|
14293
14284
|
};
|
14294
14285
|
PgCreateSchemaConvertor = class extends Convertor {
|
@@ -14359,7 +14350,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
14359
14350
|
}
|
14360
14351
|
convert(statement) {
|
14361
14352
|
const { name: name2 } = PgSquasher.unsquashIdx(statement.data);
|
14362
|
-
return `DROP INDEX
|
14353
|
+
return `DROP INDEX \`${name2}\`;`;
|
14363
14354
|
}
|
14364
14355
|
};
|
14365
14356
|
MySqlDropIndexConvertor = class extends Convertor {
|
@@ -21988,7 +21979,7 @@ var version;
|
|
21988
21979
|
var init_version = __esm({
|
21989
21980
|
"../drizzle-orm/dist/version.js"() {
|
21990
21981
|
"use strict";
|
21991
|
-
version = "0.
|
21982
|
+
version = "0.38.0";
|
21992
21983
|
}
|
21993
21984
|
});
|
21994
21985
|
|
@@ -22173,7 +22164,10 @@ function fillPlaceholders(params, values) {
|
|
22173
22164
|
return p;
|
22174
22165
|
});
|
22175
22166
|
}
|
22176
|
-
|
22167
|
+
function isView(view4) {
|
22168
|
+
return typeof view4 === "object" && view4 !== null && IsDrizzleView in view4;
|
22169
|
+
}
|
22170
|
+
var _a19, FakePrimitiveParam, _a20, StringChunk, _a21, _SQL, SQL, _a22, Name, noopDecoder, noopEncoder, noopMapper, _a23, Param, _a24, Placeholder, IsDrizzleView, _a25, _b10, _c2, View3;
|
22177
22171
|
var init_sql = __esm({
|
22178
22172
|
"../drizzle-orm/dist/sql/sql.js"() {
|
22179
22173
|
"use strict";
|
@@ -22498,11 +22492,14 @@ var init_sql = __esm({
|
|
22498
22492
|
}
|
22499
22493
|
};
|
22500
22494
|
__publicField(Placeholder, _a24, "Placeholder");
|
22501
|
-
|
22495
|
+
IsDrizzleView = Symbol.for("drizzle:IsDrizzleView");
|
22496
|
+
_c2 = entityKind, _b10 = ViewBaseConfig, _a25 = IsDrizzleView;
|
22502
22497
|
View3 = class {
|
22503
22498
|
constructor({ name: name2, schema: schema5, selectedFields, query }) {
|
22504
22499
|
/** @internal */
|
22505
|
-
__publicField(this,
|
22500
|
+
__publicField(this, _b10);
|
22501
|
+
/** @internal */
|
22502
|
+
__publicField(this, _a25, true);
|
22506
22503
|
this[ViewBaseConfig] = {
|
22507
22504
|
name: name2,
|
22508
22505
|
originalName: name2,
|
@@ -22517,7 +22514,7 @@ var init_sql = __esm({
|
|
22517
22514
|
return new SQL([this]);
|
22518
22515
|
}
|
22519
22516
|
};
|
22520
|
-
__publicField(View3,
|
22517
|
+
__publicField(View3, _c2, "View");
|
22521
22518
|
Column2.prototype.getSQL = function() {
|
22522
22519
|
return new SQL([this]);
|
22523
22520
|
};
|
@@ -23038,6 +23035,9 @@ function applyMixins(baseClass, extendedClasses) {
|
|
23038
23035
|
function getTableColumns(table5) {
|
23039
23036
|
return table5[Table2.Symbol.Columns];
|
23040
23037
|
}
|
23038
|
+
function getViewSelectedFields(view4) {
|
23039
|
+
return view4[ViewBaseConfig].selectedFields;
|
23040
|
+
}
|
23041
23041
|
function getTableLikeName(table5) {
|
23042
23042
|
return is(table5, Subquery) ? table5._.alias : is(table5, View3) ? table5[ViewBaseConfig].name : is(table5, SQL) ? void 0 : table5[Table2.Symbol.IsAlias] ? table5[Table2.Symbol.Name] : table5[Table2.Symbol.BaseName];
|
23043
23043
|
}
|
@@ -23332,7 +23332,10 @@ var init_char = __esm({
|
|
23332
23332
|
}
|
23333
23333
|
/** @internal */
|
23334
23334
|
build(table5) {
|
23335
|
-
return new PgChar(
|
23335
|
+
return new PgChar(
|
23336
|
+
table5,
|
23337
|
+
this.config
|
23338
|
+
);
|
23336
23339
|
}
|
23337
23340
|
};
|
23338
23341
|
__publicField(PgCharBuilder, _a46, "PgCharBuilder");
|
@@ -24464,7 +24467,10 @@ var init_varchar = __esm({
|
|
24464
24467
|
}
|
24465
24468
|
/** @internal */
|
24466
24469
|
build(table5) {
|
24467
|
-
return new PgVarchar(
|
24470
|
+
return new PgVarchar(
|
24471
|
+
table5,
|
24472
|
+
this.config
|
24473
|
+
);
|
24468
24474
|
}
|
24469
24475
|
};
|
24470
24476
|
__publicField(PgVarcharBuilder, _a105, "PgVarcharBuilder");
|
@@ -24624,7 +24630,10 @@ var init_vector = __esm({
|
|
24624
24630
|
}
|
24625
24631
|
/** @internal */
|
24626
24632
|
build(table5) {
|
24627
|
-
return new PgVector(
|
24633
|
+
return new PgVector(
|
24634
|
+
table5,
|
24635
|
+
this.config
|
24636
|
+
);
|
24628
24637
|
}
|
24629
24638
|
};
|
24630
24639
|
__publicField(PgVectorBuilder, _a113, "PgVectorBuilder");
|
@@ -24756,7 +24765,7 @@ function pgTableWithSchema(name2, columns, extraConfig, schema5, baseName = name
|
|
24756
24765
|
}
|
24757
24766
|
});
|
24758
24767
|
}
|
24759
|
-
var InlineForeignKeys, EnableRLS, _a115, _b94,
|
24768
|
+
var InlineForeignKeys, EnableRLS, _a115, _b94, _c3, _d2, _e2, PgTable, pgTable;
|
24760
24769
|
var init_table2 = __esm({
|
24761
24770
|
"../drizzle-orm/dist/pg-core/table.js"() {
|
24762
24771
|
"use strict";
|
@@ -24765,11 +24774,11 @@ var init_table2 = __esm({
|
|
24765
24774
|
init_all();
|
24766
24775
|
InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
|
24767
24776
|
EnableRLS = Symbol.for("drizzle:EnableRLS");
|
24768
|
-
PgTable = class extends (_e2 = Table2, _d2 = entityKind,
|
24777
|
+
PgTable = class extends (_e2 = Table2, _d2 = entityKind, _c3 = InlineForeignKeys, _b94 = EnableRLS, _a115 = Table2.Symbol.ExtraConfigBuilder, _e2) {
|
24769
24778
|
constructor() {
|
24770
24779
|
super(...arguments);
|
24771
24780
|
/**@internal */
|
24772
|
-
__publicField(this,
|
24781
|
+
__publicField(this, _c3, []);
|
24773
24782
|
/** @internal */
|
24774
24783
|
__publicField(this, _b94, false);
|
24775
24784
|
/** @internal */
|
@@ -25284,6 +25293,7 @@ __export(dist_exports, {
|
|
25284
25293
|
getTableLikeName: () => getTableLikeName,
|
25285
25294
|
getTableName: () => getTableName,
|
25286
25295
|
getTableUniqueName: () => getTableUniqueName,
|
25296
|
+
getViewSelectedFields: () => getViewSelectedFields,
|
25287
25297
|
gt: () => gt,
|
25288
25298
|
gte: () => gte,
|
25289
25299
|
hammingDistance: () => hammingDistance,
|
@@ -25299,6 +25309,7 @@ __export(dist_exports, {
|
|
25299
25309
|
isNull: () => isNull,
|
25300
25310
|
isSQLWrapper: () => isSQLWrapper,
|
25301
25311
|
isTable: () => isTable,
|
25312
|
+
isView: () => isView,
|
25302
25313
|
jaccardDistance: () => jaccardDistance,
|
25303
25314
|
l1Distance: () => l1Distance,
|
25304
25315
|
l2Distance: () => l2Distance,
|
@@ -28148,13 +28159,13 @@ var init_query_builders = __esm({
|
|
28148
28159
|
});
|
28149
28160
|
|
28150
28161
|
// ../drizzle-orm/dist/pg-core/query-builders/count.js
|
28151
|
-
var _a139, _b104,
|
28162
|
+
var _a139, _b104, _c4, _PgCountBuilder, PgCountBuilder;
|
28152
28163
|
var init_count = __esm({
|
28153
28164
|
"../drizzle-orm/dist/pg-core/query-builders/count.js"() {
|
28154
28165
|
"use strict";
|
28155
28166
|
init_entity();
|
28156
28167
|
init_sql();
|
28157
|
-
_PgCountBuilder = class _PgCountBuilder extends (
|
28168
|
+
_PgCountBuilder = class _PgCountBuilder extends (_c4 = SQL, _b104 = entityKind, _a139 = Symbol.toStringTag, _c4) {
|
28158
28169
|
constructor(params) {
|
28159
28170
|
super(_PgCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
28160
28171
|
__publicField(this, "sql");
|
@@ -28893,7 +28904,7 @@ function isPgView(obj) {
|
|
28893
28904
|
function isPgMaterializedView(obj) {
|
28894
28905
|
return is(obj, PgMaterializedView);
|
28895
28906
|
}
|
28896
|
-
var _a150, DefaultViewBuilderCore, _a151, _b107, ViewBuilder, _a152, _b108, ManualViewBuilder, _a153, MaterializedViewBuilderCore, _a154, _b109, MaterializedViewBuilder, _a155, _b110, ManualMaterializedViewBuilder, _a156, _b111,
|
28907
|
+
var _a150, DefaultViewBuilderCore, _a151, _b107, ViewBuilder, _a152, _b108, ManualViewBuilder, _a153, MaterializedViewBuilderCore, _a154, _b109, MaterializedViewBuilder, _a155, _b110, ManualMaterializedViewBuilder, _a156, _b111, _c5, PgView2, PgMaterializedViewConfig, _a157, _b112, _c6, PgMaterializedView;
|
28897
28908
|
var init_view = __esm({
|
28898
28909
|
"../drizzle-orm/dist/pg-core/view.js"() {
|
28899
28910
|
"use strict";
|
@@ -29103,7 +29114,7 @@ var init_view = __esm({
|
|
29103
29114
|
}
|
29104
29115
|
};
|
29105
29116
|
__publicField(ManualMaterializedViewBuilder, _a155, "PgManualMaterializedViewBuilder");
|
29106
|
-
PgView2 = class extends (
|
29117
|
+
PgView2 = class extends (_c5 = PgViewBase, _b111 = entityKind, _a156 = PgViewConfig, _c5) {
|
29107
29118
|
constructor({ pgConfig, config }) {
|
29108
29119
|
super(config);
|
29109
29120
|
__publicField(this, _a156);
|
@@ -29116,7 +29127,7 @@ var init_view = __esm({
|
|
29116
29127
|
};
|
29117
29128
|
__publicField(PgView2, _b111, "PgView");
|
29118
29129
|
PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
|
29119
|
-
PgMaterializedView = class extends (
|
29130
|
+
PgMaterializedView = class extends (_c6 = PgViewBase, _b112 = entityKind, _a157 = PgMaterializedViewConfig, _c6) {
|
29120
29131
|
constructor({ pgConfig, config }) {
|
29121
29132
|
super(config);
|
29122
29133
|
__publicField(this, _a157);
|
@@ -31664,7 +31675,10 @@ var init_text2 = __esm({
|
|
31664
31675
|
}
|
31665
31676
|
/** @internal */
|
31666
31677
|
build(table5) {
|
31667
|
-
return new SQLiteText(
|
31678
|
+
return new SQLiteText(
|
31679
|
+
table5,
|
31680
|
+
this.config
|
31681
|
+
);
|
31668
31682
|
}
|
31669
31683
|
};
|
31670
31684
|
__publicField(SQLiteTextBuilder, _a191, "SQLiteTextBuilder");
|
@@ -31765,7 +31779,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema5, baseName = name2)
|
|
31765
31779
|
}
|
31766
31780
|
return table5;
|
31767
31781
|
}
|
31768
|
-
var InlineForeignKeys2, _a195, _b140,
|
31782
|
+
var InlineForeignKeys2, _a195, _b140, _c7, _d3, _e3, SQLiteTable, sqliteTable;
|
31769
31783
|
var init_table3 = __esm({
|
31770
31784
|
"../drizzle-orm/dist/sqlite-core/table.js"() {
|
31771
31785
|
"use strict";
|
@@ -31773,11 +31787,11 @@ var init_table3 = __esm({
|
|
31773
31787
|
init_table();
|
31774
31788
|
init_all2();
|
31775
31789
|
InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
31776
|
-
SQLiteTable = class extends (_e3 = Table2, _d3 = entityKind,
|
31790
|
+
SQLiteTable = class extends (_e3 = Table2, _d3 = entityKind, _c7 = Table2.Symbol.Columns, _b140 = InlineForeignKeys2, _a195 = Table2.Symbol.ExtraConfigBuilder, _e3) {
|
31777
31791
|
constructor() {
|
31778
31792
|
super(...arguments);
|
31779
31793
|
/** @internal */
|
31780
|
-
__publicField(this,
|
31794
|
+
__publicField(this, _c7);
|
31781
31795
|
/** @internal */
|
31782
31796
|
__publicField(this, _b140, []);
|
31783
31797
|
/** @internal */
|
@@ -33645,13 +33659,13 @@ var init_query_builders2 = __esm({
|
|
33645
33659
|
});
|
33646
33660
|
|
33647
33661
|
// ../drizzle-orm/dist/sqlite-core/query-builders/count.js
|
33648
|
-
var _a209, _b149,
|
33662
|
+
var _a209, _b149, _c8, _SQLiteCountBuilder, SQLiteCountBuilder;
|
33649
33663
|
var init_count2 = __esm({
|
33650
33664
|
"../drizzle-orm/dist/sqlite-core/query-builders/count.js"() {
|
33651
33665
|
"use strict";
|
33652
33666
|
init_entity();
|
33653
33667
|
init_sql();
|
33654
|
-
_SQLiteCountBuilder = class _SQLiteCountBuilder extends (
|
33668
|
+
_SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c8 = SQL, _b149 = entityKind, _a209 = Symbol.toStringTag, _c8) {
|
33655
33669
|
constructor(params) {
|
33656
33670
|
super(_SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
33657
33671
|
__publicField(this, "sql");
|
@@ -34423,7 +34437,8 @@ function getTableConfig2(table5) {
|
|
34423
34437
|
const extraConfigBuilder = table5[SQLiteTable.Symbol.ExtraConfigBuilder];
|
34424
34438
|
if (extraConfigBuilder !== void 0) {
|
34425
34439
|
const extraConfig = extraConfigBuilder(table5[SQLiteTable.Symbol.Columns]);
|
34426
|
-
|
34440
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
34441
|
+
for (const builder of Object.values(extraValues)) {
|
34427
34442
|
if (is(builder, IndexBuilder2)) {
|
34428
34443
|
indexes.push(builder.build(table5));
|
34429
34444
|
} else if (is(builder, CheckBuilder2)) {
|
@@ -36320,6 +36335,18 @@ function text3(a, b = {}) {
|
|
36320
36335
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36321
36336
|
return new MySqlTextBuilder(name2, "text", config);
|
36322
36337
|
}
|
36338
|
+
function tinytext(a, b = {}) {
|
36339
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36340
|
+
return new MySqlTextBuilder(name2, "tinytext", config);
|
36341
|
+
}
|
36342
|
+
function mediumtext(a, b = {}) {
|
36343
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36344
|
+
return new MySqlTextBuilder(name2, "mediumtext", config);
|
36345
|
+
}
|
36346
|
+
function longtext(a, b = {}) {
|
36347
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
36348
|
+
return new MySqlTextBuilder(name2, "longtext", config);
|
36349
|
+
}
|
36323
36350
|
var _a279, _b202, MySqlTextBuilder, _a280, _b203, MySqlText;
|
36324
36351
|
var init_text3 = __esm({
|
36325
36352
|
"../drizzle-orm/dist/mysql-core/columns/text.js"() {
|
@@ -36679,13 +36706,13 @@ var init_columns3 = __esm({
|
|
36679
36706
|
});
|
36680
36707
|
|
36681
36708
|
// ../drizzle-orm/dist/mysql-core/query-builders/count.js
|
36682
|
-
var _a297, _b220,
|
36709
|
+
var _a297, _b220, _c9, _MySqlCountBuilder, MySqlCountBuilder;
|
36683
36710
|
var init_count3 = __esm({
|
36684
36711
|
"../drizzle-orm/dist/mysql-core/query-builders/count.js"() {
|
36685
36712
|
"use strict";
|
36686
36713
|
init_entity();
|
36687
36714
|
init_sql();
|
36688
|
-
_MySqlCountBuilder = class _MySqlCountBuilder extends (
|
36715
|
+
_MySqlCountBuilder = class _MySqlCountBuilder extends (_c9 = SQL, _b220 = entityKind, _a297 = Symbol.toStringTag, _c9) {
|
36689
36716
|
constructor(params) {
|
36690
36717
|
super(_MySqlCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
36691
36718
|
__publicField(this, "sql");
|
@@ -36861,7 +36888,10 @@ function getMySqlColumnBuilders() {
|
|
36861
36888
|
tinyint,
|
36862
36889
|
varbinary,
|
36863
36890
|
varchar: varchar2,
|
36864
|
-
year
|
36891
|
+
year,
|
36892
|
+
longtext,
|
36893
|
+
mediumtext,
|
36894
|
+
tinytext
|
36865
36895
|
};
|
36866
36896
|
}
|
36867
36897
|
var init_all3 = __esm({
|
@@ -36915,7 +36945,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema5, baseName = n
|
|
36915
36945
|
}
|
36916
36946
|
return table5;
|
36917
36947
|
}
|
36918
|
-
var InlineForeignKeys3, _a299, _b222,
|
36948
|
+
var InlineForeignKeys3, _a299, _b222, _c10, _d4, _e4, MySqlTable, mysqlTable;
|
36919
36949
|
var init_table4 = __esm({
|
36920
36950
|
"../drizzle-orm/dist/mysql-core/table.js"() {
|
36921
36951
|
"use strict";
|
@@ -36923,11 +36953,11 @@ var init_table4 = __esm({
|
|
36923
36953
|
init_table();
|
36924
36954
|
init_all3();
|
36925
36955
|
InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
|
36926
|
-
MySqlTable = class extends (_e4 = Table2, _d4 = entityKind,
|
36956
|
+
MySqlTable = class extends (_e4 = Table2, _d4 = entityKind, _c10 = Table2.Symbol.Columns, _b222 = InlineForeignKeys3, _a299 = Table2.Symbol.ExtraConfigBuilder, _e4) {
|
36927
36957
|
constructor() {
|
36928
36958
|
super(...arguments);
|
36929
36959
|
/** @internal */
|
36930
|
-
__publicField(this,
|
36960
|
+
__publicField(this, _c10);
|
36931
36961
|
/** @internal */
|
36932
36962
|
__publicField(this, _b222, []);
|
36933
36963
|
/** @internal */
|
@@ -39314,7 +39344,7 @@ function mysqlViewWithSchema(name2, selection, schema5) {
|
|
39314
39344
|
}
|
39315
39345
|
return new ViewBuilder3(name2, schema5);
|
39316
39346
|
}
|
39317
|
-
var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231,
|
39347
|
+
var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231, _c11, MySqlView2;
|
39318
39348
|
var init_view3 = __esm({
|
39319
39349
|
"../drizzle-orm/dist/mysql-core/view.js"() {
|
39320
39350
|
"use strict";
|
@@ -39419,7 +39449,7 @@ var init_view3 = __esm({
|
|
39419
39449
|
}
|
39420
39450
|
};
|
39421
39451
|
__publicField(ManualViewBuilder3, _a320, "MySqlManualViewBuilder");
|
39422
|
-
MySqlView2 = class extends (
|
39452
|
+
MySqlView2 = class extends (_c11 = MySqlViewBase, _b231 = entityKind, _a321 = MySqlViewConfig, _c11) {
|
39423
39453
|
constructor({ mysqlConfig, config }) {
|
39424
39454
|
super(config);
|
39425
39455
|
__publicField(this, _a321);
|
@@ -39542,7 +39572,8 @@ function getTableConfig3(table5) {
|
|
39542
39572
|
const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
|
39543
39573
|
if (extraConfigBuilder !== void 0) {
|
39544
39574
|
const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
|
39545
|
-
|
39575
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
39576
|
+
for (const builder of Object.values(extraValues)) {
|
39546
39577
|
if (is(builder, IndexBuilder3)) {
|
39547
39578
|
indexes.push(builder.build(table5));
|
39548
39579
|
} else if (is(builder, CheckBuilder3)) {
|
@@ -42074,13 +42105,13 @@ var init_columns4 = __esm({
|
|
42074
42105
|
});
|
42075
42106
|
|
42076
42107
|
// ../drizzle-orm/dist/singlestore-core/query-builders/count.js
|
42077
|
-
var _a391, _b295,
|
42108
|
+
var _a391, _b295, _c12, _SingleStoreCountBuilder, SingleStoreCountBuilder;
|
42078
42109
|
var init_count4 = __esm({
|
42079
42110
|
"../drizzle-orm/dist/singlestore-core/query-builders/count.js"() {
|
42080
42111
|
"use strict";
|
42081
42112
|
init_entity();
|
42082
42113
|
init_sql();
|
42083
|
-
_SingleStoreCountBuilder = class _SingleStoreCountBuilder extends (
|
42114
|
+
_SingleStoreCountBuilder = class _SingleStoreCountBuilder extends (_c12 = SQL, _b295 = entityKind, _a391 = Symbol.toStringTag, _c12) {
|
42084
42115
|
constructor(params) {
|
42085
42116
|
super(_SingleStoreCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
42086
42117
|
__publicField(this, "sql");
|
@@ -42434,14 +42465,14 @@ function singlestoreTableWithSchema(name2, columns, extraConfig, schema5, baseNa
|
|
42434
42465
|
}
|
42435
42466
|
return table5;
|
42436
42467
|
}
|
42437
|
-
var _a395, _b298,
|
42468
|
+
var _a395, _b298, _c13, _d5, SingleStoreTable;
|
42438
42469
|
var init_table5 = __esm({
|
42439
42470
|
"../drizzle-orm/dist/singlestore-core/table.js"() {
|
42440
42471
|
"use strict";
|
42441
42472
|
init_entity();
|
42442
42473
|
init_table();
|
42443
42474
|
init_all4();
|
42444
|
-
SingleStoreTable = class extends (_d5 = Table2,
|
42475
|
+
SingleStoreTable = class extends (_d5 = Table2, _c13 = entityKind, _b298 = Table2.Symbol.Columns, _a395 = Table2.Symbol.ExtraConfigBuilder, _d5) {
|
42445
42476
|
constructor() {
|
42446
42477
|
super(...arguments);
|
42447
42478
|
/** @internal */
|
@@ -42450,7 +42481,7 @@ var init_table5 = __esm({
|
|
42450
42481
|
__publicField(this, _a395);
|
42451
42482
|
}
|
42452
42483
|
};
|
42453
|
-
__publicField(SingleStoreTable,
|
42484
|
+
__publicField(SingleStoreTable, _c13, "SingleStoreTable");
|
42454
42485
|
/** @internal */
|
42455
42486
|
__publicField(SingleStoreTable, "Symbol", Object.assign({}, Table2.Symbol, {}));
|
42456
42487
|
}
|
@@ -44349,7 +44380,8 @@ function getTableConfig4(table5) {
|
|
44349
44380
|
const extraConfigBuilder = table5[SingleStoreTable.Symbol.ExtraConfigBuilder];
|
44350
44381
|
if (extraConfigBuilder !== void 0) {
|
44351
44382
|
const extraConfig = extraConfigBuilder(table5[SingleStoreTable.Symbol.Columns]);
|
44352
|
-
|
44383
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
44384
|
+
for (const builder of Object.values(extraValues)) {
|
44353
44385
|
if (is(builder, IndexBuilder4)) {
|
44354
44386
|
indexes.push(builder.build(table5));
|
44355
44387
|
} else if (is(builder, UniqueConstraintBuilder4)) {
|
package/bin.cjs
CHANGED
@@ -42787,7 +42787,7 @@ var init_sqlgenerator = __esm({
|
|
42787
42787
|
const { tableName, schema: schema6, columns, compositePKs, uniqueConstraints, checkConstraints, policies, isRLSEnabled } = st;
|
42788
42788
|
let statement = "";
|
42789
42789
|
const name = schema6 ? `"${schema6}"."${tableName}"` : `"${tableName}"`;
|
42790
|
-
statement += `CREATE TABLE
|
42790
|
+
statement += `CREATE TABLE ${name} (
|
42791
42791
|
`;
|
42792
42792
|
for (let i2 = 0; i2 < columns.length; i2++) {
|
42793
42793
|
const column9 = columns[i2];
|
@@ -43633,7 +43633,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
43633
43633
|
convert(statement) {
|
43634
43634
|
const { tableName, columnName, schema: schema6 } = statement;
|
43635
43635
|
const tableNameWithSchema = schema6 ? `"${schema6}"."${tableName}"` : `"${tableName}"`;
|
43636
|
-
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN
|
43636
|
+
return `ALTER TABLE ${tableNameWithSchema} DROP COLUMN "${columnName}";`;
|
43637
43637
|
}
|
43638
43638
|
};
|
43639
43639
|
MySqlAlterTableDropColumnConvertor = class extends Convertor {
|
@@ -44054,7 +44054,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
44054
44054
|
for (const table5 of Object.values(json2.tables)) {
|
44055
44055
|
for (const index5 of Object.values(table5.indexes)) {
|
44056
44056
|
const unsquashed = SQLiteSquasher.unsquashIdx(index5);
|
44057
|
-
sqlStatements.push(`DROP INDEX
|
44057
|
+
sqlStatements.push(`DROP INDEX "${unsquashed.name}";`);
|
44058
44058
|
indexes.push({ ...unsquashed, tableName: table5.name });
|
44059
44059
|
}
|
44060
44060
|
}
|
@@ -44570,13 +44570,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44570
44570
|
const toColumnsString = columnsTo.map((it) => `"${it}"`).join(",");
|
44571
44571
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${tableFrom}"` : `"${tableFrom}"`;
|
44572
44572
|
const tableToNameWithSchema = schemaTo ? `"${schemaTo}"."${tableTo}"` : `"${tableTo}"`;
|
44573
|
-
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
44574
|
-
|
44575
|
-
sql += " " + alterStatement + ";\n";
|
44576
|
-
sql += "EXCEPTION\n";
|
44577
|
-
sql += " WHEN duplicate_object THEN null;\n";
|
44578
|
-
sql += "END $$;\n";
|
44579
|
-
return sql;
|
44573
|
+
const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
44574
|
+
return alterStatement;
|
44580
44575
|
}
|
44581
44576
|
};
|
44582
44577
|
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
@@ -44633,12 +44628,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44633
44628
|
const toColumnsString = newFk.columnsTo.map((it) => `"${it}"`).join(",");
|
44634
44629
|
const tableFromNameWithSchema = oldFk.schemaTo ? `"${oldFk.schemaTo}"."${oldFk.tableFrom}"` : `"${oldFk.tableFrom}"`;
|
44635
44630
|
const tableToNameWithSchema = newFk.schemaTo ? `"${newFk.schemaTo}"."${newFk.tableFrom}"` : `"${newFk.tableFrom}"`;
|
44636
|
-
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}
|
44637
|
-
sql +=
|
44638
|
-
sql += " " + alterStatement + ";\n";
|
44639
|
-
sql += "EXCEPTION\n";
|
44640
|
-
sql += " WHEN duplicate_object THEN null;\n";
|
44641
|
-
sql += "END $$;\n";
|
44631
|
+
const alterStatement = `ALTER TABLE ${tableFromNameWithSchema} ADD CONSTRAINT "${newFk.name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement};`;
|
44632
|
+
sql += alterStatement;
|
44642
44633
|
return sql;
|
44643
44634
|
}
|
44644
44635
|
};
|
@@ -44694,7 +44685,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44694
44685
|
reversedString = reversedString.slice(0, -1);
|
44695
44686
|
return reversedString;
|
44696
44687
|
}
|
44697
|
-
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""}
|
44688
|
+
return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""} "${name}" ON ${tableNameWithSchema} USING ${method} (${value})${Object.keys(withMap).length !== 0 ? ` WITH (${reverseLogic(withMap)})` : ""}${where ? ` WHERE ${where}` : ""};`;
|
44698
44689
|
}
|
44699
44690
|
};
|
44700
44691
|
CreateMySqlIndexConvertor = class extends Convertor {
|
@@ -44752,7 +44743,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44752
44743
|
}
|
44753
44744
|
convert(statement) {
|
44754
44745
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
44755
|
-
return `DROP INDEX
|
44746
|
+
return `DROP INDEX "${name}";`;
|
44756
44747
|
}
|
44757
44748
|
};
|
44758
44749
|
PgCreateSchemaConvertor = class extends Convertor {
|
@@ -44823,7 +44814,7 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${statement.newC
|
|
44823
44814
|
}
|
44824
44815
|
convert(statement) {
|
44825
44816
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
44826
|
-
return `DROP INDEX
|
44817
|
+
return `DROP INDEX \`${name}\`;`;
|
44827
44818
|
}
|
44828
44819
|
};
|
44829
44820
|
MySqlDropIndexConvertor = class extends Convertor {
|
@@ -91840,7 +91831,7 @@ var generate = command2({
|
|
91840
91831
|
} else if (dialect6 === "turso") {
|
91841
91832
|
await prepareAndMigrateLibSQL2(opts);
|
91842
91833
|
} else if (dialect6 === "singlestore") {
|
91843
|
-
await
|
91834
|
+
await prepareAndMigrateSqlite2(opts);
|
91844
91835
|
} else {
|
91845
91836
|
assertUnreachable(dialect6);
|
91846
91837
|
}
|
@@ -92435,7 +92426,7 @@ init_utils5();
|
|
92435
92426
|
var version2 = async () => {
|
92436
92427
|
const { npmVersion } = await ormCoreVersions();
|
92437
92428
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
92438
|
-
const envVersion = "0.
|
92429
|
+
const envVersion = "0.30.0-3256029";
|
92439
92430
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
92440
92431
|
const versions = `drizzle-kit: ${kitVersion}
|
92441
92432
|
${ormVersion}`;
|