drizzle-kit 0.25.0-225f91d → 0.25.0-22c3e40

Sign up to get free protection for your applications and to get access to all the features.
package/api.mjs CHANGED
@@ -2480,9 +2480,9 @@ var require_inflight = __commonJS({
2480
2480
  }
2481
2481
  function slice(args) {
2482
2482
  var length = args.length;
2483
- var array2 = [];
2484
- for (var i = 0; i < length; i++) array2[i] = args[i];
2485
- return array2;
2483
+ var array = [];
2484
+ for (var i = 0; i < length; i++) array[i] = args[i];
2485
+ return array;
2486
2486
  }
2487
2487
  }
2488
2488
  });
@@ -3652,13 +3652,13 @@ function processCreateParams(params) {
3652
3652
  if (errorMap2)
3653
3653
  return { errorMap: errorMap2, description };
3654
3654
  const customMap = (iss, ctx) => {
3655
- var _a326, _b233;
3655
+ var _a324, _b233;
3656
3656
  const { message } = params;
3657
3657
  if (iss.code === "invalid_enum_value") {
3658
3658
  return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
3659
3659
  }
3660
3660
  if (typeof ctx.data === "undefined") {
3661
- return { message: (_a326 = message !== null && message !== void 0 ? message : required_error) !== null && _a326 !== void 0 ? _a326 : ctx.defaultError };
3661
+ return { message: (_a324 = message !== null && message !== void 0 ? message : required_error) !== null && _a324 !== void 0 ? _a324 : ctx.defaultError };
3662
3662
  }
3663
3663
  if (iss.code !== "invalid_type")
3664
3664
  return { message: ctx.defaultError };
@@ -3825,8 +3825,8 @@ var init_lib = __esm({
3825
3825
  return void 0;
3826
3826
  };
3827
3827
  util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
3828
- function joinValues(array2, separator = " | ") {
3829
- return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
3828
+ function joinValues(array, separator = " | ") {
3829
+ return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
3830
3830
  }
3831
3831
  util2.joinValues = joinValues;
3832
3832
  util2.jsonStringifyReplacer = (_2, value) => {
@@ -4324,11 +4324,11 @@ var init_lib = __esm({
4324
4324
  throw result.error;
4325
4325
  }
4326
4326
  safeParse(data, params) {
4327
- var _a326;
4327
+ var _a324;
4328
4328
  const ctx = {
4329
4329
  common: {
4330
4330
  issues: [],
4331
- async: (_a326 = params === null || params === void 0 ? void 0 : params.async) !== null && _a326 !== void 0 ? _a326 : false,
4331
+ async: (_a324 = params === null || params === void 0 ? void 0 : params.async) !== null && _a324 !== void 0 ? _a324 : false,
4332
4332
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
4333
4333
  },
4334
4334
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -4650,7 +4650,7 @@ var init_lib = __esm({
4650
4650
  } else if (check.kind === "url") {
4651
4651
  try {
4652
4652
  new URL(input.data);
4653
- } catch (_a326) {
4653
+ } catch (_a324) {
4654
4654
  ctx = this._getOrReturnCtx(input, ctx);
4655
4655
  addIssueToContext(ctx, {
4656
4656
  validation: "url",
@@ -4820,7 +4820,7 @@ var init_lib = __esm({
4820
4820
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
4821
4821
  }
4822
4822
  datetime(options) {
4823
- var _a326, _b233;
4823
+ var _a324, _b233;
4824
4824
  if (typeof options === "string") {
4825
4825
  return this._addCheck({
4826
4826
  kind: "datetime",
@@ -4833,7 +4833,7 @@ var init_lib = __esm({
4833
4833
  return this._addCheck({
4834
4834
  kind: "datetime",
4835
4835
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
4836
- offset: (_a326 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a326 !== void 0 ? _a326 : false,
4836
+ offset: (_a324 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a324 !== void 0 ? _a324 : false,
4837
4837
  local: (_b233 = options === null || options === void 0 ? void 0 : options.local) !== null && _b233 !== void 0 ? _b233 : false,
4838
4838
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
4839
4839
  });
@@ -4997,11 +4997,11 @@ var init_lib = __esm({
4997
4997
  }
4998
4998
  };
4999
4999
  ZodString.create = (params) => {
5000
- var _a326;
5000
+ var _a324;
5001
5001
  return new ZodString({
5002
5002
  checks: [],
5003
5003
  typeName: ZodFirstPartyTypeKind.ZodString,
5004
- coerce: (_a326 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a326 !== void 0 ? _a326 : false,
5004
+ coerce: (_a324 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a324 !== void 0 ? _a324 : false,
5005
5005
  ...processCreateParams(params)
5006
5006
  });
5007
5007
  };
@@ -5394,11 +5394,11 @@ var init_lib = __esm({
5394
5394
  }
5395
5395
  };
5396
5396
  ZodBigInt.create = (params) => {
5397
- var _a326;
5397
+ var _a324;
5398
5398
  return new ZodBigInt({
5399
5399
  checks: [],
5400
5400
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
5401
- coerce: (_a326 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a326 !== void 0 ? _a326 : false,
5401
+ coerce: (_a324 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a324 !== void 0 ? _a324 : false,
5402
5402
  ...processCreateParams(params)
5403
5403
  });
5404
5404
  };
@@ -5878,8 +5878,8 @@ var init_lib = __esm({
5878
5878
  unknownKeys: "strict",
5879
5879
  ...message !== void 0 ? {
5880
5880
  errorMap: (issue, ctx) => {
5881
- var _a326, _b233, _c12, _d5;
5882
- const defaultError = (_c12 = (_b233 = (_a326 = this._def).errorMap) === null || _b233 === void 0 ? void 0 : _b233.call(_a326, issue, ctx).message) !== null && _c12 !== void 0 ? _c12 : ctx.defaultError;
5881
+ var _a324, _b233, _c12, _d5;
5882
+ const defaultError = (_c12 = (_b233 = (_a324 = this._def).errorMap) === null || _b233 === void 0 ? void 0 : _b233.call(_a324, issue, ctx).message) !== null && _c12 !== void 0 ? _c12 : ctx.defaultError;
5883
5883
  if (issue.code === "unrecognized_keys")
5884
5884
  return {
5885
5885
  message: (_d5 = errorUtil.errToObj(message).message) !== null && _d5 !== void 0 ? _d5 : defaultError
@@ -7666,7 +7666,7 @@ var init_vector = __esm({
7666
7666
  });
7667
7667
 
7668
7668
  // src/serializer/pgSchema.ts
7669
- var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, sequenceSchema, roleSchema, sequenceSquashed, columnV7, column2, columnSquashed, tableV32, compositePK2, uniqueConstraint2, policy, tableV42, tableV5, tableV6, tableV7, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaInternalV6, pgSchemaExternal, pgSchemaInternalV7, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashedV6, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchemaV6, pgSchemaV7, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
7669
+ var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, sequenceSchema, sequenceSquashed, columnV7, column2, columnSquashed, tableV32, compositePK2, uniqueConstraint2, tableV42, tableV5, tableV6, tableV7, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaInternalV6, pgSchemaExternal, pgSchemaInternalV7, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashedV6, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchemaV6, pgSchemaV7, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
7670
7670
  var init_pgSchema = __esm({
7671
7671
  "src/serializer/pgSchema.ts"() {
7672
7672
  "use strict";
@@ -7798,12 +7798,6 @@ var init_pgSchema = __esm({
7798
7798
  cycle: booleanType().optional(),
7799
7799
  schema: stringType()
7800
7800
  }).strict();
7801
- roleSchema = objectType({
7802
- name: stringType(),
7803
- createDb: booleanType().optional(),
7804
- createRole: booleanType().optional(),
7805
- inherit: booleanType().optional()
7806
- }).strict();
7807
7801
  sequenceSquashed = objectType({
7808
7802
  name: stringType(),
7809
7803
  schema: stringType(),
@@ -7867,14 +7861,6 @@ var init_pgSchema = __esm({
7867
7861
  columns: stringType().array(),
7868
7862
  nullsNotDistinct: booleanType()
7869
7863
  }).strict();
7870
- policy = objectType({
7871
- name: stringType(),
7872
- as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
7873
- for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
7874
- to: stringType().array().optional(),
7875
- using: stringType().optional(),
7876
- withCheck: stringType().optional()
7877
- }).strict();
7878
7864
  tableV42 = objectType({
7879
7865
  name: stringType(),
7880
7866
  schema: stringType(),
@@ -7916,8 +7902,7 @@ var init_pgSchema = __esm({
7916
7902
  indexes: recordType(stringType(), index2),
7917
7903
  foreignKeys: recordType(stringType(), fk2),
7918
7904
  compositePrimaryKeys: recordType(stringType(), compositePK2),
7919
- uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
7920
- policies: recordType(stringType(), policy).default({})
7905
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
7921
7906
  }).strict();
7922
7907
  schemaHash2 = objectType({
7923
7908
  id: stringType(),
@@ -8011,7 +7996,6 @@ var init_pgSchema = __esm({
8011
7996
  enums: recordType(stringType(), enumSchema),
8012
7997
  schemas: recordType(stringType(), stringType()),
8013
7998
  sequences: recordType(stringType(), sequenceSchema).default({}),
8014
- roles: recordType(stringType(), roleSchema).default({}),
8015
7999
  _meta: objectType({
8016
8000
  schemas: recordType(stringType(), stringType()),
8017
8001
  tables: recordType(stringType(), stringType()),
@@ -8026,8 +8010,7 @@ var init_pgSchema = __esm({
8026
8010
  indexes: recordType(stringType(), stringType()),
8027
8011
  foreignKeys: recordType(stringType(), stringType()),
8028
8012
  compositePrimaryKeys: recordType(stringType(), stringType()),
8029
- uniqueConstraints: recordType(stringType(), stringType()),
8030
- policies: recordType(stringType(), stringType())
8013
+ uniqueConstraints: recordType(stringType(), stringType())
8031
8014
  }).strict();
8032
8015
  tableSquashedV42 = objectType({
8033
8016
  name: stringType(),
@@ -8056,8 +8039,7 @@ var init_pgSchema = __esm({
8056
8039
  tables: recordType(stringType(), tableSquashed2),
8057
8040
  enums: recordType(stringType(), enumSchema),
8058
8041
  schemas: recordType(stringType(), stringType()),
8059
- sequences: recordType(stringType(), sequenceSquashed),
8060
- roles: recordType(stringType(), roleSchema).default({})
8042
+ sequences: recordType(stringType(), sequenceSquashed)
8061
8043
  }).strict();
8062
8044
  pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
8063
8045
  pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
@@ -8140,23 +8122,6 @@ var init_pgSchema = __esm({
8140
8122
  squashFK: (fk4) => {
8141
8123
  return `${fk4.name};${fk4.tableFrom};${fk4.columnsFrom.join(",")};${fk4.tableTo};${fk4.columnsTo.join(",")};${fk4.onUpdate ?? ""};${fk4.onDelete ?? ""};${fk4.schemaTo || "public"}`;
8142
8124
  },
8143
- squashPolicy: (policy2) => {
8144
- return `${policy2.name}--${policy2.as}--${policy2.for}--${policy2.to?.join(",")}--${policy2.using}--${policy2.withCheck}`;
8145
- },
8146
- unsquashPolicy: (policy2) => {
8147
- const splitted = policy2.split("--");
8148
- return {
8149
- name: splitted[0],
8150
- as: splitted[1],
8151
- for: splitted[2],
8152
- to: splitted[3].split(","),
8153
- using: splitted[4] !== "undefined" ? splitted[4] : void 0,
8154
- withCheck: splitted[5] !== "undefined" ? splitted[5] : void 0
8155
- };
8156
- },
8157
- squashPolicyPush: (policy2) => {
8158
- return `${policy2.name}--${policy2.as}--${policy2.for}--${policy2.to?.join(",")}`;
8159
- },
8160
8125
  squashPK: (pk) => {
8161
8126
  return `${pk.columns.join(",")};${pk.name}`;
8162
8127
  },
@@ -8259,9 +8224,6 @@ var init_pgSchema = __esm({
8259
8224
  return PgSquasher.squashUnique(unq);
8260
8225
  }
8261
8226
  );
8262
- const squashedPolicies = mapValues(it[1].policies, (policy2) => {
8263
- return action === "push" ? PgSquasher.squashPolicyPush(policy2) : PgSquasher.squashPolicy(policy2);
8264
- });
8265
8227
  return [
8266
8228
  it[0],
8267
8229
  {
@@ -8271,8 +8233,7 @@ var init_pgSchema = __esm({
8271
8233
  indexes: squashedIndexes,
8272
8234
  foreignKeys: squashedFKs,
8273
8235
  compositePrimaryKeys: squashedPKs,
8274
- uniqueConstraints: squashedUniqueConstraints,
8275
- policies: squashedPolicies
8236
+ uniqueConstraints: squashedUniqueConstraints
8276
8237
  }
8277
8238
  ];
8278
8239
  })
@@ -8295,8 +8256,7 @@ var init_pgSchema = __esm({
8295
8256
  tables: mappedTables,
8296
8257
  enums: json3.enums,
8297
8258
  schemas: json3.schemas,
8298
- sequences: mappedSequences,
8299
- roles: json3.roles
8259
+ sequences: mappedSequences
8300
8260
  };
8301
8261
  };
8302
8262
  dryPg = pgSchema.parse({
@@ -8646,7 +8606,7 @@ var init_utils = __esm({
8646
8606
  });
8647
8607
 
8648
8608
  // src/cli/views.ts
8649
- var import_hanji, warning, error, isRenamePromptItem, ResolveColumnSelect, tableKey, ResolveSelectNamed, ResolveSelect, ResolveSchemasSelect, Spinner, ProgressView;
8609
+ var import_hanji, warning, error, isRenamePromptItem, ResolveColumnSelect, tableKey, ResolveSelect, ResolveSchemasSelect, Spinner, ProgressView;
8650
8610
  var init_views = __esm({
8651
8611
  "src/cli/views.ts"() {
8652
8612
  "use strict";
@@ -8711,53 +8671,6 @@ Is ${source_default.bold.blue(
8711
8671
  tableKey = (it) => {
8712
8672
  return it.schema === "public" || !it.schema ? it.name : `${it.schema}.${it.name}`;
8713
8673
  };
8714
- ResolveSelectNamed = class extends import_hanji.Prompt {
8715
- constructor(base, data, entityType) {
8716
- super();
8717
- this.base = base;
8718
- this.entityType = entityType;
8719
- this.on("attach", (terminal) => terminal.toggleCursor("hide"));
8720
- this.state = new import_hanji.SelectState(data);
8721
- this.state.bind(this);
8722
- this.base = base;
8723
- }
8724
- render(status) {
8725
- if (status === "submitted" || status === "aborted") {
8726
- return "";
8727
- }
8728
- const key = this.base.name;
8729
- let text4 = `
8730
- Is ${source_default.bold.blue(key)} ${this.entityType} created or renamed from another ${this.entityType}?
8731
- `;
8732
- const isSelectedRenamed = isRenamePromptItem(
8733
- this.state.items[this.state.selectedIdx]
8734
- );
8735
- const selectedPrefix = isSelectedRenamed ? source_default.yellow("\u276F ") : source_default.green("\u276F ");
8736
- const labelLength = this.state.items.filter((it) => isRenamePromptItem(it)).map((_2) => {
8737
- const it = _2;
8738
- const keyFrom = it.from.name;
8739
- return key.length + 3 + keyFrom.length;
8740
- }).reduce((a, b) => {
8741
- if (a > b) {
8742
- return a;
8743
- }
8744
- return b;
8745
- }, 0);
8746
- const entityType = this.entityType;
8747
- this.state.items.forEach((it, idx) => {
8748
- const isSelected = idx === this.state.selectedIdx;
8749
- const isRenamed = isRenamePromptItem(it);
8750
- const title = isRenamed ? `${it.from.name} \u203A ${it.to.name}`.padEnd(labelLength, " ") : it.name.padEnd(labelLength, " ");
8751
- const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray(`rename ${entityType}`)}` : `${source_default.green("+")} ${title} ${source_default.gray(`create ${entityType}`)}`;
8752
- text4 += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
8753
- text4 += idx != this.state.items.length - 1 ? "\n" : "";
8754
- });
8755
- return text4;
8756
- }
8757
- result() {
8758
- return this.state.items[this.state.selectedIdx];
8759
- }
8760
- };
8761
8674
  ResolveSelect = class extends import_hanji.Prompt {
8762
8675
  constructor(base, data, entityType) {
8763
8676
  super();
@@ -8974,57 +8887,57 @@ var require_heap = __commonJS({
8974
8887
  }
8975
8888
  return [].splice.apply(a, [lo, lo - lo].concat(x)), x;
8976
8889
  };
8977
- heappush = function(array2, item, cmp) {
8890
+ heappush = function(array, item, cmp) {
8978
8891
  if (cmp == null) {
8979
8892
  cmp = defaultCmp;
8980
8893
  }
8981
- array2.push(item);
8982
- return _siftdown(array2, 0, array2.length - 1, cmp);
8894
+ array.push(item);
8895
+ return _siftdown(array, 0, array.length - 1, cmp);
8983
8896
  };
8984
- heappop = function(array2, cmp) {
8897
+ heappop = function(array, cmp) {
8985
8898
  var lastelt, returnitem;
8986
8899
  if (cmp == null) {
8987
8900
  cmp = defaultCmp;
8988
8901
  }
8989
- lastelt = array2.pop();
8990
- if (array2.length) {
8991
- returnitem = array2[0];
8992
- array2[0] = lastelt;
8993
- _siftup(array2, 0, cmp);
8902
+ lastelt = array.pop();
8903
+ if (array.length) {
8904
+ returnitem = array[0];
8905
+ array[0] = lastelt;
8906
+ _siftup(array, 0, cmp);
8994
8907
  } else {
8995
8908
  returnitem = lastelt;
8996
8909
  }
8997
8910
  return returnitem;
8998
8911
  };
8999
- heapreplace = function(array2, item, cmp) {
8912
+ heapreplace = function(array, item, cmp) {
9000
8913
  var returnitem;
9001
8914
  if (cmp == null) {
9002
8915
  cmp = defaultCmp;
9003
8916
  }
9004
- returnitem = array2[0];
9005
- array2[0] = item;
9006
- _siftup(array2, 0, cmp);
8917
+ returnitem = array[0];
8918
+ array[0] = item;
8919
+ _siftup(array, 0, cmp);
9007
8920
  return returnitem;
9008
8921
  };
9009
- heappushpop = function(array2, item, cmp) {
8922
+ heappushpop = function(array, item, cmp) {
9010
8923
  var _ref;
9011
8924
  if (cmp == null) {
9012
8925
  cmp = defaultCmp;
9013
8926
  }
9014
- if (array2.length && cmp(array2[0], item) < 0) {
9015
- _ref = [array2[0], item], item = _ref[0], array2[0] = _ref[1];
9016
- _siftup(array2, 0, cmp);
8927
+ if (array.length && cmp(array[0], item) < 0) {
8928
+ _ref = [array[0], item], item = _ref[0], array[0] = _ref[1];
8929
+ _siftup(array, 0, cmp);
9017
8930
  }
9018
8931
  return item;
9019
8932
  };
9020
- heapify = function(array2, cmp) {
8933
+ heapify = function(array, cmp) {
9021
8934
  var i, _i2, _j2, _len, _ref, _ref1, _results, _results1;
9022
8935
  if (cmp == null) {
9023
8936
  cmp = defaultCmp;
9024
8937
  }
9025
8938
  _ref1 = function() {
9026
8939
  _results1 = [];
9027
- for (var _j3 = 0, _ref2 = floor(array2.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
8940
+ for (var _j3 = 0, _ref2 = floor(array.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
9028
8941
  _results1.push(_j3);
9029
8942
  }
9030
8943
  return _results1;
@@ -9032,51 +8945,51 @@ var require_heap = __commonJS({
9032
8945
  _results = [];
9033
8946
  for (_i2 = 0, _len = _ref1.length; _i2 < _len; _i2++) {
9034
8947
  i = _ref1[_i2];
9035
- _results.push(_siftup(array2, i, cmp));
8948
+ _results.push(_siftup(array, i, cmp));
9036
8949
  }
9037
8950
  return _results;
9038
8951
  };
9039
- updateItem = function(array2, item, cmp) {
8952
+ updateItem = function(array, item, cmp) {
9040
8953
  var pos;
9041
8954
  if (cmp == null) {
9042
8955
  cmp = defaultCmp;
9043
8956
  }
9044
- pos = array2.indexOf(item);
8957
+ pos = array.indexOf(item);
9045
8958
  if (pos === -1) {
9046
8959
  return;
9047
8960
  }
9048
- _siftdown(array2, 0, pos, cmp);
9049
- return _siftup(array2, pos, cmp);
8961
+ _siftdown(array, 0, pos, cmp);
8962
+ return _siftup(array, pos, cmp);
9050
8963
  };
9051
- nlargest = function(array2, n, cmp) {
8964
+ nlargest = function(array, n, cmp) {
9052
8965
  var elem, result, _i2, _len, _ref;
9053
8966
  if (cmp == null) {
9054
8967
  cmp = defaultCmp;
9055
8968
  }
9056
- result = array2.slice(0, n);
8969
+ result = array.slice(0, n);
9057
8970
  if (!result.length) {
9058
8971
  return result;
9059
8972
  }
9060
8973
  heapify(result, cmp);
9061
- _ref = array2.slice(n);
8974
+ _ref = array.slice(n);
9062
8975
  for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
9063
8976
  elem = _ref[_i2];
9064
8977
  heappushpop(result, elem, cmp);
9065
8978
  }
9066
8979
  return result.sort(cmp).reverse();
9067
8980
  };
9068
- nsmallest = function(array2, n, cmp) {
8981
+ nsmallest = function(array, n, cmp) {
9069
8982
  var elem, i, los, result, _i2, _j2, _len, _ref, _ref1, _results;
9070
8983
  if (cmp == null) {
9071
8984
  cmp = defaultCmp;
9072
8985
  }
9073
- if (n * 10 <= array2.length) {
9074
- result = array2.slice(0, n).sort(cmp);
8986
+ if (n * 10 <= array.length) {
8987
+ result = array.slice(0, n).sort(cmp);
9075
8988
  if (!result.length) {
9076
8989
  return result;
9077
8990
  }
9078
8991
  los = result[result.length - 1];
9079
- _ref = array2.slice(n);
8992
+ _ref = array.slice(n);
9080
8993
  for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
9081
8994
  elem = _ref[_i2];
9082
8995
  if (cmp(elem, los) < 0) {
@@ -9087,51 +9000,51 @@ var require_heap = __commonJS({
9087
9000
  }
9088
9001
  return result;
9089
9002
  }
9090
- heapify(array2, cmp);
9003
+ heapify(array, cmp);
9091
9004
  _results = [];
9092
- for (i = _j2 = 0, _ref1 = min2(n, array2.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
9093
- _results.push(heappop(array2, cmp));
9005
+ for (i = _j2 = 0, _ref1 = min2(n, array.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
9006
+ _results.push(heappop(array, cmp));
9094
9007
  }
9095
9008
  return _results;
9096
9009
  };
9097
- _siftdown = function(array2, startpos, pos, cmp) {
9010
+ _siftdown = function(array, startpos, pos, cmp) {
9098
9011
  var newitem, parent, parentpos;
9099
9012
  if (cmp == null) {
9100
9013
  cmp = defaultCmp;
9101
9014
  }
9102
- newitem = array2[pos];
9015
+ newitem = array[pos];
9103
9016
  while (pos > startpos) {
9104
9017
  parentpos = pos - 1 >> 1;
9105
- parent = array2[parentpos];
9018
+ parent = array[parentpos];
9106
9019
  if (cmp(newitem, parent) < 0) {
9107
- array2[pos] = parent;
9020
+ array[pos] = parent;
9108
9021
  pos = parentpos;
9109
9022
  continue;
9110
9023
  }
9111
9024
  break;
9112
9025
  }
9113
- return array2[pos] = newitem;
9026
+ return array[pos] = newitem;
9114
9027
  };
9115
- _siftup = function(array2, pos, cmp) {
9028
+ _siftup = function(array, pos, cmp) {
9116
9029
  var childpos, endpos, newitem, rightpos, startpos;
9117
9030
  if (cmp == null) {
9118
9031
  cmp = defaultCmp;
9119
9032
  }
9120
- endpos = array2.length;
9033
+ endpos = array.length;
9121
9034
  startpos = pos;
9122
- newitem = array2[pos];
9035
+ newitem = array[pos];
9123
9036
  childpos = 2 * pos + 1;
9124
9037
  while (childpos < endpos) {
9125
9038
  rightpos = childpos + 1;
9126
- if (rightpos < endpos && !(cmp(array2[childpos], array2[rightpos]) < 0)) {
9039
+ if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) {
9127
9040
  childpos = rightpos;
9128
9041
  }
9129
- array2[pos] = array2[childpos];
9042
+ array[pos] = array[childpos];
9130
9043
  pos = childpos;
9131
9044
  childpos = 2 * pos + 1;
9132
9045
  }
9133
- array2[pos] = newitem;
9134
- return _siftdown(array2, startpos, pos, cmp);
9046
+ array[pos] = newitem;
9047
+ return _siftdown(array, startpos, pos, cmp);
9135
9048
  };
9136
9049
  Heap = function() {
9137
9050
  Heap2.push = heappush;
@@ -11058,12 +10971,12 @@ var require_lib = __commonJS({
11058
10971
  }
11059
10972
  return bestMatch;
11060
10973
  }
11061
- scalarize(array2, originals, fuzzyOriginals) {
10974
+ scalarize(array, originals, fuzzyOriginals) {
11062
10975
  const fuzzyMatches = [];
11063
10976
  if (fuzzyOriginals) {
11064
10977
  const keyScores = {};
11065
- for (let index4 = 0; index4 < array2.length; index4++) {
11066
- const item = array2[index4];
10978
+ for (let index4 = 0; index4 < array.length; index4++) {
10979
+ const item = array[index4];
11067
10980
  if (this.isScalar(item)) {
11068
10981
  continue;
11069
10982
  }
@@ -11077,8 +10990,8 @@ var require_lib = __commonJS({
11077
10990
  }
11078
10991
  }
11079
10992
  const result = [];
11080
- for (let index4 = 0; index4 < array2.length; index4++) {
11081
- const item = array2[index4];
10993
+ for (let index4 = 0; index4 < array.length; index4++) {
10994
+ const item = array[index4];
11082
10995
  if (this.isScalar(item)) {
11083
10996
  result.push(item);
11084
10997
  } else {
@@ -11300,37 +11213,6 @@ function diffColumns(left, right) {
11300
11213
  );
11301
11214
  return alteredTables;
11302
11215
  }
11303
- function diffPolicies(left, right) {
11304
- left = JSON.parse(JSON.stringify(left));
11305
- right = JSON.parse(JSON.stringify(right));
11306
- const result = (0, import_json_diff.diff)(left, right) ?? {};
11307
- const alteredTables = Object.fromEntries(
11308
- Object.entries(result).filter((it) => {
11309
- return !(it[0].includes("__added") || it[0].includes("__deleted"));
11310
- }).map((tableEntry) => {
11311
- const deletedPolicies = Object.entries(tableEntry[1].policies ?? {}).filter((it) => {
11312
- return it[0].endsWith("__deleted");
11313
- }).map((it) => {
11314
- return it[1];
11315
- });
11316
- const addedPolicies = Object.entries(tableEntry[1].policies ?? {}).filter((it) => {
11317
- return it[0].endsWith("__added");
11318
- }).map((it) => {
11319
- return it[1];
11320
- });
11321
- tableEntry[1].policies = {
11322
- added: addedPolicies,
11323
- deleted: deletedPolicies
11324
- };
11325
- const table4 = left[tableEntry[0]];
11326
- return [
11327
- tableEntry[0],
11328
- { name: table4.name, schema: table4.schema, ...tableEntry[1] }
11329
- ];
11330
- })
11331
- );
11332
- return alteredTables;
11333
- }
11334
11216
  function applyJsonDiff(json1, json22) {
11335
11217
  json1 = JSON.parse(JSON.stringify(json1));
11336
11218
  json22 = JSON.parse(JSON.stringify(json22));
@@ -11340,7 +11222,6 @@ function applyJsonDiff(json1, json22) {
11340
11222
  difference.tables = difference.tables || {};
11341
11223
  difference.enums = difference.enums || {};
11342
11224
  difference.sequences = difference.sequences || {};
11343
- difference.roles = difference.roles || {};
11344
11225
  const schemaKeys = Object.keys(difference.schemas);
11345
11226
  for (let key of schemaKeys) {
11346
11227
  if (key.endsWith("__added") || key.endsWith("__deleted")) {
@@ -11396,10 +11277,6 @@ function applyJsonDiff(json1, json22) {
11396
11277
  const alteredSequences = sequencesEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted")) && "values" in it[1]).map((it) => {
11397
11278
  return json22.sequences[it[0]];
11398
11279
  });
11399
- const rolesEntries = Object.entries(difference.roles);
11400
- const alteredRoles = rolesEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted"))).map((it) => {
11401
- return json22.roles[it[0]];
11402
- });
11403
11280
  const alteredTablesWithColumns = Object.values(difference.tables).map(
11404
11281
  (table4) => {
11405
11282
  return findAlternationsInTable(table4);
@@ -11408,8 +11285,7 @@ function applyJsonDiff(json1, json22) {
11408
11285
  return {
11409
11286
  alteredTablesWithColumns,
11410
11287
  alteredEnums,
11411
- alteredSequences,
11412
- alteredRoles
11288
+ alteredSequences
11413
11289
  };
11414
11290
  }
11415
11291
  var import_json_diff, mapArraysDiff, findAlternationsInTable, alternationsInColumn;
@@ -11469,21 +11345,6 @@ var init_jsonDiffer = __esm({
11469
11345
  return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
11470
11346
  })
11471
11347
  );
11472
- const deletedPolicies = Object.fromEntries(
11473
- Object.entries(table4.policies__deleted || {}).concat(
11474
- Object.entries(table4.policies || {}).filter((it) => it[0].includes("__deleted"))
11475
- ).map((entry) => [entry[0].replace("__deleted", ""), entry[1]])
11476
- );
11477
- const addedPolicies = Object.fromEntries(
11478
- Object.entries(table4.policies__added || {}).concat(
11479
- Object.entries(table4.policies || {}).filter((it) => it[0].includes("__added"))
11480
- ).map((entry) => [entry[0].replace("__added", ""), entry[1]])
11481
- );
11482
- const alteredPolicies = Object.fromEntries(
11483
- Object.entries(table4.policies || {}).filter((it) => {
11484
- return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
11485
- })
11486
- );
11487
11348
  const deletedForeignKeys = Object.fromEntries(
11488
11349
  Object.entries(table4.foreignKeys__deleted || {}).concat(
11489
11350
  Object.entries(table4.foreignKeys || {}).filter((it) => it[0].includes("__deleted"))
@@ -11545,10 +11406,7 @@ var init_jsonDiffer = __esm({
11545
11406
  alteredCompositePKs,
11546
11407
  addedUniqueConstraints,
11547
11408
  deletedUniqueConstraints,
11548
- alteredUniqueConstraints,
11549
- deletedPolicies,
11550
- addedPolicies,
11551
- alteredPolicies
11409
+ alteredUniqueConstraints
11552
11410
  };
11553
11411
  };
11554
11412
  alternationsInColumn = (column4) => {
@@ -11822,7 +11680,7 @@ function fromJson(statements, dialect4, action, json22) {
11822
11680
  }).filter((it) => it !== "");
11823
11681
  return result;
11824
11682
  }
11825
- var pgNativeTypes, isPgNativeType, Convertor, PgCreateRoleConvertor, PgDropRoleConvertor, PgRenameRoleConvertor, PgAlterRoleConvertor, PgCreatePolicyConvertor, PgDropPolicyConvertor, PgRenamePolicyConvertor, PgAlterPolicyConvertor, PgEnableRlsConvertor, PgDisableRlsConvertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, AlterTypeAddValueConvertor, PgDropTableConvertor, MySQLDropTableConvertor, SQLiteDropTableConvertor, PgRenameTableConvertor, SqliteRenameTableConvertor, MySqlRenameTableConvertor, PgAlterTableRenameColumnConvertor, MySqlAlterTableRenameColumnConvertor, SQLiteAlterTableRenameColumnConvertor, PgAlterTableDropColumnConvertor, MySqlAlterTableDropColumnConvertor, SQLiteAlterTableDropColumnConvertor, PgAlterTableAddColumnConvertor, MySqlAlterTableAddColumnConvertor, SQLiteAlterTableAddColumnConvertor, PgAlterTableAlterColumnSetTypeConvertor, PgAlterTableAlterColumnSetDefaultConvertor, PgAlterTableAlterColumnDropDefaultConvertor, PgAlterTableAlterColumnDropGeneratedConvertor, PgAlterTableAlterColumnSetExpressionConvertor, PgAlterTableAlterColumnAlterrGeneratedConvertor, SqliteAlterTableAlterColumnDropGeneratedConvertor, SqliteAlterTableAlterColumnSetExpressionConvertor, SqliteAlterTableAlterColumnAlterGeneratedConvertor, MySqlAlterTableAlterColumnAlterrGeneratedConvertor, MySqlAlterTableAddPk, MySqlAlterTableDropPk, LibSQLModifyColumn, MySqlModifyColumn, PgAlterTableCreateCompositePrimaryKeyConvertor, PgAlterTableDeleteCompositePrimaryKeyConvertor, PgAlterTableAlterCompositePrimaryKeyConvertor, MySqlAlterTableCreateCompositePrimaryKeyConvertor, MySqlAlterTableDeleteCompositePrimaryKeyConvertor, MySqlAlterTableAlterCompositePrimaryKeyConvertor, PgAlterTableAlterColumnSetPrimaryKeyConvertor, PgAlterTableAlterColumnDropPrimaryKeyConvertor, PgAlterTableAlterColumnSetNotNullConvertor, PgAlterTableAlterColumnDropNotNullConvertor, PgCreateForeignKeyConvertor, LibSQLCreateForeignKeyConvertor, MySqlCreateForeignKeyConvertor, PgAlterForeignKeyConvertor, PgDeleteForeignKeyConvertor, MySqlDeleteForeignKeyConvertor, CreatePgIndexConvertor, CreateMySqlIndexConvertor, CreateSqliteIndexConvertor, PgDropIndexConvertor, PgCreateSchemaConvertor, PgRenameSchemaConvertor, PgDropSchemaConvertor, PgAlterTableSetSchemaConvertor, PgAlterTableSetNewSchemaConvertor, PgAlterTableRemoveFromSchemaConvertor, SqliteDropIndexConvertor, MySqlDropIndexConvertor, SQLiteRecreateTableConvertor, LibSQLRecreateTableConvertor, convertors;
11683
+ var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, DropTypeEnumConvertor, AlterTypeAddValueConvertor, AlterTypeSetSchemaConvertor, AlterRenameTypeConvertor, AlterTypeDropValueConvertor, PgDropTableConvertor, MySQLDropTableConvertor, SQLiteDropTableConvertor, PgRenameTableConvertor, SqliteRenameTableConvertor, MySqlRenameTableConvertor, PgAlterTableRenameColumnConvertor, MySqlAlterTableRenameColumnConvertor, SQLiteAlterTableRenameColumnConvertor, PgAlterTableDropColumnConvertor, MySqlAlterTableDropColumnConvertor, SQLiteAlterTableDropColumnConvertor, PgAlterTableAddColumnConvertor, MySqlAlterTableAddColumnConvertor, SQLiteAlterTableAddColumnConvertor, PgAlterTableAlterColumnSetTypeConvertor, PgAlterTableAlterColumnSetDefaultConvertor, PgAlterTableAlterColumnDropDefaultConvertor, PgAlterTableAlterColumnDropGeneratedConvertor, PgAlterTableAlterColumnSetExpressionConvertor, PgAlterTableAlterColumnAlterrGeneratedConvertor, SqliteAlterTableAlterColumnDropGeneratedConvertor, SqliteAlterTableAlterColumnSetExpressionConvertor, SqliteAlterTableAlterColumnAlterGeneratedConvertor, MySqlAlterTableAlterColumnAlterrGeneratedConvertor, MySqlAlterTableAddPk, MySqlAlterTableDropPk, LibSQLModifyColumn, MySqlModifyColumn, PgAlterTableCreateCompositePrimaryKeyConvertor, PgAlterTableDeleteCompositePrimaryKeyConvertor, PgAlterTableAlterCompositePrimaryKeyConvertor, MySqlAlterTableCreateCompositePrimaryKeyConvertor, MySqlAlterTableDeleteCompositePrimaryKeyConvertor, MySqlAlterTableAlterCompositePrimaryKeyConvertor, PgAlterTableAlterColumnSetPrimaryKeyConvertor, PgAlterTableAlterColumnDropPrimaryKeyConvertor, PgAlterTableAlterColumnSetNotNullConvertor, PgAlterTableAlterColumnDropNotNullConvertor, PgCreateForeignKeyConvertor, LibSQLCreateForeignKeyConvertor, MySqlCreateForeignKeyConvertor, PgAlterForeignKeyConvertor, PgDeleteForeignKeyConvertor, MySqlDeleteForeignKeyConvertor, CreatePgIndexConvertor, CreateMySqlIndexConvertor, CreateSqliteIndexConvertor, PgDropIndexConvertor, PgCreateSchemaConvertor, PgRenameSchemaConvertor, PgDropSchemaConvertor, PgAlterTableSetSchemaConvertor, PgAlterTableSetNewSchemaConvertor, PgAlterTableRemoveFromSchemaConvertor, SqliteDropIndexConvertor, MySqlDropIndexConvertor, SQLiteRecreateTableConvertor, LibSQLRecreateTableConvertor, convertors;
11826
11684
  var init_sqlgenerator = __esm({
11827
11685
  "src/sqlgenerator.ts"() {
11828
11686
  "use strict";
@@ -11878,109 +11736,12 @@ var init_sqlgenerator = __esm({
11878
11736
  };
11879
11737
  Convertor = class {
11880
11738
  };
11881
- PgCreateRoleConvertor = class extends Convertor {
11882
- can(statement, dialect4) {
11883
- return statement.type === "create_role" && dialect4 === "postgresql";
11884
- }
11885
- convert(statement) {
11886
- return `CREATE ROLE "${statement.name}"${statement.values.createDb || statement.values.createRole || !statement.values.inherit ? ` WITH${statement.values.createDb ? " CREATEDB" : ""}${statement.values.createRole ? " CREATEROLE" : ""}${statement.values.inherit ? "" : " NOINHERIT"}` : ""};`;
11887
- }
11888
- };
11889
- PgDropRoleConvertor = class extends Convertor {
11890
- can(statement, dialect4) {
11891
- return statement.type === "drop_role" && dialect4 === "postgresql";
11892
- }
11893
- convert(statement) {
11894
- return `DROP ROLE "${statement.name}";`;
11895
- }
11896
- };
11897
- PgRenameRoleConvertor = class extends Convertor {
11898
- can(statement, dialect4) {
11899
- return statement.type === "rename_role" && dialect4 === "postgresql";
11900
- }
11901
- convert(statement) {
11902
- return `ALTER ROLE "${statement.nameFrom}" RENAME TO "${statement.nameTo}";`;
11903
- }
11904
- };
11905
- PgAlterRoleConvertor = class extends Convertor {
11906
- can(statement, dialect4) {
11907
- return statement.type === "alter_role" && dialect4 === "postgresql";
11908
- }
11909
- convert(statement) {
11910
- return `ALTER ROLE "${statement.name}"${` WITH${statement.values.createDb ? " CREATEDB" : " NOCREATEDB"}${statement.values.createRole ? " CREATEROLE" : " NOCREATEROLE"}${statement.values.inherit ? " INHERIT" : " NOINHERIT"}`};`;
11911
- }
11912
- };
11913
- PgCreatePolicyConvertor = class extends Convertor {
11914
- can(statement, dialect4) {
11915
- return statement.type === "create_policy" && dialect4 === "postgresql";
11916
- }
11917
- convert(statement) {
11918
- const policy2 = statement.data;
11919
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11920
- const usingPart = policy2.using ? ` USING (${policy2.using})` : "";
11921
- const withCheckPart = policy2.withCheck ? ` WITH CHECK (${policy2.withCheck})` : "";
11922
- const policyToPart = policy2.to?.map(
11923
- (v) => ["current_user", "current_role", "session_user", "public"].includes(v) ? v : `"${v}"`
11924
- ).join(", ");
11925
- return `CREATE POLICY "${policy2.name}" ON ${tableNameWithSchema} AS ${policy2.as?.toUpperCase()} FOR ${policy2.for?.toUpperCase()} TO ${policyToPart}${usingPart}${withCheckPart};`;
11926
- }
11927
- };
11928
- PgDropPolicyConvertor = class extends Convertor {
11929
- can(statement, dialect4) {
11930
- return statement.type === "drop_policy" && dialect4 === "postgresql";
11931
- }
11932
- convert(statement) {
11933
- const policy2 = statement.data;
11934
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11935
- return `DROP POLICY "${policy2.name}" ON ${tableNameWithSchema} CASCADE;`;
11936
- }
11937
- };
11938
- PgRenamePolicyConvertor = class extends Convertor {
11939
- can(statement, dialect4) {
11940
- return statement.type === "rename_policy" && dialect4 === "postgresql";
11941
- }
11942
- convert(statement) {
11943
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11944
- return `ALTER POLICY "${statement.oldName}" ON ${tableNameWithSchema} RENAME TO "${statement.newName}";`;
11945
- }
11946
- };
11947
- PgAlterPolicyConvertor = class extends Convertor {
11948
- can(statement, dialect4) {
11949
- return statement.type === "alter_policy" && dialect4 === "postgresql";
11950
- }
11951
- convert(statement) {
11952
- const newPolicy = PgSquasher.unsquashPolicy(statement.newData);
11953
- const oldPolicy = PgSquasher.unsquashPolicy(statement.oldData);
11954
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11955
- const usingPart = newPolicy.using ? ` USING (${newPolicy.using})` : oldPolicy.using ? ` USING (${oldPolicy.using})` : "";
11956
- const withCheckPart = newPolicy.withCheck ? ` WITH CHECK (${newPolicy.withCheck})` : oldPolicy.withCheck ? ` WITH CHECK (${oldPolicy.withCheck})` : "";
11957
- return `ALTER POLICY "${oldPolicy.name}" ON ${tableNameWithSchema} TO ${newPolicy.to}${usingPart}${withCheckPart};`;
11958
- }
11959
- };
11960
- PgEnableRlsConvertor = class extends Convertor {
11961
- can(statement, dialect4) {
11962
- return statement.type === "enable_rls" && dialect4 === "postgresql";
11963
- }
11964
- convert(statement) {
11965
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11966
- return `ALTER TABLE ${tableNameWithSchema} ENABLE ROW LEVEL SECURITY;`;
11967
- }
11968
- };
11969
- PgDisableRlsConvertor = class extends Convertor {
11970
- can(statement, dialect4) {
11971
- return statement.type === "disable_rls" && dialect4 === "postgresql";
11972
- }
11973
- convert(statement) {
11974
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11975
- return `ALTER TABLE ${tableNameWithSchema} DISABLE ROW LEVEL SECURITY;`;
11976
- }
11977
- };
11978
11739
  PgCreateTableConvertor = class extends Convertor {
11979
11740
  can(statement, dialect4) {
11980
11741
  return statement.type === "create_table" && dialect4 === "postgresql";
11981
11742
  }
11982
11743
  convert(st) {
11983
- const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints, policies } = st;
11744
+ const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
11984
11745
  let statement = "";
11985
11746
  const name2 = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
11986
11747
  statement += `CREATE TABLE IF NOT EXISTS ${name2} (
@@ -12017,12 +11778,7 @@ var init_sqlgenerator = __esm({
12017
11778
  );`;
12018
11779
  statement += `
12019
11780
  `;
12020
- const enableRls = new PgEnableRlsConvertor().convert({
12021
- type: "enable_rls",
12022
- tableName,
12023
- schema: schema4
12024
- });
12025
- return [statement, ...policies && policies.length > 0 ? [enableRls] : []];
11781
+ return statement;
12026
11782
  }
12027
11783
  };
12028
11784
  MySqlCreateTableConvertor = class extends Convertor {
@@ -12305,20 +12061,22 @@ var init_sqlgenerator = __esm({
12305
12061
  }
12306
12062
  convert(st) {
12307
12063
  const { name: name2, values, schema: schema4 } = st;
12308
- const tableNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12064
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12309
12065
  let valuesStatement = "(";
12310
12066
  valuesStatement += values.map((it) => `'${it}'`).join(", ");
12311
12067
  valuesStatement += ")";
12312
- let statement = "DO $$ BEGIN";
12313
- statement += "\n";
12314
- statement += ` CREATE TYPE ${tableNameWithSchema} AS ENUM${valuesStatement};`;
12315
- statement += "\n";
12316
- statement += "EXCEPTION";
12317
- statement += "\n";
12318
- statement += " WHEN duplicate_object THEN null;";
12319
- statement += "\n";
12320
- statement += "END $$;";
12321
- statement += "\n";
12068
+ let statement = `CREATE TYPE ${enumNameWithSchema} AS ENUM${valuesStatement};`;
12069
+ return statement;
12070
+ }
12071
+ };
12072
+ DropTypeEnumConvertor = class extends Convertor {
12073
+ can(statement) {
12074
+ return statement.type === "drop_type_enum";
12075
+ }
12076
+ convert(st) {
12077
+ const { name: name2, schema: schema4 } = st;
12078
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12079
+ let statement = `DROP TYPE ${enumNameWithSchema};`;
12322
12080
  return statement;
12323
12081
  }
12324
12082
  };
@@ -12327,9 +12085,56 @@ var init_sqlgenerator = __esm({
12327
12085
  return statement.type === "alter_type_add_value";
12328
12086
  }
12329
12087
  convert(st) {
12330
- const { name: name2, schema: schema4, value } = st;
12331
- const schemaPrefix = schema4 && schema4 !== "public" ? `"${schema4}".` : "";
12332
- return `ALTER TYPE ${schemaPrefix}"${name2}" ADD VALUE '${value}';`;
12088
+ const { name: name2, schema: schema4, value, before } = st;
12089
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12090
+ return `ALTER TYPE ${enumNameWithSchema} ADD VALUE '${value}'${before.length ? ` BEFORE '${before}'` : ""};`;
12091
+ }
12092
+ };
12093
+ AlterTypeSetSchemaConvertor = class extends Convertor {
12094
+ can(statement) {
12095
+ return statement.type === "move_type_enum";
12096
+ }
12097
+ convert(st) {
12098
+ const { name: name2, schemaFrom, schemaTo } = st;
12099
+ const enumNameWithSchema = schemaFrom ? `"${schemaFrom}"."${name2}"` : `"${name2}"`;
12100
+ return `ALTER TYPE ${enumNameWithSchema} SET SCHEMA "${schemaTo}";`;
12101
+ }
12102
+ };
12103
+ AlterRenameTypeConvertor = class extends Convertor {
12104
+ can(statement) {
12105
+ return statement.type === "rename_type_enum";
12106
+ }
12107
+ convert(st) {
12108
+ const { nameTo, nameFrom, schema: schema4 } = st;
12109
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${nameFrom}"` : `"${nameFrom}"`;
12110
+ return `ALTER TYPE ${enumNameWithSchema} RENAME TO "${nameTo}";`;
12111
+ }
12112
+ };
12113
+ AlterTypeDropValueConvertor = class extends Convertor {
12114
+ can(statement) {
12115
+ return statement.type === "alter_type_drop_value";
12116
+ }
12117
+ convert(st) {
12118
+ const { columnsWithEnum, name: name2, newValues, schema: schema4 } = st;
12119
+ const statements = [];
12120
+ for (const withEnum of columnsWithEnum) {
12121
+ statements.push(
12122
+ `ALTER TABLE "${withEnum.schema}"."${withEnum.table}" ALTER COLUMN "${withEnum.column}" SET DATA TYPE text;`
12123
+ );
12124
+ }
12125
+ statements.push(new DropTypeEnumConvertor().convert({ name: name2, schema: schema4, type: "drop_type_enum" }));
12126
+ statements.push(new CreateTypeEnumConvertor().convert({
12127
+ name: name2,
12128
+ schema: schema4,
12129
+ values: newValues,
12130
+ type: "create_type_enum"
12131
+ }));
12132
+ for (const withEnum of columnsWithEnum) {
12133
+ statements.push(
12134
+ `ALTER TABLE "${withEnum.schema}"."${withEnum.table}" ALTER COLUMN "${withEnum.column}" SET DATA TYPE "${schema4}"."${name2}" USING "${withEnum.column}"::"${schema4}"."${name2}";`
12135
+ );
12136
+ }
12137
+ return statements;
12333
12138
  }
12334
12139
  };
12335
12140
  PgDropTableConvertor = class extends Convertor {
@@ -12337,21 +12142,9 @@ var init_sqlgenerator = __esm({
12337
12142
  return statement.type === "drop_table" && dialect4 === "postgresql";
12338
12143
  }
12339
12144
  convert(statement) {
12340
- const { tableName, schema: schema4, policies } = statement;
12145
+ const { tableName, schema: schema4 } = statement;
12341
12146
  const tableNameWithSchema = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
12342
- const dropPolicyConvertor = new PgDropPolicyConvertor();
12343
- const droppedPolicies = policies?.map((p) => {
12344
- return dropPolicyConvertor.convert({
12345
- type: "drop_policy",
12346
- tableName,
12347
- data: PgSquasher.unsquashPolicy(p),
12348
- schema: schema4
12349
- });
12350
- }) ?? [];
12351
- return [
12352
- ...droppedPolicies,
12353
- `DROP TABLE ${tableNameWithSchema};`
12354
- ];
12147
+ return `DROP TABLE ${tableNameWithSchema};`;
12355
12148
  }
12356
12149
  };
12357
12150
  MySQLDropTableConvertor = class extends Convertor {
@@ -13485,6 +13278,11 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
13485
13278
  convertors.push(new SQLiteRecreateTableConvertor());
13486
13279
  convertors.push(new LibSQLRecreateTableConvertor());
13487
13280
  convertors.push(new CreateTypeEnumConvertor());
13281
+ convertors.push(new DropTypeEnumConvertor());
13282
+ convertors.push(new AlterTypeAddValueConvertor());
13283
+ convertors.push(new AlterTypeSetSchemaConvertor());
13284
+ convertors.push(new AlterRenameTypeConvertor());
13285
+ convertors.push(new AlterTypeDropValueConvertor());
13488
13286
  convertors.push(new CreatePgSequenceConvertor());
13489
13287
  convertors.push(new DropPgSequenceConvertor());
13490
13288
  convertors.push(new RenamePgSequenceConvertor());
@@ -13516,23 +13314,12 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
13516
13314
  convertors.push(new PgDropIndexConvertor());
13517
13315
  convertors.push(new SqliteDropIndexConvertor());
13518
13316
  convertors.push(new MySqlDropIndexConvertor());
13519
- convertors.push(new AlterTypeAddValueConvertor());
13520
13317
  convertors.push(new PgAlterTableAlterColumnSetPrimaryKeyConvertor());
13521
13318
  convertors.push(new PgAlterTableAlterColumnDropPrimaryKeyConvertor());
13522
13319
  convertors.push(new PgAlterTableAlterColumnSetNotNullConvertor());
13523
13320
  convertors.push(new PgAlterTableAlterColumnDropNotNullConvertor());
13524
13321
  convertors.push(new PgAlterTableAlterColumnSetDefaultConvertor());
13525
13322
  convertors.push(new PgAlterTableAlterColumnDropDefaultConvertor());
13526
- convertors.push(new PgAlterPolicyConvertor());
13527
- convertors.push(new PgCreatePolicyConvertor());
13528
- convertors.push(new PgDropPolicyConvertor());
13529
- convertors.push(new PgRenamePolicyConvertor());
13530
- convertors.push(new PgEnableRlsConvertor());
13531
- convertors.push(new PgDisableRlsConvertor());
13532
- convertors.push(new PgDropRoleConvertor());
13533
- convertors.push(new PgAlterRoleConvertor());
13534
- convertors.push(new PgCreateRoleConvertor());
13535
- convertors.push(new PgRenameRoleConvertor());
13536
13323
  convertors.push(new PgAlterTableAlterColumnSetExpressionConvertor());
13537
13324
  convertors.push(new PgAlterTableAlterColumnDropGeneratedConvertor());
13538
13325
  convertors.push(new PgAlterTableAlterColumnAlterrGeneratedConvertor());
@@ -13827,7 +13614,7 @@ var init_sqlitePushUtils = __esm({
13827
13614
  });
13828
13615
 
13829
13616
  // src/jsonStatements.ts
13830
- var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateRoleJson, prepareAlterRoleJson, prepareDropRoleJson, prepareRenameRoleJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, prepareRenamePolicyJsons, prepareCreatePolicyJsons, prepareDropPolicyJsons, prepareAlterPolicyJson, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
13617
+ var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumValues, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
13831
13618
  var init_jsonStatements = __esm({
13832
13619
  "src/jsonStatements.ts"() {
13833
13620
  "use strict";
@@ -13838,7 +13625,7 @@ var init_jsonStatements = __esm({
13838
13625
  init_pgSchema();
13839
13626
  init_sqliteSchema();
13840
13627
  preparePgCreateTableJson = (table4, json22) => {
13841
- const { name: name2, schema: schema4, columns, compositePrimaryKeys, uniqueConstraints, policies } = table4;
13628
+ const { name: name2, schema: schema4, columns, compositePrimaryKeys, uniqueConstraints } = table4;
13842
13629
  const tableKey2 = `${schema4 || "public"}.${name2}`;
13843
13630
  const compositePkName = Object.values(compositePrimaryKeys).length > 0 ? json22.tables[tableKey2].compositePrimaryKeys[`${PgSquasher.unsquashPK(Object.values(compositePrimaryKeys)[0]).name}`].name : "";
13844
13631
  return {
@@ -13848,8 +13635,7 @@ var init_jsonStatements = __esm({
13848
13635
  columns: Object.values(columns),
13849
13636
  compositePKs: Object.values(compositePrimaryKeys),
13850
13637
  compositePkName,
13851
- uniqueConstraints: Object.values(uniqueConstraints),
13852
- policies: Object.values(policies)
13638
+ uniqueConstraints: Object.values(uniqueConstraints)
13853
13639
  };
13854
13640
  };
13855
13641
  prepareMySqlCreateTableJson = (table4, json22, internals) => {
@@ -13887,8 +13673,7 @@ var init_jsonStatements = __esm({
13887
13673
  return {
13888
13674
  type: "drop_table",
13889
13675
  tableName: table4.name,
13890
- schema: table4.schema,
13891
- policies: table4.policies ? Object.values(table4.policies) : []
13676
+ schema: table4.schema
13892
13677
  };
13893
13678
  };
13894
13679
  prepareRenameTableJson = (tableFrom, tableTo) => {
@@ -13919,6 +13704,27 @@ var init_jsonStatements = __esm({
13919
13704
  };
13920
13705
  });
13921
13706
  };
13707
+ prepareDropEnumValues = (name2, schema4, removedValues, json22) => {
13708
+ if (!removedValues.length) return [];
13709
+ const affectedColumns = [];
13710
+ for (const tableKey2 in json22.tables) {
13711
+ const table4 = json22.tables[tableKey2];
13712
+ for (const columnKey in table4.columns) {
13713
+ const column4 = table4.columns[columnKey];
13714
+ if (column4.type === name2 && column4.typeSchema === schema4) {
13715
+ affectedColumns.push({ schema: table4.schema || "public", table: table4.name, column: column4.name });
13716
+ }
13717
+ }
13718
+ }
13719
+ return [{
13720
+ type: "alter_type_drop_value",
13721
+ name: name2,
13722
+ schema: schema4,
13723
+ deletedValues: removedValues,
13724
+ newValues: json22.enums[`${schema4}.${name2}`].values,
13725
+ columnsWithEnum: affectedColumns
13726
+ }];
13727
+ };
13922
13728
  prepareDropEnumJson = (name2, schema4) => {
13923
13729
  return {
13924
13730
  type: "drop_type_enum",
@@ -13985,41 +13791,6 @@ var init_jsonStatements = __esm({
13985
13791
  schema: schema4
13986
13792
  };
13987
13793
  };
13988
- prepareCreateRoleJson = (role) => {
13989
- return {
13990
- type: "create_role",
13991
- name: role.name,
13992
- values: {
13993
- createDb: role.createDb,
13994
- createRole: role.createRole,
13995
- inherit: role.inherit
13996
- }
13997
- };
13998
- };
13999
- prepareAlterRoleJson = (role) => {
14000
- return {
14001
- type: "alter_role",
14002
- name: role.name,
14003
- values: {
14004
- createDb: role.createDb,
14005
- createRole: role.createRole,
14006
- inherit: role.inherit
14007
- }
14008
- };
14009
- };
14010
- prepareDropRoleJson = (name2) => {
14011
- return {
14012
- type: "drop_role",
14013
- name: name2
14014
- };
14015
- };
14016
- prepareRenameRoleJson = (nameFrom, nameTo) => {
14017
- return {
14018
- type: "rename_role",
14019
- nameFrom,
14020
- nameTo
14021
- };
14022
- };
14023
13794
  prepareCreateSchemasJson = (values) => {
14024
13795
  return values.map((it) => {
14025
13796
  return {
@@ -14916,46 +14687,6 @@ var init_jsonStatements = __esm({
14916
14687
  }
14917
14688
  return [...dropPkStatements, ...setPkStatements, ...statements];
14918
14689
  };
14919
- prepareRenamePolicyJsons = (tableName, schema4, renames) => {
14920
- return renames.map((it) => {
14921
- return {
14922
- type: "rename_policy",
14923
- tableName,
14924
- oldName: it.from.name,
14925
- newName: it.to.name,
14926
- schema: schema4
14927
- };
14928
- });
14929
- };
14930
- prepareCreatePolicyJsons = (tableName, schema4, policies) => {
14931
- return policies.map((it) => {
14932
- return {
14933
- type: "create_policy",
14934
- tableName,
14935
- data: it,
14936
- schema: schema4
14937
- };
14938
- });
14939
- };
14940
- prepareDropPolicyJsons = (tableName, schema4, policies) => {
14941
- return policies.map((it) => {
14942
- return {
14943
- type: "drop_policy",
14944
- tableName,
14945
- data: it,
14946
- schema: schema4
14947
- };
14948
- });
14949
- };
14950
- prepareAlterPolicyJson = (tableName, schema4, oldPolicy, newPolicy) => {
14951
- return {
14952
- type: "alter_policy",
14953
- tableName,
14954
- oldData: oldPolicy,
14955
- newData: newPolicy,
14956
- schema: schema4
14957
- };
14958
- };
14959
14690
  preparePgCreateIndexesJson = (tableName, schema4, indexes, fullSchema, action) => {
14960
14691
  if (action === "push") {
14961
14692
  return Object.values(indexes).map((indexData) => {
@@ -15661,8 +15392,7 @@ var init_snapshotsDiffer = __esm({
15661
15392
  indexes: recordType(stringType(), stringType()),
15662
15393
  foreignKeys: recordType(stringType(), stringType()),
15663
15394
  compositePrimaryKeys: recordType(stringType(), stringType()).default({}),
15664
- uniqueConstraints: recordType(stringType(), stringType()).default({}),
15665
- policies: recordType(stringType(), stringType()).default({})
15395
+ uniqueConstraints: recordType(stringType(), stringType()).default({})
15666
15396
  }).strict();
15667
15397
  alteredTableScheme = objectType({
15668
15398
  name: stringType(),
@@ -15703,22 +15433,12 @@ var init_snapshotsDiffer = __esm({
15703
15433
  __new: stringType(),
15704
15434
  __old: stringType()
15705
15435
  })
15706
- ),
15707
- addedPolicies: recordType(stringType(), stringType()),
15708
- deletedPolicies: recordType(stringType(), stringType()),
15709
- alteredPolicies: recordType(
15710
- stringType(),
15711
- objectType({
15712
- __new: stringType(),
15713
- __old: stringType()
15714
- })
15715
15436
  )
15716
15437
  }).strict();
15717
15438
  diffResultScheme = objectType({
15718
15439
  alteredTablesWithColumns: alteredTableScheme.array(),
15719
15440
  alteredEnums: changedEnumSchema.array(),
15720
- alteredSequences: sequenceSquashed.array(),
15721
- alteredRoles: roleSchema.array()
15441
+ alteredSequences: sequenceSquashed.array()
15722
15442
  }).strict();
15723
15443
  diffResultSchemeMysql = objectType({
15724
15444
  alteredTablesWithColumns: alteredTableScheme.array(),
@@ -15773,7 +15493,7 @@ var init_snapshotsDiffer = __esm({
15773
15493
  }
15774
15494
  return column4;
15775
15495
  };
15776
- applyPgSnapshotsDiff = async (json1, json22, schemasResolver2, enumsResolver2, sequencesResolver2, policyResolver2, roleResolver2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
15496
+ applyPgSnapshotsDiff = async (json1, json22, schemasResolver2, enumsResolver2, sequencesResolver2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
15777
15497
  const schemasDiff = diffSchemasOrTables(json1.schemas, json22.schemas);
15778
15498
  const {
15779
15499
  created: createdSchemas,
@@ -15923,47 +15643,6 @@ var init_snapshotsDiffer = __esm({
15923
15643
  return [tableKey2, tableValue];
15924
15644
  }
15925
15645
  );
15926
- const rolesDiff = diffSchemasOrTables(
15927
- schemasPatchedSnap1.roles,
15928
- json22.roles
15929
- );
15930
- const {
15931
- created: createdRoles,
15932
- deleted: deletedRoles,
15933
- renamed: renamedRoles
15934
- } = await roleResolver2({
15935
- created: rolesDiff.added,
15936
- deleted: rolesDiff.deleted
15937
- });
15938
- schemasPatchedSnap1.roles = mapEntries(
15939
- schemasPatchedSnap1.roles,
15940
- (_2, it) => {
15941
- const { name: name2 } = nameChangeFor(it, renamedRoles);
15942
- it.name = name2;
15943
- return [name2, it];
15944
- }
15945
- );
15946
- const rolesChangeMap = renamedRoles.reduce(
15947
- (acc, it) => {
15948
- acc[it.from.name] = {
15949
- nameFrom: it.from.name,
15950
- nameTo: it.to.name
15951
- };
15952
- return acc;
15953
- },
15954
- {}
15955
- );
15956
- schemasPatchedSnap1.roles = mapEntries(
15957
- schemasPatchedSnap1.roles,
15958
- (roleKey, roleValue) => {
15959
- const key = roleKey;
15960
- const change = rolesChangeMap[key];
15961
- if (change) {
15962
- roleValue.name = change.nameTo;
15963
- }
15964
- return [roleKey, roleValue];
15965
- }
15966
- );
15967
15646
  const tablesDiff = diffSchemasOrTables(
15968
15647
  schemasPatchedSnap1.tables,
15969
15648
  json22.tables
@@ -16042,65 +15721,6 @@ var init_snapshotsDiffer = __esm({
16042
15721
  return [tableKey2, tableValue];
16043
15722
  }
16044
15723
  );
16045
- const policyRes = diffPolicies(tablesPatchedSnap1.tables, json22.tables);
16046
- const policyRenames = [];
16047
- const policyCreates = [];
16048
- const policyDeletes = [];
16049
- for (let entry of Object.values(policyRes)) {
16050
- const { renamed, created, deleted } = await policyResolver2({
16051
- tableName: entry.name,
16052
- schema: entry.schema,
16053
- deleted: entry.policies.deleted.map(PgSquasher.unsquashPolicy),
16054
- created: entry.policies.added.map(PgSquasher.unsquashPolicy)
16055
- });
16056
- if (created.length > 0) {
16057
- policyCreates.push({
16058
- table: entry.name,
16059
- schema: entry.schema,
16060
- columns: created
16061
- });
16062
- }
16063
- if (deleted.length > 0) {
16064
- policyDeletes.push({
16065
- table: entry.name,
16066
- schema: entry.schema,
16067
- columns: deleted
16068
- });
16069
- }
16070
- if (renamed.length > 0) {
16071
- policyRenames.push({
16072
- table: entry.name,
16073
- schema: entry.schema,
16074
- renames: renamed
16075
- });
16076
- }
16077
- }
16078
- const policyRenamesDict = columnRenames.reduce(
16079
- (acc, it) => {
16080
- acc[`${it.schema || "public"}.${it.table}`] = it.renames;
16081
- return acc;
16082
- },
16083
- {}
16084
- );
16085
- const policyPatchedSnap1 = copy(tablesPatchedSnap1);
16086
- policyPatchedSnap1.tables = mapEntries(
16087
- policyPatchedSnap1.tables,
16088
- (tableKey2, tableValue) => {
16089
- const patchedPolicies = mapKeys(
16090
- tableValue.policies,
16091
- (policyKey, policy2) => {
16092
- const rens = policyRenamesDict[`${tableValue.schema || "public"}.${tableValue.name}`] || [];
16093
- const newName = columnChangeFor(policyKey, rens);
16094
- const unsquashedPolicy = PgSquasher.unsquashPolicy(policy2);
16095
- unsquashedPolicy.name = newName;
16096
- policy2 = PgSquasher.squashPolicy(unsquashedPolicy);
16097
- return newName;
16098
- }
16099
- );
16100
- tableValue.policies = patchedPolicies;
16101
- return [tableKey2, tableValue];
16102
- }
16103
- );
16104
15724
  const diffResult = applyJsonDiff(columnsPatchedSnap1, json22);
16105
15725
  const typedResult = diffResultScheme.parse(diffResult);
16106
15726
  const jsonStatements = [];
@@ -16145,15 +15765,13 @@ var init_snapshotsDiffer = __esm({
16145
15765
  const jsonDeletedUniqueConstraints = [];
16146
15766
  const jsonAlteredUniqueConstraints = [];
16147
15767
  const jsonSetTableSchemas = [];
16148
- if (movedTables) {
16149
- for (let it of movedTables) {
16150
- jsonSetTableSchemas.push({
16151
- type: "alter_table_set_schema",
16152
- tableName: it.name,
16153
- schemaFrom: it.schemaFrom || "public",
16154
- schemaTo: it.schemaTo || "public"
16155
- });
16156
- }
15768
+ for (let it of movedTables) {
15769
+ jsonSetTableSchemas.push({
15770
+ type: "alter_table_set_schema",
15771
+ tableName: it.name,
15772
+ schemaFrom: it.schemaFrom || "public",
15773
+ schemaTo: it.schemaTo || "public"
15774
+ });
16157
15775
  }
16158
15776
  for (let it of alteredTables) {
16159
15777
  let addedColumns = [];
@@ -16258,99 +15876,7 @@ var init_snapshotsDiffer = __esm({
16258
15876
  it.deletedIndexes || {}
16259
15877
  );
16260
15878
  }).flat();
16261
- const jsonCreatePoliciesStatements = [];
16262
- const jsonDropPoliciesStatements = [];
16263
- const jsonAlterPoliciesStatements = [];
16264
- const jsonRenamePoliciesStatements = [];
16265
- const jsonEnableRLSStatements = [];
16266
- const jsonDisableRLSStatements = [];
16267
- for (let it of policyRenames) {
16268
- jsonRenamePoliciesStatements.push(
16269
- ...prepareRenamePolicyJsons(it.table, it.schema, it.renames)
16270
- );
16271
- }
16272
- for (const it of policyCreates) {
16273
- jsonCreatePoliciesStatements.push(
16274
- ...prepareCreatePolicyJsons(
16275
- it.table,
16276
- it.schema,
16277
- it.columns
16278
- )
16279
- );
16280
- }
16281
- for (const it of policyDeletes) {
16282
- jsonDropPoliciesStatements.push(
16283
- ...prepareDropPolicyJsons(
16284
- it.table,
16285
- it.schema,
16286
- it.columns
16287
- )
16288
- );
16289
- }
16290
15879
  alteredTables.forEach((it) => {
16291
- Object.keys(it.alteredPolicies).forEach((policyName) => {
16292
- const newPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__new);
16293
- const oldPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__old);
16294
- if (newPolicy.as !== oldPolicy.as) {
16295
- jsonDropPoliciesStatements.push(
16296
- ...prepareDropPolicyJsons(
16297
- it.name,
16298
- it.schema,
16299
- [oldPolicy]
16300
- )
16301
- );
16302
- jsonCreatePoliciesStatements.push(
16303
- ...prepareCreatePolicyJsons(
16304
- it.name,
16305
- it.schema,
16306
- [newPolicy]
16307
- )
16308
- );
16309
- return;
16310
- }
16311
- if (newPolicy.for !== oldPolicy.for) {
16312
- jsonDropPoliciesStatements.push(
16313
- ...prepareDropPolicyJsons(
16314
- it.name,
16315
- it.schema,
16316
- [oldPolicy]
16317
- )
16318
- );
16319
- jsonCreatePoliciesStatements.push(
16320
- ...prepareCreatePolicyJsons(
16321
- it.name,
16322
- it.schema,
16323
- [newPolicy]
16324
- )
16325
- );
16326
- return;
16327
- }
16328
- jsonAlterPoliciesStatements.push(
16329
- prepareAlterPolicyJson(
16330
- it.name,
16331
- it.schema,
16332
- it.alteredPolicies[policyName].__old,
16333
- it.alteredPolicies[policyName].__new
16334
- )
16335
- );
16336
- });
16337
- for (const table4 of Object.values(json22.tables)) {
16338
- const policiesInCurrentState = Object.keys(table4.policies);
16339
- const tableInPreviousState = columnsPatchedSnap1.tables[`${table4.schema === "" ? "public" : table4.schema}.${table4.name}`];
16340
- const policiesInPreviousState = tableInPreviousState ? Object.keys(tableInPreviousState.policies) : [];
16341
- if (policiesInPreviousState.length === 0 && policiesInCurrentState.length > 0) {
16342
- jsonEnableRLSStatements.push({ type: "enable_rls", tableName: table4.name, schema: table4.schema });
16343
- }
16344
- if (policiesInPreviousState.length > 0 && policiesInCurrentState.length === 0) {
16345
- jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
16346
- }
16347
- }
16348
- for (const table4 of Object.values(columnsPatchedSnap1.tables)) {
16349
- const tableInCurrentState = json22.tables[`${table4.schema === "" ? "public" : table4.schema}.${table4.name}`];
16350
- if (tableInCurrentState === void 0) {
16351
- jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
16352
- }
16353
- }
16354
15880
  const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
16355
15881
  (current, item) => {
16356
15882
  current[item] = it.alteredIndexes[item].__old;
@@ -16420,6 +15946,9 @@ var init_snapshotsDiffer = __esm({
16420
15946
  const jsonAlterEnumsWithAddedValues = typedResult.alteredEnums.map((it) => {
16421
15947
  return prepareAddValuesToEnumJson(it.name, it.schema, it.addedValues);
16422
15948
  }).flat() ?? [];
15949
+ const jsonAlterEnumsWithDroppedValues = typedResult.alteredEnums.map((it) => {
15950
+ return prepareDropEnumValues(it.name, it.schema, it.deletedValues, curFull);
15951
+ }).flat() ?? [];
16423
15952
  const createSequences = createdSequences.map((it) => {
16424
15953
  return prepareCreateSequenceJson(it);
16425
15954
  }) ?? [];
@@ -16435,18 +15964,6 @@ var init_snapshotsDiffer = __esm({
16435
15964
  const jsonAlterSequences = typedResult.alteredSequences.map((it) => {
16436
15965
  return prepareAlterSequenceJson(it);
16437
15966
  }).flat() ?? [];
16438
- const createRoles = createdRoles.map((it) => {
16439
- return prepareCreateRoleJson(it);
16440
- }) ?? [];
16441
- const dropRoles = deletedRoles.map((it) => {
16442
- return prepareDropRoleJson(it.name);
16443
- });
16444
- const renameRoles = renamedRoles.map((it) => {
16445
- return prepareRenameRoleJson(it.from.name, it.to.name);
16446
- });
16447
- const jsonAlterRoles = typedResult.alteredRoles.map((it) => {
16448
- return prepareAlterRoleJson(it);
16449
- }).flat() ?? [];
16450
15967
  const createSchemas = prepareCreateSchemasJson(
16451
15968
  createdSchemas.map((it) => it.name)
16452
15969
  );
@@ -16459,11 +15976,6 @@ var init_snapshotsDiffer = __esm({
16459
15976
  const createTables = createdTables.map((it) => {
16460
15977
  return preparePgCreateTableJson(it, curFull);
16461
15978
  });
16462
- jsonCreatePoliciesStatements.push(...[].concat(
16463
- ...createdTables.map(
16464
- (it) => prepareCreatePolicyJsons(it.name, it.schema, Object.values(it.policies).map(PgSquasher.unsquashPolicy))
16465
- )
16466
- ));
16467
15979
  jsonStatements.push(...createSchemas);
16468
15980
  jsonStatements.push(...renameSchemas);
16469
15981
  jsonStatements.push(...createEnums);
@@ -16474,13 +15986,7 @@ var init_snapshotsDiffer = __esm({
16474
15986
  jsonStatements.push(...moveSequences);
16475
15987
  jsonStatements.push(...renameSequences);
16476
15988
  jsonStatements.push(...jsonAlterSequences);
16477
- jsonStatements.push(...renameRoles);
16478
- jsonStatements.push(...dropRoles);
16479
- jsonStatements.push(...createRoles);
16480
- jsonStatements.push(...jsonAlterRoles);
16481
15989
  jsonStatements.push(...createTables);
16482
- jsonStatements.push(...jsonEnableRLSStatements);
16483
- jsonStatements.push(...jsonDisableRLSStatements);
16484
15990
  jsonStatements.push(...jsonDropTables);
16485
15991
  jsonStatements.push(...jsonSetTableSchemas);
16486
15992
  jsonStatements.push(...jsonRenameTables);
@@ -16500,10 +16006,7 @@ var init_snapshotsDiffer = __esm({
16500
16006
  jsonStatements.push(...jsonAlteredCompositePKs);
16501
16007
  jsonStatements.push(...jsonAddedUniqueConstraints);
16502
16008
  jsonStatements.push(...jsonAlteredUniqueConstraints);
16503
- jsonStatements.push(...jsonRenamePoliciesStatements);
16504
- jsonStatements.push(...jsonDropPoliciesStatements);
16505
- jsonStatements.push(...jsonCreatePoliciesStatements);
16506
- jsonStatements.push(...jsonAlterPoliciesStatements);
16009
+ jsonStatements.push(...jsonAlterEnumsWithDroppedValues);
16507
16010
  jsonStatements.push(...dropEnums);
16508
16011
  jsonStatements.push(...dropSequences);
16509
16012
  jsonStatements.push(...dropSchemas);
@@ -16524,7 +16027,17 @@ var init_snapshotsDiffer = __esm({
16524
16027
  }
16525
16028
  return true;
16526
16029
  });
16527
- const sqlStatements = fromJson(filteredJsonStatements, "postgresql");
16030
+ const filteredEnumsJsonStatements = filteredJsonStatements.filter((st) => {
16031
+ if (st.type === "alter_type_add_value") {
16032
+ if (jsonStatements.find(
16033
+ (it) => it.type === "alter_type_drop_value" && it.name === st.name && it.schema === st.schema
16034
+ )) {
16035
+ return false;
16036
+ }
16037
+ }
16038
+ return true;
16039
+ });
16040
+ const sqlStatements = fromJson(filteredEnumsJsonStatements, "postgresql");
16528
16041
  const uniqueSqlStatements = [];
16529
16042
  sqlStatements.forEach((ss) => {
16530
16043
  if (!uniqueSqlStatements.includes(ss)) {
@@ -16540,7 +16053,7 @@ var init_snapshotsDiffer = __esm({
16540
16053
  });
16541
16054
  const _meta = prepareMigrationMeta(rSchemas, rTables, rColumns);
16542
16055
  return {
16543
- statements: filteredJsonStatements,
16056
+ statements: filteredEnumsJsonStatements,
16544
16057
  sqlStatements: uniqueSqlStatements,
16545
16058
  _meta
16546
16059
  };
@@ -17575,7 +17088,7 @@ var init_outputs = __esm({
17575
17088
  });
17576
17089
 
17577
17090
  // src/cli/commands/migrate.ts
17578
- var import_hanji2, schemasResolver, tablesResolver, sequencesResolver, roleResolver, policyResolver, enumsResolver, columnsResolver, promptColumnsConflicts, promptNamedConflict, promptNamedWithSchemasConflict, promptSchemasConflict, BREAKPOINT;
17091
+ var import_hanji2, schemasResolver, tablesResolver, sequencesResolver, enumsResolver, columnsResolver, promptColumnsConflicts, promptNamedWithSchemasConflict, promptSchemasConflict, BREAKPOINT;
17579
17092
  var init_migrate = __esm({
17580
17093
  "src/cli/commands/migrate.ts"() {
17581
17094
  "use strict";
@@ -17638,32 +17151,6 @@ var init_migrate = __esm({
17638
17151
  throw e;
17639
17152
  }
17640
17153
  };
17641
- roleResolver = async (input) => {
17642
- const result = await promptNamedConflict(
17643
- input.created,
17644
- input.deleted,
17645
- "role"
17646
- );
17647
- return {
17648
- created: result.created,
17649
- deleted: result.deleted,
17650
- renamed: result.renamed
17651
- };
17652
- };
17653
- policyResolver = async (input) => {
17654
- const result = await promptColumnsConflicts(
17655
- input.tableName,
17656
- input.created,
17657
- input.deleted
17658
- );
17659
- return {
17660
- tableName: input.tableName,
17661
- schema: input.schema,
17662
- created: result.created,
17663
- deleted: result.deleted,
17664
- renamed: result.renamed
17665
- };
17666
- };
17667
17154
  enumsResolver = async (input) => {
17668
17155
  try {
17669
17156
  const { created, deleted, moved, renamed } = await promptNamedWithSchemasConflict(
@@ -17746,56 +17233,6 @@ var init_migrate = __esm({
17746
17233
  result.deleted.push(...leftMissing);
17747
17234
  return result;
17748
17235
  };
17749
- promptNamedConflict = async (newItems, missingItems, entity) => {
17750
- if (missingItems.length === 0 || newItems.length === 0) {
17751
- return {
17752
- created: newItems,
17753
- renamed: [],
17754
- deleted: missingItems
17755
- };
17756
- }
17757
- const result = { created: [], renamed: [], deleted: [] };
17758
- let index4 = 0;
17759
- let leftMissing = [...missingItems];
17760
- do {
17761
- const created = newItems[index4];
17762
- const renames = leftMissing.map((it) => {
17763
- return { from: it, to: created };
17764
- });
17765
- const promptData = [created, ...renames];
17766
- const { status, data } = await (0, import_hanji2.render)(
17767
- new ResolveSelectNamed(created, promptData, entity)
17768
- );
17769
- if (status === "aborted") {
17770
- console.error("ERROR");
17771
- process.exit(1);
17772
- }
17773
- if (isRenamePromptItem(data)) {
17774
- console.log(
17775
- `${source_default.yellow("~")} ${data.from.name} \u203A ${data.to.name} ${source_default.gray(
17776
- `${entity} will be renamed/moved`
17777
- )}`
17778
- );
17779
- if (data.from.name !== data.to.name) {
17780
- result.renamed.push(data);
17781
- }
17782
- delete leftMissing[leftMissing.indexOf(data.from)];
17783
- leftMissing = leftMissing.filter(Boolean);
17784
- } else {
17785
- console.log(
17786
- `${source_default.green("+")} ${data.name} ${source_default.gray(
17787
- `${entity} will be created`
17788
- )}`
17789
- );
17790
- result.created.push(created);
17791
- }
17792
- index4 += 1;
17793
- } while (index4 < newItems.length);
17794
- console.log(source_default.gray(`--- all ${entity} conflicts resolved ---
17795
- `));
17796
- result.deleted.push(...leftMissing);
17797
- return result;
17798
- };
17799
17236
  promptNamedWithSchemasConflict = async (newItems, missingItems, entity) => {
17800
17237
  if (missingItems.length === 0 || newItems.length === 0) {
17801
17238
  return {
@@ -19352,8 +18789,8 @@ function parsePgArray(arrayString) {
19352
18789
  const [result] = parsePgNestedArray(arrayString, 1);
19353
18790
  return result;
19354
18791
  }
19355
- function makePgArray(array2) {
19356
- return `{${array2.map((item) => {
18792
+ function makePgArray(array) {
18793
+ return `{${array.map((item) => {
19357
18794
  if (Array.isArray(item)) {
19358
18795
  return makePgArray(item);
19359
18796
  }
@@ -20061,8 +19498,8 @@ var init_sql = __esm({
20061
19498
  sql2.param = param2;
20062
19499
  })(sql || (sql = {}));
20063
19500
  ((SQL2) => {
20064
- var _a326;
20065
- _a326 = entityKind;
19501
+ var _a324;
19502
+ _a324 = entityKind;
20066
19503
  const _Aliased = class _Aliased {
20067
19504
  constructor(sql2, fieldAlias) {
20068
19505
  /** @internal */
@@ -20078,7 +19515,7 @@ var init_sql = __esm({
20078
19515
  return new _Aliased(this.sql, this.fieldAlias);
20079
19516
  }
20080
19517
  };
20081
- __publicField(_Aliased, _a326, "SQL.Aliased");
19518
+ __publicField(_Aliased, _a324, "SQL.Aliased");
20082
19519
  let Aliased = _Aliased;
20083
19520
  SQL2.Aliased = Aliased;
20084
19521
  })(SQL || (SQL = {}));
@@ -20361,8 +19798,8 @@ function arrayContains(column4, values) {
20361
19798
  if (values.length === 0) {
20362
19799
  throw new Error("arrayContains requires at least one value");
20363
19800
  }
20364
- const array2 = sql`${bindIfParam(values, column4)}`;
20365
- return sql`${column4} @> ${array2}`;
19801
+ const array = sql`${bindIfParam(values, column4)}`;
19802
+ return sql`${column4} @> ${array}`;
20366
19803
  }
20367
19804
  return sql`${column4} @> ${bindIfParam(values, column4)}`;
20368
19805
  }
@@ -20371,8 +19808,8 @@ function arrayContained(column4, values) {
20371
19808
  if (values.length === 0) {
20372
19809
  throw new Error("arrayContained requires at least one value");
20373
19810
  }
20374
- const array2 = sql`${bindIfParam(values, column4)}`;
20375
- return sql`${column4} <@ ${array2}`;
19811
+ const array = sql`${bindIfParam(values, column4)}`;
19812
+ return sql`${column4} <@ ${array}`;
20376
19813
  }
20377
19814
  return sql`${column4} <@ ${bindIfParam(values, column4)}`;
20378
19815
  }
@@ -20381,8 +19818,8 @@ function arrayOverlaps(column4, values) {
20381
19818
  if (values.length === 0) {
20382
19819
  throw new Error("arrayOverlaps requires at least one value");
20383
19820
  }
20384
- const array2 = sql`${bindIfParam(values, column4)}`;
20385
- return sql`${column4} && ${array2}`;
19821
+ const array = sql`${bindIfParam(values, column4)}`;
19822
+ return sql`${column4} && ${array}`;
20386
19823
  }
20387
19824
  return sql`${column4} && ${bindIfParam(values, column4)}`;
20388
19825
  }
@@ -26048,67 +25485,6 @@ var init_indexes = __esm({
26048
25485
  }
26049
25486
  });
26050
25487
 
26051
- // ../drizzle-orm/dist/pg-core/policies.js
26052
- var _a147, PgPolicy;
26053
- var init_policies = __esm({
26054
- "../drizzle-orm/dist/pg-core/policies.js"() {
26055
- "use strict";
26056
- init_entity();
26057
- _a147 = entityKind;
26058
- PgPolicy = class {
26059
- constructor(name2, config) {
26060
- __publicField(this, "as");
26061
- __publicField(this, "for");
26062
- __publicField(this, "to");
26063
- __publicField(this, "using");
26064
- __publicField(this, "withCheck");
26065
- this.name = name2;
26066
- if (config) {
26067
- this.as = config.as;
26068
- this.for = config.for;
26069
- this.to = config.to;
26070
- this.using = config.using;
26071
- this.withCheck = config.withCheck;
26072
- }
26073
- }
26074
- };
26075
- __publicField(PgPolicy, _a147, "PgPolicy");
26076
- }
26077
- });
26078
-
26079
- // ../drizzle-orm/dist/pg-core/roles.js
26080
- var _a148, PgRole;
26081
- var init_roles = __esm({
26082
- "../drizzle-orm/dist/pg-core/roles.js"() {
26083
- "use strict";
26084
- init_entity();
26085
- _a148 = entityKind;
26086
- PgRole = class {
26087
- constructor(name2, config) {
26088
- /** @internal */
26089
- __publicField(this, "_existing");
26090
- /** @internal */
26091
- __publicField(this, "createDb");
26092
- /** @internal */
26093
- __publicField(this, "createRole");
26094
- /** @internal */
26095
- __publicField(this, "inherit");
26096
- this.name = name2;
26097
- if (config) {
26098
- this.createDb = config.createDb;
26099
- this.createRole = config.createRole;
26100
- this.inherit = config.inherit;
26101
- }
26102
- }
26103
- existing() {
26104
- this._existing = true;
26105
- return this;
26106
- }
26107
- };
26108
- __publicField(PgRole, _a148, "PgRole");
26109
- }
26110
- });
26111
-
26112
25488
  // ../drizzle-orm/dist/pg-core/sequence.js
26113
25489
  function pgSequenceWithSchema(name2, options, schema4) {
26114
25490
  return new PgSequence(name2, options, schema4);
@@ -26116,12 +25492,12 @@ function pgSequenceWithSchema(name2, options, schema4) {
26116
25492
  function isPgSequence(obj) {
26117
25493
  return is(obj, PgSequence);
26118
25494
  }
26119
- var _a149, PgSequence;
25495
+ var _a147, PgSequence;
26120
25496
  var init_sequence = __esm({
26121
25497
  "../drizzle-orm/dist/pg-core/sequence.js"() {
26122
25498
  "use strict";
26123
25499
  init_entity();
26124
- _a149 = entityKind;
25500
+ _a147 = entityKind;
26125
25501
  PgSequence = class {
26126
25502
  constructor(seqName, seqOptions, schema4) {
26127
25503
  this.seqName = seqName;
@@ -26129,7 +25505,7 @@ var init_sequence = __esm({
26129
25505
  this.schema = schema4;
26130
25506
  }
26131
25507
  };
26132
- __publicField(PgSequence, _a149, "PgSequence");
25508
+ __publicField(PgSequence, _a147, "PgSequence");
26133
25509
  }
26134
25510
  });
26135
25511
 
@@ -26155,7 +25531,7 @@ function pgMaterializedViewWithSchema(name2, selection, schema4) {
26155
25531
  }
26156
25532
  return new MaterializedViewBuilder(name2, schema4);
26157
25533
  }
26158
- var _a150, DefaultViewBuilderCore, _a151, _b107, ViewBuilder, _a152, _b108, ManualViewBuilder, _a153, MaterializedViewBuilderCore, _a154, _b109, MaterializedViewBuilder, _a155, _b110, ManualMaterializedViewBuilder, _a156, _b111, _c4, PgView, PgMaterializedViewConfig, _a157, _b112, _c5, PgMaterializedView;
25534
+ var _a148, DefaultViewBuilderCore, _a149, _b107, ViewBuilder, _a150, _b108, ManualViewBuilder, _a151, MaterializedViewBuilderCore, _a152, _b109, MaterializedViewBuilder, _a153, _b110, ManualMaterializedViewBuilder, _a154, _b111, _c4, PgView, PgMaterializedViewConfig, _a155, _b112, _c5, PgMaterializedView;
26159
25535
  var init_view = __esm({
26160
25536
  "../drizzle-orm/dist/pg-core/view.js"() {
26161
25537
  "use strict";
@@ -26166,7 +25542,7 @@ var init_view = __esm({
26166
25542
  init_table2();
26167
25543
  init_view_base();
26168
25544
  init_view_common2();
26169
- _a150 = entityKind;
25545
+ _a148 = entityKind;
26170
25546
  DefaultViewBuilderCore = class {
26171
25547
  constructor(name2, schema4) {
26172
25548
  __publicField(this, "config", {});
@@ -26178,8 +25554,8 @@ var init_view = __esm({
26178
25554
  return this;
26179
25555
  }
26180
25556
  };
26181
- __publicField(DefaultViewBuilderCore, _a150, "PgDefaultViewBuilderCore");
26182
- ViewBuilder = class extends (_b107 = DefaultViewBuilderCore, _a151 = entityKind, _b107) {
25557
+ __publicField(DefaultViewBuilderCore, _a148, "PgDefaultViewBuilderCore");
25558
+ ViewBuilder = class extends (_b107 = DefaultViewBuilderCore, _a149 = entityKind, _b107) {
26183
25559
  as(qb) {
26184
25560
  if (typeof qb === "function") {
26185
25561
  qb = qb(new QueryBuilder());
@@ -26205,8 +25581,8 @@ var init_view = __esm({
26205
25581
  );
26206
25582
  }
26207
25583
  };
26208
- __publicField(ViewBuilder, _a151, "PgViewBuilder");
26209
- ManualViewBuilder = class extends (_b108 = DefaultViewBuilderCore, _a152 = entityKind, _b108) {
25584
+ __publicField(ViewBuilder, _a149, "PgViewBuilder");
25585
+ ManualViewBuilder = class extends (_b108 = DefaultViewBuilderCore, _a150 = entityKind, _b108) {
26210
25586
  constructor(name2, columns, schema4) {
26211
25587
  super(name2, schema4);
26212
25588
  __publicField(this, "columns");
@@ -26251,8 +25627,8 @@ var init_view = __esm({
26251
25627
  );
26252
25628
  }
26253
25629
  };
26254
- __publicField(ManualViewBuilder, _a152, "PgManualViewBuilder");
26255
- _a153 = entityKind;
25630
+ __publicField(ManualViewBuilder, _a150, "PgManualViewBuilder");
25631
+ _a151 = entityKind;
26256
25632
  MaterializedViewBuilderCore = class {
26257
25633
  constructor(name2, schema4) {
26258
25634
  __publicField(this, "config", {});
@@ -26276,8 +25652,8 @@ var init_view = __esm({
26276
25652
  return this;
26277
25653
  }
26278
25654
  };
26279
- __publicField(MaterializedViewBuilderCore, _a153, "PgMaterializedViewBuilderCore");
26280
- MaterializedViewBuilder = class extends (_b109 = MaterializedViewBuilderCore, _a154 = entityKind, _b109) {
25655
+ __publicField(MaterializedViewBuilderCore, _a151, "PgMaterializedViewBuilderCore");
25656
+ MaterializedViewBuilder = class extends (_b109 = MaterializedViewBuilderCore, _a152 = entityKind, _b109) {
26281
25657
  as(qb) {
26282
25658
  if (typeof qb === "function") {
26283
25659
  qb = qb(new QueryBuilder());
@@ -26308,8 +25684,8 @@ var init_view = __esm({
26308
25684
  );
26309
25685
  }
26310
25686
  };
26311
- __publicField(MaterializedViewBuilder, _a154, "PgMaterializedViewBuilder");
26312
- ManualMaterializedViewBuilder = class extends (_b110 = MaterializedViewBuilderCore, _a155 = entityKind, _b110) {
25687
+ __publicField(MaterializedViewBuilder, _a152, "PgMaterializedViewBuilder");
25688
+ ManualMaterializedViewBuilder = class extends (_b110 = MaterializedViewBuilderCore, _a153 = entityKind, _b110) {
26313
25689
  constructor(name2, columns, schema4) {
26314
25690
  super(name2, schema4);
26315
25691
  __publicField(this, "columns");
@@ -26354,11 +25730,11 @@ var init_view = __esm({
26354
25730
  );
26355
25731
  }
26356
25732
  };
26357
- __publicField(ManualMaterializedViewBuilder, _a155, "PgManualMaterializedViewBuilder");
26358
- PgView = class extends (_c4 = PgViewBase, _b111 = entityKind, _a156 = PgViewConfig, _c4) {
25733
+ __publicField(ManualMaterializedViewBuilder, _a153, "PgManualMaterializedViewBuilder");
25734
+ PgView = class extends (_c4 = PgViewBase, _b111 = entityKind, _a154 = PgViewConfig, _c4) {
26359
25735
  constructor({ pgConfig, config }) {
26360
25736
  super(config);
26361
- __publicField(this, _a156);
25737
+ __publicField(this, _a154);
26362
25738
  if (pgConfig) {
26363
25739
  this[PgViewConfig] = {
26364
25740
  with: pgConfig.with
@@ -26368,10 +25744,10 @@ var init_view = __esm({
26368
25744
  };
26369
25745
  __publicField(PgView, _b111, "PgView");
26370
25746
  PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
26371
- PgMaterializedView = class extends (_c5 = PgViewBase, _b112 = entityKind, _a157 = PgMaterializedViewConfig, _c5) {
25747
+ PgMaterializedView = class extends (_c5 = PgViewBase, _b112 = entityKind, _a155 = PgMaterializedViewConfig, _c5) {
26372
25748
  constructor({ pgConfig, config }) {
26373
25749
  super(config);
26374
- __publicField(this, _a157);
25750
+ __publicField(this, _a155);
26375
25751
  this[PgMaterializedViewConfig] = {
26376
25752
  with: pgConfig?.with,
26377
25753
  using: pgConfig?.using,
@@ -26385,7 +25761,7 @@ var init_view = __esm({
26385
25761
  });
26386
25762
 
26387
25763
  // ../drizzle-orm/dist/pg-core/schema.js
26388
- var _a158, PgSchema5;
25764
+ var _a156, PgSchema5;
26389
25765
  var init_schema = __esm({
26390
25766
  "../drizzle-orm/dist/pg-core/schema.js"() {
26391
25767
  "use strict";
@@ -26395,7 +25771,7 @@ var init_schema = __esm({
26395
25771
  init_sequence();
26396
25772
  init_table2();
26397
25773
  init_view();
26398
- _a158 = entityKind;
25774
+ _a156 = entityKind;
26399
25775
  PgSchema5 = class {
26400
25776
  constructor(schemaName) {
26401
25777
  __publicField(this, "table", (name2, columns, extraConfig) => {
@@ -26422,12 +25798,12 @@ var init_schema = __esm({
26422
25798
  return true;
26423
25799
  }
26424
25800
  };
26425
- __publicField(PgSchema5, _a158, "PgSchema");
25801
+ __publicField(PgSchema5, _a156, "PgSchema");
26426
25802
  }
26427
25803
  });
26428
25804
 
26429
25805
  // ../drizzle-orm/dist/pg-core/session.js
26430
- var _a159, PgPreparedQuery, _a160, PgSession, _a161, _b113, PgTransaction;
25806
+ var _a157, PgPreparedQuery, _a158, PgSession, _a159, _b113, PgTransaction;
26431
25807
  var init_session = __esm({
26432
25808
  "../drizzle-orm/dist/pg-core/session.js"() {
26433
25809
  "use strict";
@@ -26436,7 +25812,7 @@ var init_session = __esm({
26436
25812
  init_sql2();
26437
25813
  init_tracing();
26438
25814
  init_db();
26439
- _a159 = entityKind;
25815
+ _a157 = entityKind;
26440
25816
  PgPreparedQuery = class {
26441
25817
  constructor(query) {
26442
25818
  /** @internal */
@@ -26450,8 +25826,8 @@ var init_session = __esm({
26450
25826
  return response;
26451
25827
  }
26452
25828
  };
26453
- __publicField(PgPreparedQuery, _a159, "PgPreparedQuery");
26454
- _a160 = entityKind;
25829
+ __publicField(PgPreparedQuery, _a157, "PgPreparedQuery");
25830
+ _a158 = entityKind;
26455
25831
  PgSession = class {
26456
25832
  constructor(dialect4) {
26457
25833
  this.dialect = dialect4;
@@ -26484,8 +25860,8 @@ var init_session = __esm({
26484
25860
  );
26485
25861
  }
26486
25862
  };
26487
- __publicField(PgSession, _a160, "PgSession");
26488
- PgTransaction = class extends (_b113 = PgDatabase, _a161 = entityKind, _b113) {
25863
+ __publicField(PgSession, _a158, "PgSession");
25864
+ PgTransaction = class extends (_b113 = PgDatabase, _a159 = entityKind, _b113) {
26489
25865
  constructor(dialect4, session, schema4, nestedIndex = 0) {
26490
25866
  super(dialect4, session, schema4);
26491
25867
  this.schema = schema4;
@@ -26512,7 +25888,7 @@ var init_session = __esm({
26512
25888
  return this.session.execute(sql`set transaction ${this.getTransactionConfigSQL(config)}`);
26513
25889
  }
26514
25890
  };
26515
- __publicField(PgTransaction, _a161, "PgTransaction");
25891
+ __publicField(PgTransaction, _a159, "PgTransaction");
26516
25892
  }
26517
25893
  });
26518
25894
 
@@ -26533,12 +25909,10 @@ function getTableConfig(table4) {
26533
25909
  const uniqueConstraints = [];
26534
25910
  const name2 = table4[Table.Symbol.Name];
26535
25911
  const schema4 = table4[Table.Symbol.Schema];
26536
- const policies = [];
26537
25912
  const extraConfigBuilder = table4[PgTable.Symbol.ExtraConfigBuilder];
26538
25913
  if (extraConfigBuilder !== void 0) {
26539
25914
  const extraConfig = extraConfigBuilder(table4[Table.Symbol.ExtraConfigColumns]);
26540
- const extraValues = Array.isArray(extraConfig) ? extraConfig : Object.values(extraConfig);
26541
- for (const builder of extraValues) {
25915
+ for (const builder of Object.values(extraConfig)) {
26542
25916
  if (is(builder, IndexBuilder)) {
26543
25917
  indexes.push(builder.build(table4));
26544
25918
  } else if (is(builder, CheckBuilder)) {
@@ -26549,8 +25923,6 @@ function getTableConfig(table4) {
26549
25923
  primaryKeys.push(builder.build(table4));
26550
25924
  } else if (is(builder, ForeignKeyBuilder)) {
26551
25925
  foreignKeys.push(builder.build(table4));
26552
- } else if (is(builder, PgPolicy)) {
26553
- policies.push(builder);
26554
25926
  }
26555
25927
  }
26556
25928
  }
@@ -26562,8 +25934,7 @@ function getTableConfig(table4) {
26562
25934
  primaryKeys,
26563
25935
  uniqueConstraints,
26564
25936
  name: name2,
26565
- schema: schema4,
26566
- policies
25937
+ schema: schema4
26567
25938
  };
26568
25939
  }
26569
25940
  var init_utils4 = __esm({
@@ -26575,7 +25946,6 @@ var init_utils4 = __esm({
26575
25946
  init_checks();
26576
25947
  init_foreign_keys();
26577
25948
  init_indexes();
26578
- init_policies();
26579
25949
  init_primary_keys();
26580
25950
  init_unique_constraint();
26581
25951
  }
@@ -26600,10 +25970,8 @@ var init_pg_core = __esm({
26600
25970
  init_dialect();
26601
25971
  init_foreign_keys();
26602
25972
  init_indexes();
26603
- init_policies();
26604
25973
  init_primary_keys();
26605
25974
  init_query_builders();
26606
- init_roles();
26607
25975
  init_schema();
26608
25976
  init_sequence();
26609
25977
  init_session();
@@ -26630,9 +25998,9 @@ function minRangeForIdentityBasedOn(columnType) {
26630
25998
  function stringFromDatabaseIdentityProperty(field) {
26631
25999
  return typeof field === "string" ? field : typeof field === "undefined" ? void 0 : typeof field === "bigint" ? field.toString() : String(field);
26632
26000
  }
26633
- function buildArrayString(array2, sqlType) {
26001
+ function buildArrayString(array, sqlType) {
26634
26002
  sqlType = sqlType.split("[")[0];
26635
- const values = array2.map((value) => {
26003
+ const values = array.map((value) => {
26636
26004
  if (typeof value === "number" || typeof value === "bigint") {
26637
26005
  return value.toString();
26638
26006
  } else if (typeof value === "boolean") {
@@ -26654,40 +26022,6 @@ function buildArrayString(array2, sqlType) {
26654
26022
  }).join(",");
26655
26023
  return `{${values}}`;
26656
26024
  }
26657
- function prepareRoles(entities) {
26658
- let useRoles = false;
26659
- const includeRoles = [];
26660
- const excludeRoles = [];
26661
- if (entities && entities.roles) {
26662
- if (typeof entities.roles === "object") {
26663
- if (entities.roles.provider) {
26664
- if (entities.roles.provider === "supabase") {
26665
- excludeRoles.push(...[
26666
- "anon",
26667
- "authenticator",
26668
- "authenticated",
26669
- "service_role",
26670
- "supabase_auth_admin",
26671
- "supabase_storage_admin",
26672
- "dashboard_user",
26673
- "supabase_admin"
26674
- ]);
26675
- } else if (entities.roles.provider === "neon") {
26676
- excludeRoles.push(...["authenticated", "anonymous"]);
26677
- }
26678
- }
26679
- if (entities.roles.include) {
26680
- includeRoles.push(...entities.roles.include);
26681
- }
26682
- if (entities.roles.exclude) {
26683
- excludeRoles.push(...entities.roles.exclude);
26684
- }
26685
- } else {
26686
- useRoles = entities.roles;
26687
- }
26688
- }
26689
- return { useRoles, includeRoles, excludeRoles };
26690
- }
26691
26025
  var indexName, generatePgSnapshot, trimChar, fromDatabase, defaultForColumn;
26692
26026
  var init_pgSerializer = __esm({
26693
26027
  "src/serializer/pgSerializer.ts"() {
@@ -26703,11 +26037,10 @@ var init_pgSerializer = __esm({
26703
26037
  indexName = (tableName, columns) => {
26704
26038
  return `${tableName}_${columns.join("_")}_index`;
26705
26039
  };
26706
- generatePgSnapshot = (tables, enums, schemas, sequences, roles, casing2, schemaFilter) => {
26040
+ generatePgSnapshot = (tables, enums, schemas, sequences, casing2, schemaFilter) => {
26707
26041
  const dialect4 = new PgDialect({ casing: casing2 });
26708
26042
  const result = {};
26709
26043
  const sequencesToReturn = {};
26710
- const rolesToReturn = {};
26711
26044
  const indexesInSchema = {};
26712
26045
  for (const table4 of tables) {
26713
26046
  const {
@@ -26718,8 +26051,7 @@ var init_pgSerializer = __esm({
26718
26051
  checks,
26719
26052
  schema: schema4,
26720
26053
  primaryKeys,
26721
- uniqueConstraints,
26722
- policies
26054
+ uniqueConstraints
26723
26055
  } = getTableConfig(table4);
26724
26056
  if (schemaFilter && !schemaFilter.includes(schema4 ?? "public")) {
26725
26057
  continue;
@@ -26729,7 +26061,6 @@ var init_pgSerializer = __esm({
26729
26061
  const foreignKeysObject = {};
26730
26062
  const primaryKeysObject = {};
26731
26063
  const uniqueConstraintObject = {};
26732
- const policiesObject = {};
26733
26064
  columns.forEach((column4) => {
26734
26065
  const name2 = getColumnCasing(column4, casing2);
26735
26066
  const notNull = column4.notNull;
@@ -26992,34 +26323,6 @@ ${withStyle.errorWarning(
26992
26323
  with: value.config.with ?? {}
26993
26324
  };
26994
26325
  });
26995
- policies.forEach((policy2) => {
26996
- const mappedTo = [];
26997
- if (!policy2.to) {
26998
- mappedTo.push("public");
26999
- } else {
27000
- if (policy2.to && typeof policy2.to === "string") {
27001
- mappedTo.push(policy2.to);
27002
- } else if (policy2.to && is(policy2.to, PgRole)) {
27003
- mappedTo.push(policy2.to.name);
27004
- } else if (policy2.to && Array.isArray(policy2.to)) {
27005
- policy2.to.forEach((it) => {
27006
- if (typeof it === "string") {
27007
- mappedTo.push(it);
27008
- } else if (is(it, PgRole)) {
27009
- mappedTo.push(it.name);
27010
- }
27011
- });
27012
- }
27013
- }
27014
- policiesObject[policy2.name] = {
27015
- name: policy2.name,
27016
- as: policy2.as?.toUpperCase() ?? "PERMISSIVE",
27017
- for: policy2.for?.toUpperCase() ?? "ALL",
27018
- to: mappedTo.sort(),
27019
- using: is(policy2.using, SQL) ? dialect4.sqlToQuery(policy2.using).sql : void 0,
27020
- withCheck: is(policy2.withCheck, SQL) ? dialect4.sqlToQuery(policy2.withCheck).sql : void 0
27021
- };
27022
- });
27023
26326
  const tableKey2 = `${schema4 ?? "public"}.${tableName}`;
27024
26327
  result[tableKey2] = {
27025
26328
  name: tableName,
@@ -27028,8 +26331,7 @@ ${withStyle.errorWarning(
27028
26331
  indexes: indexesObject,
27029
26332
  foreignKeys: foreignKeysObject,
27030
26333
  compositePrimaryKeys: primaryKeysObject,
27031
- uniqueConstraints: uniqueConstraintObject,
27032
- policies: policiesObject
26334
+ uniqueConstraints: uniqueConstraintObject
27033
26335
  };
27034
26336
  }
27035
26337
  for (const sequence of sequences) {
@@ -27053,16 +26355,6 @@ ${withStyle.errorWarning(
27053
26355
  } else {
27054
26356
  }
27055
26357
  }
27056
- for (const role of roles) {
27057
- if (!role._existing) {
27058
- rolesToReturn[role.name] = {
27059
- name: role.name,
27060
- createDb: role.createDb === void 0 ? false : role.createDb,
27061
- createRole: role.createRole === void 0 ? false : role.createRole,
27062
- inherit: role.inherit === void 0 ? true : role.inherit
27063
- };
27064
- }
27065
- }
27066
26358
  const enumsToReturn = enums.reduce((map, obj) => {
27067
26359
  const enumSchema3 = obj.schema || "public";
27068
26360
  const key = `${enumSchema3}.${obj.enumName}`;
@@ -27089,7 +26381,6 @@ ${withStyle.errorWarning(
27089
26381
  enums: enumsToReturn,
27090
26382
  schemas: schemasObject,
27091
26383
  sequences: sequencesToReturn,
27092
- roles: rolesToReturn,
27093
26384
  _meta: {
27094
26385
  schemas: {},
27095
26386
  tables: {},
@@ -27104,7 +26395,7 @@ ${withStyle.errorWarning(
27104
26395
  while (end > start && str[end - 1] === char3) --end;
27105
26396
  return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
27106
26397
  };
27107
- fromDatabase = async (db, tablesFilter = () => true, schemaFilters, entities, progressCallback) => {
26398
+ fromDatabase = async (db, tablesFilter = () => true, schemaFilters, progressCallback) => {
27108
26399
  const result = {};
27109
26400
  const internals = { tables: {} };
27110
26401
  const where = schemaFilters.map((t) => `table_schema = '${t}'`).join(" or ");
@@ -27186,60 +26477,6 @@ ${withStyle.errorWarning(
27186
26477
  if (progressCallback) {
27187
26478
  progressCallback("enums", Object.keys(enumsToReturn).length, "done");
27188
26479
  }
27189
- const allRoles = await db.query(
27190
- `SELECT rolname, rolinherit, rolcreatedb, rolcreaterole FROM pg_roles;`
27191
- );
27192
- const rolesToReturn = {};
27193
- const preparedRoles = prepareRoles(entities);
27194
- if (preparedRoles.useRoles || !(preparedRoles.includeRoles.length === 0 && preparedRoles.excludeRoles.length === 0)) {
27195
- for (const dbRole of allRoles) {
27196
- if (preparedRoles.useRoles) {
27197
- rolesToReturn[dbRole.rolname] = {
27198
- createDb: dbRole.rolcreatedb,
27199
- createRole: dbRole.rolcreatedb,
27200
- inherit: dbRole.rolinherit,
27201
- name: dbRole.rolname
27202
- };
27203
- } else {
27204
- if (preparedRoles.includeRoles.length === 0 && preparedRoles.excludeRoles.length === 0) continue;
27205
- if (preparedRoles.includeRoles.includes(dbRole.rolname) && preparedRoles.excludeRoles.includes(dbRole.rolname)) continue;
27206
- if (preparedRoles.excludeRoles.includes(dbRole.rolname)) continue;
27207
- if (!preparedRoles.includeRoles.includes(dbRole.rolname)) continue;
27208
- rolesToReturn[dbRole.rolname] = {
27209
- createDb: dbRole.rolcreatedb,
27210
- createRole: dbRole.rolcreaterole,
27211
- inherit: dbRole.rolinherit,
27212
- name: dbRole.rolname
27213
- };
27214
- }
27215
- }
27216
- }
27217
- const wherePolicies = schemaFilters.map((t) => `schemaname = '${t}'`).join(" or ");
27218
- const policiesByTable = {};
27219
- const allPolicies = await db.query(`SELECT schemaname, tablename, policyname as name, permissive as "as", roles as to, cmd as for, qual as using, with_check as "withCheck" FROM pg_policies${wherePolicies === "" ? "" : ` WHERE ${wherePolicies}`};`);
27220
- for (const dbPolicy of allPolicies) {
27221
- const { tablename, schemaname, to, withCheck, using, ...rest } = dbPolicy;
27222
- const tableForPolicy = policiesByTable[`${schemaname}.${tablename}`];
27223
- const parsedTo = to === "{}" ? [] : to.substring(1, to.length - 1).split(/\s*,\s*/g).sort();
27224
- const parsedWithCheck = withCheck === null ? void 0 : withCheck;
27225
- const parsedUsing = using === null ? void 0 : using;
27226
- if (tableForPolicy) {
27227
- tableForPolicy[dbPolicy.name] = { ...rest, to: parsedTo };
27228
- } else {
27229
- policiesByTable[`${schemaname}.${tablename}`] = {
27230
- [dbPolicy.name]: { ...rest, to: parsedTo, withCheck: parsedWithCheck, using: parsedUsing }
27231
- };
27232
- }
27233
- }
27234
- if (progressCallback) {
27235
- progressCallback(
27236
- "policies",
27237
- Object.values(policiesByTable).reduce((total, innerRecord) => {
27238
- return total + Object.keys(innerRecord).length;
27239
- }, 0),
27240
- "done"
27241
- );
27242
- }
27243
26480
  const sequencesInColumns = [];
27244
26481
  const all = allTables.map((row) => {
27245
26482
  return new Promise(async (res, rej) => {
@@ -27633,8 +26870,7 @@ ${withStyle.errorWarning(
27633
26870
  indexes: indexToReturn,
27634
26871
  foreignKeys: foreignKeysToReturn,
27635
26872
  compositePrimaryKeys: primaryKeys,
27636
- uniqueConstraints: uniqueConstrains,
27637
- policies: policiesByTable[`${tableSchema}.${tableName}`] ?? {}
26873
+ uniqueConstraints: uniqueConstrains
27638
26874
  };
27639
26875
  } catch (e) {
27640
26876
  rej(e);
@@ -27661,7 +26897,6 @@ ${withStyle.errorWarning(
27661
26897
  enums: enumsToReturn,
27662
26898
  schemas: schemasObject,
27663
26899
  sequences: sequencesToReturn,
27664
- roles: rolesToReturn,
27665
26900
  _meta: {
27666
26901
  schemas: {},
27667
26902
  tables: {},
@@ -27784,12 +27019,12 @@ var init_alias3 = __esm({
27784
27019
  });
27785
27020
 
27786
27021
  // ../drizzle-orm/dist/sqlite-core/checks.js
27787
- var _a162, CheckBuilder2, _a163, Check2;
27022
+ var _a160, CheckBuilder2, _a161, Check2;
27788
27023
  var init_checks2 = __esm({
27789
27024
  "../drizzle-orm/dist/sqlite-core/checks.js"() {
27790
27025
  "use strict";
27791
27026
  init_entity();
27792
- _a162 = entityKind;
27027
+ _a160 = entityKind;
27793
27028
  CheckBuilder2 = class {
27794
27029
  constructor(name2, value) {
27795
27030
  __publicField(this, "brand");
@@ -27800,8 +27035,8 @@ var init_checks2 = __esm({
27800
27035
  return new Check2(table4, this);
27801
27036
  }
27802
27037
  };
27803
- __publicField(CheckBuilder2, _a162, "SQLiteCheckBuilder");
27804
- _a163 = entityKind;
27038
+ __publicField(CheckBuilder2, _a160, "SQLiteCheckBuilder");
27039
+ _a161 = entityKind;
27805
27040
  Check2 = class {
27806
27041
  constructor(table4, builder) {
27807
27042
  __publicField(this, "name");
@@ -27811,18 +27046,18 @@ var init_checks2 = __esm({
27811
27046
  this.value = builder.value;
27812
27047
  }
27813
27048
  };
27814
- __publicField(Check2, _a163, "SQLiteCheck");
27049
+ __publicField(Check2, _a161, "SQLiteCheck");
27815
27050
  }
27816
27051
  });
27817
27052
 
27818
27053
  // ../drizzle-orm/dist/sqlite-core/foreign-keys.js
27819
- var _a164, ForeignKeyBuilder2, _a165, ForeignKey2;
27054
+ var _a162, ForeignKeyBuilder2, _a163, ForeignKey2;
27820
27055
  var init_foreign_keys2 = __esm({
27821
27056
  "../drizzle-orm/dist/sqlite-core/foreign-keys.js"() {
27822
27057
  "use strict";
27823
27058
  init_entity();
27824
27059
  init_table_utils();
27825
- _a164 = entityKind;
27060
+ _a162 = entityKind;
27826
27061
  ForeignKeyBuilder2 = class {
27827
27062
  constructor(config, actions) {
27828
27063
  /** @internal */
@@ -27853,8 +27088,8 @@ var init_foreign_keys2 = __esm({
27853
27088
  return new ForeignKey2(table4, this);
27854
27089
  }
27855
27090
  };
27856
- __publicField(ForeignKeyBuilder2, _a164, "SQLiteForeignKeyBuilder");
27857
- _a165 = entityKind;
27091
+ __publicField(ForeignKeyBuilder2, _a162, "SQLiteForeignKeyBuilder");
27092
+ _a163 = entityKind;
27858
27093
  ForeignKey2 = class {
27859
27094
  constructor(table4, builder) {
27860
27095
  __publicField(this, "reference");
@@ -27878,7 +27113,7 @@ var init_foreign_keys2 = __esm({
27878
27113
  return name2 ?? `${chunks.join("_")}_fk`;
27879
27114
  }
27880
27115
  };
27881
- __publicField(ForeignKey2, _a165, "SQLiteForeignKey");
27116
+ __publicField(ForeignKey2, _a163, "SQLiteForeignKey");
27882
27117
  }
27883
27118
  });
27884
27119
 
@@ -27886,13 +27121,13 @@ var init_foreign_keys2 = __esm({
27886
27121
  function uniqueKeyName2(table4, columns) {
27887
27122
  return `${table4[TableName]}_${columns.join("_")}_unique`;
27888
27123
  }
27889
- var _a166, UniqueConstraintBuilder2, _a167, UniqueOnConstraintBuilder2, _a168, UniqueConstraint2;
27124
+ var _a164, UniqueConstraintBuilder2, _a165, UniqueOnConstraintBuilder2, _a166, UniqueConstraint2;
27890
27125
  var init_unique_constraint2 = __esm({
27891
27126
  "../drizzle-orm/dist/sqlite-core/unique-constraint.js"() {
27892
27127
  "use strict";
27893
27128
  init_entity();
27894
27129
  init_table_utils();
27895
- _a166 = entityKind;
27130
+ _a164 = entityKind;
27896
27131
  UniqueConstraintBuilder2 = class {
27897
27132
  constructor(columns, name2) {
27898
27133
  /** @internal */
@@ -27905,8 +27140,8 @@ var init_unique_constraint2 = __esm({
27905
27140
  return new UniqueConstraint2(table4, this.columns, this.name);
27906
27141
  }
27907
27142
  };
27908
- __publicField(UniqueConstraintBuilder2, _a166, "SQLiteUniqueConstraintBuilder");
27909
- _a167 = entityKind;
27143
+ __publicField(UniqueConstraintBuilder2, _a164, "SQLiteUniqueConstraintBuilder");
27144
+ _a165 = entityKind;
27910
27145
  UniqueOnConstraintBuilder2 = class {
27911
27146
  constructor(name2) {
27912
27147
  /** @internal */
@@ -27917,8 +27152,8 @@ var init_unique_constraint2 = __esm({
27917
27152
  return new UniqueConstraintBuilder2(columns, this.name);
27918
27153
  }
27919
27154
  };
27920
- __publicField(UniqueOnConstraintBuilder2, _a167, "SQLiteUniqueOnConstraintBuilder");
27921
- _a168 = entityKind;
27155
+ __publicField(UniqueOnConstraintBuilder2, _a165, "SQLiteUniqueOnConstraintBuilder");
27156
+ _a166 = entityKind;
27922
27157
  UniqueConstraint2 = class {
27923
27158
  constructor(table4, columns, name2) {
27924
27159
  __publicField(this, "columns");
@@ -27931,12 +27166,12 @@ var init_unique_constraint2 = __esm({
27931
27166
  return this.name;
27932
27167
  }
27933
27168
  };
27934
- __publicField(UniqueConstraint2, _a168, "SQLiteUniqueConstraint");
27169
+ __publicField(UniqueConstraint2, _a166, "SQLiteUniqueConstraint");
27935
27170
  }
27936
27171
  });
27937
27172
 
27938
27173
  // ../drizzle-orm/dist/sqlite-core/columns/common.js
27939
- var _a169, _b114, SQLiteColumnBuilder, _a170, _b115, SQLiteColumn;
27174
+ var _a167, _b114, SQLiteColumnBuilder, _a168, _b115, SQLiteColumn;
27940
27175
  var init_common3 = __esm({
27941
27176
  "../drizzle-orm/dist/sqlite-core/columns/common.js"() {
27942
27177
  "use strict";
@@ -27945,7 +27180,7 @@ var init_common3 = __esm({
27945
27180
  init_entity();
27946
27181
  init_foreign_keys2();
27947
27182
  init_unique_constraint2();
27948
- SQLiteColumnBuilder = class extends (_b114 = ColumnBuilder, _a169 = entityKind, _b114) {
27183
+ SQLiteColumnBuilder = class extends (_b114 = ColumnBuilder, _a167 = entityKind, _b114) {
27949
27184
  constructor() {
27950
27185
  super(...arguments);
27951
27186
  __publicField(this, "foreignKeyConfigs", []);
@@ -27986,8 +27221,8 @@ var init_common3 = __esm({
27986
27221
  });
27987
27222
  }
27988
27223
  };
27989
- __publicField(SQLiteColumnBuilder, _a169, "SQLiteColumnBuilder");
27990
- SQLiteColumn = class extends (_b115 = Column2, _a170 = entityKind, _b115) {
27224
+ __publicField(SQLiteColumnBuilder, _a167, "SQLiteColumnBuilder");
27225
+ SQLiteColumn = class extends (_b115 = Column2, _a168 = entityKind, _b115) {
27991
27226
  constructor(table4, config) {
27992
27227
  if (!config.uniqueName) {
27993
27228
  config.uniqueName = uniqueKeyName2(table4, [config.name]);
@@ -27996,7 +27231,7 @@ var init_common3 = __esm({
27996
27231
  this.table = table4;
27997
27232
  }
27998
27233
  };
27999
- __publicField(SQLiteColumn, _a170, "SQLiteColumn");
27234
+ __publicField(SQLiteColumn, _a168, "SQLiteColumn");
28000
27235
  }
28001
27236
  });
28002
27237
 
@@ -28011,14 +27246,14 @@ function blob(a, b) {
28011
27246
  }
28012
27247
  return new SQLiteBlobBufferBuilder(name2);
28013
27248
  }
28014
- var _a171, _b116, SQLiteBigIntBuilder, _a172, _b117, SQLiteBigInt, _a173, _b118, SQLiteBlobJsonBuilder, _a174, _b119, SQLiteBlobJson, _a175, _b120, SQLiteBlobBufferBuilder, _a176, _b121, SQLiteBlobBuffer;
27249
+ var _a169, _b116, SQLiteBigIntBuilder, _a170, _b117, SQLiteBigInt, _a171, _b118, SQLiteBlobJsonBuilder, _a172, _b119, SQLiteBlobJson, _a173, _b120, SQLiteBlobBufferBuilder, _a174, _b121, SQLiteBlobBuffer;
28015
27250
  var init_blob = __esm({
28016
27251
  "../drizzle-orm/dist/sqlite-core/columns/blob.js"() {
28017
27252
  "use strict";
28018
27253
  init_entity();
28019
27254
  init_utils2();
28020
27255
  init_common3();
28021
- SQLiteBigIntBuilder = class extends (_b116 = SQLiteColumnBuilder, _a171 = entityKind, _b116) {
27256
+ SQLiteBigIntBuilder = class extends (_b116 = SQLiteColumnBuilder, _a169 = entityKind, _b116) {
28022
27257
  constructor(name2) {
28023
27258
  super(name2, "bigint", "SQLiteBigInt");
28024
27259
  }
@@ -28027,8 +27262,8 @@ var init_blob = __esm({
28027
27262
  return new SQLiteBigInt(table4, this.config);
28028
27263
  }
28029
27264
  };
28030
- __publicField(SQLiteBigIntBuilder, _a171, "SQLiteBigIntBuilder");
28031
- SQLiteBigInt = class extends (_b117 = SQLiteColumn, _a172 = entityKind, _b117) {
27265
+ __publicField(SQLiteBigIntBuilder, _a169, "SQLiteBigIntBuilder");
27266
+ SQLiteBigInt = class extends (_b117 = SQLiteColumn, _a170 = entityKind, _b117) {
28032
27267
  getSQLType() {
28033
27268
  return "blob";
28034
27269
  }
@@ -28039,8 +27274,8 @@ var init_blob = __esm({
28039
27274
  return Buffer.from(value.toString());
28040
27275
  }
28041
27276
  };
28042
- __publicField(SQLiteBigInt, _a172, "SQLiteBigInt");
28043
- SQLiteBlobJsonBuilder = class extends (_b118 = SQLiteColumnBuilder, _a173 = entityKind, _b118) {
27277
+ __publicField(SQLiteBigInt, _a170, "SQLiteBigInt");
27278
+ SQLiteBlobJsonBuilder = class extends (_b118 = SQLiteColumnBuilder, _a171 = entityKind, _b118) {
28044
27279
  constructor(name2) {
28045
27280
  super(name2, "json", "SQLiteBlobJson");
28046
27281
  }
@@ -28052,8 +27287,8 @@ var init_blob = __esm({
28052
27287
  );
28053
27288
  }
28054
27289
  };
28055
- __publicField(SQLiteBlobJsonBuilder, _a173, "SQLiteBlobJsonBuilder");
28056
- SQLiteBlobJson = class extends (_b119 = SQLiteColumn, _a174 = entityKind, _b119) {
27290
+ __publicField(SQLiteBlobJsonBuilder, _a171, "SQLiteBlobJsonBuilder");
27291
+ SQLiteBlobJson = class extends (_b119 = SQLiteColumn, _a172 = entityKind, _b119) {
28057
27292
  getSQLType() {
28058
27293
  return "blob";
28059
27294
  }
@@ -28064,8 +27299,8 @@ var init_blob = __esm({
28064
27299
  return Buffer.from(JSON.stringify(value));
28065
27300
  }
28066
27301
  };
28067
- __publicField(SQLiteBlobJson, _a174, "SQLiteBlobJson");
28068
- SQLiteBlobBufferBuilder = class extends (_b120 = SQLiteColumnBuilder, _a175 = entityKind, _b120) {
27302
+ __publicField(SQLiteBlobJson, _a172, "SQLiteBlobJson");
27303
+ SQLiteBlobBufferBuilder = class extends (_b120 = SQLiteColumnBuilder, _a173 = entityKind, _b120) {
28069
27304
  constructor(name2) {
28070
27305
  super(name2, "buffer", "SQLiteBlobBuffer");
28071
27306
  }
@@ -28074,13 +27309,13 @@ var init_blob = __esm({
28074
27309
  return new SQLiteBlobBuffer(table4, this.config);
28075
27310
  }
28076
27311
  };
28077
- __publicField(SQLiteBlobBufferBuilder, _a175, "SQLiteBlobBufferBuilder");
28078
- SQLiteBlobBuffer = class extends (_b121 = SQLiteColumn, _a176 = entityKind, _b121) {
27312
+ __publicField(SQLiteBlobBufferBuilder, _a173, "SQLiteBlobBufferBuilder");
27313
+ SQLiteBlobBuffer = class extends (_b121 = SQLiteColumn, _a174 = entityKind, _b121) {
28079
27314
  getSQLType() {
28080
27315
  return "blob";
28081
27316
  }
28082
27317
  };
28083
- __publicField(SQLiteBlobBuffer, _a176, "SQLiteBlobBuffer");
27318
+ __publicField(SQLiteBlobBuffer, _a174, "SQLiteBlobBuffer");
28084
27319
  }
28085
27320
  });
28086
27321
 
@@ -28095,14 +27330,14 @@ function customType2(customTypeParams) {
28095
27330
  );
28096
27331
  };
28097
27332
  }
28098
- var _a177, _b122, SQLiteCustomColumnBuilder, _a178, _b123, SQLiteCustomColumn;
27333
+ var _a175, _b122, SQLiteCustomColumnBuilder, _a176, _b123, SQLiteCustomColumn;
28099
27334
  var init_custom2 = __esm({
28100
27335
  "../drizzle-orm/dist/sqlite-core/columns/custom.js"() {
28101
27336
  "use strict";
28102
27337
  init_entity();
28103
27338
  init_utils2();
28104
27339
  init_common3();
28105
- SQLiteCustomColumnBuilder = class extends (_b122 = SQLiteColumnBuilder, _a177 = entityKind, _b122) {
27340
+ SQLiteCustomColumnBuilder = class extends (_b122 = SQLiteColumnBuilder, _a175 = entityKind, _b122) {
28106
27341
  constructor(name2, fieldConfig, customTypeParams) {
28107
27342
  super(name2, "custom", "SQLiteCustomColumn");
28108
27343
  this.config.fieldConfig = fieldConfig;
@@ -28116,8 +27351,8 @@ var init_custom2 = __esm({
28116
27351
  );
28117
27352
  }
28118
27353
  };
28119
- __publicField(SQLiteCustomColumnBuilder, _a177, "SQLiteCustomColumnBuilder");
28120
- SQLiteCustomColumn = class extends (_b123 = SQLiteColumn, _a178 = entityKind, _b123) {
27354
+ __publicField(SQLiteCustomColumnBuilder, _a175, "SQLiteCustomColumnBuilder");
27355
+ SQLiteCustomColumn = class extends (_b123 = SQLiteColumn, _a176 = entityKind, _b123) {
28121
27356
  constructor(table4, config) {
28122
27357
  super(table4, config);
28123
27358
  __publicField(this, "sqlName");
@@ -28137,7 +27372,7 @@ var init_custom2 = __esm({
28137
27372
  return typeof this.mapTo === "function" ? this.mapTo(value) : value;
28138
27373
  }
28139
27374
  };
28140
- __publicField(SQLiteCustomColumn, _a178, "SQLiteCustomColumn");
27375
+ __publicField(SQLiteCustomColumn, _a176, "SQLiteCustomColumn");
28141
27376
  }
28142
27377
  });
28143
27378
 
@@ -28152,7 +27387,7 @@ function integer2(a, b) {
28152
27387
  }
28153
27388
  return new SQLiteIntegerBuilder(name2);
28154
27389
  }
28155
- var _a179, _b124, SQLiteBaseIntegerBuilder, _a180, _b125, SQLiteBaseInteger, _a181, _b126, SQLiteIntegerBuilder, _a182, _b127, SQLiteInteger, _a183, _b128, SQLiteTimestampBuilder, _a184, _b129, SQLiteTimestamp, _a185, _b130, SQLiteBooleanBuilder, _a186, _b131, SQLiteBoolean;
27390
+ var _a177, _b124, SQLiteBaseIntegerBuilder, _a178, _b125, SQLiteBaseInteger, _a179, _b126, SQLiteIntegerBuilder, _a180, _b127, SQLiteInteger, _a181, _b128, SQLiteTimestampBuilder, _a182, _b129, SQLiteTimestamp, _a183, _b130, SQLiteBooleanBuilder, _a184, _b131, SQLiteBoolean;
28156
27391
  var init_integer2 = __esm({
28157
27392
  "../drizzle-orm/dist/sqlite-core/columns/integer.js"() {
28158
27393
  "use strict";
@@ -28160,7 +27395,7 @@ var init_integer2 = __esm({
28160
27395
  init_sql();
28161
27396
  init_utils2();
28162
27397
  init_common3();
28163
- SQLiteBaseIntegerBuilder = class extends (_b124 = SQLiteColumnBuilder, _a179 = entityKind, _b124) {
27398
+ SQLiteBaseIntegerBuilder = class extends (_b124 = SQLiteColumnBuilder, _a177 = entityKind, _b124) {
28164
27399
  constructor(name2, dataType, columnType) {
28165
27400
  super(name2, dataType, columnType);
28166
27401
  this.config.autoIncrement = false;
@@ -28173,8 +27408,8 @@ var init_integer2 = __esm({
28173
27408
  return super.primaryKey();
28174
27409
  }
28175
27410
  };
28176
- __publicField(SQLiteBaseIntegerBuilder, _a179, "SQLiteBaseIntegerBuilder");
28177
- SQLiteBaseInteger = class extends (_b125 = SQLiteColumn, _a180 = entityKind, _b125) {
27411
+ __publicField(SQLiteBaseIntegerBuilder, _a177, "SQLiteBaseIntegerBuilder");
27412
+ SQLiteBaseInteger = class extends (_b125 = SQLiteColumn, _a178 = entityKind, _b125) {
28178
27413
  constructor() {
28179
27414
  super(...arguments);
28180
27415
  __publicField(this, "autoIncrement", this.config.autoIncrement);
@@ -28183,8 +27418,8 @@ var init_integer2 = __esm({
28183
27418
  return "integer";
28184
27419
  }
28185
27420
  };
28186
- __publicField(SQLiteBaseInteger, _a180, "SQLiteBaseInteger");
28187
- SQLiteIntegerBuilder = class extends (_b126 = SQLiteBaseIntegerBuilder, _a181 = entityKind, _b126) {
27421
+ __publicField(SQLiteBaseInteger, _a178, "SQLiteBaseInteger");
27422
+ SQLiteIntegerBuilder = class extends (_b126 = SQLiteBaseIntegerBuilder, _a179 = entityKind, _b126) {
28188
27423
  constructor(name2) {
28189
27424
  super(name2, "number", "SQLiteInteger");
28190
27425
  }
@@ -28195,11 +27430,11 @@ var init_integer2 = __esm({
28195
27430
  );
28196
27431
  }
28197
27432
  };
28198
- __publicField(SQLiteIntegerBuilder, _a181, "SQLiteIntegerBuilder");
28199
- SQLiteInteger = class extends (_b127 = SQLiteBaseInteger, _a182 = entityKind, _b127) {
27433
+ __publicField(SQLiteIntegerBuilder, _a179, "SQLiteIntegerBuilder");
27434
+ SQLiteInteger = class extends (_b127 = SQLiteBaseInteger, _a180 = entityKind, _b127) {
28200
27435
  };
28201
- __publicField(SQLiteInteger, _a182, "SQLiteInteger");
28202
- SQLiteTimestampBuilder = class extends (_b128 = SQLiteBaseIntegerBuilder, _a183 = entityKind, _b128) {
27436
+ __publicField(SQLiteInteger, _a180, "SQLiteInteger");
27437
+ SQLiteTimestampBuilder = class extends (_b128 = SQLiteBaseIntegerBuilder, _a181 = entityKind, _b128) {
28203
27438
  constructor(name2, mode) {
28204
27439
  super(name2, "date", "SQLiteTimestamp");
28205
27440
  this.config.mode = mode;
@@ -28219,8 +27454,8 @@ var init_integer2 = __esm({
28219
27454
  );
28220
27455
  }
28221
27456
  };
28222
- __publicField(SQLiteTimestampBuilder, _a183, "SQLiteTimestampBuilder");
28223
- SQLiteTimestamp = class extends (_b129 = SQLiteBaseInteger, _a184 = entityKind, _b129) {
27457
+ __publicField(SQLiteTimestampBuilder, _a181, "SQLiteTimestampBuilder");
27458
+ SQLiteTimestamp = class extends (_b129 = SQLiteBaseInteger, _a182 = entityKind, _b129) {
28224
27459
  constructor() {
28225
27460
  super(...arguments);
28226
27461
  __publicField(this, "mode", this.config.mode);
@@ -28239,8 +27474,8 @@ var init_integer2 = __esm({
28239
27474
  return unix;
28240
27475
  }
28241
27476
  };
28242
- __publicField(SQLiteTimestamp, _a184, "SQLiteTimestamp");
28243
- SQLiteBooleanBuilder = class extends (_b130 = SQLiteBaseIntegerBuilder, _a185 = entityKind, _b130) {
27477
+ __publicField(SQLiteTimestamp, _a182, "SQLiteTimestamp");
27478
+ SQLiteBooleanBuilder = class extends (_b130 = SQLiteBaseIntegerBuilder, _a183 = entityKind, _b130) {
28244
27479
  constructor(name2, mode) {
28245
27480
  super(name2, "boolean", "SQLiteBoolean");
28246
27481
  this.config.mode = mode;
@@ -28252,8 +27487,8 @@ var init_integer2 = __esm({
28252
27487
  );
28253
27488
  }
28254
27489
  };
28255
- __publicField(SQLiteBooleanBuilder, _a185, "SQLiteBooleanBuilder");
28256
- SQLiteBoolean = class extends (_b131 = SQLiteBaseInteger, _a186 = entityKind, _b131) {
27490
+ __publicField(SQLiteBooleanBuilder, _a183, "SQLiteBooleanBuilder");
27491
+ SQLiteBoolean = class extends (_b131 = SQLiteBaseInteger, _a184 = entityKind, _b131) {
28257
27492
  constructor() {
28258
27493
  super(...arguments);
28259
27494
  __publicField(this, "mode", this.config.mode);
@@ -28265,7 +27500,7 @@ var init_integer2 = __esm({
28265
27500
  return value ? 1 : 0;
28266
27501
  }
28267
27502
  };
28268
- __publicField(SQLiteBoolean, _a186, "SQLiteBoolean");
27503
+ __publicField(SQLiteBoolean, _a184, "SQLiteBoolean");
28269
27504
  }
28270
27505
  });
28271
27506
 
@@ -28273,13 +27508,13 @@ var init_integer2 = __esm({
28273
27508
  function numeric2(name2) {
28274
27509
  return new SQLiteNumericBuilder(name2 ?? "");
28275
27510
  }
28276
- var _a187, _b132, SQLiteNumericBuilder, _a188, _b133, SQLiteNumeric;
27511
+ var _a185, _b132, SQLiteNumericBuilder, _a186, _b133, SQLiteNumeric;
28277
27512
  var init_numeric2 = __esm({
28278
27513
  "../drizzle-orm/dist/sqlite-core/columns/numeric.js"() {
28279
27514
  "use strict";
28280
27515
  init_entity();
28281
27516
  init_common3();
28282
- SQLiteNumericBuilder = class extends (_b132 = SQLiteColumnBuilder, _a187 = entityKind, _b132) {
27517
+ SQLiteNumericBuilder = class extends (_b132 = SQLiteColumnBuilder, _a185 = entityKind, _b132) {
28283
27518
  constructor(name2) {
28284
27519
  super(name2, "string", "SQLiteNumeric");
28285
27520
  }
@@ -28291,13 +27526,13 @@ var init_numeric2 = __esm({
28291
27526
  );
28292
27527
  }
28293
27528
  };
28294
- __publicField(SQLiteNumericBuilder, _a187, "SQLiteNumericBuilder");
28295
- SQLiteNumeric = class extends (_b133 = SQLiteColumn, _a188 = entityKind, _b133) {
27529
+ __publicField(SQLiteNumericBuilder, _a185, "SQLiteNumericBuilder");
27530
+ SQLiteNumeric = class extends (_b133 = SQLiteColumn, _a186 = entityKind, _b133) {
28296
27531
  getSQLType() {
28297
27532
  return "numeric";
28298
27533
  }
28299
27534
  };
28300
- __publicField(SQLiteNumeric, _a188, "SQLiteNumeric");
27535
+ __publicField(SQLiteNumeric, _a186, "SQLiteNumeric");
28301
27536
  }
28302
27537
  });
28303
27538
 
@@ -28305,13 +27540,13 @@ var init_numeric2 = __esm({
28305
27540
  function real2(name2) {
28306
27541
  return new SQLiteRealBuilder(name2 ?? "");
28307
27542
  }
28308
- var _a189, _b134, SQLiteRealBuilder, _a190, _b135, SQLiteReal;
27543
+ var _a187, _b134, SQLiteRealBuilder, _a188, _b135, SQLiteReal;
28309
27544
  var init_real2 = __esm({
28310
27545
  "../drizzle-orm/dist/sqlite-core/columns/real.js"() {
28311
27546
  "use strict";
28312
27547
  init_entity();
28313
27548
  init_common3();
28314
- SQLiteRealBuilder = class extends (_b134 = SQLiteColumnBuilder, _a189 = entityKind, _b134) {
27549
+ SQLiteRealBuilder = class extends (_b134 = SQLiteColumnBuilder, _a187 = entityKind, _b134) {
28315
27550
  constructor(name2) {
28316
27551
  super(name2, "number", "SQLiteReal");
28317
27552
  }
@@ -28320,13 +27555,13 @@ var init_real2 = __esm({
28320
27555
  return new SQLiteReal(table4, this.config);
28321
27556
  }
28322
27557
  };
28323
- __publicField(SQLiteRealBuilder, _a189, "SQLiteRealBuilder");
28324
- SQLiteReal = class extends (_b135 = SQLiteColumn, _a190 = entityKind, _b135) {
27558
+ __publicField(SQLiteRealBuilder, _a187, "SQLiteRealBuilder");
27559
+ SQLiteReal = class extends (_b135 = SQLiteColumn, _a188 = entityKind, _b135) {
28325
27560
  getSQLType() {
28326
27561
  return "real";
28327
27562
  }
28328
27563
  };
28329
- __publicField(SQLiteReal, _a190, "SQLiteReal");
27564
+ __publicField(SQLiteReal, _a188, "SQLiteReal");
28330
27565
  }
28331
27566
  });
28332
27567
 
@@ -28338,14 +27573,14 @@ function text2(a, b = {}) {
28338
27573
  }
28339
27574
  return new SQLiteTextBuilder(name2, config);
28340
27575
  }
28341
- var _a191, _b136, SQLiteTextBuilder, _a192, _b137, SQLiteText, _a193, _b138, SQLiteTextJsonBuilder, _a194, _b139, SQLiteTextJson;
27576
+ var _a189, _b136, SQLiteTextBuilder, _a190, _b137, SQLiteText, _a191, _b138, SQLiteTextJsonBuilder, _a192, _b139, SQLiteTextJson;
28342
27577
  var init_text2 = __esm({
28343
27578
  "../drizzle-orm/dist/sqlite-core/columns/text.js"() {
28344
27579
  "use strict";
28345
27580
  init_entity();
28346
27581
  init_utils2();
28347
27582
  init_common3();
28348
- SQLiteTextBuilder = class extends (_b136 = SQLiteColumnBuilder, _a191 = entityKind, _b136) {
27583
+ SQLiteTextBuilder = class extends (_b136 = SQLiteColumnBuilder, _a189 = entityKind, _b136) {
28349
27584
  constructor(name2, config) {
28350
27585
  super(name2, "string", "SQLiteText");
28351
27586
  this.config.enumValues = config.enum;
@@ -28356,8 +27591,8 @@ var init_text2 = __esm({
28356
27591
  return new SQLiteText(table4, this.config);
28357
27592
  }
28358
27593
  };
28359
- __publicField(SQLiteTextBuilder, _a191, "SQLiteTextBuilder");
28360
- SQLiteText = class extends (_b137 = SQLiteColumn, _a192 = entityKind, _b137) {
27594
+ __publicField(SQLiteTextBuilder, _a189, "SQLiteTextBuilder");
27595
+ SQLiteText = class extends (_b137 = SQLiteColumn, _a190 = entityKind, _b137) {
28361
27596
  constructor(table4, config) {
28362
27597
  super(table4, config);
28363
27598
  __publicField(this, "enumValues", this.config.enumValues);
@@ -28367,8 +27602,8 @@ var init_text2 = __esm({
28367
27602
  return `text${this.config.length ? `(${this.config.length})` : ""}`;
28368
27603
  }
28369
27604
  };
28370
- __publicField(SQLiteText, _a192, "SQLiteText");
28371
- SQLiteTextJsonBuilder = class extends (_b138 = SQLiteColumnBuilder, _a193 = entityKind, _b138) {
27605
+ __publicField(SQLiteText, _a190, "SQLiteText");
27606
+ SQLiteTextJsonBuilder = class extends (_b138 = SQLiteColumnBuilder, _a191 = entityKind, _b138) {
28372
27607
  constructor(name2) {
28373
27608
  super(name2, "json", "SQLiteTextJson");
28374
27609
  }
@@ -28380,8 +27615,8 @@ var init_text2 = __esm({
28380
27615
  );
28381
27616
  }
28382
27617
  };
28383
- __publicField(SQLiteTextJsonBuilder, _a193, "SQLiteTextJsonBuilder");
28384
- SQLiteTextJson = class extends (_b139 = SQLiteColumn, _a194 = entityKind, _b139) {
27618
+ __publicField(SQLiteTextJsonBuilder, _a191, "SQLiteTextJsonBuilder");
27619
+ SQLiteTextJson = class extends (_b139 = SQLiteColumn, _a192 = entityKind, _b139) {
28385
27620
  getSQLType() {
28386
27621
  return "text";
28387
27622
  }
@@ -28392,7 +27627,7 @@ var init_text2 = __esm({
28392
27627
  return JSON.stringify(value);
28393
27628
  }
28394
27629
  };
28395
- __publicField(SQLiteTextJson, _a194, "SQLiteTextJson");
27630
+ __publicField(SQLiteTextJson, _a192, "SQLiteTextJson");
28396
27631
  }
28397
27632
  });
28398
27633
 
@@ -28454,7 +27689,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
28454
27689
  }
28455
27690
  return table4;
28456
27691
  }
28457
- var InlineForeignKeys2, _a195, _b140, _c6, _d3, _e2, SQLiteTable, sqliteTable;
27692
+ var InlineForeignKeys2, _a193, _b140, _c6, _d3, _e2, SQLiteTable, sqliteTable;
28458
27693
  var init_table3 = __esm({
28459
27694
  "../drizzle-orm/dist/sqlite-core/table.js"() {
28460
27695
  "use strict";
@@ -28462,7 +27697,7 @@ var init_table3 = __esm({
28462
27697
  init_table();
28463
27698
  init_all2();
28464
27699
  InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
28465
- SQLiteTable = class extends (_e2 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a195 = Table.Symbol.ExtraConfigBuilder, _e2) {
27700
+ SQLiteTable = class extends (_e2 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a193 = Table.Symbol.ExtraConfigBuilder, _e2) {
28466
27701
  constructor() {
28467
27702
  super(...arguments);
28468
27703
  /** @internal */
@@ -28470,7 +27705,7 @@ var init_table3 = __esm({
28470
27705
  /** @internal */
28471
27706
  __publicField(this, _b140, []);
28472
27707
  /** @internal */
28473
- __publicField(this, _a195);
27708
+ __publicField(this, _a193);
28474
27709
  }
28475
27710
  };
28476
27711
  __publicField(SQLiteTable, _d3, "SQLiteTable");
@@ -28485,7 +27720,7 @@ var init_table3 = __esm({
28485
27720
  });
28486
27721
 
28487
27722
  // ../drizzle-orm/dist/sqlite-core/query-builders/delete.js
28488
- var _a196, _b141, SQLiteDeleteBase;
27723
+ var _a194, _b141, SQLiteDeleteBase;
28489
27724
  var init_delete2 = __esm({
28490
27725
  "../drizzle-orm/dist/sqlite-core/query-builders/delete.js"() {
28491
27726
  "use strict";
@@ -28493,7 +27728,7 @@ var init_delete2 = __esm({
28493
27728
  init_query_promise();
28494
27729
  init_table3();
28495
27730
  init_utils2();
28496
- SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a196 = entityKind, _b141) {
27731
+ SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a194 = entityKind, _b141) {
28497
27732
  constructor(table4, session, dialect4, withList) {
28498
27733
  super();
28499
27734
  /** @internal */
@@ -28579,12 +27814,12 @@ var init_delete2 = __esm({
28579
27814
  return this;
28580
27815
  }
28581
27816
  };
28582
- __publicField(SQLiteDeleteBase, _a196, "SQLiteDelete");
27817
+ __publicField(SQLiteDeleteBase, _a194, "SQLiteDelete");
28583
27818
  }
28584
27819
  });
28585
27820
 
28586
27821
  // ../drizzle-orm/dist/sqlite-core/query-builders/insert.js
28587
- var _a197, SQLiteInsertBuilder, _a198, _b142, SQLiteInsertBase;
27822
+ var _a195, SQLiteInsertBuilder, _a196, _b142, SQLiteInsertBase;
28588
27823
  var init_insert2 = __esm({
28589
27824
  "../drizzle-orm/dist/sqlite-core/query-builders/insert.js"() {
28590
27825
  "use strict";
@@ -28594,7 +27829,7 @@ var init_insert2 = __esm({
28594
27829
  init_table3();
28595
27830
  init_table();
28596
27831
  init_utils2();
28597
- _a197 = entityKind;
27832
+ _a195 = entityKind;
28598
27833
  SQLiteInsertBuilder = class {
28599
27834
  constructor(table4, session, dialect4, withList) {
28600
27835
  this.table = table4;
@@ -28619,8 +27854,8 @@ var init_insert2 = __esm({
28619
27854
  return new SQLiteInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList);
28620
27855
  }
28621
27856
  };
28622
- __publicField(SQLiteInsertBuilder, _a197, "SQLiteInsertBuilder");
28623
- SQLiteInsertBase = class extends (_b142 = QueryPromise, _a198 = entityKind, _b142) {
27857
+ __publicField(SQLiteInsertBuilder, _a195, "SQLiteInsertBuilder");
27858
+ SQLiteInsertBase = class extends (_b142 = QueryPromise, _a196 = entityKind, _b142) {
28624
27859
  constructor(table4, values, session, dialect4, withList) {
28625
27860
  super();
28626
27861
  /** @internal */
@@ -28747,25 +27982,25 @@ var init_insert2 = __esm({
28747
27982
  return this;
28748
27983
  }
28749
27984
  };
28750
- __publicField(SQLiteInsertBase, _a198, "SQLiteInsert");
27985
+ __publicField(SQLiteInsertBase, _a196, "SQLiteInsert");
28751
27986
  }
28752
27987
  });
28753
27988
 
28754
27989
  // ../drizzle-orm/dist/sqlite-core/view-base.js
28755
- var _a199, _b143, SQLiteViewBase;
27990
+ var _a197, _b143, SQLiteViewBase;
28756
27991
  var init_view_base2 = __esm({
28757
27992
  "../drizzle-orm/dist/sqlite-core/view-base.js"() {
28758
27993
  "use strict";
28759
27994
  init_entity();
28760
27995
  init_sql();
28761
- SQLiteViewBase = class extends (_b143 = View, _a199 = entityKind, _b143) {
27996
+ SQLiteViewBase = class extends (_b143 = View, _a197 = entityKind, _b143) {
28762
27997
  };
28763
- __publicField(SQLiteViewBase, _a199, "SQLiteViewBase");
27998
+ __publicField(SQLiteViewBase, _a197, "SQLiteViewBase");
28764
27999
  }
28765
28000
  });
28766
28001
 
28767
28002
  // ../drizzle-orm/dist/sqlite-core/dialect.js
28768
- var _a200, SQLiteDialect, _a201, _b144, SQLiteSyncDialect, _a202, _b145, SQLiteAsyncDialect;
28003
+ var _a198, SQLiteDialect, _a199, _b144, SQLiteSyncDialect, _a200, _b145, SQLiteAsyncDialect;
28769
28004
  var init_dialect2 = __esm({
28770
28005
  "../drizzle-orm/dist/sqlite-core/dialect.js"() {
28771
28006
  "use strict";
@@ -28784,7 +28019,7 @@ var init_dialect2 = __esm({
28784
28019
  init_utils2();
28785
28020
  init_view_common();
28786
28021
  init_view_base2();
28787
- _a200 = entityKind;
28022
+ _a198 = entityKind;
28788
28023
  SQLiteDialect = class {
28789
28024
  constructor(config) {
28790
28025
  /** @internal */
@@ -29296,8 +28531,8 @@ var init_dialect2 = __esm({
29296
28531
  };
29297
28532
  }
29298
28533
  };
29299
- __publicField(SQLiteDialect, _a200, "SQLiteDialect");
29300
- SQLiteSyncDialect = class extends (_b144 = SQLiteDialect, _a201 = entityKind, _b144) {
28534
+ __publicField(SQLiteDialect, _a198, "SQLiteDialect");
28535
+ SQLiteSyncDialect = class extends (_b144 = SQLiteDialect, _a199 = entityKind, _b144) {
29301
28536
  migrate(migrations, session, config) {
29302
28537
  const migrationsTable = config === void 0 ? "__drizzle_migrations" : typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations";
29303
28538
  const migrationTableCreate = sql`
@@ -29331,8 +28566,8 @@ var init_dialect2 = __esm({
29331
28566
  }
29332
28567
  }
29333
28568
  };
29334
- __publicField(SQLiteSyncDialect, _a201, "SQLiteSyncDialect");
29335
- SQLiteAsyncDialect = class extends (_b145 = SQLiteDialect, _a202 = entityKind, _b145) {
28569
+ __publicField(SQLiteSyncDialect, _a199, "SQLiteSyncDialect");
28570
+ SQLiteAsyncDialect = class extends (_b145 = SQLiteDialect, _a200 = entityKind, _b145) {
29336
28571
  async migrate(migrations, session, config) {
29337
28572
  const migrationsTable = config === void 0 ? "__drizzle_migrations" : typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations";
29338
28573
  const migrationTableCreate = sql`
@@ -29361,7 +28596,7 @@ var init_dialect2 = __esm({
29361
28596
  });
29362
28597
  }
29363
28598
  };
29364
- __publicField(SQLiteAsyncDialect, _a202, "SQLiteAsyncDialect");
28599
+ __publicField(SQLiteAsyncDialect, _a200, "SQLiteAsyncDialect");
29365
28600
  }
29366
28601
  });
29367
28602
 
@@ -29383,7 +28618,7 @@ function createSetOperator2(type, isAll) {
29383
28618
  return leftSelect.addSetOperators(setOperators);
29384
28619
  };
29385
28620
  }
29386
- var _a203, SQLiteSelectBuilder, _a204, _b146, SQLiteSelectQueryBuilderBase, _a205, _b147, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
28621
+ var _a201, SQLiteSelectBuilder, _a202, _b146, SQLiteSelectQueryBuilderBase, _a203, _b147, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
29387
28622
  var init_select3 = __esm({
29388
28623
  "../drizzle-orm/dist/sqlite-core/query-builders/select.js"() {
29389
28624
  "use strict";
@@ -29397,7 +28632,7 @@ var init_select3 = __esm({
29397
28632
  init_utils2();
29398
28633
  init_view_common();
29399
28634
  init_view_base2();
29400
- _a203 = entityKind;
28635
+ _a201 = entityKind;
29401
28636
  SQLiteSelectBuilder = class {
29402
28637
  constructor(config) {
29403
28638
  __publicField(this, "fields");
@@ -29438,8 +28673,8 @@ var init_select3 = __esm({
29438
28673
  });
29439
28674
  }
29440
28675
  };
29441
- __publicField(SQLiteSelectBuilder, _a203, "SQLiteSelectBuilder");
29442
- SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a204 = entityKind, _b146) {
28676
+ __publicField(SQLiteSelectBuilder, _a201, "SQLiteSelectBuilder");
28677
+ SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a202 = entityKind, _b146) {
29443
28678
  constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
29444
28679
  super();
29445
28680
  __publicField(this, "_");
@@ -29944,8 +29179,8 @@ var init_select3 = __esm({
29944
29179
  return this;
29945
29180
  }
29946
29181
  };
29947
- __publicField(SQLiteSelectQueryBuilderBase, _a204, "SQLiteSelectQueryBuilder");
29948
- SQLiteSelectBase = class extends (_b147 = SQLiteSelectQueryBuilderBase, _a205 = entityKind, _b147) {
29182
+ __publicField(SQLiteSelectQueryBuilderBase, _a202, "SQLiteSelectQueryBuilder");
29183
+ SQLiteSelectBase = class extends (_b147 = SQLiteSelectQueryBuilderBase, _a203 = entityKind, _b147) {
29949
29184
  constructor() {
29950
29185
  super(...arguments);
29951
29186
  __publicField(this, "run", (placeholderValues) => {
@@ -29983,7 +29218,7 @@ var init_select3 = __esm({
29983
29218
  return this.all();
29984
29219
  }
29985
29220
  };
29986
- __publicField(SQLiteSelectBase, _a205, "SQLiteSelect");
29221
+ __publicField(SQLiteSelectBase, _a203, "SQLiteSelect");
29987
29222
  applyMixins(SQLiteSelectBase, [QueryPromise]);
29988
29223
  getSQLiteSetOperators = () => ({
29989
29224
  union: union2,
@@ -29999,7 +29234,7 @@ var init_select3 = __esm({
29999
29234
  });
30000
29235
 
30001
29236
  // ../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js
30002
- var _a206, QueryBuilder2;
29237
+ var _a204, QueryBuilder2;
30003
29238
  var init_query_builder3 = __esm({
30004
29239
  "../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js"() {
30005
29240
  "use strict";
@@ -30008,7 +29243,7 @@ var init_query_builder3 = __esm({
30008
29243
  init_dialect2();
30009
29244
  init_subquery();
30010
29245
  init_select3();
30011
- _a206 = entityKind;
29246
+ _a204 = entityKind;
30012
29247
  QueryBuilder2 = class {
30013
29248
  constructor(dialect4) {
30014
29249
  __publicField(this, "dialect");
@@ -30070,7 +29305,7 @@ var init_query_builder3 = __esm({
30070
29305
  return this.dialect;
30071
29306
  }
30072
29307
  };
30073
- __publicField(QueryBuilder2, _a206, "SQLiteQueryBuilder");
29308
+ __publicField(QueryBuilder2, _a204, "SQLiteQueryBuilder");
30074
29309
  }
30075
29310
  });
30076
29311
 
@@ -30082,7 +29317,7 @@ var init_select_types2 = __esm({
30082
29317
  });
30083
29318
 
30084
29319
  // ../drizzle-orm/dist/sqlite-core/query-builders/update.js
30085
- var _a207, SQLiteUpdateBuilder, _a208, _b148, SQLiteUpdateBase;
29320
+ var _a205, SQLiteUpdateBuilder, _a206, _b148, SQLiteUpdateBase;
30086
29321
  var init_update2 = __esm({
30087
29322
  "../drizzle-orm/dist/sqlite-core/query-builders/update.js"() {
30088
29323
  "use strict";
@@ -30090,7 +29325,7 @@ var init_update2 = __esm({
30090
29325
  init_query_promise();
30091
29326
  init_table3();
30092
29327
  init_utils2();
30093
- _a207 = entityKind;
29328
+ _a205 = entityKind;
30094
29329
  SQLiteUpdateBuilder = class {
30095
29330
  constructor(table4, session, dialect4, withList) {
30096
29331
  this.table = table4;
@@ -30108,8 +29343,8 @@ var init_update2 = __esm({
30108
29343
  );
30109
29344
  }
30110
29345
  };
30111
- __publicField(SQLiteUpdateBuilder, _a207, "SQLiteUpdateBuilder");
30112
- SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a208 = entityKind, _b148) {
29346
+ __publicField(SQLiteUpdateBuilder, _a205, "SQLiteUpdateBuilder");
29347
+ SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a206 = entityKind, _b148) {
30113
29348
  constructor(table4, set, session, dialect4, withList) {
30114
29349
  super();
30115
29350
  /** @internal */
@@ -30198,7 +29433,7 @@ var init_update2 = __esm({
30198
29433
  return this;
30199
29434
  }
30200
29435
  };
30201
- __publicField(SQLiteUpdateBase, _a208, "SQLiteUpdate");
29436
+ __publicField(SQLiteUpdateBase, _a206, "SQLiteUpdate");
30202
29437
  }
30203
29438
  });
30204
29439
 
@@ -30216,17 +29451,17 @@ var init_query_builders2 = __esm({
30216
29451
  });
30217
29452
 
30218
29453
  // ../drizzle-orm/dist/sqlite-core/query-builders/count.js
30219
- var _a209, _b149, _c7, _SQLiteCountBuilder, SQLiteCountBuilder;
29454
+ var _a207, _b149, _c7, _SQLiteCountBuilder, SQLiteCountBuilder;
30220
29455
  var init_count2 = __esm({
30221
29456
  "../drizzle-orm/dist/sqlite-core/query-builders/count.js"() {
30222
29457
  "use strict";
30223
29458
  init_entity();
30224
29459
  init_sql();
30225
- _SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c7 = SQL, _b149 = entityKind, _a209 = Symbol.toStringTag, _c7) {
29460
+ _SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c7 = SQL, _b149 = entityKind, _a207 = Symbol.toStringTag, _c7) {
30226
29461
  constructor(params) {
30227
29462
  super(_SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
30228
29463
  __publicField(this, "sql");
30229
- __publicField(this, _a209, "SQLiteCountBuilderAsync");
29464
+ __publicField(this, _a207, "SQLiteCountBuilderAsync");
30230
29465
  __publicField(this, "session");
30231
29466
  this.params = params;
30232
29467
  this.session = params.session;
@@ -30269,14 +29504,14 @@ var init_count2 = __esm({
30269
29504
  });
30270
29505
 
30271
29506
  // ../drizzle-orm/dist/sqlite-core/query-builders/query.js
30272
- var _a210, RelationalQueryBuilder2, _a211, _b150, SQLiteRelationalQuery, _a212, _b151, SQLiteSyncRelationalQuery;
29507
+ var _a208, RelationalQueryBuilder2, _a209, _b150, SQLiteRelationalQuery, _a210, _b151, SQLiteSyncRelationalQuery;
30273
29508
  var init_query2 = __esm({
30274
29509
  "../drizzle-orm/dist/sqlite-core/query-builders/query.js"() {
30275
29510
  "use strict";
30276
29511
  init_entity();
30277
29512
  init_query_promise();
30278
29513
  init_relations();
30279
- _a210 = entityKind;
29514
+ _a208 = entityKind;
30280
29515
  RelationalQueryBuilder2 = class {
30281
29516
  constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
30282
29517
  this.mode = mode;
@@ -30335,8 +29570,8 @@ var init_query2 = __esm({
30335
29570
  );
30336
29571
  }
30337
29572
  };
30338
- __publicField(RelationalQueryBuilder2, _a210, "SQLiteAsyncRelationalQueryBuilder");
30339
- SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a211 = entityKind, _b150) {
29573
+ __publicField(RelationalQueryBuilder2, _a208, "SQLiteAsyncRelationalQueryBuilder");
29574
+ SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a209 = entityKind, _b150) {
30340
29575
  constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
30341
29576
  super();
30342
29577
  /** @internal */
@@ -30412,24 +29647,24 @@ var init_query2 = __esm({
30412
29647
  return this.executeRaw();
30413
29648
  }
30414
29649
  };
30415
- __publicField(SQLiteRelationalQuery, _a211, "SQLiteAsyncRelationalQuery");
30416
- SQLiteSyncRelationalQuery = class extends (_b151 = SQLiteRelationalQuery, _a212 = entityKind, _b151) {
29650
+ __publicField(SQLiteRelationalQuery, _a209, "SQLiteAsyncRelationalQuery");
29651
+ SQLiteSyncRelationalQuery = class extends (_b151 = SQLiteRelationalQuery, _a210 = entityKind, _b151) {
30417
29652
  sync() {
30418
29653
  return this.executeRaw();
30419
29654
  }
30420
29655
  };
30421
- __publicField(SQLiteSyncRelationalQuery, _a212, "SQLiteSyncRelationalQuery");
29656
+ __publicField(SQLiteSyncRelationalQuery, _a210, "SQLiteSyncRelationalQuery");
30422
29657
  }
30423
29658
  });
30424
29659
 
30425
29660
  // ../drizzle-orm/dist/sqlite-core/query-builders/raw.js
30426
- var _a213, _b152, SQLiteRaw;
29661
+ var _a211, _b152, SQLiteRaw;
30427
29662
  var init_raw2 = __esm({
30428
29663
  "../drizzle-orm/dist/sqlite-core/query-builders/raw.js"() {
30429
29664
  "use strict";
30430
29665
  init_entity();
30431
29666
  init_query_promise();
30432
- SQLiteRaw = class extends (_b152 = QueryPromise, _a213 = entityKind, _b152) {
29667
+ SQLiteRaw = class extends (_b152 = QueryPromise, _a211 = entityKind, _b152) {
30433
29668
  constructor(execute, getSQL, action, dialect4, mapBatchResult) {
30434
29669
  super();
30435
29670
  /** @internal */
@@ -30454,12 +29689,12 @@ var init_raw2 = __esm({
30454
29689
  return false;
30455
29690
  }
30456
29691
  };
30457
- __publicField(SQLiteRaw, _a213, "SQLiteRaw");
29692
+ __publicField(SQLiteRaw, _a211, "SQLiteRaw");
30458
29693
  }
30459
29694
  });
30460
29695
 
30461
29696
  // ../drizzle-orm/dist/sqlite-core/db.js
30462
- var _a214, BaseSQLiteDatabase;
29697
+ var _a212, BaseSQLiteDatabase;
30463
29698
  var init_db2 = __esm({
30464
29699
  "../drizzle-orm/dist/sqlite-core/db.js"() {
30465
29700
  "use strict";
@@ -30471,7 +29706,7 @@ var init_db2 = __esm({
30471
29706
  init_count2();
30472
29707
  init_query2();
30473
29708
  init_raw2();
30474
- _a214 = entityKind;
29709
+ _a212 = entityKind;
30475
29710
  BaseSQLiteDatabase = class {
30476
29711
  constructor(resultKind, dialect4, session, schema4) {
30477
29712
  __publicField(this, "query");
@@ -30753,17 +29988,17 @@ var init_db2 = __esm({
30753
29988
  return this.session.transaction(transaction, config);
30754
29989
  }
30755
29990
  };
30756
- __publicField(BaseSQLiteDatabase, _a214, "BaseSQLiteDatabase");
29991
+ __publicField(BaseSQLiteDatabase, _a212, "BaseSQLiteDatabase");
30757
29992
  }
30758
29993
  });
30759
29994
 
30760
29995
  // ../drizzle-orm/dist/sqlite-core/indexes.js
30761
- var _a215, IndexBuilderOn2, _a216, IndexBuilder2, _a217, Index4;
29996
+ var _a213, IndexBuilderOn2, _a214, IndexBuilder2, _a215, Index4;
30762
29997
  var init_indexes2 = __esm({
30763
29998
  "../drizzle-orm/dist/sqlite-core/indexes.js"() {
30764
29999
  "use strict";
30765
30000
  init_entity();
30766
- _a215 = entityKind;
30001
+ _a213 = entityKind;
30767
30002
  IndexBuilderOn2 = class {
30768
30003
  constructor(name2, unique) {
30769
30004
  this.name = name2;
@@ -30773,8 +30008,8 @@ var init_indexes2 = __esm({
30773
30008
  return new IndexBuilder2(this.name, columns, this.unique);
30774
30009
  }
30775
30010
  };
30776
- __publicField(IndexBuilderOn2, _a215, "SQLiteIndexBuilderOn");
30777
- _a216 = entityKind;
30011
+ __publicField(IndexBuilderOn2, _a213, "SQLiteIndexBuilderOn");
30012
+ _a214 = entityKind;
30778
30013
  IndexBuilder2 = class {
30779
30014
  constructor(name2, columns, unique) {
30780
30015
  /** @internal */
@@ -30798,26 +30033,26 @@ var init_indexes2 = __esm({
30798
30033
  return new Index4(this.config, table4);
30799
30034
  }
30800
30035
  };
30801
- __publicField(IndexBuilder2, _a216, "SQLiteIndexBuilder");
30802
- _a217 = entityKind;
30036
+ __publicField(IndexBuilder2, _a214, "SQLiteIndexBuilder");
30037
+ _a215 = entityKind;
30803
30038
  Index4 = class {
30804
30039
  constructor(config, table4) {
30805
30040
  __publicField(this, "config");
30806
30041
  this.config = { ...config, table: table4 };
30807
30042
  }
30808
30043
  };
30809
- __publicField(Index4, _a217, "SQLiteIndex");
30044
+ __publicField(Index4, _a215, "SQLiteIndex");
30810
30045
  }
30811
30046
  });
30812
30047
 
30813
30048
  // ../drizzle-orm/dist/sqlite-core/primary-keys.js
30814
- var _a218, PrimaryKeyBuilder2, _a219, PrimaryKey2;
30049
+ var _a216, PrimaryKeyBuilder2, _a217, PrimaryKey2;
30815
30050
  var init_primary_keys2 = __esm({
30816
30051
  "../drizzle-orm/dist/sqlite-core/primary-keys.js"() {
30817
30052
  "use strict";
30818
30053
  init_entity();
30819
30054
  init_table3();
30820
- _a218 = entityKind;
30055
+ _a216 = entityKind;
30821
30056
  PrimaryKeyBuilder2 = class {
30822
30057
  constructor(columns, name2) {
30823
30058
  /** @internal */
@@ -30832,8 +30067,8 @@ var init_primary_keys2 = __esm({
30832
30067
  return new PrimaryKey2(table4, this.columns, this.name);
30833
30068
  }
30834
30069
  };
30835
- __publicField(PrimaryKeyBuilder2, _a218, "SQLitePrimaryKeyBuilder");
30836
- _a219 = entityKind;
30070
+ __publicField(PrimaryKeyBuilder2, _a216, "SQLitePrimaryKeyBuilder");
30071
+ _a217 = entityKind;
30837
30072
  PrimaryKey2 = class {
30838
30073
  constructor(table4, columns, name2) {
30839
30074
  __publicField(this, "columns");
@@ -30846,12 +30081,12 @@ var init_primary_keys2 = __esm({
30846
30081
  return this.name ?? `${this.table[SQLiteTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
30847
30082
  }
30848
30083
  };
30849
- __publicField(PrimaryKey2, _a219, "SQLitePrimaryKey");
30084
+ __publicField(PrimaryKey2, _a217, "SQLitePrimaryKey");
30850
30085
  }
30851
30086
  });
30852
30087
 
30853
30088
  // ../drizzle-orm/dist/sqlite-core/session.js
30854
- var _a220, _b153, ExecuteResultSync, _a221, SQLitePreparedQuery, _a222, SQLiteSession, _a223, _b154, SQLiteTransaction;
30089
+ var _a218, _b153, ExecuteResultSync, _a219, SQLitePreparedQuery, _a220, SQLiteSession, _a221, _b154, SQLiteTransaction;
30855
30090
  var init_session2 = __esm({
30856
30091
  "../drizzle-orm/dist/sqlite-core/session.js"() {
30857
30092
  "use strict";
@@ -30859,7 +30094,7 @@ var init_session2 = __esm({
30859
30094
  init_errors();
30860
30095
  init_query_promise();
30861
30096
  init_db2();
30862
- ExecuteResultSync = class extends (_b153 = QueryPromise, _a220 = entityKind, _b153) {
30097
+ ExecuteResultSync = class extends (_b153 = QueryPromise, _a218 = entityKind, _b153) {
30863
30098
  constructor(resultCb) {
30864
30099
  super();
30865
30100
  this.resultCb = resultCb;
@@ -30871,8 +30106,8 @@ var init_session2 = __esm({
30871
30106
  return this.resultCb();
30872
30107
  }
30873
30108
  };
30874
- __publicField(ExecuteResultSync, _a220, "ExecuteResultSync");
30875
- _a221 = entityKind;
30109
+ __publicField(ExecuteResultSync, _a218, "ExecuteResultSync");
30110
+ _a219 = entityKind;
30876
30111
  SQLitePreparedQuery = class {
30877
30112
  constructor(mode, executeMethod, query) {
30878
30113
  /** @internal */
@@ -30913,8 +30148,8 @@ var init_session2 = __esm({
30913
30148
  }
30914
30149
  }
30915
30150
  };
30916
- __publicField(SQLitePreparedQuery, _a221, "PreparedQuery");
30917
- _a222 = entityKind;
30151
+ __publicField(SQLitePreparedQuery, _a219, "PreparedQuery");
30152
+ _a220 = entityKind;
30918
30153
  SQLiteSession = class {
30919
30154
  constructor(dialect4) {
30920
30155
  this.dialect = dialect4;
@@ -30960,8 +30195,8 @@ var init_session2 = __esm({
30960
30195
  throw new Error("Not implemented");
30961
30196
  }
30962
30197
  };
30963
- __publicField(SQLiteSession, _a222, "SQLiteSession");
30964
- SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a223 = entityKind, _b154) {
30198
+ __publicField(SQLiteSession, _a220, "SQLiteSession");
30199
+ SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a221 = entityKind, _b154) {
30965
30200
  constructor(resultType, dialect4, session, schema4, nestedIndex = 0) {
30966
30201
  super(resultType, dialect4, session, schema4);
30967
30202
  this.schema = schema4;
@@ -30971,7 +30206,7 @@ var init_session2 = __esm({
30971
30206
  throw new TransactionRollbackError();
30972
30207
  }
30973
30208
  };
30974
- __publicField(SQLiteTransaction, _a223, "SQLiteTransaction");
30209
+ __publicField(SQLiteTransaction, _a221, "SQLiteTransaction");
30975
30210
  }
30976
30211
  });
30977
30212
 
@@ -31042,7 +30277,7 @@ var init_utils6 = __esm({
31042
30277
  });
31043
30278
 
31044
30279
  // ../drizzle-orm/dist/sqlite-core/view.js
31045
- var _a224, ViewBuilderCore, _a225, _b155, ViewBuilder2, _a226, _b156, ManualViewBuilder2, _a227, _b157, _c8, SQLiteView;
30280
+ var _a222, ViewBuilderCore, _a223, _b155, ViewBuilder2, _a224, _b156, ManualViewBuilder2, _a225, _b157, _c8, SQLiteView;
31046
30281
  var init_view2 = __esm({
31047
30282
  "../drizzle-orm/dist/sqlite-core/view.js"() {
31048
30283
  "use strict";
@@ -31053,15 +30288,15 @@ var init_view2 = __esm({
31053
30288
  init_table3();
31054
30289
  init_view_base2();
31055
30290
  init_view_common3();
31056
- _a224 = entityKind;
30291
+ _a222 = entityKind;
31057
30292
  ViewBuilderCore = class {
31058
30293
  constructor(name2) {
31059
30294
  __publicField(this, "config", {});
31060
30295
  this.name = name2;
31061
30296
  }
31062
30297
  };
31063
- __publicField(ViewBuilderCore, _a224, "SQLiteViewBuilderCore");
31064
- ViewBuilder2 = class extends (_b155 = ViewBuilderCore, _a225 = entityKind, _b155) {
30298
+ __publicField(ViewBuilderCore, _a222, "SQLiteViewBuilderCore");
30299
+ ViewBuilder2 = class extends (_b155 = ViewBuilderCore, _a223 = entityKind, _b155) {
31065
30300
  as(qb) {
31066
30301
  if (typeof qb === "function") {
31067
30302
  qb = qb(new QueryBuilder2());
@@ -31087,8 +30322,8 @@ var init_view2 = __esm({
31087
30322
  );
31088
30323
  }
31089
30324
  };
31090
- __publicField(ViewBuilder2, _a225, "SQLiteViewBuilder");
31091
- ManualViewBuilder2 = class extends (_b156 = ViewBuilderCore, _a226 = entityKind, _b156) {
30325
+ __publicField(ViewBuilder2, _a223, "SQLiteViewBuilder");
30326
+ ManualViewBuilder2 = class extends (_b156 = ViewBuilderCore, _a224 = entityKind, _b156) {
31092
30327
  constructor(name2, columns) {
31093
30328
  super(name2);
31094
30329
  __publicField(this, "columns");
@@ -31133,12 +30368,12 @@ var init_view2 = __esm({
31133
30368
  );
31134
30369
  }
31135
30370
  };
31136
- __publicField(ManualViewBuilder2, _a226, "SQLiteManualViewBuilder");
31137
- SQLiteView = class extends (_c8 = SQLiteViewBase, _b157 = entityKind, _a227 = SQLiteViewConfig, _c8) {
30371
+ __publicField(ManualViewBuilder2, _a224, "SQLiteManualViewBuilder");
30372
+ SQLiteView = class extends (_c8 = SQLiteViewBase, _b157 = entityKind, _a225 = SQLiteViewConfig, _c8) {
31138
30373
  constructor({ sqliteConfig, config }) {
31139
30374
  super(config);
31140
30375
  /** @internal */
31141
- __publicField(this, _a227);
30376
+ __publicField(this, _a225);
31142
30377
  this[SQLiteViewConfig] = sqliteConfig;
31143
30378
  }
31144
30379
  };
@@ -31675,12 +30910,12 @@ var init_alias4 = __esm({
31675
30910
  });
31676
30911
 
31677
30912
  // ../drizzle-orm/dist/mysql-core/checks.js
31678
- var _a228, CheckBuilder3, _a229, Check3;
30913
+ var _a226, CheckBuilder3, _a227, Check3;
31679
30914
  var init_checks3 = __esm({
31680
30915
  "../drizzle-orm/dist/mysql-core/checks.js"() {
31681
30916
  "use strict";
31682
30917
  init_entity();
31683
- _a228 = entityKind;
30918
+ _a226 = entityKind;
31684
30919
  CheckBuilder3 = class {
31685
30920
  constructor(name2, value) {
31686
30921
  __publicField(this, "brand");
@@ -31692,8 +30927,8 @@ var init_checks3 = __esm({
31692
30927
  return new Check3(table4, this);
31693
30928
  }
31694
30929
  };
31695
- __publicField(CheckBuilder3, _a228, "MySqlCheckBuilder");
31696
- _a229 = entityKind;
30930
+ __publicField(CheckBuilder3, _a226, "MySqlCheckBuilder");
30931
+ _a227 = entityKind;
31697
30932
  Check3 = class {
31698
30933
  constructor(table4, builder) {
31699
30934
  __publicField(this, "name");
@@ -31703,18 +30938,18 @@ var init_checks3 = __esm({
31703
30938
  this.value = builder.value;
31704
30939
  }
31705
30940
  };
31706
- __publicField(Check3, _a229, "MySqlCheck");
30941
+ __publicField(Check3, _a227, "MySqlCheck");
31707
30942
  }
31708
30943
  });
31709
30944
 
31710
30945
  // ../drizzle-orm/dist/mysql-core/foreign-keys.js
31711
- var _a230, ForeignKeyBuilder3, _a231, ForeignKey3;
30946
+ var _a228, ForeignKeyBuilder3, _a229, ForeignKey3;
31712
30947
  var init_foreign_keys3 = __esm({
31713
30948
  "../drizzle-orm/dist/mysql-core/foreign-keys.js"() {
31714
30949
  "use strict";
31715
30950
  init_entity();
31716
30951
  init_table_utils();
31717
- _a230 = entityKind;
30952
+ _a228 = entityKind;
31718
30953
  ForeignKeyBuilder3 = class {
31719
30954
  constructor(config, actions) {
31720
30955
  /** @internal */
@@ -31745,8 +30980,8 @@ var init_foreign_keys3 = __esm({
31745
30980
  return new ForeignKey3(table4, this);
31746
30981
  }
31747
30982
  };
31748
- __publicField(ForeignKeyBuilder3, _a230, "MySqlForeignKeyBuilder");
31749
- _a231 = entityKind;
30983
+ __publicField(ForeignKeyBuilder3, _a228, "MySqlForeignKeyBuilder");
30984
+ _a229 = entityKind;
31750
30985
  ForeignKey3 = class {
31751
30986
  constructor(table4, builder) {
31752
30987
  __publicField(this, "reference");
@@ -31770,7 +31005,7 @@ var init_foreign_keys3 = __esm({
31770
31005
  return name2 ?? `${chunks.join("_")}_fk`;
31771
31006
  }
31772
31007
  };
31773
- __publicField(ForeignKey3, _a231, "MySqlForeignKey");
31008
+ __publicField(ForeignKey3, _a229, "MySqlForeignKey");
31774
31009
  }
31775
31010
  });
31776
31011
 
@@ -31778,13 +31013,13 @@ var init_foreign_keys3 = __esm({
31778
31013
  function uniqueKeyName3(table4, columns) {
31779
31014
  return `${table4[TableName]}_${columns.join("_")}_unique`;
31780
31015
  }
31781
- var _a232, UniqueConstraintBuilder3, _a233, UniqueOnConstraintBuilder3, _a234, UniqueConstraint3;
31016
+ var _a230, UniqueConstraintBuilder3, _a231, UniqueOnConstraintBuilder3, _a232, UniqueConstraint3;
31782
31017
  var init_unique_constraint3 = __esm({
31783
31018
  "../drizzle-orm/dist/mysql-core/unique-constraint.js"() {
31784
31019
  "use strict";
31785
31020
  init_entity();
31786
31021
  init_table_utils();
31787
- _a232 = entityKind;
31022
+ _a230 = entityKind;
31788
31023
  UniqueConstraintBuilder3 = class {
31789
31024
  constructor(columns, name2) {
31790
31025
  /** @internal */
@@ -31797,8 +31032,8 @@ var init_unique_constraint3 = __esm({
31797
31032
  return new UniqueConstraint3(table4, this.columns, this.name);
31798
31033
  }
31799
31034
  };
31800
- __publicField(UniqueConstraintBuilder3, _a232, "MySqlUniqueConstraintBuilder");
31801
- _a233 = entityKind;
31035
+ __publicField(UniqueConstraintBuilder3, _a230, "MySqlUniqueConstraintBuilder");
31036
+ _a231 = entityKind;
31802
31037
  UniqueOnConstraintBuilder3 = class {
31803
31038
  constructor(name2) {
31804
31039
  /** @internal */
@@ -31809,8 +31044,8 @@ var init_unique_constraint3 = __esm({
31809
31044
  return new UniqueConstraintBuilder3(columns, this.name);
31810
31045
  }
31811
31046
  };
31812
- __publicField(UniqueOnConstraintBuilder3, _a233, "MySqlUniqueOnConstraintBuilder");
31813
- _a234 = entityKind;
31047
+ __publicField(UniqueOnConstraintBuilder3, _a231, "MySqlUniqueOnConstraintBuilder");
31048
+ _a232 = entityKind;
31814
31049
  UniqueConstraint3 = class {
31815
31050
  constructor(table4, columns, name2) {
31816
31051
  __publicField(this, "columns");
@@ -31824,12 +31059,12 @@ var init_unique_constraint3 = __esm({
31824
31059
  return this.name;
31825
31060
  }
31826
31061
  };
31827
- __publicField(UniqueConstraint3, _a234, "MySqlUniqueConstraint");
31062
+ __publicField(UniqueConstraint3, _a232, "MySqlUniqueConstraint");
31828
31063
  }
31829
31064
  });
31830
31065
 
31831
31066
  // ../drizzle-orm/dist/mysql-core/columns/common.js
31832
- var _a235, _b158, MySqlColumnBuilder, _a236, _b159, MySqlColumn, _a237, _b160, MySqlColumnBuilderWithAutoIncrement, _a238, _b161, MySqlColumnWithAutoIncrement;
31067
+ var _a233, _b158, MySqlColumnBuilder, _a234, _b159, MySqlColumn, _a235, _b160, MySqlColumnBuilderWithAutoIncrement, _a236, _b161, MySqlColumnWithAutoIncrement;
31833
31068
  var init_common4 = __esm({
31834
31069
  "../drizzle-orm/dist/mysql-core/columns/common.js"() {
31835
31070
  "use strict";
@@ -31838,7 +31073,7 @@ var init_common4 = __esm({
31838
31073
  init_entity();
31839
31074
  init_foreign_keys3();
31840
31075
  init_unique_constraint3();
31841
- MySqlColumnBuilder = class extends (_b158 = ColumnBuilder, _a235 = entityKind, _b158) {
31076
+ MySqlColumnBuilder = class extends (_b158 = ColumnBuilder, _a233 = entityKind, _b158) {
31842
31077
  constructor() {
31843
31078
  super(...arguments);
31844
31079
  __publicField(this, "foreignKeyConfigs", []);
@@ -31879,8 +31114,8 @@ var init_common4 = __esm({
31879
31114
  });
31880
31115
  }
31881
31116
  };
31882
- __publicField(MySqlColumnBuilder, _a235, "MySqlColumnBuilder");
31883
- MySqlColumn = class extends (_b159 = Column2, _a236 = entityKind, _b159) {
31117
+ __publicField(MySqlColumnBuilder, _a233, "MySqlColumnBuilder");
31118
+ MySqlColumn = class extends (_b159 = Column2, _a234 = entityKind, _b159) {
31884
31119
  constructor(table4, config) {
31885
31120
  if (!config.uniqueName) {
31886
31121
  config.uniqueName = uniqueKeyName3(table4, [config.name]);
@@ -31889,8 +31124,8 @@ var init_common4 = __esm({
31889
31124
  this.table = table4;
31890
31125
  }
31891
31126
  };
31892
- __publicField(MySqlColumn, _a236, "MySqlColumn");
31893
- MySqlColumnBuilderWithAutoIncrement = class extends (_b160 = MySqlColumnBuilder, _a237 = entityKind, _b160) {
31127
+ __publicField(MySqlColumn, _a234, "MySqlColumn");
31128
+ MySqlColumnBuilderWithAutoIncrement = class extends (_b160 = MySqlColumnBuilder, _a235 = entityKind, _b160) {
31894
31129
  constructor(name2, dataType, columnType) {
31895
31130
  super(name2, dataType, columnType);
31896
31131
  this.config.autoIncrement = false;
@@ -31901,14 +31136,14 @@ var init_common4 = __esm({
31901
31136
  return this;
31902
31137
  }
31903
31138
  };
31904
- __publicField(MySqlColumnBuilderWithAutoIncrement, _a237, "MySqlColumnBuilderWithAutoIncrement");
31905
- MySqlColumnWithAutoIncrement = class extends (_b161 = MySqlColumn, _a238 = entityKind, _b161) {
31139
+ __publicField(MySqlColumnBuilderWithAutoIncrement, _a235, "MySqlColumnBuilderWithAutoIncrement");
31140
+ MySqlColumnWithAutoIncrement = class extends (_b161 = MySqlColumn, _a236 = entityKind, _b161) {
31906
31141
  constructor() {
31907
31142
  super(...arguments);
31908
31143
  __publicField(this, "autoIncrement", this.config.autoIncrement);
31909
31144
  }
31910
31145
  };
31911
- __publicField(MySqlColumnWithAutoIncrement, _a238, "MySqlColumnWithAutoIncrement");
31146
+ __publicField(MySqlColumnWithAutoIncrement, _a236, "MySqlColumnWithAutoIncrement");
31912
31147
  }
31913
31148
  });
31914
31149
 
@@ -31920,14 +31155,14 @@ function bigint2(a, b) {
31920
31155
  }
31921
31156
  return new MySqlBigInt64Builder(name2, config.unsigned);
31922
31157
  }
31923
- var _a239, _b162, MySqlBigInt53Builder, _a240, _b163, MySqlBigInt53, _a241, _b164, MySqlBigInt64Builder, _a242, _b165, MySqlBigInt64;
31158
+ var _a237, _b162, MySqlBigInt53Builder, _a238, _b163, MySqlBigInt53, _a239, _b164, MySqlBigInt64Builder, _a240, _b165, MySqlBigInt64;
31924
31159
  var init_bigint2 = __esm({
31925
31160
  "../drizzle-orm/dist/mysql-core/columns/bigint.js"() {
31926
31161
  "use strict";
31927
31162
  init_entity();
31928
31163
  init_utils2();
31929
31164
  init_common4();
31930
- MySqlBigInt53Builder = class extends (_b162 = MySqlColumnBuilderWithAutoIncrement, _a239 = entityKind, _b162) {
31165
+ MySqlBigInt53Builder = class extends (_b162 = MySqlColumnBuilderWithAutoIncrement, _a237 = entityKind, _b162) {
31931
31166
  constructor(name2, unsigned = false) {
31932
31167
  super(name2, "number", "MySqlBigInt53");
31933
31168
  this.config.unsigned = unsigned;
@@ -31940,8 +31175,8 @@ var init_bigint2 = __esm({
31940
31175
  );
31941
31176
  }
31942
31177
  };
31943
- __publicField(MySqlBigInt53Builder, _a239, "MySqlBigInt53Builder");
31944
- MySqlBigInt53 = class extends (_b163 = MySqlColumnWithAutoIncrement, _a240 = entityKind, _b163) {
31178
+ __publicField(MySqlBigInt53Builder, _a237, "MySqlBigInt53Builder");
31179
+ MySqlBigInt53 = class extends (_b163 = MySqlColumnWithAutoIncrement, _a238 = entityKind, _b163) {
31945
31180
  getSQLType() {
31946
31181
  return `bigint${this.config.unsigned ? " unsigned" : ""}`;
31947
31182
  }
@@ -31952,8 +31187,8 @@ var init_bigint2 = __esm({
31952
31187
  return Number(value);
31953
31188
  }
31954
31189
  };
31955
- __publicField(MySqlBigInt53, _a240, "MySqlBigInt53");
31956
- MySqlBigInt64Builder = class extends (_b164 = MySqlColumnBuilderWithAutoIncrement, _a241 = entityKind, _b164) {
31190
+ __publicField(MySqlBigInt53, _a238, "MySqlBigInt53");
31191
+ MySqlBigInt64Builder = class extends (_b164 = MySqlColumnBuilderWithAutoIncrement, _a239 = entityKind, _b164) {
31957
31192
  constructor(name2, unsigned = false) {
31958
31193
  super(name2, "bigint", "MySqlBigInt64");
31959
31194
  this.config.unsigned = unsigned;
@@ -31966,8 +31201,8 @@ var init_bigint2 = __esm({
31966
31201
  );
31967
31202
  }
31968
31203
  };
31969
- __publicField(MySqlBigInt64Builder, _a241, "MySqlBigInt64Builder");
31970
- MySqlBigInt64 = class extends (_b165 = MySqlColumnWithAutoIncrement, _a242 = entityKind, _b165) {
31204
+ __publicField(MySqlBigInt64Builder, _a239, "MySqlBigInt64Builder");
31205
+ MySqlBigInt64 = class extends (_b165 = MySqlColumnWithAutoIncrement, _a240 = entityKind, _b165) {
31971
31206
  getSQLType() {
31972
31207
  return `bigint${this.config.unsigned ? " unsigned" : ""}`;
31973
31208
  }
@@ -31976,7 +31211,7 @@ var init_bigint2 = __esm({
31976
31211
  return BigInt(value);
31977
31212
  }
31978
31213
  };
31979
- __publicField(MySqlBigInt64, _a242, "MySqlBigInt64");
31214
+ __publicField(MySqlBigInt64, _a240, "MySqlBigInt64");
31980
31215
  }
31981
31216
  });
31982
31217
 
@@ -31985,14 +31220,14 @@ function binary(a, b = {}) {
31985
31220
  const { name: name2, config } = getColumnNameAndConfig(a, b);
31986
31221
  return new MySqlBinaryBuilder(name2, config.length);
31987
31222
  }
31988
- var _a243, _b166, MySqlBinaryBuilder, _a244, _b167, MySqlBinary;
31223
+ var _a241, _b166, MySqlBinaryBuilder, _a242, _b167, MySqlBinary;
31989
31224
  var init_binary = __esm({
31990
31225
  "../drizzle-orm/dist/mysql-core/columns/binary.js"() {
31991
31226
  "use strict";
31992
31227
  init_entity();
31993
31228
  init_utils2();
31994
31229
  init_common4();
31995
- MySqlBinaryBuilder = class extends (_b166 = MySqlColumnBuilder, _a243 = entityKind, _b166) {
31230
+ MySqlBinaryBuilder = class extends (_b166 = MySqlColumnBuilder, _a241 = entityKind, _b166) {
31996
31231
  constructor(name2, length) {
31997
31232
  super(name2, "string", "MySqlBinary");
31998
31233
  this.config.length = length;
@@ -32002,8 +31237,8 @@ var init_binary = __esm({
32002
31237
  return new MySqlBinary(table4, this.config);
32003
31238
  }
32004
31239
  };
32005
- __publicField(MySqlBinaryBuilder, _a243, "MySqlBinaryBuilder");
32006
- MySqlBinary = class extends (_b167 = MySqlColumn, _a244 = entityKind, _b167) {
31240
+ __publicField(MySqlBinaryBuilder, _a241, "MySqlBinaryBuilder");
31241
+ MySqlBinary = class extends (_b167 = MySqlColumn, _a242 = entityKind, _b167) {
32007
31242
  constructor() {
32008
31243
  super(...arguments);
32009
31244
  __publicField(this, "length", this.config.length);
@@ -32012,7 +31247,7 @@ var init_binary = __esm({
32012
31247
  return this.length === void 0 ? `binary` : `binary(${this.length})`;
32013
31248
  }
32014
31249
  };
32015
- __publicField(MySqlBinary, _a244, "MySqlBinary");
31250
+ __publicField(MySqlBinary, _a242, "MySqlBinary");
32016
31251
  }
32017
31252
  });
32018
31253
 
@@ -32020,13 +31255,13 @@ var init_binary = __esm({
32020
31255
  function boolean2(name2) {
32021
31256
  return new MySqlBooleanBuilder(name2 ?? "");
32022
31257
  }
32023
- var _a245, _b168, MySqlBooleanBuilder, _a246, _b169, MySqlBoolean;
31258
+ var _a243, _b168, MySqlBooleanBuilder, _a244, _b169, MySqlBoolean;
32024
31259
  var init_boolean2 = __esm({
32025
31260
  "../drizzle-orm/dist/mysql-core/columns/boolean.js"() {
32026
31261
  "use strict";
32027
31262
  init_entity();
32028
31263
  init_common4();
32029
- MySqlBooleanBuilder = class extends (_b168 = MySqlColumnBuilder, _a245 = entityKind, _b168) {
31264
+ MySqlBooleanBuilder = class extends (_b168 = MySqlColumnBuilder, _a243 = entityKind, _b168) {
32030
31265
  constructor(name2) {
32031
31266
  super(name2, "boolean", "MySqlBoolean");
32032
31267
  }
@@ -32038,8 +31273,8 @@ var init_boolean2 = __esm({
32038
31273
  );
32039
31274
  }
32040
31275
  };
32041
- __publicField(MySqlBooleanBuilder, _a245, "MySqlBooleanBuilder");
32042
- MySqlBoolean = class extends (_b169 = MySqlColumn, _a246 = entityKind, _b169) {
31276
+ __publicField(MySqlBooleanBuilder, _a243, "MySqlBooleanBuilder");
31277
+ MySqlBoolean = class extends (_b169 = MySqlColumn, _a244 = entityKind, _b169) {
32043
31278
  getSQLType() {
32044
31279
  return "boolean";
32045
31280
  }
@@ -32050,7 +31285,7 @@ var init_boolean2 = __esm({
32050
31285
  return value === 1;
32051
31286
  }
32052
31287
  };
32053
- __publicField(MySqlBoolean, _a246, "MySqlBoolean");
31288
+ __publicField(MySqlBoolean, _a244, "MySqlBoolean");
32054
31289
  }
32055
31290
  });
32056
31291
 
@@ -32059,14 +31294,14 @@ function char2(a, b = {}) {
32059
31294
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32060
31295
  return new MySqlCharBuilder(name2, config);
32061
31296
  }
32062
- var _a247, _b170, MySqlCharBuilder, _a248, _b171, MySqlChar;
31297
+ var _a245, _b170, MySqlCharBuilder, _a246, _b171, MySqlChar;
32063
31298
  var init_char2 = __esm({
32064
31299
  "../drizzle-orm/dist/mysql-core/columns/char.js"() {
32065
31300
  "use strict";
32066
31301
  init_entity();
32067
31302
  init_utils2();
32068
31303
  init_common4();
32069
- MySqlCharBuilder = class extends (_b170 = MySqlColumnBuilder, _a247 = entityKind, _b170) {
31304
+ MySqlCharBuilder = class extends (_b170 = MySqlColumnBuilder, _a245 = entityKind, _b170) {
32070
31305
  constructor(name2, config) {
32071
31306
  super(name2, "string", "MySqlChar");
32072
31307
  this.config.length = config.length;
@@ -32080,8 +31315,8 @@ var init_char2 = __esm({
32080
31315
  );
32081
31316
  }
32082
31317
  };
32083
- __publicField(MySqlCharBuilder, _a247, "MySqlCharBuilder");
32084
- MySqlChar = class extends (_b171 = MySqlColumn, _a248 = entityKind, _b171) {
31318
+ __publicField(MySqlCharBuilder, _a245, "MySqlCharBuilder");
31319
+ MySqlChar = class extends (_b171 = MySqlColumn, _a246 = entityKind, _b171) {
32085
31320
  constructor() {
32086
31321
  super(...arguments);
32087
31322
  __publicField(this, "length", this.config.length);
@@ -32091,7 +31326,7 @@ var init_char2 = __esm({
32091
31326
  return this.length === void 0 ? `char` : `char(${this.length})`;
32092
31327
  }
32093
31328
  };
32094
- __publicField(MySqlChar, _a248, "MySqlChar");
31329
+ __publicField(MySqlChar, _a246, "MySqlChar");
32095
31330
  }
32096
31331
  });
32097
31332
 
@@ -32102,14 +31337,14 @@ function customType3(customTypeParams) {
32102
31337
  return new MySqlCustomColumnBuilder(name2, config, customTypeParams);
32103
31338
  };
32104
31339
  }
32105
- var _a249, _b172, MySqlCustomColumnBuilder, _a250, _b173, MySqlCustomColumn;
31340
+ var _a247, _b172, MySqlCustomColumnBuilder, _a248, _b173, MySqlCustomColumn;
32106
31341
  var init_custom3 = __esm({
32107
31342
  "../drizzle-orm/dist/mysql-core/columns/custom.js"() {
32108
31343
  "use strict";
32109
31344
  init_entity();
32110
31345
  init_utils2();
32111
31346
  init_common4();
32112
- MySqlCustomColumnBuilder = class extends (_b172 = MySqlColumnBuilder, _a249 = entityKind, _b172) {
31347
+ MySqlCustomColumnBuilder = class extends (_b172 = MySqlColumnBuilder, _a247 = entityKind, _b172) {
32113
31348
  constructor(name2, fieldConfig, customTypeParams) {
32114
31349
  super(name2, "custom", "MySqlCustomColumn");
32115
31350
  this.config.fieldConfig = fieldConfig;
@@ -32123,8 +31358,8 @@ var init_custom3 = __esm({
32123
31358
  );
32124
31359
  }
32125
31360
  };
32126
- __publicField(MySqlCustomColumnBuilder, _a249, "MySqlCustomColumnBuilder");
32127
- MySqlCustomColumn = class extends (_b173 = MySqlColumn, _a250 = entityKind, _b173) {
31361
+ __publicField(MySqlCustomColumnBuilder, _a247, "MySqlCustomColumnBuilder");
31362
+ MySqlCustomColumn = class extends (_b173 = MySqlColumn, _a248 = entityKind, _b173) {
32128
31363
  constructor(table4, config) {
32129
31364
  super(table4, config);
32130
31365
  __publicField(this, "sqlName");
@@ -32144,7 +31379,7 @@ var init_custom3 = __esm({
32144
31379
  return typeof this.mapTo === "function" ? this.mapTo(value) : value;
32145
31380
  }
32146
31381
  };
32147
- __publicField(MySqlCustomColumn, _a250, "MySqlCustomColumn");
31382
+ __publicField(MySqlCustomColumn, _a248, "MySqlCustomColumn");
32148
31383
  }
32149
31384
  });
32150
31385
 
@@ -32156,14 +31391,14 @@ function date2(a, b) {
32156
31391
  }
32157
31392
  return new MySqlDateBuilder(name2);
32158
31393
  }
32159
- var _a251, _b174, MySqlDateBuilder, _a252, _b175, MySqlDate, _a253, _b176, MySqlDateStringBuilder, _a254, _b177, MySqlDateString;
31394
+ var _a249, _b174, MySqlDateBuilder, _a250, _b175, MySqlDate, _a251, _b176, MySqlDateStringBuilder, _a252, _b177, MySqlDateString;
32160
31395
  var init_date2 = __esm({
32161
31396
  "../drizzle-orm/dist/mysql-core/columns/date.js"() {
32162
31397
  "use strict";
32163
31398
  init_entity();
32164
31399
  init_utils2();
32165
31400
  init_common4();
32166
- MySqlDateBuilder = class extends (_b174 = MySqlColumnBuilder, _a251 = entityKind, _b174) {
31401
+ MySqlDateBuilder = class extends (_b174 = MySqlColumnBuilder, _a249 = entityKind, _b174) {
32167
31402
  constructor(name2) {
32168
31403
  super(name2, "date", "MySqlDate");
32169
31404
  }
@@ -32172,8 +31407,8 @@ var init_date2 = __esm({
32172
31407
  return new MySqlDate(table4, this.config);
32173
31408
  }
32174
31409
  };
32175
- __publicField(MySqlDateBuilder, _a251, "MySqlDateBuilder");
32176
- MySqlDate = class extends (_b175 = MySqlColumn, _a252 = entityKind, _b175) {
31410
+ __publicField(MySqlDateBuilder, _a249, "MySqlDateBuilder");
31411
+ MySqlDate = class extends (_b175 = MySqlColumn, _a250 = entityKind, _b175) {
32177
31412
  constructor(table4, config) {
32178
31413
  super(table4, config);
32179
31414
  }
@@ -32184,8 +31419,8 @@ var init_date2 = __esm({
32184
31419
  return new Date(value);
32185
31420
  }
32186
31421
  };
32187
- __publicField(MySqlDate, _a252, "MySqlDate");
32188
- MySqlDateStringBuilder = class extends (_b176 = MySqlColumnBuilder, _a253 = entityKind, _b176) {
31422
+ __publicField(MySqlDate, _a250, "MySqlDate");
31423
+ MySqlDateStringBuilder = class extends (_b176 = MySqlColumnBuilder, _a251 = entityKind, _b176) {
32189
31424
  constructor(name2) {
32190
31425
  super(name2, "string", "MySqlDateString");
32191
31426
  }
@@ -32197,8 +31432,8 @@ var init_date2 = __esm({
32197
31432
  );
32198
31433
  }
32199
31434
  };
32200
- __publicField(MySqlDateStringBuilder, _a253, "MySqlDateStringBuilder");
32201
- MySqlDateString = class extends (_b177 = MySqlColumn, _a254 = entityKind, _b177) {
31435
+ __publicField(MySqlDateStringBuilder, _a251, "MySqlDateStringBuilder");
31436
+ MySqlDateString = class extends (_b177 = MySqlColumn, _a252 = entityKind, _b177) {
32202
31437
  constructor(table4, config) {
32203
31438
  super(table4, config);
32204
31439
  }
@@ -32206,7 +31441,7 @@ var init_date2 = __esm({
32206
31441
  return `date`;
32207
31442
  }
32208
31443
  };
32209
- __publicField(MySqlDateString, _a254, "MySqlDateString");
31444
+ __publicField(MySqlDateString, _a252, "MySqlDateString");
32210
31445
  }
32211
31446
  });
32212
31447
 
@@ -32218,14 +31453,14 @@ function datetime(a, b) {
32218
31453
  }
32219
31454
  return new MySqlDateTimeBuilder(name2, config);
32220
31455
  }
32221
- var _a255, _b178, MySqlDateTimeBuilder, _a256, _b179, MySqlDateTime, _a257, _b180, MySqlDateTimeStringBuilder, _a258, _b181, MySqlDateTimeString;
31456
+ var _a253, _b178, MySqlDateTimeBuilder, _a254, _b179, MySqlDateTime, _a255, _b180, MySqlDateTimeStringBuilder, _a256, _b181, MySqlDateTimeString;
32222
31457
  var init_datetime = __esm({
32223
31458
  "../drizzle-orm/dist/mysql-core/columns/datetime.js"() {
32224
31459
  "use strict";
32225
31460
  init_entity();
32226
31461
  init_utils2();
32227
31462
  init_common4();
32228
- MySqlDateTimeBuilder = class extends (_b178 = MySqlColumnBuilder, _a255 = entityKind, _b178) {
31463
+ MySqlDateTimeBuilder = class extends (_b178 = MySqlColumnBuilder, _a253 = entityKind, _b178) {
32229
31464
  constructor(name2, config) {
32230
31465
  super(name2, "date", "MySqlDateTime");
32231
31466
  this.config.fsp = config?.fsp;
@@ -32238,8 +31473,8 @@ var init_datetime = __esm({
32238
31473
  );
32239
31474
  }
32240
31475
  };
32241
- __publicField(MySqlDateTimeBuilder, _a255, "MySqlDateTimeBuilder");
32242
- MySqlDateTime = class extends (_b179 = MySqlColumn, _a256 = entityKind, _b179) {
31476
+ __publicField(MySqlDateTimeBuilder, _a253, "MySqlDateTimeBuilder");
31477
+ MySqlDateTime = class extends (_b179 = MySqlColumn, _a254 = entityKind, _b179) {
32243
31478
  constructor(table4, config) {
32244
31479
  super(table4, config);
32245
31480
  __publicField(this, "fsp");
@@ -32256,8 +31491,8 @@ var init_datetime = __esm({
32256
31491
  return /* @__PURE__ */ new Date(value.replace(" ", "T") + "Z");
32257
31492
  }
32258
31493
  };
32259
- __publicField(MySqlDateTime, _a256, "MySqlDateTime");
32260
- MySqlDateTimeStringBuilder = class extends (_b180 = MySqlColumnBuilder, _a257 = entityKind, _b180) {
31494
+ __publicField(MySqlDateTime, _a254, "MySqlDateTime");
31495
+ MySqlDateTimeStringBuilder = class extends (_b180 = MySqlColumnBuilder, _a255 = entityKind, _b180) {
32261
31496
  constructor(name2, config) {
32262
31497
  super(name2, "string", "MySqlDateTimeString");
32263
31498
  this.config.fsp = config?.fsp;
@@ -32270,8 +31505,8 @@ var init_datetime = __esm({
32270
31505
  );
32271
31506
  }
32272
31507
  };
32273
- __publicField(MySqlDateTimeStringBuilder, _a257, "MySqlDateTimeStringBuilder");
32274
- MySqlDateTimeString = class extends (_b181 = MySqlColumn, _a258 = entityKind, _b181) {
31508
+ __publicField(MySqlDateTimeStringBuilder, _a255, "MySqlDateTimeStringBuilder");
31509
+ MySqlDateTimeString = class extends (_b181 = MySqlColumn, _a256 = entityKind, _b181) {
32275
31510
  constructor(table4, config) {
32276
31511
  super(table4, config);
32277
31512
  __publicField(this, "fsp");
@@ -32282,7 +31517,7 @@ var init_datetime = __esm({
32282
31517
  return `datetime${precision}`;
32283
31518
  }
32284
31519
  };
32285
- __publicField(MySqlDateTimeString, _a258, "MySqlDateTimeString");
31520
+ __publicField(MySqlDateTimeString, _a256, "MySqlDateTimeString");
32286
31521
  }
32287
31522
  });
32288
31523
 
@@ -32291,14 +31526,14 @@ function decimal(a, b = {}) {
32291
31526
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32292
31527
  return new MySqlDecimalBuilder(name2, config.precision, config.scale);
32293
31528
  }
32294
- var _a259, _b182, MySqlDecimalBuilder, _a260, _b183, MySqlDecimal;
31529
+ var _a257, _b182, MySqlDecimalBuilder, _a258, _b183, MySqlDecimal;
32295
31530
  var init_decimal = __esm({
32296
31531
  "../drizzle-orm/dist/mysql-core/columns/decimal.js"() {
32297
31532
  "use strict";
32298
31533
  init_entity();
32299
31534
  init_utils2();
32300
31535
  init_common4();
32301
- MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b182) {
31536
+ MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a257 = entityKind, _b182) {
32302
31537
  constructor(name2, precision, scale) {
32303
31538
  super(name2, "string", "MySqlDecimal");
32304
31539
  this.config.precision = precision;
@@ -32312,8 +31547,8 @@ var init_decimal = __esm({
32312
31547
  );
32313
31548
  }
32314
31549
  };
32315
- __publicField(MySqlDecimalBuilder, _a259, "MySqlDecimalBuilder");
32316
- MySqlDecimal = class extends (_b183 = MySqlColumnWithAutoIncrement, _a260 = entityKind, _b183) {
31550
+ __publicField(MySqlDecimalBuilder, _a257, "MySqlDecimalBuilder");
31551
+ MySqlDecimal = class extends (_b183 = MySqlColumnWithAutoIncrement, _a258 = entityKind, _b183) {
32317
31552
  constructor() {
32318
31553
  super(...arguments);
32319
31554
  __publicField(this, "precision", this.config.precision);
@@ -32329,7 +31564,7 @@ var init_decimal = __esm({
32329
31564
  }
32330
31565
  }
32331
31566
  };
32332
- __publicField(MySqlDecimal, _a260, "MySqlDecimal");
31567
+ __publicField(MySqlDecimal, _a258, "MySqlDecimal");
32333
31568
  }
32334
31569
  });
32335
31570
 
@@ -32338,14 +31573,14 @@ function double(a, b) {
32338
31573
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32339
31574
  return new MySqlDoubleBuilder(name2, config);
32340
31575
  }
32341
- var _a261, _b184, MySqlDoubleBuilder, _a262, _b185, MySqlDouble;
31576
+ var _a259, _b184, MySqlDoubleBuilder, _a260, _b185, MySqlDouble;
32342
31577
  var init_double = __esm({
32343
31578
  "../drizzle-orm/dist/mysql-core/columns/double.js"() {
32344
31579
  "use strict";
32345
31580
  init_entity();
32346
31581
  init_utils2();
32347
31582
  init_common4();
32348
- MySqlDoubleBuilder = class extends (_b184 = MySqlColumnBuilderWithAutoIncrement, _a261 = entityKind, _b184) {
31583
+ MySqlDoubleBuilder = class extends (_b184 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b184) {
32349
31584
  constructor(name2, config) {
32350
31585
  super(name2, "number", "MySqlDouble");
32351
31586
  this.config.precision = config?.precision;
@@ -32356,8 +31591,8 @@ var init_double = __esm({
32356
31591
  return new MySqlDouble(table4, this.config);
32357
31592
  }
32358
31593
  };
32359
- __publicField(MySqlDoubleBuilder, _a261, "MySqlDoubleBuilder");
32360
- MySqlDouble = class extends (_b185 = MySqlColumnWithAutoIncrement, _a262 = entityKind, _b185) {
31594
+ __publicField(MySqlDoubleBuilder, _a259, "MySqlDoubleBuilder");
31595
+ MySqlDouble = class extends (_b185 = MySqlColumnWithAutoIncrement, _a260 = entityKind, _b185) {
32361
31596
  constructor() {
32362
31597
  super(...arguments);
32363
31598
  __publicField(this, "precision", this.config.precision);
@@ -32373,7 +31608,7 @@ var init_double = __esm({
32373
31608
  }
32374
31609
  }
32375
31610
  };
32376
- __publicField(MySqlDouble, _a262, "MySqlDouble");
31611
+ __publicField(MySqlDouble, _a260, "MySqlDouble");
32377
31612
  }
32378
31613
  });
32379
31614
 
@@ -32385,14 +31620,14 @@ function mysqlEnum(a, b) {
32385
31620
  }
32386
31621
  return new MySqlEnumColumnBuilder(name2, values);
32387
31622
  }
32388
- var _a263, _b186, MySqlEnumColumnBuilder, _a264, _b187, MySqlEnumColumn;
31623
+ var _a261, _b186, MySqlEnumColumnBuilder, _a262, _b187, MySqlEnumColumn;
32389
31624
  var init_enum2 = __esm({
32390
31625
  "../drizzle-orm/dist/mysql-core/columns/enum.js"() {
32391
31626
  "use strict";
32392
31627
  init_entity();
32393
31628
  init_utils2();
32394
31629
  init_common4();
32395
- MySqlEnumColumnBuilder = class extends (_b186 = MySqlColumnBuilder, _a263 = entityKind, _b186) {
31630
+ MySqlEnumColumnBuilder = class extends (_b186 = MySqlColumnBuilder, _a261 = entityKind, _b186) {
32396
31631
  constructor(name2, values) {
32397
31632
  super(name2, "string", "MySqlEnumColumn");
32398
31633
  this.config.enumValues = values;
@@ -32405,8 +31640,8 @@ var init_enum2 = __esm({
32405
31640
  );
32406
31641
  }
32407
31642
  };
32408
- __publicField(MySqlEnumColumnBuilder, _a263, "MySqlEnumColumnBuilder");
32409
- MySqlEnumColumn = class extends (_b187 = MySqlColumn, _a264 = entityKind, _b187) {
31643
+ __publicField(MySqlEnumColumnBuilder, _a261, "MySqlEnumColumnBuilder");
31644
+ MySqlEnumColumn = class extends (_b187 = MySqlColumn, _a262 = entityKind, _b187) {
32410
31645
  constructor() {
32411
31646
  super(...arguments);
32412
31647
  __publicField(this, "enumValues", this.config.enumValues);
@@ -32415,7 +31650,7 @@ var init_enum2 = __esm({
32415
31650
  return `enum(${this.enumValues.map((value) => `'${value}'`).join(",")})`;
32416
31651
  }
32417
31652
  };
32418
- __publicField(MySqlEnumColumn, _a264, "MySqlEnumColumn");
31653
+ __publicField(MySqlEnumColumn, _a262, "MySqlEnumColumn");
32419
31654
  }
32420
31655
  });
32421
31656
 
@@ -32423,13 +31658,13 @@ var init_enum2 = __esm({
32423
31658
  function float(name2) {
32424
31659
  return new MySqlFloatBuilder(name2 ?? "");
32425
31660
  }
32426
- var _a265, _b188, MySqlFloatBuilder, _a266, _b189, MySqlFloat;
31661
+ var _a263, _b188, MySqlFloatBuilder, _a264, _b189, MySqlFloat;
32427
31662
  var init_float = __esm({
32428
31663
  "../drizzle-orm/dist/mysql-core/columns/float.js"() {
32429
31664
  "use strict";
32430
31665
  init_entity();
32431
31666
  init_common4();
32432
- MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b188) {
31667
+ MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a263 = entityKind, _b188) {
32433
31668
  constructor(name2) {
32434
31669
  super(name2, "number", "MySqlFloat");
32435
31670
  }
@@ -32438,13 +31673,13 @@ var init_float = __esm({
32438
31673
  return new MySqlFloat(table4, this.config);
32439
31674
  }
32440
31675
  };
32441
- __publicField(MySqlFloatBuilder, _a265, "MySqlFloatBuilder");
32442
- MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b189) {
31676
+ __publicField(MySqlFloatBuilder, _a263, "MySqlFloatBuilder");
31677
+ MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a264 = entityKind, _b189) {
32443
31678
  getSQLType() {
32444
31679
  return "float";
32445
31680
  }
32446
31681
  };
32447
- __publicField(MySqlFloat, _a266, "MySqlFloat");
31682
+ __publicField(MySqlFloat, _a264, "MySqlFloat");
32448
31683
  }
32449
31684
  });
32450
31685
 
@@ -32453,14 +31688,14 @@ function int(a, b) {
32453
31688
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32454
31689
  return new MySqlIntBuilder(name2, config);
32455
31690
  }
32456
- var _a267, _b190, MySqlIntBuilder, _a268, _b191, MySqlInt;
31691
+ var _a265, _b190, MySqlIntBuilder, _a266, _b191, MySqlInt;
32457
31692
  var init_int = __esm({
32458
31693
  "../drizzle-orm/dist/mysql-core/columns/int.js"() {
32459
31694
  "use strict";
32460
31695
  init_entity();
32461
31696
  init_utils2();
32462
31697
  init_common4();
32463
- MySqlIntBuilder = class extends (_b190 = MySqlColumnBuilderWithAutoIncrement, _a267 = entityKind, _b190) {
31698
+ MySqlIntBuilder = class extends (_b190 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b190) {
32464
31699
  constructor(name2, config) {
32465
31700
  super(name2, "number", "MySqlInt");
32466
31701
  this.config.unsigned = config ? config.unsigned : false;
@@ -32470,8 +31705,8 @@ var init_int = __esm({
32470
31705
  return new MySqlInt(table4, this.config);
32471
31706
  }
32472
31707
  };
32473
- __publicField(MySqlIntBuilder, _a267, "MySqlIntBuilder");
32474
- MySqlInt = class extends (_b191 = MySqlColumnWithAutoIncrement, _a268 = entityKind, _b191) {
31708
+ __publicField(MySqlIntBuilder, _a265, "MySqlIntBuilder");
31709
+ MySqlInt = class extends (_b191 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b191) {
32475
31710
  getSQLType() {
32476
31711
  return `int${this.config.unsigned ? " unsigned" : ""}`;
32477
31712
  }
@@ -32482,7 +31717,7 @@ var init_int = __esm({
32482
31717
  return value;
32483
31718
  }
32484
31719
  };
32485
- __publicField(MySqlInt, _a268, "MySqlInt");
31720
+ __publicField(MySqlInt, _a266, "MySqlInt");
32486
31721
  }
32487
31722
  });
32488
31723
 
@@ -32490,13 +31725,13 @@ var init_int = __esm({
32490
31725
  function json2(name2) {
32491
31726
  return new MySqlJsonBuilder(name2 ?? "");
32492
31727
  }
32493
- var _a269, _b192, MySqlJsonBuilder, _a270, _b193, MySqlJson;
31728
+ var _a267, _b192, MySqlJsonBuilder, _a268, _b193, MySqlJson;
32494
31729
  var init_json2 = __esm({
32495
31730
  "../drizzle-orm/dist/mysql-core/columns/json.js"() {
32496
31731
  "use strict";
32497
31732
  init_entity();
32498
31733
  init_common4();
32499
- MySqlJsonBuilder = class extends (_b192 = MySqlColumnBuilder, _a269 = entityKind, _b192) {
31734
+ MySqlJsonBuilder = class extends (_b192 = MySqlColumnBuilder, _a267 = entityKind, _b192) {
32500
31735
  constructor(name2) {
32501
31736
  super(name2, "json", "MySqlJson");
32502
31737
  }
@@ -32505,8 +31740,8 @@ var init_json2 = __esm({
32505
31740
  return new MySqlJson(table4, this.config);
32506
31741
  }
32507
31742
  };
32508
- __publicField(MySqlJsonBuilder, _a269, "MySqlJsonBuilder");
32509
- MySqlJson = class extends (_b193 = MySqlColumn, _a270 = entityKind, _b193) {
31743
+ __publicField(MySqlJsonBuilder, _a267, "MySqlJsonBuilder");
31744
+ MySqlJson = class extends (_b193 = MySqlColumn, _a268 = entityKind, _b193) {
32510
31745
  getSQLType() {
32511
31746
  return "json";
32512
31747
  }
@@ -32514,7 +31749,7 @@ var init_json2 = __esm({
32514
31749
  return JSON.stringify(value);
32515
31750
  }
32516
31751
  };
32517
- __publicField(MySqlJson, _a270, "MySqlJson");
31752
+ __publicField(MySqlJson, _a268, "MySqlJson");
32518
31753
  }
32519
31754
  });
32520
31755
 
@@ -32523,14 +31758,14 @@ function mediumint(a, b) {
32523
31758
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32524
31759
  return new MySqlMediumIntBuilder(name2, config);
32525
31760
  }
32526
- var _a271, _b194, MySqlMediumIntBuilder, _a272, _b195, MySqlMediumInt;
31761
+ var _a269, _b194, MySqlMediumIntBuilder, _a270, _b195, MySqlMediumInt;
32527
31762
  var init_mediumint = __esm({
32528
31763
  "../drizzle-orm/dist/mysql-core/columns/mediumint.js"() {
32529
31764
  "use strict";
32530
31765
  init_entity();
32531
31766
  init_utils2();
32532
31767
  init_common4();
32533
- MySqlMediumIntBuilder = class extends (_b194 = MySqlColumnBuilderWithAutoIncrement, _a271 = entityKind, _b194) {
31768
+ MySqlMediumIntBuilder = class extends (_b194 = MySqlColumnBuilderWithAutoIncrement, _a269 = entityKind, _b194) {
32534
31769
  constructor(name2, config) {
32535
31770
  super(name2, "number", "MySqlMediumInt");
32536
31771
  this.config.unsigned = config ? config.unsigned : false;
@@ -32543,8 +31778,8 @@ var init_mediumint = __esm({
32543
31778
  );
32544
31779
  }
32545
31780
  };
32546
- __publicField(MySqlMediumIntBuilder, _a271, "MySqlMediumIntBuilder");
32547
- MySqlMediumInt = class extends (_b195 = MySqlColumnWithAutoIncrement, _a272 = entityKind, _b195) {
31781
+ __publicField(MySqlMediumIntBuilder, _a269, "MySqlMediumIntBuilder");
31782
+ MySqlMediumInt = class extends (_b195 = MySqlColumnWithAutoIncrement, _a270 = entityKind, _b195) {
32548
31783
  getSQLType() {
32549
31784
  return `mediumint${this.config.unsigned ? " unsigned" : ""}`;
32550
31785
  }
@@ -32555,7 +31790,7 @@ var init_mediumint = __esm({
32555
31790
  return value;
32556
31791
  }
32557
31792
  };
32558
- __publicField(MySqlMediumInt, _a272, "MySqlMediumInt");
31793
+ __publicField(MySqlMediumInt, _a270, "MySqlMediumInt");
32559
31794
  }
32560
31795
  });
32561
31796
 
@@ -32564,14 +31799,14 @@ function real3(a, b = {}) {
32564
31799
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32565
31800
  return new MySqlRealBuilder(name2, config);
32566
31801
  }
32567
- var _a273, _b196, MySqlRealBuilder, _a274, _b197, MySqlReal;
31802
+ var _a271, _b196, MySqlRealBuilder, _a272, _b197, MySqlReal;
32568
31803
  var init_real3 = __esm({
32569
31804
  "../drizzle-orm/dist/mysql-core/columns/real.js"() {
32570
31805
  "use strict";
32571
31806
  init_entity();
32572
31807
  init_utils2();
32573
31808
  init_common4();
32574
- MySqlRealBuilder = class extends (_b196 = MySqlColumnBuilderWithAutoIncrement, _a273 = entityKind, _b196) {
31809
+ MySqlRealBuilder = class extends (_b196 = MySqlColumnBuilderWithAutoIncrement, _a271 = entityKind, _b196) {
32575
31810
  constructor(name2, config) {
32576
31811
  super(name2, "number", "MySqlReal");
32577
31812
  this.config.precision = config?.precision;
@@ -32582,8 +31817,8 @@ var init_real3 = __esm({
32582
31817
  return new MySqlReal(table4, this.config);
32583
31818
  }
32584
31819
  };
32585
- __publicField(MySqlRealBuilder, _a273, "MySqlRealBuilder");
32586
- MySqlReal = class extends (_b197 = MySqlColumnWithAutoIncrement, _a274 = entityKind, _b197) {
31820
+ __publicField(MySqlRealBuilder, _a271, "MySqlRealBuilder");
31821
+ MySqlReal = class extends (_b197 = MySqlColumnWithAutoIncrement, _a272 = entityKind, _b197) {
32587
31822
  constructor() {
32588
31823
  super(...arguments);
32589
31824
  __publicField(this, "precision", this.config.precision);
@@ -32599,7 +31834,7 @@ var init_real3 = __esm({
32599
31834
  }
32600
31835
  }
32601
31836
  };
32602
- __publicField(MySqlReal, _a274, "MySqlReal");
31837
+ __publicField(MySqlReal, _a272, "MySqlReal");
32603
31838
  }
32604
31839
  });
32605
31840
 
@@ -32607,13 +31842,13 @@ var init_real3 = __esm({
32607
31842
  function serial2(name2) {
32608
31843
  return new MySqlSerialBuilder(name2 ?? "");
32609
31844
  }
32610
- var _a275, _b198, MySqlSerialBuilder, _a276, _b199, MySqlSerial;
31845
+ var _a273, _b198, MySqlSerialBuilder, _a274, _b199, MySqlSerial;
32611
31846
  var init_serial2 = __esm({
32612
31847
  "../drizzle-orm/dist/mysql-core/columns/serial.js"() {
32613
31848
  "use strict";
32614
31849
  init_entity();
32615
31850
  init_common4();
32616
- MySqlSerialBuilder = class extends (_b198 = MySqlColumnBuilderWithAutoIncrement, _a275 = entityKind, _b198) {
31851
+ MySqlSerialBuilder = class extends (_b198 = MySqlColumnBuilderWithAutoIncrement, _a273 = entityKind, _b198) {
32617
31852
  constructor(name2) {
32618
31853
  super(name2, "number", "MySqlSerial");
32619
31854
  this.config.hasDefault = true;
@@ -32624,8 +31859,8 @@ var init_serial2 = __esm({
32624
31859
  return new MySqlSerial(table4, this.config);
32625
31860
  }
32626
31861
  };
32627
- __publicField(MySqlSerialBuilder, _a275, "MySqlSerialBuilder");
32628
- MySqlSerial = class extends (_b199 = MySqlColumnWithAutoIncrement, _a276 = entityKind, _b199) {
31862
+ __publicField(MySqlSerialBuilder, _a273, "MySqlSerialBuilder");
31863
+ MySqlSerial = class extends (_b199 = MySqlColumnWithAutoIncrement, _a274 = entityKind, _b199) {
32629
31864
  getSQLType() {
32630
31865
  return "serial";
32631
31866
  }
@@ -32636,7 +31871,7 @@ var init_serial2 = __esm({
32636
31871
  return value;
32637
31872
  }
32638
31873
  };
32639
- __publicField(MySqlSerial, _a276, "MySqlSerial");
31874
+ __publicField(MySqlSerial, _a274, "MySqlSerial");
32640
31875
  }
32641
31876
  });
32642
31877
 
@@ -32645,14 +31880,14 @@ function smallint2(a, b) {
32645
31880
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32646
31881
  return new MySqlSmallIntBuilder(name2, config);
32647
31882
  }
32648
- var _a277, _b200, MySqlSmallIntBuilder, _a278, _b201, MySqlSmallInt;
31883
+ var _a275, _b200, MySqlSmallIntBuilder, _a276, _b201, MySqlSmallInt;
32649
31884
  var init_smallint2 = __esm({
32650
31885
  "../drizzle-orm/dist/mysql-core/columns/smallint.js"() {
32651
31886
  "use strict";
32652
31887
  init_entity();
32653
31888
  init_utils2();
32654
31889
  init_common4();
32655
- MySqlSmallIntBuilder = class extends (_b200 = MySqlColumnBuilderWithAutoIncrement, _a277 = entityKind, _b200) {
31890
+ MySqlSmallIntBuilder = class extends (_b200 = MySqlColumnBuilderWithAutoIncrement, _a275 = entityKind, _b200) {
32656
31891
  constructor(name2, config) {
32657
31892
  super(name2, "number", "MySqlSmallInt");
32658
31893
  this.config.unsigned = config ? config.unsigned : false;
@@ -32665,8 +31900,8 @@ var init_smallint2 = __esm({
32665
31900
  );
32666
31901
  }
32667
31902
  };
32668
- __publicField(MySqlSmallIntBuilder, _a277, "MySqlSmallIntBuilder");
32669
- MySqlSmallInt = class extends (_b201 = MySqlColumnWithAutoIncrement, _a278 = entityKind, _b201) {
31903
+ __publicField(MySqlSmallIntBuilder, _a275, "MySqlSmallIntBuilder");
31904
+ MySqlSmallInt = class extends (_b201 = MySqlColumnWithAutoIncrement, _a276 = entityKind, _b201) {
32670
31905
  getSQLType() {
32671
31906
  return `smallint${this.config.unsigned ? " unsigned" : ""}`;
32672
31907
  }
@@ -32677,7 +31912,7 @@ var init_smallint2 = __esm({
32677
31912
  return value;
32678
31913
  }
32679
31914
  };
32680
- __publicField(MySqlSmallInt, _a278, "MySqlSmallInt");
31915
+ __publicField(MySqlSmallInt, _a276, "MySqlSmallInt");
32681
31916
  }
32682
31917
  });
32683
31918
 
@@ -32686,14 +31921,14 @@ function text3(a, b = {}) {
32686
31921
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32687
31922
  return new MySqlTextBuilder(name2, "text", config);
32688
31923
  }
32689
- var _a279, _b202, MySqlTextBuilder, _a280, _b203, MySqlText;
31924
+ var _a277, _b202, MySqlTextBuilder, _a278, _b203, MySqlText;
32690
31925
  var init_text3 = __esm({
32691
31926
  "../drizzle-orm/dist/mysql-core/columns/text.js"() {
32692
31927
  "use strict";
32693
31928
  init_entity();
32694
31929
  init_utils2();
32695
31930
  init_common4();
32696
- MySqlTextBuilder = class extends (_b202 = MySqlColumnBuilder, _a279 = entityKind, _b202) {
31931
+ MySqlTextBuilder = class extends (_b202 = MySqlColumnBuilder, _a277 = entityKind, _b202) {
32697
31932
  constructor(name2, textType, config) {
32698
31933
  super(name2, "string", "MySqlText");
32699
31934
  this.config.textType = textType;
@@ -32704,8 +31939,8 @@ var init_text3 = __esm({
32704
31939
  return new MySqlText(table4, this.config);
32705
31940
  }
32706
31941
  };
32707
- __publicField(MySqlTextBuilder, _a279, "MySqlTextBuilder");
32708
- MySqlText = class extends (_b203 = MySqlColumn, _a280 = entityKind, _b203) {
31942
+ __publicField(MySqlTextBuilder, _a277, "MySqlTextBuilder");
31943
+ MySqlText = class extends (_b203 = MySqlColumn, _a278 = entityKind, _b203) {
32709
31944
  constructor() {
32710
31945
  super(...arguments);
32711
31946
  __publicField(this, "textType", this.config.textType);
@@ -32715,7 +31950,7 @@ var init_text3 = __esm({
32715
31950
  return this.textType;
32716
31951
  }
32717
31952
  };
32718
- __publicField(MySqlText, _a280, "MySqlText");
31953
+ __publicField(MySqlText, _a278, "MySqlText");
32719
31954
  }
32720
31955
  });
32721
31956
 
@@ -32724,14 +31959,14 @@ function time2(a, b) {
32724
31959
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32725
31960
  return new MySqlTimeBuilder(name2, config);
32726
31961
  }
32727
- var _a281, _b204, MySqlTimeBuilder, _a282, _b205, MySqlTime;
31962
+ var _a279, _b204, MySqlTimeBuilder, _a280, _b205, MySqlTime;
32728
31963
  var init_time2 = __esm({
32729
31964
  "../drizzle-orm/dist/mysql-core/columns/time.js"() {
32730
31965
  "use strict";
32731
31966
  init_entity();
32732
31967
  init_utils2();
32733
31968
  init_common4();
32734
- MySqlTimeBuilder = class extends (_b204 = MySqlColumnBuilder, _a281 = entityKind, _b204) {
31969
+ MySqlTimeBuilder = class extends (_b204 = MySqlColumnBuilder, _a279 = entityKind, _b204) {
32735
31970
  constructor(name2, config) {
32736
31971
  super(name2, "string", "MySqlTime");
32737
31972
  this.config.fsp = config?.fsp;
@@ -32741,8 +31976,8 @@ var init_time2 = __esm({
32741
31976
  return new MySqlTime(table4, this.config);
32742
31977
  }
32743
31978
  };
32744
- __publicField(MySqlTimeBuilder, _a281, "MySqlTimeBuilder");
32745
- MySqlTime = class extends (_b205 = MySqlColumn, _a282 = entityKind, _b205) {
31979
+ __publicField(MySqlTimeBuilder, _a279, "MySqlTimeBuilder");
31980
+ MySqlTime = class extends (_b205 = MySqlColumn, _a280 = entityKind, _b205) {
32746
31981
  constructor() {
32747
31982
  super(...arguments);
32748
31983
  __publicField(this, "fsp", this.config.fsp);
@@ -32752,19 +31987,19 @@ var init_time2 = __esm({
32752
31987
  return `time${precision}`;
32753
31988
  }
32754
31989
  };
32755
- __publicField(MySqlTime, _a282, "MySqlTime");
31990
+ __publicField(MySqlTime, _a280, "MySqlTime");
32756
31991
  }
32757
31992
  });
32758
31993
 
32759
31994
  // ../drizzle-orm/dist/mysql-core/columns/date.common.js
32760
- var _a283, _b206, MySqlDateColumnBaseBuilder, _a284, _b207, MySqlDateBaseColumn;
31995
+ var _a281, _b206, MySqlDateColumnBaseBuilder, _a282, _b207, MySqlDateBaseColumn;
32761
31996
  var init_date_common2 = __esm({
32762
31997
  "../drizzle-orm/dist/mysql-core/columns/date.common.js"() {
32763
31998
  "use strict";
32764
31999
  init_entity();
32765
32000
  init_sql();
32766
32001
  init_common4();
32767
- MySqlDateColumnBaseBuilder = class extends (_b206 = MySqlColumnBuilder, _a283 = entityKind, _b206) {
32002
+ MySqlDateColumnBaseBuilder = class extends (_b206 = MySqlColumnBuilder, _a281 = entityKind, _b206) {
32768
32003
  defaultNow() {
32769
32004
  return this.default(sql`(now())`);
32770
32005
  }
@@ -32775,14 +32010,14 @@ var init_date_common2 = __esm({
32775
32010
  return this;
32776
32011
  }
32777
32012
  };
32778
- __publicField(MySqlDateColumnBaseBuilder, _a283, "MySqlDateColumnBuilder");
32779
- MySqlDateBaseColumn = class extends (_b207 = MySqlColumn, _a284 = entityKind, _b207) {
32013
+ __publicField(MySqlDateColumnBaseBuilder, _a281, "MySqlDateColumnBuilder");
32014
+ MySqlDateBaseColumn = class extends (_b207 = MySqlColumn, _a282 = entityKind, _b207) {
32780
32015
  constructor() {
32781
32016
  super(...arguments);
32782
32017
  __publicField(this, "hasOnUpdateNow", this.config.hasOnUpdateNow);
32783
32018
  }
32784
32019
  };
32785
- __publicField(MySqlDateBaseColumn, _a284, "MySqlDateColumn");
32020
+ __publicField(MySqlDateBaseColumn, _a282, "MySqlDateColumn");
32786
32021
  }
32787
32022
  });
32788
32023
 
@@ -32794,14 +32029,14 @@ function timestamp2(a, b = {}) {
32794
32029
  }
32795
32030
  return new MySqlTimestampBuilder(name2, config);
32796
32031
  }
32797
- var _a285, _b208, MySqlTimestampBuilder, _a286, _b209, MySqlTimestamp, _a287, _b210, MySqlTimestampStringBuilder, _a288, _b211, MySqlTimestampString;
32032
+ var _a283, _b208, MySqlTimestampBuilder, _a284, _b209, MySqlTimestamp, _a285, _b210, MySqlTimestampStringBuilder, _a286, _b211, MySqlTimestampString;
32798
32033
  var init_timestamp2 = __esm({
32799
32034
  "../drizzle-orm/dist/mysql-core/columns/timestamp.js"() {
32800
32035
  "use strict";
32801
32036
  init_entity();
32802
32037
  init_utils2();
32803
32038
  init_date_common2();
32804
- MySqlTimestampBuilder = class extends (_b208 = MySqlDateColumnBaseBuilder, _a285 = entityKind, _b208) {
32039
+ MySqlTimestampBuilder = class extends (_b208 = MySqlDateColumnBaseBuilder, _a283 = entityKind, _b208) {
32805
32040
  constructor(name2, config) {
32806
32041
  super(name2, "date", "MySqlTimestamp");
32807
32042
  this.config.fsp = config?.fsp;
@@ -32814,8 +32049,8 @@ var init_timestamp2 = __esm({
32814
32049
  );
32815
32050
  }
32816
32051
  };
32817
- __publicField(MySqlTimestampBuilder, _a285, "MySqlTimestampBuilder");
32818
- MySqlTimestamp = class extends (_b209 = MySqlDateBaseColumn, _a286 = entityKind, _b209) {
32052
+ __publicField(MySqlTimestampBuilder, _a283, "MySqlTimestampBuilder");
32053
+ MySqlTimestamp = class extends (_b209 = MySqlDateBaseColumn, _a284 = entityKind, _b209) {
32819
32054
  constructor() {
32820
32055
  super(...arguments);
32821
32056
  __publicField(this, "fsp", this.config.fsp);
@@ -32831,8 +32066,8 @@ var init_timestamp2 = __esm({
32831
32066
  return value.toISOString().slice(0, -1).replace("T", " ");
32832
32067
  }
32833
32068
  };
32834
- __publicField(MySqlTimestamp, _a286, "MySqlTimestamp");
32835
- MySqlTimestampStringBuilder = class extends (_b210 = MySqlDateColumnBaseBuilder, _a287 = entityKind, _b210) {
32069
+ __publicField(MySqlTimestamp, _a284, "MySqlTimestamp");
32070
+ MySqlTimestampStringBuilder = class extends (_b210 = MySqlDateColumnBaseBuilder, _a285 = entityKind, _b210) {
32836
32071
  constructor(name2, config) {
32837
32072
  super(name2, "string", "MySqlTimestampString");
32838
32073
  this.config.fsp = config?.fsp;
@@ -32845,8 +32080,8 @@ var init_timestamp2 = __esm({
32845
32080
  );
32846
32081
  }
32847
32082
  };
32848
- __publicField(MySqlTimestampStringBuilder, _a287, "MySqlTimestampStringBuilder");
32849
- MySqlTimestampString = class extends (_b211 = MySqlDateBaseColumn, _a288 = entityKind, _b211) {
32083
+ __publicField(MySqlTimestampStringBuilder, _a285, "MySqlTimestampStringBuilder");
32084
+ MySqlTimestampString = class extends (_b211 = MySqlDateBaseColumn, _a286 = entityKind, _b211) {
32850
32085
  constructor() {
32851
32086
  super(...arguments);
32852
32087
  __publicField(this, "fsp", this.config.fsp);
@@ -32856,7 +32091,7 @@ var init_timestamp2 = __esm({
32856
32091
  return `timestamp${precision}`;
32857
32092
  }
32858
32093
  };
32859
- __publicField(MySqlTimestampString, _a288, "MySqlTimestampString");
32094
+ __publicField(MySqlTimestampString, _a286, "MySqlTimestampString");
32860
32095
  }
32861
32096
  });
32862
32097
 
@@ -32865,14 +32100,14 @@ function tinyint(a, b) {
32865
32100
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32866
32101
  return new MySqlTinyIntBuilder(name2, config);
32867
32102
  }
32868
- var _a289, _b212, MySqlTinyIntBuilder, _a290, _b213, MySqlTinyInt;
32103
+ var _a287, _b212, MySqlTinyIntBuilder, _a288, _b213, MySqlTinyInt;
32869
32104
  var init_tinyint = __esm({
32870
32105
  "../drizzle-orm/dist/mysql-core/columns/tinyint.js"() {
32871
32106
  "use strict";
32872
32107
  init_entity();
32873
32108
  init_utils2();
32874
32109
  init_common4();
32875
- MySqlTinyIntBuilder = class extends (_b212 = MySqlColumnBuilderWithAutoIncrement, _a289 = entityKind, _b212) {
32110
+ MySqlTinyIntBuilder = class extends (_b212 = MySqlColumnBuilderWithAutoIncrement, _a287 = entityKind, _b212) {
32876
32111
  constructor(name2, config) {
32877
32112
  super(name2, "number", "MySqlTinyInt");
32878
32113
  this.config.unsigned = config ? config.unsigned : false;
@@ -32885,8 +32120,8 @@ var init_tinyint = __esm({
32885
32120
  );
32886
32121
  }
32887
32122
  };
32888
- __publicField(MySqlTinyIntBuilder, _a289, "MySqlTinyIntBuilder");
32889
- MySqlTinyInt = class extends (_b213 = MySqlColumnWithAutoIncrement, _a290 = entityKind, _b213) {
32123
+ __publicField(MySqlTinyIntBuilder, _a287, "MySqlTinyIntBuilder");
32124
+ MySqlTinyInt = class extends (_b213 = MySqlColumnWithAutoIncrement, _a288 = entityKind, _b213) {
32890
32125
  getSQLType() {
32891
32126
  return `tinyint${this.config.unsigned ? " unsigned" : ""}`;
32892
32127
  }
@@ -32897,7 +32132,7 @@ var init_tinyint = __esm({
32897
32132
  return value;
32898
32133
  }
32899
32134
  };
32900
- __publicField(MySqlTinyInt, _a290, "MySqlTinyInt");
32135
+ __publicField(MySqlTinyInt, _a288, "MySqlTinyInt");
32901
32136
  }
32902
32137
  });
32903
32138
 
@@ -32906,14 +32141,14 @@ function varbinary(a, b) {
32906
32141
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32907
32142
  return new MySqlVarBinaryBuilder(name2, config);
32908
32143
  }
32909
- var _a291, _b214, MySqlVarBinaryBuilder, _a292, _b215, MySqlVarBinary;
32144
+ var _a289, _b214, MySqlVarBinaryBuilder, _a290, _b215, MySqlVarBinary;
32910
32145
  var init_varbinary = __esm({
32911
32146
  "../drizzle-orm/dist/mysql-core/columns/varbinary.js"() {
32912
32147
  "use strict";
32913
32148
  init_entity();
32914
32149
  init_utils2();
32915
32150
  init_common4();
32916
- MySqlVarBinaryBuilder = class extends (_b214 = MySqlColumnBuilder, _a291 = entityKind, _b214) {
32151
+ MySqlVarBinaryBuilder = class extends (_b214 = MySqlColumnBuilder, _a289 = entityKind, _b214) {
32917
32152
  /** @internal */
32918
32153
  constructor(name2, config) {
32919
32154
  super(name2, "string", "MySqlVarBinary");
@@ -32927,8 +32162,8 @@ var init_varbinary = __esm({
32927
32162
  );
32928
32163
  }
32929
32164
  };
32930
- __publicField(MySqlVarBinaryBuilder, _a291, "MySqlVarBinaryBuilder");
32931
- MySqlVarBinary = class extends (_b215 = MySqlColumn, _a292 = entityKind, _b215) {
32165
+ __publicField(MySqlVarBinaryBuilder, _a289, "MySqlVarBinaryBuilder");
32166
+ MySqlVarBinary = class extends (_b215 = MySqlColumn, _a290 = entityKind, _b215) {
32932
32167
  constructor() {
32933
32168
  super(...arguments);
32934
32169
  __publicField(this, "length", this.config.length);
@@ -32937,7 +32172,7 @@ var init_varbinary = __esm({
32937
32172
  return this.length === void 0 ? `varbinary` : `varbinary(${this.length})`;
32938
32173
  }
32939
32174
  };
32940
- __publicField(MySqlVarBinary, _a292, "MySqlVarBinary");
32175
+ __publicField(MySqlVarBinary, _a290, "MySqlVarBinary");
32941
32176
  }
32942
32177
  });
32943
32178
 
@@ -32946,14 +32181,14 @@ function varchar2(a, b) {
32946
32181
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32947
32182
  return new MySqlVarCharBuilder(name2, config);
32948
32183
  }
32949
- var _a293, _b216, MySqlVarCharBuilder, _a294, _b217, MySqlVarChar;
32184
+ var _a291, _b216, MySqlVarCharBuilder, _a292, _b217, MySqlVarChar;
32950
32185
  var init_varchar2 = __esm({
32951
32186
  "../drizzle-orm/dist/mysql-core/columns/varchar.js"() {
32952
32187
  "use strict";
32953
32188
  init_entity();
32954
32189
  init_utils2();
32955
32190
  init_common4();
32956
- MySqlVarCharBuilder = class extends (_b216 = MySqlColumnBuilder, _a293 = entityKind, _b216) {
32191
+ MySqlVarCharBuilder = class extends (_b216 = MySqlColumnBuilder, _a291 = entityKind, _b216) {
32957
32192
  /** @internal */
32958
32193
  constructor(name2, config) {
32959
32194
  super(name2, "string", "MySqlVarChar");
@@ -32968,8 +32203,8 @@ var init_varchar2 = __esm({
32968
32203
  );
32969
32204
  }
32970
32205
  };
32971
- __publicField(MySqlVarCharBuilder, _a293, "MySqlVarCharBuilder");
32972
- MySqlVarChar = class extends (_b217 = MySqlColumn, _a294 = entityKind, _b217) {
32206
+ __publicField(MySqlVarCharBuilder, _a291, "MySqlVarCharBuilder");
32207
+ MySqlVarChar = class extends (_b217 = MySqlColumn, _a292 = entityKind, _b217) {
32973
32208
  constructor() {
32974
32209
  super(...arguments);
32975
32210
  __publicField(this, "length", this.config.length);
@@ -32979,7 +32214,7 @@ var init_varchar2 = __esm({
32979
32214
  return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
32980
32215
  }
32981
32216
  };
32982
- __publicField(MySqlVarChar, _a294, "MySqlVarChar");
32217
+ __publicField(MySqlVarChar, _a292, "MySqlVarChar");
32983
32218
  }
32984
32219
  });
32985
32220
 
@@ -32987,13 +32222,13 @@ var init_varchar2 = __esm({
32987
32222
  function year(name2) {
32988
32223
  return new MySqlYearBuilder(name2 ?? "");
32989
32224
  }
32990
- var _a295, _b218, MySqlYearBuilder, _a296, _b219, MySqlYear;
32225
+ var _a293, _b218, MySqlYearBuilder, _a294, _b219, MySqlYear;
32991
32226
  var init_year = __esm({
32992
32227
  "../drizzle-orm/dist/mysql-core/columns/year.js"() {
32993
32228
  "use strict";
32994
32229
  init_entity();
32995
32230
  init_common4();
32996
- MySqlYearBuilder = class extends (_b218 = MySqlColumnBuilder, _a295 = entityKind, _b218) {
32231
+ MySqlYearBuilder = class extends (_b218 = MySqlColumnBuilder, _a293 = entityKind, _b218) {
32997
32232
  constructor(name2) {
32998
32233
  super(name2, "number", "MySqlYear");
32999
32234
  }
@@ -33002,13 +32237,13 @@ var init_year = __esm({
33002
32237
  return new MySqlYear(table4, this.config);
33003
32238
  }
33004
32239
  };
33005
- __publicField(MySqlYearBuilder, _a295, "MySqlYearBuilder");
33006
- MySqlYear = class extends (_b219 = MySqlColumn, _a296 = entityKind, _b219) {
32240
+ __publicField(MySqlYearBuilder, _a293, "MySqlYearBuilder");
32241
+ MySqlYear = class extends (_b219 = MySqlColumn, _a294 = entityKind, _b219) {
33007
32242
  getSQLType() {
33008
32243
  return `year`;
33009
32244
  }
33010
32245
  };
33011
- __publicField(MySqlYear, _a296, "MySqlYear");
32246
+ __publicField(MySqlYear, _a294, "MySqlYear");
33012
32247
  }
33013
32248
  });
33014
32249
 
@@ -33045,17 +32280,17 @@ var init_columns3 = __esm({
33045
32280
  });
33046
32281
 
33047
32282
  // ../drizzle-orm/dist/mysql-core/query-builders/count.js
33048
- var _a297, _b220, _c9, _MySqlCountBuilder, MySqlCountBuilder;
32283
+ var _a295, _b220, _c9, _MySqlCountBuilder, MySqlCountBuilder;
33049
32284
  var init_count3 = __esm({
33050
32285
  "../drizzle-orm/dist/mysql-core/query-builders/count.js"() {
33051
32286
  "use strict";
33052
32287
  init_entity();
33053
32288
  init_sql();
33054
- _MySqlCountBuilder = class _MySqlCountBuilder extends (_c9 = SQL, _b220 = entityKind, _a297 = Symbol.toStringTag, _c9) {
32289
+ _MySqlCountBuilder = class _MySqlCountBuilder extends (_c9 = SQL, _b220 = entityKind, _a295 = Symbol.toStringTag, _c9) {
33055
32290
  constructor(params) {
33056
32291
  super(_MySqlCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
33057
32292
  __publicField(this, "sql");
33058
- __publicField(this, _a297, "MySqlCountBuilder");
32293
+ __publicField(this, _a295, "MySqlCountBuilder");
33059
32294
  __publicField(this, "session");
33060
32295
  this.params = params;
33061
32296
  this.mapWith(Number);
@@ -33099,13 +32334,13 @@ var init_count3 = __esm({
33099
32334
  });
33100
32335
 
33101
32336
  // ../drizzle-orm/dist/mysql-core/query-builders/delete.js
33102
- var _a298, _b221, MySqlDeleteBase;
32337
+ var _a296, _b221, MySqlDeleteBase;
33103
32338
  var init_delete3 = __esm({
33104
32339
  "../drizzle-orm/dist/mysql-core/query-builders/delete.js"() {
33105
32340
  "use strict";
33106
32341
  init_entity();
33107
32342
  init_query_promise();
33108
- MySqlDeleteBase = class extends (_b221 = QueryPromise, _a298 = entityKind, _b221) {
32343
+ MySqlDeleteBase = class extends (_b221 = QueryPromise, _a296 = entityKind, _b221) {
33109
32344
  constructor(table4, session, dialect4, withList) {
33110
32345
  super();
33111
32346
  __publicField(this, "config");
@@ -33175,12 +32410,12 @@ var init_delete3 = __esm({
33175
32410
  return this;
33176
32411
  }
33177
32412
  };
33178
- __publicField(MySqlDeleteBase, _a298, "MySqlDelete");
32413
+ __publicField(MySqlDeleteBase, _a296, "MySqlDelete");
33179
32414
  }
33180
32415
  });
33181
32416
 
33182
32417
  // ../drizzle-orm/dist/mysql-core/query-builders/insert.js
33183
- var _a299, MySqlInsertBuilder, _a300, _b222, MySqlInsertBase;
32418
+ var _a297, MySqlInsertBuilder, _a298, _b222, MySqlInsertBase;
33184
32419
  var init_insert3 = __esm({
33185
32420
  "../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
33186
32421
  "use strict";
@@ -33189,7 +32424,7 @@ var init_insert3 = __esm({
33189
32424
  init_sql();
33190
32425
  init_table();
33191
32426
  init_utils2();
33192
- _a299 = entityKind;
32427
+ _a297 = entityKind;
33193
32428
  MySqlInsertBuilder = class {
33194
32429
  constructor(table4, session, dialect4) {
33195
32430
  __publicField(this, "shouldIgnore", false);
@@ -33218,8 +32453,8 @@ var init_insert3 = __esm({
33218
32453
  return new MySqlInsertBase(this.table, mappedValues, this.shouldIgnore, this.session, this.dialect);
33219
32454
  }
33220
32455
  };
33221
- __publicField(MySqlInsertBuilder, _a299, "MySqlInsertBuilder");
33222
- MySqlInsertBase = class extends (_b222 = QueryPromise, _a300 = entityKind, _b222) {
32456
+ __publicField(MySqlInsertBuilder, _a297, "MySqlInsertBuilder");
32457
+ MySqlInsertBase = class extends (_b222 = QueryPromise, _a298 = entityKind, _b222) {
33223
32458
  constructor(table4, values, ignore, session, dialect4) {
33224
32459
  super();
33225
32460
  __publicField(this, "config");
@@ -33300,7 +32535,7 @@ var init_insert3 = __esm({
33300
32535
  return this;
33301
32536
  }
33302
32537
  };
33303
- __publicField(MySqlInsertBase, _a300, "MySqlInsert");
32538
+ __publicField(MySqlInsertBase, _a298, "MySqlInsert");
33304
32539
  }
33305
32540
  });
33306
32541
 
@@ -33384,7 +32619,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
33384
32619
  }
33385
32620
  return table4;
33386
32621
  }
33387
- var InlineForeignKeys3, _a301, _b223, _c10, _d4, _e3, MySqlTable, mysqlTable;
32622
+ var InlineForeignKeys3, _a299, _b223, _c10, _d4, _e3, MySqlTable, mysqlTable;
33388
32623
  var init_table4 = __esm({
33389
32624
  "../drizzle-orm/dist/mysql-core/table.js"() {
33390
32625
  "use strict";
@@ -33392,7 +32627,7 @@ var init_table4 = __esm({
33392
32627
  init_table();
33393
32628
  init_all3();
33394
32629
  InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
33395
- MySqlTable = class extends (_e3 = Table, _d4 = entityKind, _c10 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a301 = Table.Symbol.ExtraConfigBuilder, _e3) {
32630
+ MySqlTable = class extends (_e3 = Table, _d4 = entityKind, _c10 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a299 = Table.Symbol.ExtraConfigBuilder, _e3) {
33396
32631
  constructor() {
33397
32632
  super(...arguments);
33398
32633
  /** @internal */
@@ -33400,7 +32635,7 @@ var init_table4 = __esm({
33400
32635
  /** @internal */
33401
32636
  __publicField(this, _b223, []);
33402
32637
  /** @internal */
33403
- __publicField(this, _a301);
32638
+ __publicField(this, _a299);
33404
32639
  }
33405
32640
  };
33406
32641
  __publicField(MySqlTable, _d4, "MySqlTable");
@@ -33415,20 +32650,20 @@ var init_table4 = __esm({
33415
32650
  });
33416
32651
 
33417
32652
  // ../drizzle-orm/dist/mysql-core/view-base.js
33418
- var _a302, _b224, MySqlViewBase;
32653
+ var _a300, _b224, MySqlViewBase;
33419
32654
  var init_view_base3 = __esm({
33420
32655
  "../drizzle-orm/dist/mysql-core/view-base.js"() {
33421
32656
  "use strict";
33422
32657
  init_entity();
33423
32658
  init_sql();
33424
- MySqlViewBase = class extends (_b224 = View, _a302 = entityKind, _b224) {
32659
+ MySqlViewBase = class extends (_b224 = View, _a300 = entityKind, _b224) {
33425
32660
  };
33426
- __publicField(MySqlViewBase, _a302, "MySqlViewBase");
32661
+ __publicField(MySqlViewBase, _a300, "MySqlViewBase");
33427
32662
  }
33428
32663
  });
33429
32664
 
33430
32665
  // ../drizzle-orm/dist/mysql-core/dialect.js
33431
- var _a303, MySqlDialect;
32666
+ var _a301, MySqlDialect;
33432
32667
  var init_dialect3 = __esm({
33433
32668
  "../drizzle-orm/dist/mysql-core/dialect.js"() {
33434
32669
  "use strict";
@@ -33447,7 +32682,7 @@ var init_dialect3 = __esm({
33447
32682
  init_common4();
33448
32683
  init_table4();
33449
32684
  init_view_base3();
33450
- _a303 = entityKind;
32685
+ _a301 = entityKind;
33451
32686
  MySqlDialect = class {
33452
32687
  constructor(config) {
33453
32688
  /** @internal */
@@ -34229,7 +33464,7 @@ var init_dialect3 = __esm({
34229
33464
  };
34230
33465
  }
34231
33466
  };
34232
- __publicField(MySqlDialect, _a303, "MySqlDialect");
33467
+ __publicField(MySqlDialect, _a301, "MySqlDialect");
34233
33468
  }
34234
33469
  });
34235
33470
 
@@ -34251,7 +33486,7 @@ function createSetOperator3(type, isAll) {
34251
33486
  return leftSelect.addSetOperators(setOperators);
34252
33487
  };
34253
33488
  }
34254
- var _a304, MySqlSelectBuilder, _a305, _b225, MySqlSelectQueryBuilderBase, _a306, _b226, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
33489
+ var _a302, MySqlSelectBuilder, _a303, _b225, MySqlSelectQueryBuilderBase, _a304, _b226, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
34255
33490
  var init_select4 = __esm({
34256
33491
  "../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
34257
33492
  "use strict";
@@ -34266,7 +33501,7 @@ var init_select4 = __esm({
34266
33501
  init_utils2();
34267
33502
  init_view_common();
34268
33503
  init_view_base3();
34269
- _a304 = entityKind;
33504
+ _a302 = entityKind;
34270
33505
  MySqlSelectBuilder = class {
34271
33506
  constructor(config) {
34272
33507
  __publicField(this, "fields");
@@ -34311,8 +33546,8 @@ var init_select4 = __esm({
34311
33546
  );
34312
33547
  }
34313
33548
  };
34314
- __publicField(MySqlSelectBuilder, _a304, "MySqlSelectBuilder");
34315
- MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a305 = entityKind, _b225) {
33549
+ __publicField(MySqlSelectBuilder, _a302, "MySqlSelectBuilder");
33550
+ MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a303 = entityKind, _b225) {
34316
33551
  constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
34317
33552
  super();
34318
33553
  __publicField(this, "_");
@@ -34913,8 +34148,8 @@ var init_select4 = __esm({
34913
34148
  return this;
34914
34149
  }
34915
34150
  };
34916
- __publicField(MySqlSelectQueryBuilderBase, _a305, "MySqlSelectQueryBuilder");
34917
- MySqlSelectBase = class extends (_b226 = MySqlSelectQueryBuilderBase, _a306 = entityKind, _b226) {
34151
+ __publicField(MySqlSelectQueryBuilderBase, _a303, "MySqlSelectQueryBuilder");
34152
+ MySqlSelectBase = class extends (_b226 = MySqlSelectQueryBuilderBase, _a304 = entityKind, _b226) {
34918
34153
  constructor() {
34919
34154
  super(...arguments);
34920
34155
  __publicField(this, "execute", (placeholderValues) => {
@@ -34938,7 +34173,7 @@ var init_select4 = __esm({
34938
34173
  return query;
34939
34174
  }
34940
34175
  };
34941
- __publicField(MySqlSelectBase, _a306, "MySqlSelect");
34176
+ __publicField(MySqlSelectBase, _a304, "MySqlSelect");
34942
34177
  applyMixins(MySqlSelectBase, [QueryPromise]);
34943
34178
  getMySqlSetOperators = () => ({
34944
34179
  union: union3,
@@ -34958,7 +34193,7 @@ var init_select4 = __esm({
34958
34193
  });
34959
34194
 
34960
34195
  // ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
34961
- var _a307, QueryBuilder3;
34196
+ var _a305, QueryBuilder3;
34962
34197
  var init_query_builder4 = __esm({
34963
34198
  "../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
34964
34199
  "use strict";
@@ -34967,7 +34202,7 @@ var init_query_builder4 = __esm({
34967
34202
  init_selection_proxy();
34968
34203
  init_subquery();
34969
34204
  init_select4();
34970
- _a307 = entityKind;
34205
+ _a305 = entityKind;
34971
34206
  QueryBuilder3 = class {
34972
34207
  constructor(dialect4) {
34973
34208
  __publicField(this, "dialect");
@@ -35029,7 +34264,7 @@ var init_query_builder4 = __esm({
35029
34264
  return this.dialect;
35030
34265
  }
35031
34266
  };
35032
- __publicField(QueryBuilder3, _a307, "MySqlQueryBuilder");
34267
+ __publicField(QueryBuilder3, _a305, "MySqlQueryBuilder");
35033
34268
  }
35034
34269
  });
35035
34270
 
@@ -35041,14 +34276,14 @@ var init_select_types3 = __esm({
35041
34276
  });
35042
34277
 
35043
34278
  // ../drizzle-orm/dist/mysql-core/query-builders/update.js
35044
- var _a308, MySqlUpdateBuilder, _a309, _b227, MySqlUpdateBase;
34279
+ var _a306, MySqlUpdateBuilder, _a307, _b227, MySqlUpdateBase;
35045
34280
  var init_update3 = __esm({
35046
34281
  "../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
35047
34282
  "use strict";
35048
34283
  init_entity();
35049
34284
  init_query_promise();
35050
34285
  init_utils2();
35051
- _a308 = entityKind;
34286
+ _a306 = entityKind;
35052
34287
  MySqlUpdateBuilder = class {
35053
34288
  constructor(table4, session, dialect4, withList) {
35054
34289
  this.table = table4;
@@ -35060,8 +34295,8 @@ var init_update3 = __esm({
35060
34295
  return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
35061
34296
  }
35062
34297
  };
35063
- __publicField(MySqlUpdateBuilder, _a308, "MySqlUpdateBuilder");
35064
- MySqlUpdateBase = class extends (_b227 = QueryPromise, _a309 = entityKind, _b227) {
34298
+ __publicField(MySqlUpdateBuilder, _a306, "MySqlUpdateBuilder");
34299
+ MySqlUpdateBase = class extends (_b227 = QueryPromise, _a307 = entityKind, _b227) {
35065
34300
  constructor(table4, set, session, dialect4, withList) {
35066
34301
  super();
35067
34302
  __publicField(this, "config");
@@ -35134,7 +34369,7 @@ var init_update3 = __esm({
35134
34369
  return this;
35135
34370
  }
35136
34371
  };
35137
- __publicField(MySqlUpdateBase, _a309, "MySqlUpdate");
34372
+ __publicField(MySqlUpdateBase, _a307, "MySqlUpdate");
35138
34373
  }
35139
34374
  });
35140
34375
 
@@ -35152,14 +34387,14 @@ var init_query_builders3 = __esm({
35152
34387
  });
35153
34388
 
35154
34389
  // ../drizzle-orm/dist/mysql-core/query-builders/query.js
35155
- var _a310, RelationalQueryBuilder3, _a311, _b228, MySqlRelationalQuery;
34390
+ var _a308, RelationalQueryBuilder3, _a309, _b228, MySqlRelationalQuery;
35156
34391
  var init_query3 = __esm({
35157
34392
  "../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
35158
34393
  "use strict";
35159
34394
  init_entity();
35160
34395
  init_query_promise();
35161
34396
  init_relations();
35162
- _a310 = entityKind;
34397
+ _a308 = entityKind;
35163
34398
  RelationalQueryBuilder3 = class {
35164
34399
  constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, mode) {
35165
34400
  this.fullSchema = fullSchema;
@@ -35200,8 +34435,8 @@ var init_query3 = __esm({
35200
34435
  );
35201
34436
  }
35202
34437
  };
35203
- __publicField(RelationalQueryBuilder3, _a310, "MySqlRelationalQueryBuilder");
35204
- MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a311 = entityKind, _b228) {
34438
+ __publicField(RelationalQueryBuilder3, _a308, "MySqlRelationalQueryBuilder");
34439
+ MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a309 = entityKind, _b228) {
35205
34440
  constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, queryMode, mode) {
35206
34441
  super();
35207
34442
  this.fullSchema = fullSchema;
@@ -35265,12 +34500,12 @@ var init_query3 = __esm({
35265
34500
  return this.prepare().execute();
35266
34501
  }
35267
34502
  };
35268
- __publicField(MySqlRelationalQuery, _a311, "MySqlRelationalQuery");
34503
+ __publicField(MySqlRelationalQuery, _a309, "MySqlRelationalQuery");
35269
34504
  }
35270
34505
  });
35271
34506
 
35272
34507
  // ../drizzle-orm/dist/mysql-core/db.js
35273
- var _a312, MySqlDatabase;
34508
+ var _a310, MySqlDatabase;
35274
34509
  var init_db3 = __esm({
35275
34510
  "../drizzle-orm/dist/mysql-core/db.js"() {
35276
34511
  "use strict";
@@ -35281,7 +34516,7 @@ var init_db3 = __esm({
35281
34516
  init_count3();
35282
34517
  init_query_builders3();
35283
34518
  init_query3();
35284
- _a312 = entityKind;
34519
+ _a310 = entityKind;
35285
34520
  MySqlDatabase = class {
35286
34521
  constructor(dialect4, session, schema4, mode) {
35287
34522
  __publicField(this, "query");
@@ -35494,17 +34729,17 @@ var init_db3 = __esm({
35494
34729
  return this.session.transaction(transaction, config);
35495
34730
  }
35496
34731
  };
35497
- __publicField(MySqlDatabase, _a312, "MySqlDatabase");
34732
+ __publicField(MySqlDatabase, _a310, "MySqlDatabase");
35498
34733
  }
35499
34734
  });
35500
34735
 
35501
34736
  // ../drizzle-orm/dist/mysql-core/indexes.js
35502
- var _a313, IndexBuilderOn3, _a314, IndexBuilder3, _a315, Index5;
34737
+ var _a311, IndexBuilderOn3, _a312, IndexBuilder3, _a313, Index5;
35503
34738
  var init_indexes3 = __esm({
35504
34739
  "../drizzle-orm/dist/mysql-core/indexes.js"() {
35505
34740
  "use strict";
35506
34741
  init_entity();
35507
- _a313 = entityKind;
34742
+ _a311 = entityKind;
35508
34743
  IndexBuilderOn3 = class {
35509
34744
  constructor(name2, unique) {
35510
34745
  this.name = name2;
@@ -35514,8 +34749,8 @@ var init_indexes3 = __esm({
35514
34749
  return new IndexBuilder3(this.name, columns, this.unique);
35515
34750
  }
35516
34751
  };
35517
- __publicField(IndexBuilderOn3, _a313, "MySqlIndexBuilderOn");
35518
- _a314 = entityKind;
34752
+ __publicField(IndexBuilderOn3, _a311, "MySqlIndexBuilderOn");
34753
+ _a312 = entityKind;
35519
34754
  IndexBuilder3 = class {
35520
34755
  constructor(name2, columns, unique) {
35521
34756
  /** @internal */
@@ -35543,26 +34778,26 @@ var init_indexes3 = __esm({
35543
34778
  return new Index5(this.config, table4);
35544
34779
  }
35545
34780
  };
35546
- __publicField(IndexBuilder3, _a314, "MySqlIndexBuilder");
35547
- _a315 = entityKind;
34781
+ __publicField(IndexBuilder3, _a312, "MySqlIndexBuilder");
34782
+ _a313 = entityKind;
35548
34783
  Index5 = class {
35549
34784
  constructor(config, table4) {
35550
34785
  __publicField(this, "config");
35551
34786
  this.config = { ...config, table: table4 };
35552
34787
  }
35553
34788
  };
35554
- __publicField(Index5, _a315, "MySqlIndex");
34789
+ __publicField(Index5, _a313, "MySqlIndex");
35555
34790
  }
35556
34791
  });
35557
34792
 
35558
34793
  // ../drizzle-orm/dist/mysql-core/primary-keys.js
35559
- var _a316, PrimaryKeyBuilder3, _a317, PrimaryKey3;
34794
+ var _a314, PrimaryKeyBuilder3, _a315, PrimaryKey3;
35560
34795
  var init_primary_keys3 = __esm({
35561
34796
  "../drizzle-orm/dist/mysql-core/primary-keys.js"() {
35562
34797
  "use strict";
35563
34798
  init_entity();
35564
34799
  init_table4();
35565
- _a316 = entityKind;
34800
+ _a314 = entityKind;
35566
34801
  PrimaryKeyBuilder3 = class {
35567
34802
  constructor(columns, name2) {
35568
34803
  /** @internal */
@@ -35577,8 +34812,8 @@ var init_primary_keys3 = __esm({
35577
34812
  return new PrimaryKey3(table4, this.columns, this.name);
35578
34813
  }
35579
34814
  };
35580
- __publicField(PrimaryKeyBuilder3, _a316, "MySqlPrimaryKeyBuilder");
35581
- _a317 = entityKind;
34815
+ __publicField(PrimaryKeyBuilder3, _a314, "MySqlPrimaryKeyBuilder");
34816
+ _a315 = entityKind;
35582
34817
  PrimaryKey3 = class {
35583
34818
  constructor(table4, columns, name2) {
35584
34819
  __publicField(this, "columns");
@@ -35591,7 +34826,7 @@ var init_primary_keys3 = __esm({
35591
34826
  return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
35592
34827
  }
35593
34828
  };
35594
- __publicField(PrimaryKey3, _a317, "MySqlPrimaryKey");
34829
+ __publicField(PrimaryKey3, _a315, "MySqlPrimaryKey");
35595
34830
  }
35596
34831
  });
35597
34832
 
@@ -35611,7 +34846,7 @@ function mysqlViewWithSchema(name2, selection, schema4) {
35611
34846
  }
35612
34847
  return new ViewBuilder3(name2, schema4);
35613
34848
  }
35614
- var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231, _c11, MySqlView;
34849
+ var _a316, ViewBuilderCore2, _a317, _b229, ViewBuilder3, _a318, _b230, ManualViewBuilder3, _a319, _b231, _c11, MySqlView;
35615
34850
  var init_view3 = __esm({
35616
34851
  "../drizzle-orm/dist/mysql-core/view.js"() {
35617
34852
  "use strict";
@@ -35622,7 +34857,7 @@ var init_view3 = __esm({
35622
34857
  init_table4();
35623
34858
  init_view_base3();
35624
34859
  init_view_common4();
35625
- _a318 = entityKind;
34860
+ _a316 = entityKind;
35626
34861
  ViewBuilderCore2 = class {
35627
34862
  constructor(name2, schema4) {
35628
34863
  __publicField(this, "config", {});
@@ -35646,8 +34881,8 @@ var init_view3 = __esm({
35646
34881
  return this;
35647
34882
  }
35648
34883
  };
35649
- __publicField(ViewBuilderCore2, _a318, "MySqlViewBuilder");
35650
- ViewBuilder3 = class extends (_b229 = ViewBuilderCore2, _a319 = entityKind, _b229) {
34884
+ __publicField(ViewBuilderCore2, _a316, "MySqlViewBuilder");
34885
+ ViewBuilder3 = class extends (_b229 = ViewBuilderCore2, _a317 = entityKind, _b229) {
35651
34886
  as(qb) {
35652
34887
  if (typeof qb === "function") {
35653
34888
  qb = qb(new QueryBuilder3());
@@ -35673,8 +34908,8 @@ var init_view3 = __esm({
35673
34908
  );
35674
34909
  }
35675
34910
  };
35676
- __publicField(ViewBuilder3, _a319, "MySqlViewBuilder");
35677
- ManualViewBuilder3 = class extends (_b230 = ViewBuilderCore2, _a320 = entityKind, _b230) {
34911
+ __publicField(ViewBuilder3, _a317, "MySqlViewBuilder");
34912
+ ManualViewBuilder3 = class extends (_b230 = ViewBuilderCore2, _a318 = entityKind, _b230) {
35678
34913
  constructor(name2, columns, schema4) {
35679
34914
  super(name2, schema4);
35680
34915
  __publicField(this, "columns");
@@ -35719,11 +34954,11 @@ var init_view3 = __esm({
35719
34954
  );
35720
34955
  }
35721
34956
  };
35722
- __publicField(ManualViewBuilder3, _a320, "MySqlManualViewBuilder");
35723
- MySqlView = class extends (_c11 = MySqlViewBase, _b231 = entityKind, _a321 = MySqlViewConfig, _c11) {
34957
+ __publicField(ManualViewBuilder3, _a318, "MySqlManualViewBuilder");
34958
+ MySqlView = class extends (_c11 = MySqlViewBase, _b231 = entityKind, _a319 = MySqlViewConfig, _c11) {
35724
34959
  constructor({ mysqlConfig, config }) {
35725
34960
  super(config);
35726
- __publicField(this, _a321);
34961
+ __publicField(this, _a319);
35727
34962
  this[MySqlViewConfig] = mysqlConfig;
35728
34963
  }
35729
34964
  };
@@ -35732,14 +34967,14 @@ var init_view3 = __esm({
35732
34967
  });
35733
34968
 
35734
34969
  // ../drizzle-orm/dist/mysql-core/schema.js
35735
- var _a322, MySqlSchema5;
34970
+ var _a320, MySqlSchema5;
35736
34971
  var init_schema2 = __esm({
35737
34972
  "../drizzle-orm/dist/mysql-core/schema.js"() {
35738
34973
  "use strict";
35739
34974
  init_entity();
35740
34975
  init_table4();
35741
34976
  init_view3();
35742
- _a322 = entityKind;
34977
+ _a320 = entityKind;
35743
34978
  MySqlSchema5 = class {
35744
34979
  constructor(schemaName) {
35745
34980
  __publicField(this, "table", (name2, columns, extraConfig) => {
@@ -35751,12 +34986,12 @@ var init_schema2 = __esm({
35751
34986
  this.schemaName = schemaName;
35752
34987
  }
35753
34988
  };
35754
- __publicField(MySqlSchema5, _a322, "MySqlSchema");
34989
+ __publicField(MySqlSchema5, _a320, "MySqlSchema");
35755
34990
  }
35756
34991
  });
35757
34992
 
35758
34993
  // ../drizzle-orm/dist/mysql-core/session.js
35759
- var _a323, MySqlPreparedQuery, _a324, MySqlSession, _a325, _b232, MySqlTransaction;
34994
+ var _a321, MySqlPreparedQuery, _a322, MySqlSession, _a323, _b232, MySqlTransaction;
35760
34995
  var init_session3 = __esm({
35761
34996
  "../drizzle-orm/dist/mysql-core/session.js"() {
35762
34997
  "use strict";
@@ -35764,15 +34999,15 @@ var init_session3 = __esm({
35764
34999
  init_errors();
35765
35000
  init_sql();
35766
35001
  init_db3();
35767
- _a323 = entityKind;
35002
+ _a321 = entityKind;
35768
35003
  MySqlPreparedQuery = class {
35769
35004
  constructor() {
35770
35005
  /** @internal */
35771
35006
  __publicField(this, "joinsNotNullableMap");
35772
35007
  }
35773
35008
  };
35774
- __publicField(MySqlPreparedQuery, _a323, "MySqlPreparedQuery");
35775
- _a324 = entityKind;
35009
+ __publicField(MySqlPreparedQuery, _a321, "MySqlPreparedQuery");
35010
+ _a322 = entityKind;
35776
35011
  MySqlSession = class {
35777
35012
  constructor(dialect4) {
35778
35013
  this.dialect = dialect4;
@@ -35807,8 +35042,8 @@ var init_session3 = __esm({
35807
35042
  return parts.length ? sql`start transaction ${sql.raw(parts.join(" "))}` : void 0;
35808
35043
  }
35809
35044
  };
35810
- __publicField(MySqlSession, _a324, "MySqlSession");
35811
- MySqlTransaction = class extends (_b232 = MySqlDatabase, _a325 = entityKind, _b232) {
35045
+ __publicField(MySqlSession, _a322, "MySqlSession");
35046
+ MySqlTransaction = class extends (_b232 = MySqlDatabase, _a323 = entityKind, _b232) {
35812
35047
  constructor(dialect4, session, schema4, nestedIndex, mode) {
35813
35048
  super(dialect4, session, schema4, mode);
35814
35049
  this.schema = schema4;
@@ -35818,7 +35053,7 @@ var init_session3 = __esm({
35818
35053
  throw new TransactionRollbackError();
35819
35054
  }
35820
35055
  };
35821
- __publicField(MySqlTransaction, _a325, "MySqlTransaction");
35056
+ __publicField(MySqlTransaction, _a323, "MySqlTransaction");
35822
35057
  }
35823
35058
  });
35824
35059
 
@@ -36516,13 +35751,6 @@ var init_cli = __esm({
36516
35751
  breakpoints: booleanType().optional().default(true),
36517
35752
  migrations: objectType({
36518
35753
  prefix: prefix.optional().default("index")
36519
- }).optional(),
36520
- entities: objectType({
36521
- roles: booleanType().or(objectType({
36522
- provider: stringType().optional(),
36523
- include: stringType().array().optional(),
36524
- exclude: stringType().array().optional()
36525
- })).optional().default(false)
36526
35754
  }).optional()
36527
35755
  }).passthrough();
36528
35756
  configCheck = objectType({
@@ -36789,7 +36017,6 @@ var init_pgImports = __esm({
36789
36017
  const enums = [];
36790
36018
  const schemas = [];
36791
36019
  const sequences = [];
36792
- const roles = [];
36793
36020
  const i0values = Object.values(exports);
36794
36021
  i0values.forEach((t) => {
36795
36022
  if (isPgEnum(t)) {
@@ -36805,11 +36032,8 @@ var init_pgImports = __esm({
36805
36032
  if (isPgSequence(t)) {
36806
36033
  sequences.push(t);
36807
36034
  }
36808
- if (is(t, PgRole)) {
36809
- roles.push(t);
36810
- }
36811
36035
  });
36812
- return { tables, enums, schemas, sequences, roles };
36036
+ return { tables, enums, schemas, sequences };
36813
36037
  };
36814
36038
  }
36815
36039
  });
@@ -37203,7 +36427,7 @@ init_mjs();
37203
36427
  init_global();
37204
36428
  init_pgSerializer();
37205
36429
  init_views();
37206
- var pgPushIntrospect = async (db, filters, schemaFilters, entities = { roles: true }) => {
36430
+ var pgPushIntrospect = async (db, filters, schemaFilters) => {
37207
36431
  const matchers = filters.map((it) => {
37208
36432
  return new Minimatch(it);
37209
36433
  });
@@ -37231,7 +36455,7 @@ var pgPushIntrospect = async (db, filters, schemaFilters, entities = { roles: tr
37231
36455
  );
37232
36456
  const res = await (0, import_hanji3.renderWithTask)(
37233
36457
  progress,
37234
- fromDatabase(db, filter2, schemaFilters, entities)
36458
+ fromDatabase(db, filter2, schemaFilters)
37235
36459
  );
37236
36460
  const schema4 = { id: originUUID, prevId: "", ...res };
37237
36461
  const { internal, ...schemaWithoutInternals } = schema4;
@@ -37709,7 +36933,6 @@ var generateDrizzleJson = (imports, prevId, schemaFilters, casing2) => {
37709
36933
  prepared.enums,
37710
36934
  prepared.schemas,
37711
36935
  prepared.sequences,
37712
- prepared.roles,
37713
36936
  casing2,
37714
36937
  schemaFilters
37715
36938
  );
@@ -37731,8 +36954,6 @@ var generateMigration = async (prev, cur) => {
37731
36954
  schemasResolver,
37732
36955
  enumsResolver,
37733
36956
  sequencesResolver,
37734
- policyResolver,
37735
- roleResolver,
37736
36957
  tablesResolver,
37737
36958
  columnsResolver,
37738
36959
  validatedPrev,
@@ -37765,8 +36986,6 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
37765
36986
  schemasResolver,
37766
36987
  enumsResolver,
37767
36988
  sequencesResolver,
37768
- policyResolver,
37769
- roleResolver,
37770
36989
  tablesResolver,
37771
36990
  columnsResolver,
37772
36991
  validatedPrev,