drizzle-kit 0.30.0-c56b864 → 0.30.0-e14a5a2
Sign up to get free protection for your applications and to get access to all the features.
- package/api.js +207 -305
- package/api.mjs +207 -305
- package/bin.cjs +1 -1
- package/package.json +1 -1
package/api.js
CHANGED
@@ -37148,12 +37148,6 @@ var init_dialect3 = __esm({
|
|
37148
37148
|
buildOrderBy(orderBy) {
|
37149
37149
|
return orderBy && orderBy.length > 0 ? sql` order by ${sql.join(orderBy, sql`, `)}` : void 0;
|
37150
37150
|
}
|
37151
|
-
buildIndex({
|
37152
|
-
indexes,
|
37153
|
-
indexFor
|
37154
|
-
}) {
|
37155
|
-
return indexes && indexes.length > 0 ? sql` ${sql.raw(indexFor)} INDEX (${sql.raw(indexes.join(`, `))})` : void 0;
|
37156
|
-
}
|
37157
37151
|
buildSelectQuery({
|
37158
37152
|
withList,
|
37159
37153
|
fields,
|
@@ -37168,10 +37162,7 @@ var init_dialect3 = __esm({
|
|
37168
37162
|
offset,
|
37169
37163
|
lockingClause,
|
37170
37164
|
distinct,
|
37171
|
-
setOperators
|
37172
|
-
useIndex,
|
37173
|
-
forceIndex,
|
37174
|
-
ignoreIndex
|
37165
|
+
setOperators
|
37175
37166
|
}) {
|
37176
37167
|
const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
|
37177
37168
|
for (const f of fieldsList) {
|
@@ -37207,11 +37198,8 @@ var init_dialect3 = __esm({
|
|
37207
37198
|
const tableSchema = table22[MySqlTable.Symbol.Schema];
|
37208
37199
|
const origTableName = table22[MySqlTable.Symbol.OriginalName];
|
37209
37200
|
const alias = tableName === origTableName ? void 0 : joinMeta.alias;
|
37210
|
-
const useIndexSql2 = this.buildIndex({ indexes: joinMeta.useIndex, indexFor: "USE" });
|
37211
|
-
const forceIndexSql2 = this.buildIndex({ indexes: joinMeta.forceIndex, indexFor: "FORCE" });
|
37212
|
-
const ignoreIndexSql2 = this.buildIndex({ indexes: joinMeta.ignoreIndex, indexFor: "IGNORE" });
|
37213
37201
|
joinsArray.push(
|
37214
|
-
sql`${sql.raw(joinMeta.joinType)} join${lateralSql} ${tableSchema ? sql`${sql.identifier(tableSchema)}.` : void 0}${sql.identifier(origTableName)}${
|
37202
|
+
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}`
|
37215
37203
|
);
|
37216
37204
|
} else if (is(table22, View3)) {
|
37217
37205
|
const viewName = table22[ViewBaseConfig].name;
|
@@ -37238,9 +37226,6 @@ var init_dialect3 = __esm({
|
|
37238
37226
|
const groupBySql = groupBy && groupBy.length > 0 ? sql` group by ${sql.join(groupBy, sql`, `)}` : void 0;
|
37239
37227
|
const limitSql = this.buildLimit(limit);
|
37240
37228
|
const offsetSql = offset ? sql` offset ${offset}` : void 0;
|
37241
|
-
const useIndexSql = this.buildIndex({ indexes: useIndex, indexFor: "USE" });
|
37242
|
-
const forceIndexSql = this.buildIndex({ indexes: forceIndex, indexFor: "FORCE" });
|
37243
|
-
const ignoreIndexSql = this.buildIndex({ indexes: ignoreIndex, indexFor: "IGNORE" });
|
37244
37229
|
let lockingClausesSql;
|
37245
37230
|
if (lockingClause) {
|
37246
37231
|
const { config, strength } = lockingClause;
|
@@ -37251,7 +37236,7 @@ var init_dialect3 = __esm({
|
|
37251
37236
|
lockingClausesSql.append(sql` skip locked`);
|
37252
37237
|
}
|
37253
37238
|
}
|
37254
|
-
const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${
|
37239
|
+
const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
|
37255
37240
|
if (setOperators.length > 0) {
|
37256
37241
|
return this.buildSetOperations(finalQuery, setOperators);
|
37257
37242
|
}
|
@@ -37819,183 +37804,6 @@ var init_dialect3 = __esm({
|
|
37819
37804
|
}
|
37820
37805
|
});
|
37821
37806
|
|
37822
|
-
// ../drizzle-orm/dist/mysql-core/indexes.js
|
37823
|
-
var _a302, IndexBuilderOn3, _a303, IndexBuilder3, _a304, Index5;
|
37824
|
-
var init_indexes3 = __esm({
|
37825
|
-
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
37826
|
-
"use strict";
|
37827
|
-
init_entity();
|
37828
|
-
_a302 = entityKind;
|
37829
|
-
IndexBuilderOn3 = class {
|
37830
|
-
constructor(name2, unique) {
|
37831
|
-
this.name = name2;
|
37832
|
-
this.unique = unique;
|
37833
|
-
}
|
37834
|
-
on(...columns) {
|
37835
|
-
return new IndexBuilder3(this.name, columns, this.unique);
|
37836
|
-
}
|
37837
|
-
};
|
37838
|
-
__publicField(IndexBuilderOn3, _a302, "MySqlIndexBuilderOn");
|
37839
|
-
_a303 = entityKind;
|
37840
|
-
IndexBuilder3 = class {
|
37841
|
-
constructor(name2, columns, unique) {
|
37842
|
-
/** @internal */
|
37843
|
-
__publicField(this, "config");
|
37844
|
-
this.config = {
|
37845
|
-
name: name2,
|
37846
|
-
columns,
|
37847
|
-
unique
|
37848
|
-
};
|
37849
|
-
}
|
37850
|
-
using(using) {
|
37851
|
-
this.config.using = using;
|
37852
|
-
return this;
|
37853
|
-
}
|
37854
|
-
algorythm(algorythm) {
|
37855
|
-
this.config.algorythm = algorythm;
|
37856
|
-
return this;
|
37857
|
-
}
|
37858
|
-
lock(lock) {
|
37859
|
-
this.config.lock = lock;
|
37860
|
-
return this;
|
37861
|
-
}
|
37862
|
-
/** @internal */
|
37863
|
-
build(table5) {
|
37864
|
-
return new Index5(this.config, table5);
|
37865
|
-
}
|
37866
|
-
};
|
37867
|
-
__publicField(IndexBuilder3, _a303, "MySqlIndexBuilder");
|
37868
|
-
_a304 = entityKind;
|
37869
|
-
Index5 = class {
|
37870
|
-
constructor(config, table5) {
|
37871
|
-
__publicField(this, "config");
|
37872
|
-
this.config = { ...config, table: table5 };
|
37873
|
-
}
|
37874
|
-
};
|
37875
|
-
__publicField(Index5, _a304, "MySqlIndex");
|
37876
|
-
}
|
37877
|
-
});
|
37878
|
-
|
37879
|
-
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
37880
|
-
var _a305, PrimaryKeyBuilder3, _a306, PrimaryKey3;
|
37881
|
-
var init_primary_keys3 = __esm({
|
37882
|
-
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
37883
|
-
"use strict";
|
37884
|
-
init_entity();
|
37885
|
-
init_table4();
|
37886
|
-
_a305 = entityKind;
|
37887
|
-
PrimaryKeyBuilder3 = class {
|
37888
|
-
constructor(columns, name2) {
|
37889
|
-
/** @internal */
|
37890
|
-
__publicField(this, "columns");
|
37891
|
-
/** @internal */
|
37892
|
-
__publicField(this, "name");
|
37893
|
-
this.columns = columns;
|
37894
|
-
this.name = name2;
|
37895
|
-
}
|
37896
|
-
/** @internal */
|
37897
|
-
build(table5) {
|
37898
|
-
return new PrimaryKey3(table5, this.columns, this.name);
|
37899
|
-
}
|
37900
|
-
};
|
37901
|
-
__publicField(PrimaryKeyBuilder3, _a305, "MySqlPrimaryKeyBuilder");
|
37902
|
-
_a306 = entityKind;
|
37903
|
-
PrimaryKey3 = class {
|
37904
|
-
constructor(table5, columns, name2) {
|
37905
|
-
__publicField(this, "columns");
|
37906
|
-
__publicField(this, "name");
|
37907
|
-
this.table = table5;
|
37908
|
-
this.columns = columns;
|
37909
|
-
this.name = name2;
|
37910
|
-
}
|
37911
|
-
getName() {
|
37912
|
-
return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column5) => column5.name).join("_")}_pk`;
|
37913
|
-
}
|
37914
|
-
};
|
37915
|
-
__publicField(PrimaryKey3, _a306, "MySqlPrimaryKey");
|
37916
|
-
}
|
37917
|
-
});
|
37918
|
-
|
37919
|
-
// ../drizzle-orm/dist/mysql-core/view-common.js
|
37920
|
-
var MySqlViewConfig;
|
37921
|
-
var init_view_common3 = __esm({
|
37922
|
-
"../drizzle-orm/dist/mysql-core/view-common.js"() {
|
37923
|
-
"use strict";
|
37924
|
-
MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
|
37925
|
-
}
|
37926
|
-
});
|
37927
|
-
|
37928
|
-
// ../drizzle-orm/dist/mysql-core/utils.js
|
37929
|
-
function getTableConfig3(table5) {
|
37930
|
-
const columns = Object.values(table5[MySqlTable.Symbol.Columns]);
|
37931
|
-
const indexes = [];
|
37932
|
-
const checks = [];
|
37933
|
-
const primaryKeys = [];
|
37934
|
-
const uniqueConstraints = [];
|
37935
|
-
const foreignKeys = Object.values(table5[MySqlTable.Symbol.InlineForeignKeys]);
|
37936
|
-
const name2 = table5[Table2.Symbol.Name];
|
37937
|
-
const schema5 = table5[Table2.Symbol.Schema];
|
37938
|
-
const baseName = table5[Table2.Symbol.BaseName];
|
37939
|
-
const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
|
37940
|
-
if (extraConfigBuilder !== void 0) {
|
37941
|
-
const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
|
37942
|
-
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
37943
|
-
for (const builder of Object.values(extraValues)) {
|
37944
|
-
if (is(builder, IndexBuilder3)) {
|
37945
|
-
indexes.push(builder.build(table5));
|
37946
|
-
} else if (is(builder, CheckBuilder3)) {
|
37947
|
-
checks.push(builder.build(table5));
|
37948
|
-
} else if (is(builder, UniqueConstraintBuilder3)) {
|
37949
|
-
uniqueConstraints.push(builder.build(table5));
|
37950
|
-
} else if (is(builder, PrimaryKeyBuilder3)) {
|
37951
|
-
primaryKeys.push(builder.build(table5));
|
37952
|
-
} else if (is(builder, ForeignKeyBuilder3)) {
|
37953
|
-
foreignKeys.push(builder.build(table5));
|
37954
|
-
}
|
37955
|
-
}
|
37956
|
-
}
|
37957
|
-
return {
|
37958
|
-
columns,
|
37959
|
-
indexes,
|
37960
|
-
foreignKeys,
|
37961
|
-
checks,
|
37962
|
-
primaryKeys,
|
37963
|
-
uniqueConstraints,
|
37964
|
-
name: name2,
|
37965
|
-
schema: schema5,
|
37966
|
-
baseName
|
37967
|
-
};
|
37968
|
-
}
|
37969
|
-
function getViewConfig3(view4) {
|
37970
|
-
return {
|
37971
|
-
...view4[ViewBaseConfig],
|
37972
|
-
...view4[MySqlViewConfig]
|
37973
|
-
};
|
37974
|
-
}
|
37975
|
-
function convertIndexToString(indexes) {
|
37976
|
-
return indexes.map((idx) => {
|
37977
|
-
return typeof idx === "object" ? idx.config.name : idx;
|
37978
|
-
});
|
37979
|
-
}
|
37980
|
-
function toArray(value) {
|
37981
|
-
return Array.isArray(value) ? value : [value];
|
37982
|
-
}
|
37983
|
-
var init_utils8 = __esm({
|
37984
|
-
"../drizzle-orm/dist/mysql-core/utils.js"() {
|
37985
|
-
"use strict";
|
37986
|
-
init_entity();
|
37987
|
-
init_table();
|
37988
|
-
init_view_common();
|
37989
|
-
init_checks3();
|
37990
|
-
init_foreign_keys3();
|
37991
|
-
init_indexes3();
|
37992
|
-
init_primary_keys3();
|
37993
|
-
init_table4();
|
37994
|
-
init_unique_constraint3();
|
37995
|
-
init_view_common3();
|
37996
|
-
}
|
37997
|
-
});
|
37998
|
-
|
37999
37807
|
// ../drizzle-orm/dist/mysql-core/query-builders/select.js
|
38000
37808
|
function createSetOperator3(type, isAll) {
|
38001
37809
|
return (leftSelect, rightSelect, ...restSelects) => {
|
@@ -38014,12 +37822,11 @@ function createSetOperator3(type, isAll) {
|
|
38014
37822
|
return leftSelect.addSetOperators(setOperators);
|
38015
37823
|
};
|
38016
37824
|
}
|
38017
|
-
var
|
37825
|
+
var _a302, MySqlSelectBuilder, _a303, _b224, MySqlSelectQueryBuilderBase, _a304, _b225, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
|
38018
37826
|
var init_select4 = __esm({
|
38019
37827
|
"../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
|
38020
37828
|
"use strict";
|
38021
37829
|
init_entity();
|
38022
|
-
init_table4();
|
38023
37830
|
init_query_builder();
|
38024
37831
|
init_query_promise();
|
38025
37832
|
init_selection_proxy();
|
@@ -38027,10 +37834,10 @@ var init_select4 = __esm({
|
|
38027
37834
|
init_subquery();
|
38028
37835
|
init_table();
|
38029
37836
|
init_utils2();
|
37837
|
+
init_utils2();
|
38030
37838
|
init_view_common();
|
38031
|
-
init_utils8();
|
38032
37839
|
init_view_base3();
|
38033
|
-
|
37840
|
+
_a302 = entityKind;
|
38034
37841
|
MySqlSelectBuilder = class {
|
38035
37842
|
constructor(config) {
|
38036
37843
|
__publicField(this, "fields");
|
@@ -38046,7 +37853,7 @@ var init_select4 = __esm({
|
|
38046
37853
|
}
|
38047
37854
|
this.distinct = config.distinct;
|
38048
37855
|
}
|
38049
|
-
from(source
|
37856
|
+
from(source) {
|
38050
37857
|
const isPartialSelect = !!this.fields;
|
38051
37858
|
let fields;
|
38052
37859
|
if (this.fields) {
|
@@ -38062,20 +37869,6 @@ var init_select4 = __esm({
|
|
38062
37869
|
} else {
|
38063
37870
|
fields = getTableColumns(source);
|
38064
37871
|
}
|
38065
|
-
let useIndex = [];
|
38066
|
-
let forceIndex = [];
|
38067
|
-
let ignoreIndex = [];
|
38068
|
-
if (is(source, MySqlTable) && onIndex && typeof onIndex !== "string") {
|
38069
|
-
if (onIndex.useIndex) {
|
38070
|
-
useIndex = convertIndexToString(toArray(onIndex.useIndex));
|
38071
|
-
}
|
38072
|
-
if (onIndex.forceIndex) {
|
38073
|
-
forceIndex = convertIndexToString(toArray(onIndex.forceIndex));
|
38074
|
-
}
|
38075
|
-
if (onIndex.ignoreIndex) {
|
38076
|
-
ignoreIndex = convertIndexToString(toArray(onIndex.ignoreIndex));
|
38077
|
-
}
|
38078
|
-
}
|
38079
37872
|
return new MySqlSelectBase(
|
38080
37873
|
{
|
38081
37874
|
table: source,
|
@@ -38084,17 +37877,14 @@ var init_select4 = __esm({
|
|
38084
37877
|
session: this.session,
|
38085
37878
|
dialect: this.dialect,
|
38086
37879
|
withList: this.withList,
|
38087
|
-
distinct: this.distinct
|
38088
|
-
useIndex,
|
38089
|
-
forceIndex,
|
38090
|
-
ignoreIndex
|
37880
|
+
distinct: this.distinct
|
38091
37881
|
}
|
38092
37882
|
);
|
38093
37883
|
}
|
38094
37884
|
};
|
38095
|
-
__publicField(MySqlSelectBuilder,
|
38096
|
-
MySqlSelectQueryBuilderBase = class extends (_b224 = TypedQueryBuilder,
|
38097
|
-
constructor({ table: table5, fields, isPartialSelect, session, dialect: dialect6, withList, distinct
|
37885
|
+
__publicField(MySqlSelectBuilder, _a302, "MySqlSelectBuilder");
|
37886
|
+
MySqlSelectQueryBuilderBase = class extends (_b224 = TypedQueryBuilder, _a303 = entityKind, _b224) {
|
37887
|
+
constructor({ table: table5, fields, isPartialSelect, session, dialect: dialect6, withList, distinct }) {
|
38098
37888
|
super();
|
38099
37889
|
__publicField(this, "_");
|
38100
37890
|
__publicField(this, "config");
|
@@ -38129,16 +37919,6 @@ var init_select4 = __esm({
|
|
38129
37919
|
* })
|
38130
37920
|
* .from(users)
|
38131
37921
|
* .leftJoin(pets, eq(users.id, pets.ownerId))
|
38132
|
-
*
|
38133
|
-
* // Select userId and petId with use index hint
|
38134
|
-
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38135
|
-
* userId: users.id,
|
38136
|
-
* petId: pets.id,
|
38137
|
-
* })
|
38138
|
-
* .from(users)
|
38139
|
-
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38140
|
-
* useIndex: ['pets_owner_id_index']
|
38141
|
-
* })
|
38142
37922
|
* ```
|
38143
37923
|
*/
|
38144
37924
|
__publicField(this, "leftJoin", this.createJoin("left"));
|
@@ -38167,16 +37947,6 @@ var init_select4 = __esm({
|
|
38167
37947
|
* })
|
38168
37948
|
* .from(users)
|
38169
37949
|
* .rightJoin(pets, eq(users.id, pets.ownerId))
|
38170
|
-
*
|
38171
|
-
* // Select userId and petId with use index hint
|
38172
|
-
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38173
|
-
* userId: users.id,
|
38174
|
-
* petId: pets.id,
|
38175
|
-
* })
|
38176
|
-
* .from(users)
|
38177
|
-
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38178
|
-
* useIndex: ['pets_owner_id_index']
|
38179
|
-
* })
|
38180
37950
|
* ```
|
38181
37951
|
*/
|
38182
37952
|
__publicField(this, "rightJoin", this.createJoin("right"));
|
@@ -38205,16 +37975,6 @@ var init_select4 = __esm({
|
|
38205
37975
|
* })
|
38206
37976
|
* .from(users)
|
38207
37977
|
* .innerJoin(pets, eq(users.id, pets.ownerId))
|
38208
|
-
*
|
38209
|
-
* // Select userId and petId with use index hint
|
38210
|
-
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38211
|
-
* userId: users.id,
|
38212
|
-
* petId: pets.id,
|
38213
|
-
* })
|
38214
|
-
* .from(users)
|
38215
|
-
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38216
|
-
* useIndex: ['pets_owner_id_index']
|
38217
|
-
* })
|
38218
37978
|
* ```
|
38219
37979
|
*/
|
38220
37980
|
__publicField(this, "innerJoin", this.createJoin("inner"));
|
@@ -38243,16 +38003,6 @@ var init_select4 = __esm({
|
|
38243
38003
|
* })
|
38244
38004
|
* .from(users)
|
38245
38005
|
* .fullJoin(pets, eq(users.id, pets.ownerId))
|
38246
|
-
*
|
38247
|
-
* // Select userId and petId with use index hint
|
38248
|
-
* const usersIdsAndPetIds: { userId: number; petId: number | null }[] = await db.select({
|
38249
|
-
* userId: users.id,
|
38250
|
-
* petId: pets.id,
|
38251
|
-
* })
|
38252
|
-
* .from(users)
|
38253
|
-
* .leftJoin(pets, eq(users.id, pets.ownerId), {
|
38254
|
-
* useIndex: ['pets_owner_id_index']
|
38255
|
-
* })
|
38256
38006
|
* ```
|
38257
38007
|
*/
|
38258
38008
|
__publicField(this, "fullJoin", this.createJoin("full"));
|
@@ -38447,10 +38197,7 @@ var init_select4 = __esm({
|
|
38447
38197
|
table: table5,
|
38448
38198
|
fields: { ...fields },
|
38449
38199
|
distinct,
|
38450
|
-
setOperators: []
|
38451
|
-
useIndex,
|
38452
|
-
forceIndex,
|
38453
|
-
ignoreIndex
|
38200
|
+
setOperators: []
|
38454
38201
|
};
|
38455
38202
|
this.isPartialSelect = isPartialSelect;
|
38456
38203
|
this.session = session;
|
@@ -38462,7 +38209,7 @@ var init_select4 = __esm({
|
|
38462
38209
|
this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
|
38463
38210
|
}
|
38464
38211
|
createJoin(joinType) {
|
38465
|
-
return (table5, on
|
38212
|
+
return (table5, on) => {
|
38466
38213
|
const baseTableName = this.tableName;
|
38467
38214
|
const tableName = getTableLikeName(table5);
|
38468
38215
|
if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
|
@@ -38490,21 +38237,7 @@ var init_select4 = __esm({
|
|
38490
38237
|
if (!this.config.joins) {
|
38491
38238
|
this.config.joins = [];
|
38492
38239
|
}
|
38493
|
-
|
38494
|
-
let forceIndex = [];
|
38495
|
-
let ignoreIndex = [];
|
38496
|
-
if (is(table5, MySqlTable) && onIndex && typeof onIndex !== "string") {
|
38497
|
-
if (onIndex.useIndex) {
|
38498
|
-
useIndex = convertIndexToString(toArray(onIndex.useIndex));
|
38499
|
-
}
|
38500
|
-
if (onIndex.forceIndex) {
|
38501
|
-
forceIndex = convertIndexToString(toArray(onIndex.forceIndex));
|
38502
|
-
}
|
38503
|
-
if (onIndex.ignoreIndex) {
|
38504
|
-
ignoreIndex = convertIndexToString(toArray(onIndex.ignoreIndex));
|
38505
|
-
}
|
38506
|
-
}
|
38507
|
-
this.config.joins.push({ on, table: table5, joinType, alias: tableName, useIndex, forceIndex, ignoreIndex });
|
38240
|
+
this.config.joins.push({ on, table: table5, joinType, alias: tableName });
|
38508
38241
|
if (typeof tableName === "string") {
|
38509
38242
|
switch (joinType) {
|
38510
38243
|
case "left": {
|
@@ -38751,8 +38484,8 @@ var init_select4 = __esm({
|
|
38751
38484
|
return this;
|
38752
38485
|
}
|
38753
38486
|
};
|
38754
|
-
__publicField(MySqlSelectQueryBuilderBase,
|
38755
|
-
MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase,
|
38487
|
+
__publicField(MySqlSelectQueryBuilderBase, _a303, "MySqlSelectQueryBuilder");
|
38488
|
+
MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase, _a304 = entityKind, _b225) {
|
38756
38489
|
constructor() {
|
38757
38490
|
super(...arguments);
|
38758
38491
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -38776,7 +38509,7 @@ var init_select4 = __esm({
|
|
38776
38509
|
return query;
|
38777
38510
|
}
|
38778
38511
|
};
|
38779
|
-
__publicField(MySqlSelectBase,
|
38512
|
+
__publicField(MySqlSelectBase, _a304, "MySqlSelect");
|
38780
38513
|
applyMixins(MySqlSelectBase, [QueryPromise]);
|
38781
38514
|
getMySqlSetOperators = () => ({
|
38782
38515
|
union: union3,
|
@@ -38796,7 +38529,7 @@ var init_select4 = __esm({
|
|
38796
38529
|
});
|
38797
38530
|
|
38798
38531
|
// ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
|
38799
|
-
var
|
38532
|
+
var _a305, QueryBuilder3;
|
38800
38533
|
var init_query_builder4 = __esm({
|
38801
38534
|
"../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
|
38802
38535
|
"use strict";
|
@@ -38805,7 +38538,7 @@ var init_query_builder4 = __esm({
|
|
38805
38538
|
init_selection_proxy();
|
38806
38539
|
init_subquery();
|
38807
38540
|
init_select4();
|
38808
|
-
|
38541
|
+
_a305 = entityKind;
|
38809
38542
|
QueryBuilder3 = class {
|
38810
38543
|
constructor(dialect6) {
|
38811
38544
|
__publicField(this, "dialect");
|
@@ -38867,12 +38600,12 @@ var init_query_builder4 = __esm({
|
|
38867
38600
|
return this.dialect;
|
38868
38601
|
}
|
38869
38602
|
};
|
38870
|
-
__publicField(QueryBuilder3,
|
38603
|
+
__publicField(QueryBuilder3, _a305, "MySqlQueryBuilder");
|
38871
38604
|
}
|
38872
38605
|
});
|
38873
38606
|
|
38874
38607
|
// ../drizzle-orm/dist/mysql-core/query-builders/insert.js
|
38875
|
-
var
|
38608
|
+
var _a306, MySqlInsertBuilder, _a307, _b226, MySqlInsertBase;
|
38876
38609
|
var init_insert3 = __esm({
|
38877
38610
|
"../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
|
38878
38611
|
"use strict";
|
@@ -38882,7 +38615,7 @@ var init_insert3 = __esm({
|
|
38882
38615
|
init_table();
|
38883
38616
|
init_utils2();
|
38884
38617
|
init_query_builder4();
|
38885
|
-
|
38618
|
+
_a306 = entityKind;
|
38886
38619
|
MySqlInsertBuilder = class {
|
38887
38620
|
constructor(table5, session, dialect6) {
|
38888
38621
|
__publicField(this, "shouldIgnore", false);
|
@@ -38920,8 +38653,8 @@ var init_insert3 = __esm({
|
|
38920
38653
|
return new MySqlInsertBase(this.table, select, this.shouldIgnore, this.session, this.dialect, true);
|
38921
38654
|
}
|
38922
38655
|
};
|
38923
|
-
__publicField(MySqlInsertBuilder,
|
38924
|
-
MySqlInsertBase = class extends (_b226 = QueryPromise,
|
38656
|
+
__publicField(MySqlInsertBuilder, _a306, "MySqlInsertBuilder");
|
38657
|
+
MySqlInsertBase = class extends (_b226 = QueryPromise, _a307 = entityKind, _b226) {
|
38925
38658
|
constructor(table5, values, ignore, session, dialect6, select) {
|
38926
38659
|
super();
|
38927
38660
|
__publicField(this, "config");
|
@@ -39002,7 +38735,7 @@ var init_insert3 = __esm({
|
|
39002
38735
|
return this;
|
39003
38736
|
}
|
39004
38737
|
};
|
39005
|
-
__publicField(MySqlInsertBase,
|
38738
|
+
__publicField(MySqlInsertBase, _a307, "MySqlInsert");
|
39006
38739
|
}
|
39007
38740
|
});
|
39008
38741
|
|
@@ -39014,7 +38747,7 @@ var init_select_types3 = __esm({
|
|
39014
38747
|
});
|
39015
38748
|
|
39016
38749
|
// ../drizzle-orm/dist/mysql-core/query-builders/update.js
|
39017
|
-
var
|
38750
|
+
var _a308, MySqlUpdateBuilder, _a309, _b227, MySqlUpdateBase;
|
39018
38751
|
var init_update3 = __esm({
|
39019
38752
|
"../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
|
39020
38753
|
"use strict";
|
@@ -39023,7 +38756,7 @@ var init_update3 = __esm({
|
|
39023
38756
|
init_selection_proxy();
|
39024
38757
|
init_table();
|
39025
38758
|
init_utils2();
|
39026
|
-
|
38759
|
+
_a308 = entityKind;
|
39027
38760
|
MySqlUpdateBuilder = class {
|
39028
38761
|
constructor(table5, session, dialect6, withList) {
|
39029
38762
|
this.table = table5;
|
@@ -39035,8 +38768,8 @@ var init_update3 = __esm({
|
|
39035
38768
|
return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
|
39036
38769
|
}
|
39037
38770
|
};
|
39038
|
-
__publicField(MySqlUpdateBuilder,
|
39039
|
-
MySqlUpdateBase = class extends (_b227 = QueryPromise,
|
38771
|
+
__publicField(MySqlUpdateBuilder, _a308, "MySqlUpdateBuilder");
|
38772
|
+
MySqlUpdateBase = class extends (_b227 = QueryPromise, _a309 = entityKind, _b227) {
|
39040
38773
|
constructor(table5, set, session, dialect6, withList) {
|
39041
38774
|
super();
|
39042
38775
|
__publicField(this, "config");
|
@@ -39129,7 +38862,7 @@ var init_update3 = __esm({
|
|
39129
38862
|
return this;
|
39130
38863
|
}
|
39131
38864
|
};
|
39132
|
-
__publicField(MySqlUpdateBase,
|
38865
|
+
__publicField(MySqlUpdateBase, _a309, "MySqlUpdate");
|
39133
38866
|
}
|
39134
38867
|
});
|
39135
38868
|
|
@@ -39147,14 +38880,14 @@ var init_query_builders3 = __esm({
|
|
39147
38880
|
});
|
39148
38881
|
|
39149
38882
|
// ../drizzle-orm/dist/mysql-core/query-builders/query.js
|
39150
|
-
var
|
38883
|
+
var _a310, RelationalQueryBuilder3, _a311, _b228, MySqlRelationalQuery;
|
39151
38884
|
var init_query3 = __esm({
|
39152
38885
|
"../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
|
39153
38886
|
"use strict";
|
39154
38887
|
init_entity();
|
39155
38888
|
init_query_promise();
|
39156
38889
|
init_relations();
|
39157
|
-
|
38890
|
+
_a310 = entityKind;
|
39158
38891
|
RelationalQueryBuilder3 = class {
|
39159
38892
|
constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, mode) {
|
39160
38893
|
this.fullSchema = fullSchema;
|
@@ -39195,8 +38928,8 @@ var init_query3 = __esm({
|
|
39195
38928
|
);
|
39196
38929
|
}
|
39197
38930
|
};
|
39198
|
-
__publicField(RelationalQueryBuilder3,
|
39199
|
-
MySqlRelationalQuery = class extends (_b228 = QueryPromise,
|
38931
|
+
__publicField(RelationalQueryBuilder3, _a310, "MySqlRelationalQueryBuilder");
|
38932
|
+
MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a311 = entityKind, _b228) {
|
39200
38933
|
constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, config, queryMode, mode) {
|
39201
38934
|
super();
|
39202
38935
|
this.fullSchema = fullSchema;
|
@@ -39260,12 +38993,12 @@ var init_query3 = __esm({
|
|
39260
38993
|
return this.prepare().execute();
|
39261
38994
|
}
|
39262
38995
|
};
|
39263
|
-
__publicField(MySqlRelationalQuery,
|
38996
|
+
__publicField(MySqlRelationalQuery, _a311, "MySqlRelationalQuery");
|
39264
38997
|
}
|
39265
38998
|
});
|
39266
38999
|
|
39267
39000
|
// ../drizzle-orm/dist/mysql-core/db.js
|
39268
|
-
var
|
39001
|
+
var _a312, MySqlDatabase;
|
39269
39002
|
var init_db3 = __esm({
|
39270
39003
|
"../drizzle-orm/dist/mysql-core/db.js"() {
|
39271
39004
|
"use strict";
|
@@ -39276,7 +39009,7 @@ var init_db3 = __esm({
|
|
39276
39009
|
init_count3();
|
39277
39010
|
init_query_builders3();
|
39278
39011
|
init_query3();
|
39279
|
-
|
39012
|
+
_a312 = entityKind;
|
39280
39013
|
MySqlDatabase = class {
|
39281
39014
|
constructor(dialect6, session, schema5, mode) {
|
39282
39015
|
__publicField(this, "query");
|
@@ -39489,7 +39222,113 @@ var init_db3 = __esm({
|
|
39489
39222
|
return this.session.transaction(transaction, config);
|
39490
39223
|
}
|
39491
39224
|
};
|
39492
|
-
__publicField(MySqlDatabase,
|
39225
|
+
__publicField(MySqlDatabase, _a312, "MySqlDatabase");
|
39226
|
+
}
|
39227
|
+
});
|
39228
|
+
|
39229
|
+
// ../drizzle-orm/dist/mysql-core/indexes.js
|
39230
|
+
var _a313, IndexBuilderOn3, _a314, IndexBuilder3, _a315, Index5;
|
39231
|
+
var init_indexes3 = __esm({
|
39232
|
+
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
39233
|
+
"use strict";
|
39234
|
+
init_entity();
|
39235
|
+
_a313 = entityKind;
|
39236
|
+
IndexBuilderOn3 = class {
|
39237
|
+
constructor(name2, unique) {
|
39238
|
+
this.name = name2;
|
39239
|
+
this.unique = unique;
|
39240
|
+
}
|
39241
|
+
on(...columns) {
|
39242
|
+
return new IndexBuilder3(this.name, columns, this.unique);
|
39243
|
+
}
|
39244
|
+
};
|
39245
|
+
__publicField(IndexBuilderOn3, _a313, "MySqlIndexBuilderOn");
|
39246
|
+
_a314 = entityKind;
|
39247
|
+
IndexBuilder3 = class {
|
39248
|
+
constructor(name2, columns, unique) {
|
39249
|
+
/** @internal */
|
39250
|
+
__publicField(this, "config");
|
39251
|
+
this.config = {
|
39252
|
+
name: name2,
|
39253
|
+
columns,
|
39254
|
+
unique
|
39255
|
+
};
|
39256
|
+
}
|
39257
|
+
using(using) {
|
39258
|
+
this.config.using = using;
|
39259
|
+
return this;
|
39260
|
+
}
|
39261
|
+
algorythm(algorythm) {
|
39262
|
+
this.config.algorythm = algorythm;
|
39263
|
+
return this;
|
39264
|
+
}
|
39265
|
+
lock(lock) {
|
39266
|
+
this.config.lock = lock;
|
39267
|
+
return this;
|
39268
|
+
}
|
39269
|
+
/** @internal */
|
39270
|
+
build(table5) {
|
39271
|
+
return new Index5(this.config, table5);
|
39272
|
+
}
|
39273
|
+
};
|
39274
|
+
__publicField(IndexBuilder3, _a314, "MySqlIndexBuilder");
|
39275
|
+
_a315 = entityKind;
|
39276
|
+
Index5 = class {
|
39277
|
+
constructor(config, table5) {
|
39278
|
+
__publicField(this, "config");
|
39279
|
+
this.config = { ...config, table: table5 };
|
39280
|
+
}
|
39281
|
+
};
|
39282
|
+
__publicField(Index5, _a315, "MySqlIndex");
|
39283
|
+
}
|
39284
|
+
});
|
39285
|
+
|
39286
|
+
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
39287
|
+
var _a316, PrimaryKeyBuilder3, _a317, PrimaryKey3;
|
39288
|
+
var init_primary_keys3 = __esm({
|
39289
|
+
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
39290
|
+
"use strict";
|
39291
|
+
init_entity();
|
39292
|
+
init_table4();
|
39293
|
+
_a316 = entityKind;
|
39294
|
+
PrimaryKeyBuilder3 = class {
|
39295
|
+
constructor(columns, name2) {
|
39296
|
+
/** @internal */
|
39297
|
+
__publicField(this, "columns");
|
39298
|
+
/** @internal */
|
39299
|
+
__publicField(this, "name");
|
39300
|
+
this.columns = columns;
|
39301
|
+
this.name = name2;
|
39302
|
+
}
|
39303
|
+
/** @internal */
|
39304
|
+
build(table5) {
|
39305
|
+
return new PrimaryKey3(table5, this.columns, this.name);
|
39306
|
+
}
|
39307
|
+
};
|
39308
|
+
__publicField(PrimaryKeyBuilder3, _a316, "MySqlPrimaryKeyBuilder");
|
39309
|
+
_a317 = entityKind;
|
39310
|
+
PrimaryKey3 = class {
|
39311
|
+
constructor(table5, columns, name2) {
|
39312
|
+
__publicField(this, "columns");
|
39313
|
+
__publicField(this, "name");
|
39314
|
+
this.table = table5;
|
39315
|
+
this.columns = columns;
|
39316
|
+
this.name = name2;
|
39317
|
+
}
|
39318
|
+
getName() {
|
39319
|
+
return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column5) => column5.name).join("_")}_pk`;
|
39320
|
+
}
|
39321
|
+
};
|
39322
|
+
__publicField(PrimaryKey3, _a317, "MySqlPrimaryKey");
|
39323
|
+
}
|
39324
|
+
});
|
39325
|
+
|
39326
|
+
// ../drizzle-orm/dist/mysql-core/view-common.js
|
39327
|
+
var MySqlViewConfig;
|
39328
|
+
var init_view_common3 = __esm({
|
39329
|
+
"../drizzle-orm/dist/mysql-core/view-common.js"() {
|
39330
|
+
"use strict";
|
39331
|
+
MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
|
39493
39332
|
}
|
39494
39333
|
});
|
39495
39334
|
|
@@ -39714,6 +39553,69 @@ var init_subquery4 = __esm({
|
|
39714
39553
|
}
|
39715
39554
|
});
|
39716
39555
|
|
39556
|
+
// ../drizzle-orm/dist/mysql-core/utils.js
|
39557
|
+
function getTableConfig3(table5) {
|
39558
|
+
const columns = Object.values(table5[MySqlTable.Symbol.Columns]);
|
39559
|
+
const indexes = [];
|
39560
|
+
const checks = [];
|
39561
|
+
const primaryKeys = [];
|
39562
|
+
const uniqueConstraints = [];
|
39563
|
+
const foreignKeys = Object.values(table5[MySqlTable.Symbol.InlineForeignKeys]);
|
39564
|
+
const name2 = table5[Table2.Symbol.Name];
|
39565
|
+
const schema5 = table5[Table2.Symbol.Schema];
|
39566
|
+
const baseName = table5[Table2.Symbol.BaseName];
|
39567
|
+
const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
|
39568
|
+
if (extraConfigBuilder !== void 0) {
|
39569
|
+
const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
|
39570
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
39571
|
+
for (const builder of Object.values(extraValues)) {
|
39572
|
+
if (is(builder, IndexBuilder3)) {
|
39573
|
+
indexes.push(builder.build(table5));
|
39574
|
+
} else if (is(builder, CheckBuilder3)) {
|
39575
|
+
checks.push(builder.build(table5));
|
39576
|
+
} else if (is(builder, UniqueConstraintBuilder3)) {
|
39577
|
+
uniqueConstraints.push(builder.build(table5));
|
39578
|
+
} else if (is(builder, PrimaryKeyBuilder3)) {
|
39579
|
+
primaryKeys.push(builder.build(table5));
|
39580
|
+
} else if (is(builder, ForeignKeyBuilder3)) {
|
39581
|
+
foreignKeys.push(builder.build(table5));
|
39582
|
+
}
|
39583
|
+
}
|
39584
|
+
}
|
39585
|
+
return {
|
39586
|
+
columns,
|
39587
|
+
indexes,
|
39588
|
+
foreignKeys,
|
39589
|
+
checks,
|
39590
|
+
primaryKeys,
|
39591
|
+
uniqueConstraints,
|
39592
|
+
name: name2,
|
39593
|
+
schema: schema5,
|
39594
|
+
baseName
|
39595
|
+
};
|
39596
|
+
}
|
39597
|
+
function getViewConfig3(view4) {
|
39598
|
+
return {
|
39599
|
+
...view4[ViewBaseConfig],
|
39600
|
+
...view4[MySqlViewConfig]
|
39601
|
+
};
|
39602
|
+
}
|
39603
|
+
var init_utils8 = __esm({
|
39604
|
+
"../drizzle-orm/dist/mysql-core/utils.js"() {
|
39605
|
+
"use strict";
|
39606
|
+
init_entity();
|
39607
|
+
init_table();
|
39608
|
+
init_view_common();
|
39609
|
+
init_checks3();
|
39610
|
+
init_foreign_keys3();
|
39611
|
+
init_indexes3();
|
39612
|
+
init_primary_keys3();
|
39613
|
+
init_table4();
|
39614
|
+
init_unique_constraint3();
|
39615
|
+
init_view_common3();
|
39616
|
+
}
|
39617
|
+
});
|
39618
|
+
|
39717
39619
|
// ../drizzle-orm/dist/mysql-core/index.js
|
39718
39620
|
var init_mysql_core = __esm({
|
39719
39621
|
"../drizzle-orm/dist/mysql-core/index.js"() {
|