drizzle-kit 0.30.0-3256029 → 0.30.0-c56b864
Sign up to get free protection for your applications and to get access to all the features.
- package/api.js +305 -207
- package/api.mjs +305 -207
- package/bin.cjs +61 -81
- package/package.json +1 -1
package/api.mjs
CHANGED
@@ -37153,6 +37153,12 @@ var init_dialect3 = __esm({
|
|
37153
37153
|
buildOrderBy(orderBy) {
|
37154
37154
|
return orderBy && orderBy.length > 0 ? sql` order by ${sql.join(orderBy, sql`, `)}` : void 0;
|
37155
37155
|
}
|
37156
|
+
buildIndex({
|
37157
|
+
indexes,
|
37158
|
+
indexFor
|
37159
|
+
}) {
|
37160
|
+
return indexes && indexes.length > 0 ? sql` ${sql.raw(indexFor)} INDEX (${sql.raw(indexes.join(`, `))})` : void 0;
|
37161
|
+
}
|
37156
37162
|
buildSelectQuery({
|
37157
37163
|
withList,
|
37158
37164
|
fields,
|
@@ -37167,7 +37173,10 @@ var init_dialect3 = __esm({
|
|
37167
37173
|
offset,
|
37168
37174
|
lockingClause,
|
37169
37175
|
distinct,
|
37170
|
-
setOperators
|
37176
|
+
setOperators,
|
37177
|
+
useIndex,
|
37178
|
+
forceIndex,
|
37179
|
+
ignoreIndex
|
37171
37180
|
}) {
|
37172
37181
|
const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
|
37173
37182
|
for (const f of fieldsList) {
|
@@ -37203,8 +37212,11 @@ var init_dialect3 = __esm({
|
|
37203
37212
|
const tableSchema = table22[MySqlTable.Symbol.Schema];
|
37204
37213
|
const origTableName = table22[MySqlTable.Symbol.OriginalName];
|
37205
37214
|
const alias = tableName === origTableName ? void 0 : joinMeta.alias;
|
37215
|
+
const useIndexSql2 = this.buildIndex({ indexes: joinMeta.useIndex, indexFor: "USE" });
|
37216
|
+
const forceIndexSql2 = this.buildIndex({ indexes: joinMeta.forceIndex, indexFor: "FORCE" });
|
37217
|
+
const ignoreIndexSql2 = this.buildIndex({ indexes: joinMeta.ignoreIndex, indexFor: "IGNORE" });
|
37206
37218
|
joinsArray.push(
|
37207
|
-
sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : void 0}${sql.identifier(origTableName)}${alias && sql` ${sql.identifier(alias)}`} on ${joinMeta.on}`
|
37219
|
+
sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : void 0}${sql.identifier(origTableName)}${useIndexSql2}${forceIndexSql2}${ignoreIndexSql2}${alias && sql` ${sql.identifier(alias)}`} on ${joinMeta.on}`
|
37208
37220
|
);
|
37209
37221
|
} else if (is(table22, View3)) {
|
37210
37222
|
const viewName = table22[ViewBaseConfig].name;
|
@@ -37231,6 +37243,9 @@ var init_dialect3 = __esm({
|
|
37231
37243
|
const groupBySql = groupBy && groupBy.length > 0 ? sql` group by ${sql.join(groupBy, sql`, `)}` : void 0;
|
37232
37244
|
const limitSql = this.buildLimit(limit);
|
37233
37245
|
const offsetSql = offset ? sql` offset ${offset}` : void 0;
|
37246
|
+
const useIndexSql = this.buildIndex({ indexes: useIndex, indexFor: "USE" });
|
37247
|
+
const forceIndexSql = this.buildIndex({ indexes: forceIndex, indexFor: "FORCE" });
|
37248
|
+
const ignoreIndexSql = this.buildIndex({ indexes: ignoreIndex, indexFor: "IGNORE" });
|
37234
37249
|
let lockingClausesSql;
|
37235
37250
|
if (lockingClause) {
|
37236
37251
|
const { config, strength } = lockingClause;
|
@@ -37241,7 +37256,7 @@ var init_dialect3 = __esm({
|
|
37241
37256
|
lockingClausesSql.append(sql` skip locked`);
|
37242
37257
|
}
|
37243
37258
|
}
|
37244
|
-
const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
|
37259
|
+
const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${useIndexSql}${forceIndexSql}${ignoreIndexSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
|
37245
37260
|
if (setOperators.length > 0) {
|
37246
37261
|
return this.buildSetOperations(finalQuery, setOperators);
|
37247
37262
|
}
|
@@ -37809,6 +37824,183 @@ var init_dialect3 = __esm({
|
|
37809
37824
|
}
|
37810
37825
|
});
|
37811
37826
|
|
37827
|
+
// ../drizzle-orm/dist/mysql-core/indexes.js
|
37828
|
+
var _a302, IndexBuilderOn3, _a303, IndexBuilder3, _a304, Index5;
|
37829
|
+
var init_indexes3 = __esm({
|
37830
|
+
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
37831
|
+
"use strict";
|
37832
|
+
init_entity();
|
37833
|
+
_a302 = entityKind;
|
37834
|
+
IndexBuilderOn3 = class {
|
37835
|
+
constructor(name2, unique) {
|
37836
|
+
this.name = name2;
|
37837
|
+
this.unique = unique;
|
37838
|
+
}
|
37839
|
+
on(...columns) {
|
37840
|
+
return new IndexBuilder3(this.name, columns, this.unique);
|
37841
|
+
}
|
37842
|
+
};
|
37843
|
+
__publicField(IndexBuilderOn3, _a302, "MySqlIndexBuilderOn");
|
37844
|
+
_a303 = entityKind;
|
37845
|
+
IndexBuilder3 = class {
|
37846
|
+
constructor(name2, columns, unique) {
|
37847
|
+
/** @internal */
|
37848
|
+
__publicField(this, "config");
|
37849
|
+
this.config = {
|
37850
|
+
name: name2,
|
37851
|
+
columns,
|
37852
|
+
unique
|
37853
|
+
};
|
37854
|
+
}
|
37855
|
+
using(using) {
|
37856
|
+
this.config.using = using;
|
37857
|
+
return this;
|
37858
|
+
}
|
37859
|
+
algorythm(algorythm) {
|
37860
|
+
this.config.algorythm = algorythm;
|
37861
|
+
return this;
|
37862
|
+
}
|
37863
|
+
lock(lock) {
|
37864
|
+
this.config.lock = lock;
|
37865
|
+
return this;
|
37866
|
+
}
|
37867
|
+
/** @internal */
|
37868
|
+
build(table5) {
|
37869
|
+
return new Index5(this.config, table5);
|
37870
|
+
}
|
37871
|
+
};
|
37872
|
+
__publicField(IndexBuilder3, _a303, "MySqlIndexBuilder");
|
37873
|
+
_a304 = entityKind;
|
37874
|
+
Index5 = class {
|
37875
|
+
constructor(config, table5) {
|
37876
|
+
__publicField(this, "config");
|
37877
|
+
this.config = { ...config, table: table5 };
|
37878
|
+
}
|
37879
|
+
};
|
37880
|
+
__publicField(Index5, _a304, "MySqlIndex");
|
37881
|
+
}
|
37882
|
+
});
|
37883
|
+
|
37884
|
+
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
37885
|
+
var _a305, PrimaryKeyBuilder3, _a306, PrimaryKey3;
|
37886
|
+
var init_primary_keys3 = __esm({
|
37887
|
+
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
37888
|
+
"use strict";
|
37889
|
+
init_entity();
|
37890
|
+
init_table4();
|
37891
|
+
_a305 = entityKind;
|
37892
|
+
PrimaryKeyBuilder3 = class {
|
37893
|
+
constructor(columns, name2) {
|
37894
|
+
/** @internal */
|
37895
|
+
__publicField(this, "columns");
|
37896
|
+
/** @internal */
|
37897
|
+
__publicField(this, "name");
|
37898
|
+
this.columns = columns;
|
37899
|
+
this.name = name2;
|
37900
|
+
}
|
37901
|
+
/** @internal */
|
37902
|
+
build(table5) {
|
37903
|
+
return new PrimaryKey3(table5, this.columns, this.name);
|
37904
|
+
}
|
37905
|
+
};
|
37906
|
+
__publicField(PrimaryKeyBuilder3, _a305, "MySqlPrimaryKeyBuilder");
|
37907
|
+
_a306 = entityKind;
|
37908
|
+
PrimaryKey3 = class {
|
37909
|
+
constructor(table5, columns, name2) {
|
37910
|
+
__publicField(this, "columns");
|
37911
|
+
__publicField(this, "name");
|
37912
|
+
this.table = table5;
|
37913
|
+
this.columns = columns;
|
37914
|
+
this.name = name2;
|
37915
|
+
}
|
37916
|
+
getName() {
|
37917
|
+
return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column5) => column5.name).join("_")}_pk`;
|
37918
|
+
}
|
37919
|
+
};
|
37920
|
+
__publicField(PrimaryKey3, _a306, "MySqlPrimaryKey");
|
37921
|
+
}
|
37922
|
+
});
|
37923
|
+
|
37924
|
+
// ../drizzle-orm/dist/mysql-core/view-common.js
|
37925
|
+
var MySqlViewConfig;
|
37926
|
+
var init_view_common3 = __esm({
|
37927
|
+
"../drizzle-orm/dist/mysql-core/view-common.js"() {
|
37928
|
+
"use strict";
|
37929
|
+
MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
|
37930
|
+
}
|
37931
|
+
});
|
37932
|
+
|
37933
|
+
// ../drizzle-orm/dist/mysql-core/utils.js
|
37934
|
+
function getTableConfig3(table5) {
|
37935
|
+
const columns = Object.values(table5[MySqlTable.Symbol.Columns]);
|
37936
|
+
const indexes = [];
|
37937
|
+
const checks = [];
|
37938
|
+
const primaryKeys = [];
|
37939
|
+
const uniqueConstraints = [];
|
37940
|
+
const foreignKeys = Object.values(table5[MySqlTable.Symbol.InlineForeignKeys]);
|
37941
|
+
const name2 = table5[Table2.Symbol.Name];
|
37942
|
+
const schema5 = table5[Table2.Symbol.Schema];
|
37943
|
+
const baseName = table5[Table2.Symbol.BaseName];
|
37944
|
+
const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
|
37945
|
+
if (extraConfigBuilder !== void 0) {
|
37946
|
+
const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
|
37947
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
37948
|
+
for (const builder of Object.values(extraValues)) {
|
37949
|
+
if (is(builder, IndexBuilder3)) {
|
37950
|
+
indexes.push(builder.build(table5));
|
37951
|
+
} else if (is(builder, CheckBuilder3)) {
|
37952
|
+
checks.push(builder.build(table5));
|
37953
|
+
} else if (is(builder, UniqueConstraintBuilder3)) {
|
37954
|
+
uniqueConstraints.push(builder.build(table5));
|
37955
|
+
} else if (is(builder, PrimaryKeyBuilder3)) {
|
37956
|
+
primaryKeys.push(builder.build(table5));
|
37957
|
+
} else if (is(builder, ForeignKeyBuilder3)) {
|
37958
|
+
foreignKeys.push(builder.build(table5));
|
37959
|
+
}
|
37960
|
+
}
|
37961
|
+
}
|
37962
|
+
return {
|
37963
|
+
columns,
|
37964
|
+
indexes,
|
37965
|
+
foreignKeys,
|
37966
|
+
checks,
|
37967
|
+
primaryKeys,
|
37968
|
+
uniqueConstraints,
|
37969
|
+
name: name2,
|
37970
|
+
schema: schema5,
|
37971
|
+
baseName
|
37972
|
+
};
|
37973
|
+
}
|
37974
|
+
function getViewConfig3(view4) {
|
37975
|
+
return {
|
37976
|
+
...view4[ViewBaseConfig],
|
37977
|
+
...view4[MySqlViewConfig]
|
37978
|
+
};
|
37979
|
+
}
|
37980
|
+
function convertIndexToString(indexes) {
|
37981
|
+
return indexes.map((idx) => {
|
37982
|
+
return typeof idx === "object" ? idx.config.name : idx;
|
37983
|
+
});
|
37984
|
+
}
|
37985
|
+
function toArray(value) {
|
37986
|
+
return Array.isArray(value) ? value : [value];
|
37987
|
+
}
|
37988
|
+
var init_utils8 = __esm({
|
37989
|
+
"../drizzle-orm/dist/mysql-core/utils.js"() {
|
37990
|
+
"use strict";
|
37991
|
+
init_entity();
|
37992
|
+
init_table();
|
37993
|
+
init_view_common();
|
37994
|
+
init_checks3();
|
37995
|
+
init_foreign_keys3();
|
37996
|
+
init_indexes3();
|
37997
|
+
init_primary_keys3();
|
37998
|
+
init_table4();
|
37999
|
+
init_unique_constraint3();
|
38000
|
+
init_view_common3();
|
38001
|
+
}
|
38002
|
+
});
|
38003
|
+
|
37812
38004
|
// ../drizzle-orm/dist/mysql-core/query-builders/select.js
|
37813
38005
|
function createSetOperator3(type, isAll) {
|
37814
38006
|
return (leftSelect, rightSelect, ...restSelects) => {
|
@@ -37827,11 +38019,12 @@ function createSetOperator3(type, isAll) {
|
|
37827
38019
|
return leftSelect.addSetOperators(setOperators);
|
37828
38020
|
};
|
37829
38021
|
}
|
37830
|
-
var
|
38022
|
+
var _a307, MySqlSelectBuilder, _a308, _b224, MySqlSelectQueryBuilderBase, _a309, _b225, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
|
37831
38023
|
var init_select4 = __esm({
|
37832
38024
|
"../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
|
37833
38025
|
"use strict";
|
37834
38026
|
init_entity();
|
38027
|
+
init_table4();
|
37835
38028
|
init_query_builder();
|
37836
38029
|
init_query_promise();
|
37837
38030
|
init_selection_proxy();
|
@@ -37839,10 +38032,10 @@ var init_select4 = __esm({
|
|
37839
38032
|
init_subquery();
|
37840
38033
|
init_table();
|
37841
38034
|
init_utils2();
|
37842
|
-
init_utils2();
|
37843
38035
|
init_view_common();
|
38036
|
+
init_utils8();
|
37844
38037
|
init_view_base3();
|
37845
|
-
|
38038
|
+
_a307 = entityKind;
|
37846
38039
|
MySqlSelectBuilder = class {
|
37847
38040
|
constructor(config) {
|
37848
38041
|
__publicField(this, "fields");
|
@@ -37858,7 +38051,7 @@ var init_select4 = __esm({
|
|
37858
38051
|
}
|
37859
38052
|
this.distinct = config.distinct;
|
37860
38053
|
}
|
37861
|
-
from(source) {
|
38054
|
+
from(source, onIndex) {
|
37862
38055
|
const isPartialSelect = !!this.fields;
|
37863
38056
|
let fields;
|
37864
38057
|
if (this.fields) {
|
@@ -37874,6 +38067,20 @@ var init_select4 = __esm({
|
|
37874
38067
|
} else {
|
37875
38068
|
fields = getTableColumns(source);
|
37876
38069
|
}
|
38070
|
+
let useIndex = [];
|
38071
|
+
let forceIndex = [];
|
38072
|
+
let ignoreIndex = [];
|
38073
|
+
if (is(source, MySqlTable) && onIndex && typeof onIndex !== "string") {
|
38074
|
+
if (onIndex.useIndex) {
|
38075
|
+
useIndex = convertIndexToString(toArray(onIndex.useIndex));
|
38076
|
+
}
|
38077
|
+
if (onIndex.forceIndex) {
|
38078
|
+
forceIndex = convertIndexToString(toArray(onIndex.forceIndex));
|
38079
|
+
}
|
38080
|
+
if (onIndex.ignoreIndex) {
|
38081
|
+
ignoreIndex = convertIndexToString(toArray(onIndex.ignoreIndex));
|
38082
|
+
}
|
38083
|
+
}
|
37877
38084
|
return new MySqlSelectBase(
|
37878
38085
|
{
|
37879
38086
|
table: source,
|
@@ -37882,14 +38089,17 @@ var init_select4 = __esm({
|
|
37882
38089
|
session: this.session,
|
37883
38090
|
dialect: this.dialect,
|
37884
38091
|
withList: this.withList,
|
37885
|
-
distinct: this.distinct
|
38092
|
+
distinct: this.distinct,
|
38093
|
+
useIndex,
|
38094
|
+
forceIndex,
|
38095
|
+
ignoreIndex
|
37886
38096
|
}
|
37887
38097
|
);
|
37888
38098
|
}
|
37889
38099
|
};
|
37890
|
-
__publicField(MySqlSelectBuilder,
|
37891
|
-
MySqlSelectQueryBuilderBase = class extends (_b224 = TypedQueryBuilder,
|
37892
|
-
constructor({ table: table5, fields, isPartialSelect, session, dialect: dialect6, withList, distinct }) {
|
38100
|
+
__publicField(MySqlSelectBuilder, _a307, "MySqlSelectBuilder");
|
38101
|
+
MySqlSelectQueryBuilderBase = class extends (_b224 = TypedQueryBuilder, _a308 = entityKind, _b224) {
|
38102
|
+
constructor({ table: table5, fields, isPartialSelect, session, dialect: dialect6, withList, distinct, useIndex, forceIndex, ignoreIndex }) {
|
37893
38103
|
super();
|
37894
38104
|
__publicField(this, "_");
|
37895
38105
|
__publicField(this, "config");
|
@@ -37924,6 +38134,16 @@ var init_select4 = __esm({
|
|
37924
38134
|
* })
|
37925
38135
|
* .from(users)
|
37926
38136
|
* .leftJoin(pets, eq(users.id, pets.ownerId))
|
38137
|
+
*
|
38138
|
+
* // Select userId and petId with use index hint
|
38139
|
+
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38140
|
+
* userId: users.id,
|
38141
|
+
* petId: pets.id,
|
38142
|
+
* })
|
38143
|
+
* .from(users)
|
38144
|
+
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38145
|
+
* useIndex: ['pets_owner_id_index']
|
38146
|
+
* })
|
37927
38147
|
* ```
|
37928
38148
|
*/
|
37929
38149
|
__publicField(this, "leftJoin", this.createJoin("left"));
|
@@ -37952,6 +38172,16 @@ var init_select4 = __esm({
|
|
37952
38172
|
* })
|
37953
38173
|
* .from(users)
|
37954
38174
|
* .rightJoin(pets, eq(users.id, pets.ownerId))
|
38175
|
+
*
|
38176
|
+
* // Select userId and petId with use index hint
|
38177
|
+
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38178
|
+
* userId: users.id,
|
38179
|
+
* petId: pets.id,
|
38180
|
+
* })
|
38181
|
+
* .from(users)
|
38182
|
+
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38183
|
+
* useIndex: ['pets_owner_id_index']
|
38184
|
+
* })
|
37955
38185
|
* ```
|
37956
38186
|
*/
|
37957
38187
|
__publicField(this, "rightJoin", this.createJoin("right"));
|
@@ -37980,6 +38210,16 @@ var init_select4 = __esm({
|
|
37980
38210
|
* })
|
37981
38211
|
* .from(users)
|
37982
38212
|
* .innerJoin(pets, eq(users.id, pets.ownerId))
|
38213
|
+
*
|
38214
|
+
* // Select userId and petId with use index hint
|
38215
|
+
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38216
|
+
* userId: users.id,
|
38217
|
+
* petId: pets.id,
|
38218
|
+
* })
|
38219
|
+
* .from(users)
|
38220
|
+
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38221
|
+
* useIndex: ['pets_owner_id_index']
|
38222
|
+
* })
|
37983
38223
|
* ```
|
37984
38224
|
*/
|
37985
38225
|
__publicField(this, "innerJoin", this.createJoin("inner"));
|
@@ -38008,6 +38248,16 @@ var init_select4 = __esm({
|
|
38008
38248
|
* })
|
38009
38249
|
* .from(users)
|
38010
38250
|
* .fullJoin(pets, eq(users.id, pets.ownerId))
|
38251
|
+
*
|
38252
|
+
* // Select userId and petId with use index hint
|
38253
|
+
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38254
|
+
* userId: users.id,
|
38255
|
+
* petId: pets.id,
|
38256
|
+
* })
|
38257
|
+
* .from(users)
|
38258
|
+
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38259
|
+
* useIndex: ['pets_owner_id_index']
|
38260
|
+
* })
|
38011
38261
|
* ```
|
38012
38262
|
*/
|
38013
38263
|
__publicField(this, "fullJoin", this.createJoin("full"));
|
@@ -38202,7 +38452,10 @@ var init_select4 = __esm({
|
|
38202
38452
|
table: table5,
|
38203
38453
|
fields: { ...fields },
|
38204
38454
|
distinct,
|
38205
|
-
setOperators: []
|
38455
|
+
setOperators: [],
|
38456
|
+
useIndex,
|
38457
|
+
forceIndex,
|
38458
|
+
ignoreIndex
|
38206
38459
|
};
|
38207
38460
|
this.isPartialSelect = isPartialSelect;
|
38208
38461
|
this.session = session;
|
@@ -38214,7 +38467,7 @@ var init_select4 = __esm({
|
|
38214
38467
|
this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
|
38215
38468
|
}
|
38216
38469
|
createJoin(joinType) {
|
38217
|
-
return (table5, on) => {
|
38470
|
+
return (table5, on, onIndex) => {
|
38218
38471
|
const baseTableName = this.tableName;
|
38219
38472
|
const tableName = getTableLikeName(table5);
|
38220
38473
|
if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
|
@@ -38242,7 +38495,21 @@ var init_select4 = __esm({
|
|
38242
38495
|
if (!this.config.joins) {
|
38243
38496
|
this.config.joins = [];
|
38244
38497
|
}
|
38245
|
-
|
38498
|
+
let useIndex = [];
|
38499
|
+
let forceIndex = [];
|
38500
|
+
let ignoreIndex = [];
|
38501
|
+
if (is(table5, MySqlTable) && onIndex && typeof onIndex !== "string") {
|
38502
|
+
if (onIndex.useIndex) {
|
38503
|
+
useIndex = convertIndexToString(toArray(onIndex.useIndex));
|
38504
|
+
}
|
38505
|
+
if (onIndex.forceIndex) {
|
38506
|
+
forceIndex = convertIndexToString(toArray(onIndex.forceIndex));
|
38507
|
+
}
|
38508
|
+
if (onIndex.ignoreIndex) {
|
38509
|
+
ignoreIndex = convertIndexToString(toArray(onIndex.ignoreIndex));
|
38510
|
+
}
|
38511
|
+
}
|
38512
|
+
this.config.joins.push({ on, table: table5, joinType, alias: tableName, useIndex, forceIndex, ignoreIndex });
|
38246
38513
|
if (typeof tableName === "string") {
|
38247
38514
|
switch (joinType) {
|
38248
38515
|
case "left": {
|
@@ -38489,8 +38756,8 @@ var init_select4 = __esm({
|
|
38489
38756
|
return this;
|
38490
38757
|
}
|
38491
38758
|
};
|
38492
|
-
__publicField(MySqlSelectQueryBuilderBase,
|
38493
|
-
MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase,
|
38759
|
+
__publicField(MySqlSelectQueryBuilderBase, _a308, "MySqlSelectQueryBuilder");
|
38760
|
+
MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase, _a309 = entityKind, _b225) {
|
38494
38761
|
constructor() {
|
38495
38762
|
super(...arguments);
|
38496
38763
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -38514,7 +38781,7 @@ var init_select4 = __esm({
|
|
38514
38781
|
return query;
|
38515
38782
|
}
|
38516
38783
|
};
|
38517
|
-
__publicField(MySqlSelectBase,
|
38784
|
+
__publicField(MySqlSelectBase, _a309, "MySqlSelect");
|
38518
38785
|
applyMixins(MySqlSelectBase, [QueryPromise]);
|
38519
38786
|
getMySqlSetOperators = () => ({
|
38520
38787
|
union: union3,
|
@@ -38534,7 +38801,7 @@ var init_select4 = __esm({
|
|
38534
38801
|
});
|
38535
38802
|
|
38536
38803
|
// ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
|
38537
|
-
var
|
38804
|
+
var _a310, QueryBuilder3;
|
38538
38805
|
var init_query_builder4 = __esm({
|
38539
38806
|
"../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
|
38540
38807
|
"use strict";
|
@@ -38543,7 +38810,7 @@ var init_query_builder4 = __esm({
|
|
38543
38810
|
init_selection_proxy();
|
38544
38811
|
init_subquery();
|
38545
38812
|
init_select4();
|
38546
|
-
|
38813
|
+
_a310 = entityKind;
|
38547
38814
|
QueryBuilder3 = class {
|
38548
38815
|
constructor(dialect6) {
|
38549
38816
|
__publicField(this, "dialect");
|
@@ -38605,12 +38872,12 @@ var init_query_builder4 = __esm({
|
|
38605
38872
|
return this.dialect;
|
38606
38873
|
}
|
38607
38874
|
};
|
38608
|
-
__publicField(QueryBuilder3,
|
38875
|
+
__publicField(QueryBuilder3, _a310, "MySqlQueryBuilder");
|
38609
38876
|
}
|
38610
38877
|
});
|
38611
38878
|
|
38612
38879
|
// ../drizzle-orm/dist/mysql-core/query-builders/insert.js
|
38613
|
-
var
|
38880
|
+
var _a311, MySqlInsertBuilder, _a312, _b226, MySqlInsertBase;
|
38614
38881
|
var init_insert3 = __esm({
|
38615
38882
|
"../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
|
38616
38883
|
"use strict";
|
@@ -38620,7 +38887,7 @@ var init_insert3 = __esm({
|
|
38620
38887
|
init_table();
|
38621
38888
|
init_utils2();
|
38622
38889
|
init_query_builder4();
|
38623
|
-
|
38890
|
+
_a311 = entityKind;
|
38624
38891
|
MySqlInsertBuilder = class {
|
38625
38892
|
constructor(table5, session, dialect6) {
|
38626
38893
|
__publicField(this, "shouldIgnore", false);
|
@@ -38658,8 +38925,8 @@ var init_insert3 = __esm({
|
|
38658
38925
|
return new MySqlInsertBase(this.table, select, this.shouldIgnore, this.session, this.dialect, true);
|
38659
38926
|
}
|
38660
38927
|
};
|
38661
|
-
__publicField(MySqlInsertBuilder,
|
38662
|
-
MySqlInsertBase = class extends (_b226 = QueryPromise,
|
38928
|
+
__publicField(MySqlInsertBuilder, _a311, "MySqlInsertBuilder");
|
38929
|
+
MySqlInsertBase = class extends (_b226 = QueryPromise, _a312 = entityKind, _b226) {
|
38663
38930
|
constructor(table5, values, ignore, session, dialect6, select) {
|
38664
38931
|
super();
|
38665
38932
|
__publicField(this, "config");
|
@@ -38740,7 +39007,7 @@ var init_insert3 = __esm({
|
|
38740
39007
|
return this;
|
38741
39008
|
}
|
38742
39009
|
};
|
38743
|
-
__publicField(MySqlInsertBase,
|
39010
|
+
__publicField(MySqlInsertBase, _a312, "MySqlInsert");
|
38744
39011
|
}
|
38745
39012
|
});
|
38746
39013
|
|
@@ -38752,7 +39019,7 @@ var init_select_types3 = __esm({
|
|
38752
39019
|
});
|
38753
39020
|
|
38754
39021
|
// ../drizzle-orm/dist/mysql-core/query-builders/update.js
|
38755
|
-
var
|
39022
|
+
var _a313, MySqlUpdateBuilder, _a314, _b227, MySqlUpdateBase;
|
38756
39023
|
var init_update3 = __esm({
|
38757
39024
|
"../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
|
38758
39025
|
"use strict";
|
@@ -38761,7 +39028,7 @@ var init_update3 = __esm({
|
|
38761
39028
|
init_selection_proxy();
|
38762
39029
|
init_table();
|
38763
39030
|
init_utils2();
|
38764
|
-
|
39031
|
+
_a313 = entityKind;
|
38765
39032
|
MySqlUpdateBuilder = class {
|
38766
39033
|
constructor(table5, session, dialect6, withList) {
|
38767
39034
|
this.table = table5;
|
@@ -38773,8 +39040,8 @@ var init_update3 = __esm({
|
|
38773
39040
|
return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
|
38774
39041
|
}
|
38775
39042
|
};
|
38776
|
-
__publicField(MySqlUpdateBuilder,
|
38777
|
-
MySqlUpdateBase = class extends (_b227 = QueryPromise,
|
39043
|
+
__publicField(MySqlUpdateBuilder, _a313, "MySqlUpdateBuilder");
|
39044
|
+
MySqlUpdateBase = class extends (_b227 = QueryPromise, _a314 = entityKind, _b227) {
|
38778
39045
|
constructor(table5, set, session, dialect6, withList) {
|
38779
39046
|
super();
|
38780
39047
|
__publicField(this, "config");
|
@@ -38867,7 +39134,7 @@ var init_update3 = __esm({
|
|
38867
39134
|
return this;
|
38868
39135
|
}
|
38869
39136
|
};
|
38870
|
-
__publicField(MySqlUpdateBase,
|
39137
|
+
__publicField(MySqlUpdateBase, _a314, "MySqlUpdate");
|
38871
39138
|
}
|
38872
39139
|
});
|
38873
39140
|
|
@@ -38885,14 +39152,14 @@ var init_query_builders3 = __esm({
|
|
38885
39152
|
});
|
38886
39153
|
|
38887
39154
|
// ../drizzle-orm/dist/mysql-core/query-builders/query.js
|
38888
|
-
var
|
39155
|
+
var _a315, RelationalQueryBuilder3, _a316, _b228, MySqlRelationalQuery;
|
38889
39156
|
var init_query3 = __esm({
|
38890
39157
|
"../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
|
38891
39158
|
"use strict";
|
38892
39159
|
init_entity();
|
38893
39160
|
init_query_promise();
|
38894
39161
|
init_relations();
|
38895
|
-
|
39162
|
+
_a315 = entityKind;
|
38896
39163
|
RelationalQueryBuilder3 = class {
|
38897
39164
|
constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, mode) {
|
38898
39165
|
this.fullSchema = fullSchema;
|
@@ -38933,8 +39200,8 @@ var init_query3 = __esm({
|
|
38933
39200
|
);
|
38934
39201
|
}
|
38935
39202
|
};
|
38936
|
-
__publicField(RelationalQueryBuilder3,
|
38937
|
-
MySqlRelationalQuery = class extends (_b228 = QueryPromise,
|
39203
|
+
__publicField(RelationalQueryBuilder3, _a315, "MySqlRelationalQueryBuilder");
|
39204
|
+
MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a316 = entityKind, _b228) {
|
38938
39205
|
constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, config, queryMode, mode) {
|
38939
39206
|
super();
|
38940
39207
|
this.fullSchema = fullSchema;
|
@@ -38998,12 +39265,12 @@ var init_query3 = __esm({
|
|
38998
39265
|
return this.prepare().execute();
|
38999
39266
|
}
|
39000
39267
|
};
|
39001
|
-
__publicField(MySqlRelationalQuery,
|
39268
|
+
__publicField(MySqlRelationalQuery, _a316, "MySqlRelationalQuery");
|
39002
39269
|
}
|
39003
39270
|
});
|
39004
39271
|
|
39005
39272
|
// ../drizzle-orm/dist/mysql-core/db.js
|
39006
|
-
var
|
39273
|
+
var _a317, MySqlDatabase;
|
39007
39274
|
var init_db3 = __esm({
|
39008
39275
|
"../drizzle-orm/dist/mysql-core/db.js"() {
|
39009
39276
|
"use strict";
|
@@ -39014,7 +39281,7 @@ var init_db3 = __esm({
|
|
39014
39281
|
init_count3();
|
39015
39282
|
init_query_builders3();
|
39016
39283
|
init_query3();
|
39017
|
-
|
39284
|
+
_a317 = entityKind;
|
39018
39285
|
MySqlDatabase = class {
|
39019
39286
|
constructor(dialect6, session, schema5, mode) {
|
39020
39287
|
__publicField(this, "query");
|
@@ -39227,113 +39494,7 @@ var init_db3 = __esm({
|
|
39227
39494
|
return this.session.transaction(transaction, config);
|
39228
39495
|
}
|
39229
39496
|
};
|
39230
|
-
__publicField(MySqlDatabase,
|
39231
|
-
}
|
39232
|
-
});
|
39233
|
-
|
39234
|
-
// ../drizzle-orm/dist/mysql-core/indexes.js
|
39235
|
-
var _a313, IndexBuilderOn3, _a314, IndexBuilder3, _a315, Index5;
|
39236
|
-
var init_indexes3 = __esm({
|
39237
|
-
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
39238
|
-
"use strict";
|
39239
|
-
init_entity();
|
39240
|
-
_a313 = entityKind;
|
39241
|
-
IndexBuilderOn3 = class {
|
39242
|
-
constructor(name2, unique) {
|
39243
|
-
this.name = name2;
|
39244
|
-
this.unique = unique;
|
39245
|
-
}
|
39246
|
-
on(...columns) {
|
39247
|
-
return new IndexBuilder3(this.name, columns, this.unique);
|
39248
|
-
}
|
39249
|
-
};
|
39250
|
-
__publicField(IndexBuilderOn3, _a313, "MySqlIndexBuilderOn");
|
39251
|
-
_a314 = entityKind;
|
39252
|
-
IndexBuilder3 = class {
|
39253
|
-
constructor(name2, columns, unique) {
|
39254
|
-
/** @internal */
|
39255
|
-
__publicField(this, "config");
|
39256
|
-
this.config = {
|
39257
|
-
name: name2,
|
39258
|
-
columns,
|
39259
|
-
unique
|
39260
|
-
};
|
39261
|
-
}
|
39262
|
-
using(using) {
|
39263
|
-
this.config.using = using;
|
39264
|
-
return this;
|
39265
|
-
}
|
39266
|
-
algorythm(algorythm) {
|
39267
|
-
this.config.algorythm = algorythm;
|
39268
|
-
return this;
|
39269
|
-
}
|
39270
|
-
lock(lock) {
|
39271
|
-
this.config.lock = lock;
|
39272
|
-
return this;
|
39273
|
-
}
|
39274
|
-
/** @internal */
|
39275
|
-
build(table5) {
|
39276
|
-
return new Index5(this.config, table5);
|
39277
|
-
}
|
39278
|
-
};
|
39279
|
-
__publicField(IndexBuilder3, _a314, "MySqlIndexBuilder");
|
39280
|
-
_a315 = entityKind;
|
39281
|
-
Index5 = class {
|
39282
|
-
constructor(config, table5) {
|
39283
|
-
__publicField(this, "config");
|
39284
|
-
this.config = { ...config, table: table5 };
|
39285
|
-
}
|
39286
|
-
};
|
39287
|
-
__publicField(Index5, _a315, "MySqlIndex");
|
39288
|
-
}
|
39289
|
-
});
|
39290
|
-
|
39291
|
-
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
39292
|
-
var _a316, PrimaryKeyBuilder3, _a317, PrimaryKey3;
|
39293
|
-
var init_primary_keys3 = __esm({
|
39294
|
-
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
39295
|
-
"use strict";
|
39296
|
-
init_entity();
|
39297
|
-
init_table4();
|
39298
|
-
_a316 = entityKind;
|
39299
|
-
PrimaryKeyBuilder3 = class {
|
39300
|
-
constructor(columns, name2) {
|
39301
|
-
/** @internal */
|
39302
|
-
__publicField(this, "columns");
|
39303
|
-
/** @internal */
|
39304
|
-
__publicField(this, "name");
|
39305
|
-
this.columns = columns;
|
39306
|
-
this.name = name2;
|
39307
|
-
}
|
39308
|
-
/** @internal */
|
39309
|
-
build(table5) {
|
39310
|
-
return new PrimaryKey3(table5, this.columns, this.name);
|
39311
|
-
}
|
39312
|
-
};
|
39313
|
-
__publicField(PrimaryKeyBuilder3, _a316, "MySqlPrimaryKeyBuilder");
|
39314
|
-
_a317 = entityKind;
|
39315
|
-
PrimaryKey3 = class {
|
39316
|
-
constructor(table5, columns, name2) {
|
39317
|
-
__publicField(this, "columns");
|
39318
|
-
__publicField(this, "name");
|
39319
|
-
this.table = table5;
|
39320
|
-
this.columns = columns;
|
39321
|
-
this.name = name2;
|
39322
|
-
}
|
39323
|
-
getName() {
|
39324
|
-
return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column5) => column5.name).join("_")}_pk`;
|
39325
|
-
}
|
39326
|
-
};
|
39327
|
-
__publicField(PrimaryKey3, _a317, "MySqlPrimaryKey");
|
39328
|
-
}
|
39329
|
-
});
|
39330
|
-
|
39331
|
-
// ../drizzle-orm/dist/mysql-core/view-common.js
|
39332
|
-
var MySqlViewConfig;
|
39333
|
-
var init_view_common3 = __esm({
|
39334
|
-
"../drizzle-orm/dist/mysql-core/view-common.js"() {
|
39335
|
-
"use strict";
|
39336
|
-
MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
|
39497
|
+
__publicField(MySqlDatabase, _a317, "MySqlDatabase");
|
39337
39498
|
}
|
39338
39499
|
});
|
39339
39500
|
|
@@ -39558,69 +39719,6 @@ var init_subquery4 = __esm({
|
|
39558
39719
|
}
|
39559
39720
|
});
|
39560
39721
|
|
39561
|
-
// ../drizzle-orm/dist/mysql-core/utils.js
|
39562
|
-
function getTableConfig3(table5) {
|
39563
|
-
const columns = Object.values(table5[MySqlTable.Symbol.Columns]);
|
39564
|
-
const indexes = [];
|
39565
|
-
const checks = [];
|
39566
|
-
const primaryKeys = [];
|
39567
|
-
const uniqueConstraints = [];
|
39568
|
-
const foreignKeys = Object.values(table5[MySqlTable.Symbol.InlineForeignKeys]);
|
39569
|
-
const name2 = table5[Table2.Symbol.Name];
|
39570
|
-
const schema5 = table5[Table2.Symbol.Schema];
|
39571
|
-
const baseName = table5[Table2.Symbol.BaseName];
|
39572
|
-
const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
|
39573
|
-
if (extraConfigBuilder !== void 0) {
|
39574
|
-
const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
|
39575
|
-
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
39576
|
-
for (const builder of Object.values(extraValues)) {
|
39577
|
-
if (is(builder, IndexBuilder3)) {
|
39578
|
-
indexes.push(builder.build(table5));
|
39579
|
-
} else if (is(builder, CheckBuilder3)) {
|
39580
|
-
checks.push(builder.build(table5));
|
39581
|
-
} else if (is(builder, UniqueConstraintBuilder3)) {
|
39582
|
-
uniqueConstraints.push(builder.build(table5));
|
39583
|
-
} else if (is(builder, PrimaryKeyBuilder3)) {
|
39584
|
-
primaryKeys.push(builder.build(table5));
|
39585
|
-
} else if (is(builder, ForeignKeyBuilder3)) {
|
39586
|
-
foreignKeys.push(builder.build(table5));
|
39587
|
-
}
|
39588
|
-
}
|
39589
|
-
}
|
39590
|
-
return {
|
39591
|
-
columns,
|
39592
|
-
indexes,
|
39593
|
-
foreignKeys,
|
39594
|
-
checks,
|
39595
|
-
primaryKeys,
|
39596
|
-
uniqueConstraints,
|
39597
|
-
name: name2,
|
39598
|
-
schema: schema5,
|
39599
|
-
baseName
|
39600
|
-
};
|
39601
|
-
}
|
39602
|
-
function getViewConfig3(view4) {
|
39603
|
-
return {
|
39604
|
-
...view4[ViewBaseConfig],
|
39605
|
-
...view4[MySqlViewConfig]
|
39606
|
-
};
|
39607
|
-
}
|
39608
|
-
var init_utils8 = __esm({
|
39609
|
-
"../drizzle-orm/dist/mysql-core/utils.js"() {
|
39610
|
-
"use strict";
|
39611
|
-
init_entity();
|
39612
|
-
init_table();
|
39613
|
-
init_view_common();
|
39614
|
-
init_checks3();
|
39615
|
-
init_foreign_keys3();
|
39616
|
-
init_indexes3();
|
39617
|
-
init_primary_keys3();
|
39618
|
-
init_table4();
|
39619
|
-
init_unique_constraint3();
|
39620
|
-
init_view_common3();
|
39621
|
-
}
|
39622
|
-
});
|
39623
|
-
|
39624
39722
|
// ../drizzle-orm/dist/mysql-core/index.js
|
39625
39723
|
var init_mysql_core = __esm({
|
39626
39724
|
"../drizzle-orm/dist/mysql-core/index.js"() {
|