drizzle-kit 0.30.0-1abaaf8 → 0.30.0-21dab20

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 +210 -307
  2. package/api.mjs +210 -307
  3. package/bin.cjs +211 -8
  4. package/package.json +1 -1
package/api.js CHANGED
@@ -19719,7 +19719,8 @@ var init_common = __esm({
19719
19719
  schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
19720
19720
  migrations: configMigrations,
19721
19721
  dbCredentials: anyType().optional(),
19722
- casing: casingType.optional()
19722
+ casing: casingType.optional(),
19723
+ sql: booleanType().default(true)
19723
19724
  }).passthrough();
19724
19725
  casing = unionType([literalType("camel"), literalType("preserve")]).default(
19725
19726
  "camel"
@@ -21974,7 +21975,7 @@ var version;
21974
21975
  var init_version = __esm({
21975
21976
  "../drizzle-orm/dist/version.js"() {
21976
21977
  "use strict";
21977
- version = "0.38.0";
21978
+ version = "0.38.1";
21978
21979
  }
21979
21980
  });
21980
21981
 
@@ -37148,12 +37149,6 @@ var init_dialect3 = __esm({
37148
37149
  buildOrderBy(orderBy) {
37149
37150
  return orderBy && orderBy.length > 0 ? sql` order by ${sql.join(orderBy, sql`, `)}` : void 0;
37150
37151
  }
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
37152
  buildSelectQuery({
37158
37153
  withList,
37159
37154
  fields,
@@ -37168,10 +37163,7 @@ var init_dialect3 = __esm({
37168
37163
  offset,
37169
37164
  lockingClause,
37170
37165
  distinct,
37171
- setOperators,
37172
- useIndex,
37173
- forceIndex,
37174
- ignoreIndex
37166
+ setOperators
37175
37167
  }) {
37176
37168
  const fieldsList = fieldsFlat ?? orderSelectedFields(fields);
37177
37169
  for (const f of fieldsList) {
@@ -37207,11 +37199,8 @@ var init_dialect3 = __esm({
37207
37199
  const tableSchema = table22[MySqlTable.Symbol.Schema];
37208
37200
  const origTableName = table22[MySqlTable.Symbol.OriginalName];
37209
37201
  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
37202
  joinsArray.push(
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
+ 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
37204
  );
37216
37205
  } else if (is(table22, View3)) {
37217
37206
  const viewName = table22[ViewBaseConfig].name;
@@ -37238,9 +37227,6 @@ var init_dialect3 = __esm({
37238
37227
  const groupBySql = groupBy && groupBy.length > 0 ? sql` group by ${sql.join(groupBy, sql`, `)}` : void 0;
37239
37228
  const limitSql = this.buildLimit(limit);
37240
37229
  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
37230
  let lockingClausesSql;
37245
37231
  if (lockingClause) {
37246
37232
  const { config, strength } = lockingClause;
@@ -37251,7 +37237,7 @@ var init_dialect3 = __esm({
37251
37237
  lockingClausesSql.append(sql` skip locked`);
37252
37238
  }
37253
37239
  }
37254
- const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${useIndexSql}${forceIndexSql}${ignoreIndexSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
37240
+ const finalQuery = sql`${withSql}select${distinctSql} ${selection} from ${tableSql}${joinsSql}${whereSql}${groupBySql}${havingSql}${orderBySql}${limitSql}${offsetSql}${lockingClausesSql}`;
37255
37241
  if (setOperators.length > 0) {
37256
37242
  return this.buildSetOperations(finalQuery, setOperators);
37257
37243
  }
@@ -37819,183 +37805,6 @@ var init_dialect3 = __esm({
37819
37805
  }
37820
37806
  });
37821
37807
 
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
37808
  // ../drizzle-orm/dist/mysql-core/query-builders/select.js
38000
37809
  function createSetOperator3(type, isAll) {
38001
37810
  return (leftSelect, rightSelect, ...restSelects) => {
@@ -38014,12 +37823,11 @@ function createSetOperator3(type, isAll) {
38014
37823
  return leftSelect.addSetOperators(setOperators);
38015
37824
  };
38016
37825
  }
38017
- var _a307, MySqlSelectBuilder, _a308, _b224, MySqlSelectQueryBuilderBase, _a309, _b225, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
37826
+ var _a302, MySqlSelectBuilder, _a303, _b224, MySqlSelectQueryBuilderBase, _a304, _b225, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
38018
37827
  var init_select4 = __esm({
38019
37828
  "../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
38020
37829
  "use strict";
38021
37830
  init_entity();
38022
- init_table4();
38023
37831
  init_query_builder();
38024
37832
  init_query_promise();
38025
37833
  init_selection_proxy();
@@ -38027,10 +37835,10 @@ var init_select4 = __esm({
38027
37835
  init_subquery();
38028
37836
  init_table();
38029
37837
  init_utils2();
37838
+ init_utils2();
38030
37839
  init_view_common();
38031
- init_utils8();
38032
37840
  init_view_base3();
38033
- _a307 = entityKind;
37841
+ _a302 = entityKind;
38034
37842
  MySqlSelectBuilder = class {
38035
37843
  constructor(config) {
38036
37844
  __publicField(this, "fields");
@@ -38046,7 +37854,7 @@ var init_select4 = __esm({
38046
37854
  }
38047
37855
  this.distinct = config.distinct;
38048
37856
  }
38049
- from(source, onIndex) {
37857
+ from(source) {
38050
37858
  const isPartialSelect = !!this.fields;
38051
37859
  let fields;
38052
37860
  if (this.fields) {
@@ -38062,20 +37870,6 @@ var init_select4 = __esm({
38062
37870
  } else {
38063
37871
  fields = getTableColumns(source);
38064
37872
  }
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
37873
  return new MySqlSelectBase(
38080
37874
  {
38081
37875
  table: source,
@@ -38084,17 +37878,14 @@ var init_select4 = __esm({
38084
37878
  session: this.session,
38085
37879
  dialect: this.dialect,
38086
37880
  withList: this.withList,
38087
- distinct: this.distinct,
38088
- useIndex,
38089
- forceIndex,
38090
- ignoreIndex
37881
+ distinct: this.distinct
38091
37882
  }
38092
37883
  );
38093
37884
  }
38094
37885
  };
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 }) {
37886
+ __publicField(MySqlSelectBuilder, _a302, "MySqlSelectBuilder");
37887
+ MySqlSelectQueryBuilderBase = class extends (_b224 = TypedQueryBuilder, _a303 = entityKind, _b224) {
37888
+ constructor({ table: table5, fields, isPartialSelect, session, dialect: dialect6, withList, distinct }) {
38098
37889
  super();
38099
37890
  __publicField(this, "_");
38100
37891
  __publicField(this, "config");
@@ -38129,16 +37920,6 @@ var init_select4 = __esm({
38129
37920
  * })
38130
37921
  * .from(users)
38131
37922
  * .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
37923
  * ```
38143
37924
  */
38144
37925
  __publicField(this, "leftJoin", this.createJoin("left"));
@@ -38167,16 +37948,6 @@ var init_select4 = __esm({
38167
37948
  * })
38168
37949
  * .from(users)
38169
37950
  * .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
37951
  * ```
38181
37952
  */
38182
37953
  __publicField(this, "rightJoin", this.createJoin("right"));
@@ -38205,16 +37976,6 @@ var init_select4 = __esm({
38205
37976
  * })
38206
37977
  * .from(users)
38207
37978
  * .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
37979
  * ```
38219
37980
  */
38220
37981
  __publicField(this, "innerJoin", this.createJoin("inner"));
@@ -38243,16 +38004,6 @@ var init_select4 = __esm({
38243
38004
  * })
38244
38005
  * .from(users)
38245
38006
  * .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
38007
  * ```
38257
38008
  */
38258
38009
  __publicField(this, "fullJoin", this.createJoin("full"));
@@ -38447,10 +38198,7 @@ var init_select4 = __esm({
38447
38198
  table: table5,
38448
38199
  fields: { ...fields },
38449
38200
  distinct,
38450
- setOperators: [],
38451
- useIndex,
38452
- forceIndex,
38453
- ignoreIndex
38201
+ setOperators: []
38454
38202
  };
38455
38203
  this.isPartialSelect = isPartialSelect;
38456
38204
  this.session = session;
@@ -38462,7 +38210,7 @@ var init_select4 = __esm({
38462
38210
  this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
38463
38211
  }
38464
38212
  createJoin(joinType) {
38465
- return (table5, on, onIndex) => {
38213
+ return (table5, on) => {
38466
38214
  const baseTableName = this.tableName;
38467
38215
  const tableName = getTableLikeName(table5);
38468
38216
  if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
@@ -38490,21 +38238,7 @@ var init_select4 = __esm({
38490
38238
  if (!this.config.joins) {
38491
38239
  this.config.joins = [];
38492
38240
  }
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
+ this.config.joins.push({ on, table: table5, joinType, alias: tableName });
38508
38242
  if (typeof tableName === "string") {
38509
38243
  switch (joinType) {
38510
38244
  case "left": {
@@ -38751,8 +38485,8 @@ var init_select4 = __esm({
38751
38485
  return this;
38752
38486
  }
38753
38487
  };
38754
- __publicField(MySqlSelectQueryBuilderBase, _a308, "MySqlSelectQueryBuilder");
38755
- MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase, _a309 = entityKind, _b225) {
38488
+ __publicField(MySqlSelectQueryBuilderBase, _a303, "MySqlSelectQueryBuilder");
38489
+ MySqlSelectBase = class extends (_b225 = MySqlSelectQueryBuilderBase, _a304 = entityKind, _b225) {
38756
38490
  constructor() {
38757
38491
  super(...arguments);
38758
38492
  __publicField(this, "execute", (placeholderValues) => {
@@ -38776,7 +38510,7 @@ var init_select4 = __esm({
38776
38510
  return query;
38777
38511
  }
38778
38512
  };
38779
- __publicField(MySqlSelectBase, _a309, "MySqlSelect");
38513
+ __publicField(MySqlSelectBase, _a304, "MySqlSelect");
38780
38514
  applyMixins(MySqlSelectBase, [QueryPromise]);
38781
38515
  getMySqlSetOperators = () => ({
38782
38516
  union: union3,
@@ -38796,7 +38530,7 @@ var init_select4 = __esm({
38796
38530
  });
38797
38531
 
38798
38532
  // ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
38799
- var _a310, QueryBuilder3;
38533
+ var _a305, QueryBuilder3;
38800
38534
  var init_query_builder4 = __esm({
38801
38535
  "../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
38802
38536
  "use strict";
@@ -38805,7 +38539,7 @@ var init_query_builder4 = __esm({
38805
38539
  init_selection_proxy();
38806
38540
  init_subquery();
38807
38541
  init_select4();
38808
- _a310 = entityKind;
38542
+ _a305 = entityKind;
38809
38543
  QueryBuilder3 = class {
38810
38544
  constructor(dialect6) {
38811
38545
  __publicField(this, "dialect");
@@ -38867,12 +38601,12 @@ var init_query_builder4 = __esm({
38867
38601
  return this.dialect;
38868
38602
  }
38869
38603
  };
38870
- __publicField(QueryBuilder3, _a310, "MySqlQueryBuilder");
38604
+ __publicField(QueryBuilder3, _a305, "MySqlQueryBuilder");
38871
38605
  }
38872
38606
  });
38873
38607
 
38874
38608
  // ../drizzle-orm/dist/mysql-core/query-builders/insert.js
38875
- var _a311, MySqlInsertBuilder, _a312, _b226, MySqlInsertBase;
38609
+ var _a306, MySqlInsertBuilder, _a307, _b226, MySqlInsertBase;
38876
38610
  var init_insert3 = __esm({
38877
38611
  "../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
38878
38612
  "use strict";
@@ -38882,7 +38616,7 @@ var init_insert3 = __esm({
38882
38616
  init_table();
38883
38617
  init_utils2();
38884
38618
  init_query_builder4();
38885
- _a311 = entityKind;
38619
+ _a306 = entityKind;
38886
38620
  MySqlInsertBuilder = class {
38887
38621
  constructor(table5, session, dialect6) {
38888
38622
  __publicField(this, "shouldIgnore", false);
@@ -38920,8 +38654,8 @@ var init_insert3 = __esm({
38920
38654
  return new MySqlInsertBase(this.table, select, this.shouldIgnore, this.session, this.dialect, true);
38921
38655
  }
38922
38656
  };
38923
- __publicField(MySqlInsertBuilder, _a311, "MySqlInsertBuilder");
38924
- MySqlInsertBase = class extends (_b226 = QueryPromise, _a312 = entityKind, _b226) {
38657
+ __publicField(MySqlInsertBuilder, _a306, "MySqlInsertBuilder");
38658
+ MySqlInsertBase = class extends (_b226 = QueryPromise, _a307 = entityKind, _b226) {
38925
38659
  constructor(table5, values, ignore, session, dialect6, select) {
38926
38660
  super();
38927
38661
  __publicField(this, "config");
@@ -39002,7 +38736,7 @@ var init_insert3 = __esm({
39002
38736
  return this;
39003
38737
  }
39004
38738
  };
39005
- __publicField(MySqlInsertBase, _a312, "MySqlInsert");
38739
+ __publicField(MySqlInsertBase, _a307, "MySqlInsert");
39006
38740
  }
39007
38741
  });
39008
38742
 
@@ -39014,7 +38748,7 @@ var init_select_types3 = __esm({
39014
38748
  });
39015
38749
 
39016
38750
  // ../drizzle-orm/dist/mysql-core/query-builders/update.js
39017
- var _a313, MySqlUpdateBuilder, _a314, _b227, MySqlUpdateBase;
38751
+ var _a308, MySqlUpdateBuilder, _a309, _b227, MySqlUpdateBase;
39018
38752
  var init_update3 = __esm({
39019
38753
  "../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
39020
38754
  "use strict";
@@ -39023,7 +38757,7 @@ var init_update3 = __esm({
39023
38757
  init_selection_proxy();
39024
38758
  init_table();
39025
38759
  init_utils2();
39026
- _a313 = entityKind;
38760
+ _a308 = entityKind;
39027
38761
  MySqlUpdateBuilder = class {
39028
38762
  constructor(table5, session, dialect6, withList) {
39029
38763
  this.table = table5;
@@ -39035,8 +38769,8 @@ var init_update3 = __esm({
39035
38769
  return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
39036
38770
  }
39037
38771
  };
39038
- __publicField(MySqlUpdateBuilder, _a313, "MySqlUpdateBuilder");
39039
- MySqlUpdateBase = class extends (_b227 = QueryPromise, _a314 = entityKind, _b227) {
38772
+ __publicField(MySqlUpdateBuilder, _a308, "MySqlUpdateBuilder");
38773
+ MySqlUpdateBase = class extends (_b227 = QueryPromise, _a309 = entityKind, _b227) {
39040
38774
  constructor(table5, set, session, dialect6, withList) {
39041
38775
  super();
39042
38776
  __publicField(this, "config");
@@ -39129,7 +38863,7 @@ var init_update3 = __esm({
39129
38863
  return this;
39130
38864
  }
39131
38865
  };
39132
- __publicField(MySqlUpdateBase, _a314, "MySqlUpdate");
38866
+ __publicField(MySqlUpdateBase, _a309, "MySqlUpdate");
39133
38867
  }
39134
38868
  });
39135
38869
 
@@ -39147,14 +38881,14 @@ var init_query_builders3 = __esm({
39147
38881
  });
39148
38882
 
39149
38883
  // ../drizzle-orm/dist/mysql-core/query-builders/query.js
39150
- var _a315, RelationalQueryBuilder3, _a316, _b228, MySqlRelationalQuery;
38884
+ var _a310, RelationalQueryBuilder3, _a311, _b228, MySqlRelationalQuery;
39151
38885
  var init_query3 = __esm({
39152
38886
  "../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
39153
38887
  "use strict";
39154
38888
  init_entity();
39155
38889
  init_query_promise();
39156
38890
  init_relations();
39157
- _a315 = entityKind;
38891
+ _a310 = entityKind;
39158
38892
  RelationalQueryBuilder3 = class {
39159
38893
  constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, mode) {
39160
38894
  this.fullSchema = fullSchema;
@@ -39195,8 +38929,8 @@ var init_query3 = __esm({
39195
38929
  );
39196
38930
  }
39197
38931
  };
39198
- __publicField(RelationalQueryBuilder3, _a315, "MySqlRelationalQueryBuilder");
39199
- MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a316 = entityKind, _b228) {
38932
+ __publicField(RelationalQueryBuilder3, _a310, "MySqlRelationalQueryBuilder");
38933
+ MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a311 = entityKind, _b228) {
39200
38934
  constructor(fullSchema, schema5, tableNamesMap, table5, tableConfig, dialect6, session, config, queryMode, mode) {
39201
38935
  super();
39202
38936
  this.fullSchema = fullSchema;
@@ -39260,12 +38994,12 @@ var init_query3 = __esm({
39260
38994
  return this.prepare().execute();
39261
38995
  }
39262
38996
  };
39263
- __publicField(MySqlRelationalQuery, _a316, "MySqlRelationalQuery");
38997
+ __publicField(MySqlRelationalQuery, _a311, "MySqlRelationalQuery");
39264
38998
  }
39265
38999
  });
39266
39000
 
39267
39001
  // ../drizzle-orm/dist/mysql-core/db.js
39268
- var _a317, MySqlDatabase;
39002
+ var _a312, MySqlDatabase;
39269
39003
  var init_db3 = __esm({
39270
39004
  "../drizzle-orm/dist/mysql-core/db.js"() {
39271
39005
  "use strict";
@@ -39276,7 +39010,7 @@ var init_db3 = __esm({
39276
39010
  init_count3();
39277
39011
  init_query_builders3();
39278
39012
  init_query3();
39279
- _a317 = entityKind;
39013
+ _a312 = entityKind;
39280
39014
  MySqlDatabase = class {
39281
39015
  constructor(dialect6, session, schema5, mode) {
39282
39016
  __publicField(this, "query");
@@ -39489,7 +39223,113 @@ var init_db3 = __esm({
39489
39223
  return this.session.transaction(transaction, config);
39490
39224
  }
39491
39225
  };
39492
- __publicField(MySqlDatabase, _a317, "MySqlDatabase");
39226
+ __publicField(MySqlDatabase, _a312, "MySqlDatabase");
39227
+ }
39228
+ });
39229
+
39230
+ // ../drizzle-orm/dist/mysql-core/indexes.js
39231
+ var _a313, IndexBuilderOn3, _a314, IndexBuilder3, _a315, Index5;
39232
+ var init_indexes3 = __esm({
39233
+ "../drizzle-orm/dist/mysql-core/indexes.js"() {
39234
+ "use strict";
39235
+ init_entity();
39236
+ _a313 = entityKind;
39237
+ IndexBuilderOn3 = class {
39238
+ constructor(name2, unique) {
39239
+ this.name = name2;
39240
+ this.unique = unique;
39241
+ }
39242
+ on(...columns) {
39243
+ return new IndexBuilder3(this.name, columns, this.unique);
39244
+ }
39245
+ };
39246
+ __publicField(IndexBuilderOn3, _a313, "MySqlIndexBuilderOn");
39247
+ _a314 = entityKind;
39248
+ IndexBuilder3 = class {
39249
+ constructor(name2, columns, unique) {
39250
+ /** @internal */
39251
+ __publicField(this, "config");
39252
+ this.config = {
39253
+ name: name2,
39254
+ columns,
39255
+ unique
39256
+ };
39257
+ }
39258
+ using(using) {
39259
+ this.config.using = using;
39260
+ return this;
39261
+ }
39262
+ algorythm(algorythm) {
39263
+ this.config.algorythm = algorythm;
39264
+ return this;
39265
+ }
39266
+ lock(lock) {
39267
+ this.config.lock = lock;
39268
+ return this;
39269
+ }
39270
+ /** @internal */
39271
+ build(table5) {
39272
+ return new Index5(this.config, table5);
39273
+ }
39274
+ };
39275
+ __publicField(IndexBuilder3, _a314, "MySqlIndexBuilder");
39276
+ _a315 = entityKind;
39277
+ Index5 = class {
39278
+ constructor(config, table5) {
39279
+ __publicField(this, "config");
39280
+ this.config = { ...config, table: table5 };
39281
+ }
39282
+ };
39283
+ __publicField(Index5, _a315, "MySqlIndex");
39284
+ }
39285
+ });
39286
+
39287
+ // ../drizzle-orm/dist/mysql-core/primary-keys.js
39288
+ var _a316, PrimaryKeyBuilder3, _a317, PrimaryKey3;
39289
+ var init_primary_keys3 = __esm({
39290
+ "../drizzle-orm/dist/mysql-core/primary-keys.js"() {
39291
+ "use strict";
39292
+ init_entity();
39293
+ init_table4();
39294
+ _a316 = entityKind;
39295
+ PrimaryKeyBuilder3 = class {
39296
+ constructor(columns, name2) {
39297
+ /** @internal */
39298
+ __publicField(this, "columns");
39299
+ /** @internal */
39300
+ __publicField(this, "name");
39301
+ this.columns = columns;
39302
+ this.name = name2;
39303
+ }
39304
+ /** @internal */
39305
+ build(table5) {
39306
+ return new PrimaryKey3(table5, this.columns, this.name);
39307
+ }
39308
+ };
39309
+ __publicField(PrimaryKeyBuilder3, _a316, "MySqlPrimaryKeyBuilder");
39310
+ _a317 = entityKind;
39311
+ PrimaryKey3 = class {
39312
+ constructor(table5, columns, name2) {
39313
+ __publicField(this, "columns");
39314
+ __publicField(this, "name");
39315
+ this.table = table5;
39316
+ this.columns = columns;
39317
+ this.name = name2;
39318
+ }
39319
+ getName() {
39320
+ return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column5) => column5.name).join("_")}_pk`;
39321
+ }
39322
+ };
39323
+ __publicField(PrimaryKey3, _a317, "MySqlPrimaryKey");
39324
+ }
39325
+ });
39326
+
39327
+ // ../drizzle-orm/dist/mysql-core/view-common.js
39328
+ var MySqlViewConfig;
39329
+ var init_view_common3 = __esm({
39330
+ "../drizzle-orm/dist/mysql-core/view-common.js"() {
39331
+ "use strict";
39332
+ MySqlViewConfig = Symbol.for("drizzle:MySqlViewConfig");
39493
39333
  }
39494
39334
  });
39495
39335
 
@@ -39714,6 +39554,69 @@ var init_subquery4 = __esm({
39714
39554
  }
39715
39555
  });
39716
39556
 
39557
+ // ../drizzle-orm/dist/mysql-core/utils.js
39558
+ function getTableConfig3(table5) {
39559
+ const columns = Object.values(table5[MySqlTable.Symbol.Columns]);
39560
+ const indexes = [];
39561
+ const checks = [];
39562
+ const primaryKeys = [];
39563
+ const uniqueConstraints = [];
39564
+ const foreignKeys = Object.values(table5[MySqlTable.Symbol.InlineForeignKeys]);
39565
+ const name2 = table5[Table2.Symbol.Name];
39566
+ const schema5 = table5[Table2.Symbol.Schema];
39567
+ const baseName = table5[Table2.Symbol.BaseName];
39568
+ const extraConfigBuilder = table5[MySqlTable.Symbol.ExtraConfigBuilder];
39569
+ if (extraConfigBuilder !== void 0) {
39570
+ const extraConfig = extraConfigBuilder(table5[MySqlTable.Symbol.Columns]);
39571
+ const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
39572
+ for (const builder of Object.values(extraValues)) {
39573
+ if (is(builder, IndexBuilder3)) {
39574
+ indexes.push(builder.build(table5));
39575
+ } else if (is(builder, CheckBuilder3)) {
39576
+ checks.push(builder.build(table5));
39577
+ } else if (is(builder, UniqueConstraintBuilder3)) {
39578
+ uniqueConstraints.push(builder.build(table5));
39579
+ } else if (is(builder, PrimaryKeyBuilder3)) {
39580
+ primaryKeys.push(builder.build(table5));
39581
+ } else if (is(builder, ForeignKeyBuilder3)) {
39582
+ foreignKeys.push(builder.build(table5));
39583
+ }
39584
+ }
39585
+ }
39586
+ return {
39587
+ columns,
39588
+ indexes,
39589
+ foreignKeys,
39590
+ checks,
39591
+ primaryKeys,
39592
+ uniqueConstraints,
39593
+ name: name2,
39594
+ schema: schema5,
39595
+ baseName
39596
+ };
39597
+ }
39598
+ function getViewConfig3(view4) {
39599
+ return {
39600
+ ...view4[ViewBaseConfig],
39601
+ ...view4[MySqlViewConfig]
39602
+ };
39603
+ }
39604
+ var init_utils8 = __esm({
39605
+ "../drizzle-orm/dist/mysql-core/utils.js"() {
39606
+ "use strict";
39607
+ init_entity();
39608
+ init_table();
39609
+ init_view_common();
39610
+ init_checks3();
39611
+ init_foreign_keys3();
39612
+ init_indexes3();
39613
+ init_primary_keys3();
39614
+ init_table4();
39615
+ init_unique_constraint3();
39616
+ init_view_common3();
39617
+ }
39618
+ });
39619
+
39717
39620
  // ../drizzle-orm/dist/mysql-core/index.js
39718
39621
  var init_mysql_core = __esm({
39719
39622
  "../drizzle-orm/dist/mysql-core/index.js"() {