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.
Files changed (4) hide show
  1. package/api.js +305 -207
  2. package/api.mjs +305 -207
  3. package/bin.cjs +61 -81
  4. package/package.json +1 -1
package/api.js CHANGED
@@ -37148,6 +37148,12 @@ 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
+ }
37151
37157
  buildSelectQuery({
37152
37158
  withList,
37153
37159
  fields,
@@ -37162,7 +37168,10 @@ var init_dialect3 = __esm({
37162
37168
  offset,
37163
37169
  lockingClause,
37164
37170
  distinct,
37165
- setOperators
37171
+ setOperators,
37172
+ useIndex,
37173
+ forceIndex,
37174
+ ignoreIndex
37166
37175
  }) {
37167
37176
  const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
37168
37177
  for (const f of fieldsList) {
@@ -37198,8 +37207,11 @@ var init_dialect3 = __esm({
37198
37207
  const tableSchema = table22[MySqlTable.Symbol.Schema];
37199
37208
  const origTableName = table22[MySqlTable.Symbol.OriginalName];
37200
37209
  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" });
37201
37213
  joinsArray.push(
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}`
37214
+ 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}`
37203
37215
  );
37204
37216
  } else if (is(table22, View3)) {
37205
37217
  const viewName = table22[ViewBaseConfig].name;
@@ -37226,6 +37238,9 @@ var init_dialect3 = __esm({
37226
37238
  const groupBySql = groupBy && groupBy.length > 0 ? sql` group by ${sql.join(groupBy, sql`, `)}` : void 0;
37227
37239
  const limitSql = this.buildLimit(limit);
37228
37240
  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" });
37229
37244
  let lockingClausesSql;
37230
37245
  if (lockingClause) {
37231
37246
  const { config, strength } = lockingClause;
@@ -37236,7 +37251,7 @@ var init_dialect3 = __esm({
37236
37251
  lockingClausesSql.append(sql` skip locked`);
37237
37252
  }
37238
37253
  }
37239
- const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
37254
+ const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${useIndexSql}${forceIndexSql}${ignoreIndexSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
37240
37255
  if (setOperators.length > 0) {
37241
37256
  return this.buildSetOperations(finalQuery, setOperators);
37242
37257
  }
@@ -37804,6 +37819,183 @@ var init_dialect3 = __esm({
37804
37819
  }
37805
37820
  });
37806
37821
 
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
+
37807
37999
  // ../drizzle-orm/dist/mysql-core/query-builders/select.js
37808
38000
  function createSetOperator3(type, isAll) {
37809
38001
  return (leftSelect, rightSelect, ...restSelects) => {
@@ -37822,11 +38014,12 @@ function createSetOperator3(type, isAll) {
37822
38014
  return leftSelect.addSetOperators(setOperators);
37823
38015
  };
37824
38016
  }
37825
- var _a302, MySqlSelectBuilder, _a303, _b224, MySqlSelectQueryBuilderBase, _a304, _b225, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
38017
+ var _a307, MySqlSelectBuilder, _a308, _b224, MySqlSelectQueryBuilderBase, _a309, _b225, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
37826
38018
  var init_select4 = __esm({
37827
38019
  "../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
37828
38020
  "use strict";
37829
38021
  init_entity();
38022
+ init_table4();
37830
38023
  init_query_builder();
37831
38024
  init_query_promise();
37832
38025
  init_selection_proxy();
@@ -37834,10 +38027,10 @@ var init_select4 = __esm({
37834
38027
  init_subquery();
37835
38028
  init_table();
37836
38029
  init_utils2();
37837
- init_utils2();
37838
38030
  init_view_common();
38031
+ init_utils8();
37839
38032
  init_view_base3();
37840
- _a302 = entityKind;
38033
+ _a307 = entityKind;
37841
38034
  MySqlSelectBuilder = class {
37842
38035
  constructor(config) {
37843
38036
  __publicField(this, "fields");
@@ -37853,7 +38046,7 @@ var init_select4 = __esm({
37853
38046
  }
37854
38047
  this.distinct = config.distinct;
37855
38048
  }
37856
- from(source) {
38049
+ from(source, onIndex) {
37857
38050
  const isPartialSelect = !!this.fields;
37858
38051
  let fields;
37859
38052
  if (this.fields) {
@@ -37869,6 +38062,20 @@ var init_select4 = __esm({
37869
38062
  } else {
37870
38063
  fields = getTableColumns(source);
37871
38064
  }
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
+ }
37872
38079
  return new MySqlSelectBase(
37873
38080
  {
37874
38081
  table: source,
@@ -37877,14 +38084,17 @@ var init_select4 = __esm({
37877
38084
  session: this.session,
37878
38085
  dialect: this.dialect,
37879
38086
  withList: this.withList,
37880
- distinct: this.distinct
38087
+ distinct: this.distinct,
38088
+ useIndex,
38089
+ forceIndex,
38090
+ ignoreIndex
37881
38091
  }
37882
38092
  );
37883
38093
  }
37884
38094
  };
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 }) {
38095
+ __publicField(MySqlSelectBuilder, _a307, "MySqlSelectBuilder");
38096
+ MySqlSelectQueryBuilderBase = class extends (_b224 = TypedQueryBuilder, _a308 = entityKind, _b224) {
38097
+ constructor({ table: table5, fields, isPartialSelect, session, dialect: dialect6, withList, distinct, useIndex, forceIndex, ignoreIndex }) {
37888
38098
  super();
37889
38099
  __publicField(this, "_");
37890
38100
  __publicField(this, "config");
@@ -37919,6 +38129,16 @@ var init_select4 = __esm({
37919
38129
  * })
37920
38130
  * .from(users)
37921
38131
  * .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
+ * })
37922
38142
  * ```
37923
38143
  */
37924
38144
  __publicField(this, "leftJoin", this.createJoin("left"));
@@ -37947,6 +38167,16 @@ var init_select4 = __esm({
37947
38167
  * })
37948
38168
  * .from(users)
37949
38169
  * .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
+ * })
37950
38180
  * ```
37951
38181
  */
37952
38182
  __publicField(this, "rightJoin", this.createJoin("right"));
@@ -37975,6 +38205,16 @@ var init_select4 = __esm({
37975
38205
  * })
37976
38206
  * .from(users)
37977
38207
  * .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
+ * })
37978
38218
  * ```
37979
38219
  */
37980
38220
  __publicField(this, "innerJoin", this.createJoin("inner"));
@@ -38003,6 +38243,16 @@ var init_select4 = __esm({
38003
38243
  * })
38004
38244
  * .from(users)
38005
38245
  * .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
+ * })
38006
38256
  * ```
38007
38257
  */
38008
38258
  __publicField(this, "fullJoin", this.createJoin("full"));
@@ -38197,7 +38447,10 @@ var init_select4 = __esm({
38197
38447
  table: table5,
38198
38448
  fields: { ...fields },
38199
38449
  distinct,
38200
- setOperators: []
38450
+ setOperators: [],
38451
+ useIndex,
38452
+ forceIndex,
38453
+ ignoreIndex
38201
38454
  };
38202
38455
  this.isPartialSelect = isPartialSelect;
38203
38456
  this.session = session;
@@ -38209,7 +38462,7 @@ var init_select4 = __esm({
38209
38462
  this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
38210
38463
  }
38211
38464
  createJoin(joinType) {
38212
- return (table5, on) => {
38465
+ return (table5, on, onIndex) => {
38213
38466
  const baseTableName = this.tableName;
38214
38467
  const tableName = getTableLikeName(table5);
38215
38468
  if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
@@ -38237,7 +38490,21 @@ var init_select4 = __esm({
38237
38490
  if (!this.config.joins) {
38238
38491
  this.config.joins = [];
38239
38492
  }
38240
- this.config.joins.push({ on, table: table5, joinType, alias: tableName });
38493
+ let useIndex = [];
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 });
38241
38508
  if (typeof tableName === "string") {
38242
38509
  switch (joinType) {
38243
38510
  case "left": {
@@ -38484,8 +38751,8 @@ var init_select4 = __esm({
38484
38751
  return this;
38485
38752
  }
38486
38753
  };
38487
- __publicField(MySqlSelectQueryBuilderBase, _a303, "MySqlSelectQueryBuilder");
38488
- MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase, _a304 = entityKind, _b225) {
38754
+ __publicField(MySqlSelectQueryBuilderBase, _a308, "MySqlSelectQueryBuilder");
38755
+ MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase, _a309 = entityKind, _b225) {
38489
38756
  constructor() {
38490
38757
  super(...arguments);
38491
38758
  __publicField(this, "execute", (placeholderValues) => {
@@ -38509,7 +38776,7 @@ var init_select4 = __esm({
38509
38776
  return query;
38510
38777
  }
38511
38778
  };
38512
- __publicField(MySqlSelectBase, _a304, "MySqlSelect");
38779
+ __publicField(MySqlSelectBase, _a309, "MySqlSelect");
38513
38780
  applyMixins(MySqlSelectBase, [QueryPromise]);
38514
38781
  getMySqlSetOperators = () => ({
38515
38782
  union: union3,
@@ -38529,7 +38796,7 @@ var init_select4 = __esm({
38529
38796
  });
38530
38797
 
38531
38798
  // ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
38532
- var _a305, QueryBuilder3;
38799
+ var _a310, QueryBuilder3;
38533
38800
  var init_query_builder4 = __esm({
38534
38801
  "../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
38535
38802
  "use strict";
@@ -38538,7 +38805,7 @@ var init_query_builder4 = __esm({
38538
38805
  init_selection_proxy();
38539
38806
  init_subquery();
38540
38807
  init_select4();
38541
- _a305 = entityKind;
38808
+ _a310 = entityKind;
38542
38809
  QueryBuilder3 = class {
38543
38810
  constructor(dialect6) {
38544
38811
  __publicField(this, "dialect");
@@ -38600,12 +38867,12 @@ var init_query_builder4 = __esm({
38600
38867
  return this.dialect;
38601
38868
  }
38602
38869
  };
38603
- __publicField(QueryBuilder3, _a305, "MySqlQueryBuilder");
38870
+ __publicField(QueryBuilder3, _a310, "MySqlQueryBuilder");
38604
38871
  }
38605
38872
  });
38606
38873
 
38607
38874
  // ../drizzle-orm/dist/mysql-core/query-builders/insert.js
38608
- var _a306, MySqlInsertBuilder, _a307, _b226, MySqlInsertBase;
38875
+ var _a311, MySqlInsertBuilder, _a312, _b226, MySqlInsertBase;
38609
38876
  var init_insert3 = __esm({
38610
38877
  "../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
38611
38878
  "use strict";
@@ -38615,7 +38882,7 @@ var init_insert3 = __esm({
38615
38882
  init_table();
38616
38883
  init_utils2();
38617
38884
  init_query_builder4();
38618
- _a306 = entityKind;
38885
+ _a311 = entityKind;
38619
38886
  MySqlInsertBuilder = class {
38620
38887
  constructor(table5, session, dialect6) {
38621
38888
  __publicField(this, "shouldIgnore", false);
@@ -38653,8 +38920,8 @@ var init_insert3 = __esm({
38653
38920
  return new MySqlInsertBase(this.table, select, this.shouldIgnore, this.session, this.dialect, true);
38654
38921
  }
38655
38922
  };
38656
- __publicField(MySqlInsertBuilder, _a306, "MySqlInsertBuilder");
38657
- MySqlInsertBase = class extends (_b226 = QueryPromise, _a307 = entityKind, _b226) {
38923
+ __publicField(MySqlInsertBuilder, _a311, "MySqlInsertBuilder");
38924
+ MySqlInsertBase = class extends (_b226 = QueryPromise, _a312 = entityKind, _b226) {
38658
38925
  constructor(table5, values, ignore, session, dialect6, select) {
38659
38926
  super();
38660
38927
  __publicField(this, "config");
@@ -38735,7 +39002,7 @@ var init_insert3 = __esm({
38735
39002
  return this;
38736
39003
  }
38737
39004
  };
38738
- __publicField(MySqlInsertBase, _a307, "MySqlInsert");
39005
+ __publicField(MySqlInsertBase, _a312, "MySqlInsert");
38739
39006
  }
38740
39007
  });
38741
39008
 
@@ -38747,7 +39014,7 @@ var init_select_types3 = __esm({
38747
39014
  });
38748
39015
 
38749
39016
  // ../drizzle-orm/dist/mysql-core/query-builders/update.js
38750
- var _a308, MySqlUpdateBuilder, _a309, _b227, MySqlUpdateBase;
39017
+ var _a313, MySqlUpdateBuilder, _a314, _b227, MySqlUpdateBase;
38751
39018
  var init_update3 = __esm({
38752
39019
  "../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
38753
39020
  "use strict";
@@ -38756,7 +39023,7 @@ var init_update3 = __esm({
38756
39023
  init_selection_proxy();
38757
39024
  init_table();
38758
39025
  init_utils2();
38759
- _a308 = entityKind;
39026
+ _a313 = entityKind;
38760
39027
  MySqlUpdateBuilder = class {
38761
39028
  constructor(table5, session, dialect6, withList) {
38762
39029
  this.table = table5;
@@ -38768,8 +39035,8 @@ var init_update3 = __esm({
38768
39035
  return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
38769
39036
  }
38770
39037
  };
38771
- __publicField(MySqlUpdateBuilder, _a308, "MySqlUpdateBuilder");
38772
- MySqlUpdateBase = class extends (_b227 = QueryPromise, _a309 = entityKind, _b227) {
39038
+ __publicField(MySqlUpdateBuilder, _a313, "MySqlUpdateBuilder");
39039
+ MySqlUpdateBase = class extends (_b227 = QueryPromise, _a314 = entityKind, _b227) {
38773
39040
  constructor(table5, set, session, dialect6, withList) {
38774
39041
  super();
38775
39042
  __publicField(this, "config");
@@ -38862,7 +39129,7 @@ var init_update3 = __esm({
38862
39129
  return this;
38863
39130
  }
38864
39131
  };
38865
- __publicField(MySqlUpdateBase, _a309, "MySqlUpdate");
39132
+ __publicField(MySqlUpdateBase, _a314, "MySqlUpdate");
38866
39133
  }
38867
39134
  });
38868
39135
 
@@ -38880,14 +39147,14 @@ var init_query_builders3 = __esm({
38880
39147
  });
38881
39148
 
38882
39149
  // ../drizzle-orm/dist/mysql-core/query-builders/query.js
38883
- var _a310, RelationalQueryBuilder3, _a311, _b228, MySqlRelationalQuery;
39150
+ var _a315, RelationalQueryBuilder3, _a316, _b228, MySqlRelationalQuery;
38884
39151
  var init_query3 = __esm({
38885
39152
  "../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
38886
39153
  "use strict";
38887
39154
  init_entity();
38888
39155
  init_query_promise();
38889
39156
  init_relations();
38890
- _a310 = entityKind;
39157
+ _a315 = entityKind;
38891
39158
  RelationalQueryBuilder3 = class {
38892
39159
  constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, mode) {
38893
39160
  this.fullSchema = fullSchema;
@@ -38928,8 +39195,8 @@ var init_query3 = __esm({
38928
39195
  );
38929
39196
  }
38930
39197
  };
38931
- __publicField(RelationalQueryBuilder3, _a310, "MySqlRelationalQueryBuilder");
38932
- MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a311 = entityKind, _b228) {
39198
+ __publicField(RelationalQueryBuilder3, _a315, "MySqlRelationalQueryBuilder");
39199
+ MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a316 = entityKind, _b228) {
38933
39200
  constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, config, queryMode, mode) {
38934
39201
  super();
38935
39202
  this.fullSchema = fullSchema;
@@ -38993,12 +39260,12 @@ var init_query3 = __esm({
38993
39260
  return this.prepare().execute();
38994
39261
  }
38995
39262
  };
38996
- __publicField(MySqlRelationalQuery, _a311, "MySqlRelationalQuery");
39263
+ __publicField(MySqlRelationalQuery, _a316, "MySqlRelationalQuery");
38997
39264
  }
38998
39265
  });
38999
39266
 
39000
39267
  // ../drizzle-orm/dist/mysql-core/db.js
39001
- var _a312, MySqlDatabase;
39268
+ var _a317, MySqlDatabase;
39002
39269
  var init_db3 = __esm({
39003
39270
  "../drizzle-orm/dist/mysql-core/db.js"() {
39004
39271
  "use strict";
@@ -39009,7 +39276,7 @@ var init_db3 = __esm({
39009
39276
  init_count3();
39010
39277
  init_query_builders3();
39011
39278
  init_query3();
39012
- _a312 = entityKind;
39279
+ _a317 = entityKind;
39013
39280
  MySqlDatabase = class {
39014
39281
  constructor(dialect6, session, schema5, mode) {
39015
39282
  __publicField(this, "query");
@@ -39222,113 +39489,7 @@ var init_db3 = __esm({
39222
39489
  return this.session.transaction(transaction, config);
39223
39490
  }
39224
39491
  };
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");
39492
+ __publicField(MySqlDatabase, _a317, "MySqlDatabase");
39332
39493
  }
39333
39494
  });
39334
39495
 
@@ -39553,69 +39714,6 @@ var init_subquery4 = __esm({
39553
39714
  }
39554
39715
  });
39555
39716
 
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
-
39619
39717
  // ../drizzle-orm/dist/mysql-core/index.js
39620
39718
  var init_mysql_core = __esm({
39621
39719
  "../drizzle-orm/dist/mysql-core/index.js"() {