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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.js CHANGED
@@ -2475,9 +2475,9 @@ var require_inflight = __commonJS({
2475
2475
  }
2476
2476
  function slice(args) {
2477
2477
  var length = args.length;
2478
- var array2 = [];
2479
- for (var i = 0; i < length; i++) array2[i] = args[i];
2480
- return array2;
2478
+ var array = [];
2479
+ for (var i = 0; i < length; i++) array[i] = args[i];
2480
+ return array;
2481
2481
  }
2482
2482
  }
2483
2483
  });
@@ -3647,13 +3647,13 @@ function processCreateParams(params) {
3647
3647
  if (errorMap2)
3648
3648
  return { errorMap: errorMap2, description };
3649
3649
  const customMap = (iss, ctx) => {
3650
- var _a326, _b233;
3650
+ var _a324, _b233;
3651
3651
  const { message } = params;
3652
3652
  if (iss.code === "invalid_enum_value") {
3653
3653
  return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
3654
3654
  }
3655
3655
  if (typeof ctx.data === "undefined") {
3656
- return { message: (_a326 = message !== null && message !== void 0 ? message : required_error) !== null && _a326 !== void 0 ? _a326 : ctx.defaultError };
3656
+ return { message: (_a324 = message !== null && message !== void 0 ? message : required_error) !== null && _a324 !== void 0 ? _a324 : ctx.defaultError };
3657
3657
  }
3658
3658
  if (iss.code !== "invalid_type")
3659
3659
  return { message: ctx.defaultError };
@@ -3820,8 +3820,8 @@ var init_lib = __esm({
3820
3820
  return void 0;
3821
3821
  };
3822
3822
  util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
3823
- function joinValues(array2, separator = " | ") {
3824
- return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
3823
+ function joinValues(array, separator = " | ") {
3824
+ return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
3825
3825
  }
3826
3826
  util2.joinValues = joinValues;
3827
3827
  util2.jsonStringifyReplacer = (_2, value) => {
@@ -4319,11 +4319,11 @@ var init_lib = __esm({
4319
4319
  throw result.error;
4320
4320
  }
4321
4321
  safeParse(data, params) {
4322
- var _a326;
4322
+ var _a324;
4323
4323
  const ctx = {
4324
4324
  common: {
4325
4325
  issues: [],
4326
- async: (_a326 = params === null || params === void 0 ? void 0 : params.async) !== null && _a326 !== void 0 ? _a326 : false,
4326
+ async: (_a324 = params === null || params === void 0 ? void 0 : params.async) !== null && _a324 !== void 0 ? _a324 : false,
4327
4327
  contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
4328
4328
  },
4329
4329
  path: (params === null || params === void 0 ? void 0 : params.path) || [],
@@ -4645,7 +4645,7 @@ var init_lib = __esm({
4645
4645
  } else if (check.kind === "url") {
4646
4646
  try {
4647
4647
  new URL(input.data);
4648
- } catch (_a326) {
4648
+ } catch (_a324) {
4649
4649
  ctx = this._getOrReturnCtx(input, ctx);
4650
4650
  addIssueToContext(ctx, {
4651
4651
  validation: "url",
@@ -4815,7 +4815,7 @@ var init_lib = __esm({
4815
4815
  return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
4816
4816
  }
4817
4817
  datetime(options) {
4818
- var _a326, _b233;
4818
+ var _a324, _b233;
4819
4819
  if (typeof options === "string") {
4820
4820
  return this._addCheck({
4821
4821
  kind: "datetime",
@@ -4828,7 +4828,7 @@ var init_lib = __esm({
4828
4828
  return this._addCheck({
4829
4829
  kind: "datetime",
4830
4830
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
4831
- offset: (_a326 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a326 !== void 0 ? _a326 : false,
4831
+ offset: (_a324 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a324 !== void 0 ? _a324 : false,
4832
4832
  local: (_b233 = options === null || options === void 0 ? void 0 : options.local) !== null && _b233 !== void 0 ? _b233 : false,
4833
4833
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
4834
4834
  });
@@ -4992,11 +4992,11 @@ var init_lib = __esm({
4992
4992
  }
4993
4993
  };
4994
4994
  ZodString.create = (params) => {
4995
- var _a326;
4995
+ var _a324;
4996
4996
  return new ZodString({
4997
4997
  checks: [],
4998
4998
  typeName: ZodFirstPartyTypeKind.ZodString,
4999
- coerce: (_a326 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a326 !== void 0 ? _a326 : false,
4999
+ coerce: (_a324 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a324 !== void 0 ? _a324 : false,
5000
5000
  ...processCreateParams(params)
5001
5001
  });
5002
5002
  };
@@ -5389,11 +5389,11 @@ var init_lib = __esm({
5389
5389
  }
5390
5390
  };
5391
5391
  ZodBigInt.create = (params) => {
5392
- var _a326;
5392
+ var _a324;
5393
5393
  return new ZodBigInt({
5394
5394
  checks: [],
5395
5395
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
5396
- coerce: (_a326 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a326 !== void 0 ? _a326 : false,
5396
+ coerce: (_a324 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a324 !== void 0 ? _a324 : false,
5397
5397
  ...processCreateParams(params)
5398
5398
  });
5399
5399
  };
@@ -5873,8 +5873,8 @@ var init_lib = __esm({
5873
5873
  unknownKeys: "strict",
5874
5874
  ...message !== void 0 ? {
5875
5875
  errorMap: (issue, ctx) => {
5876
- var _a326, _b233, _c12, _d5;
5877
- 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;
5876
+ var _a324, _b233, _c12, _d5;
5877
+ 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;
5878
5878
  if (issue.code === "unrecognized_keys")
5879
5879
  return {
5880
5880
  message: (_d5 = errorUtil.errToObj(message).message) !== null && _d5 !== void 0 ? _d5 : defaultError
@@ -7661,7 +7661,7 @@ var init_vector = __esm({
7661
7661
  });
7662
7662
 
7663
7663
  // src/serializer/pgSchema.ts
7664
- 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;
7664
+ 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;
7665
7665
  var init_pgSchema = __esm({
7666
7666
  "src/serializer/pgSchema.ts"() {
7667
7667
  "use strict";
@@ -7793,12 +7793,6 @@ var init_pgSchema = __esm({
7793
7793
  cycle: booleanType().optional(),
7794
7794
  schema: stringType()
7795
7795
  }).strict();
7796
- roleSchema = objectType({
7797
- name: stringType(),
7798
- createDb: booleanType().optional(),
7799
- createRole: booleanType().optional(),
7800
- inherit: booleanType().optional()
7801
- }).strict();
7802
7796
  sequenceSquashed = objectType({
7803
7797
  name: stringType(),
7804
7798
  schema: stringType(),
@@ -7862,14 +7856,6 @@ var init_pgSchema = __esm({
7862
7856
  columns: stringType().array(),
7863
7857
  nullsNotDistinct: booleanType()
7864
7858
  }).strict();
7865
- policy = objectType({
7866
- name: stringType(),
7867
- as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
7868
- for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
7869
- to: stringType().array().optional(),
7870
- using: stringType().optional(),
7871
- withCheck: stringType().optional()
7872
- }).strict();
7873
7859
  tableV42 = objectType({
7874
7860
  name: stringType(),
7875
7861
  schema: stringType(),
@@ -7911,8 +7897,7 @@ var init_pgSchema = __esm({
7911
7897
  indexes: recordType(stringType(), index2),
7912
7898
  foreignKeys: recordType(stringType(), fk2),
7913
7899
  compositePrimaryKeys: recordType(stringType(), compositePK2),
7914
- uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
7915
- policies: recordType(stringType(), policy).default({})
7900
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
7916
7901
  }).strict();
7917
7902
  schemaHash2 = objectType({
7918
7903
  id: stringType(),
@@ -8006,7 +7991,6 @@ var init_pgSchema = __esm({
8006
7991
  enums: recordType(stringType(), enumSchema),
8007
7992
  schemas: recordType(stringType(), stringType()),
8008
7993
  sequences: recordType(stringType(), sequenceSchema).default({}),
8009
- roles: recordType(stringType(), roleSchema).default({}),
8010
7994
  _meta: objectType({
8011
7995
  schemas: recordType(stringType(), stringType()),
8012
7996
  tables: recordType(stringType(), stringType()),
@@ -8021,8 +8005,7 @@ var init_pgSchema = __esm({
8021
8005
  indexes: recordType(stringType(), stringType()),
8022
8006
  foreignKeys: recordType(stringType(), stringType()),
8023
8007
  compositePrimaryKeys: recordType(stringType(), stringType()),
8024
- uniqueConstraints: recordType(stringType(), stringType()),
8025
- policies: recordType(stringType(), stringType())
8008
+ uniqueConstraints: recordType(stringType(), stringType())
8026
8009
  }).strict();
8027
8010
  tableSquashedV42 = objectType({
8028
8011
  name: stringType(),
@@ -8051,8 +8034,7 @@ var init_pgSchema = __esm({
8051
8034
  tables: recordType(stringType(), tableSquashed2),
8052
8035
  enums: recordType(stringType(), enumSchema),
8053
8036
  schemas: recordType(stringType(), stringType()),
8054
- sequences: recordType(stringType(), sequenceSquashed),
8055
- roles: recordType(stringType(), roleSchema).default({})
8037
+ sequences: recordType(stringType(), sequenceSquashed)
8056
8038
  }).strict();
8057
8039
  pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
8058
8040
  pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
@@ -8135,23 +8117,6 @@ var init_pgSchema = __esm({
8135
8117
  squashFK: (fk4) => {
8136
8118
  return `${fk4.name};${fk4.tableFrom};${fk4.columnsFrom.join(",")};${fk4.tableTo};${fk4.columnsTo.join(",")};${fk4.onUpdate ?? ""};${fk4.onDelete ?? ""};${fk4.schemaTo || "public"}`;
8137
8119
  },
8138
- squashPolicy: (policy2) => {
8139
- return `${policy2.name}--${policy2.as}--${policy2.for}--${policy2.to?.join(",")}--${policy2.using}--${policy2.withCheck}`;
8140
- },
8141
- unsquashPolicy: (policy2) => {
8142
- const splitted = policy2.split("--");
8143
- return {
8144
- name: splitted[0],
8145
- as: splitted[1],
8146
- for: splitted[2],
8147
- to: splitted[3].split(","),
8148
- using: splitted[4] !== "undefined" ? splitted[4] : void 0,
8149
- withCheck: splitted[5] !== "undefined" ? splitted[5] : void 0
8150
- };
8151
- },
8152
- squashPolicyPush: (policy2) => {
8153
- return `${policy2.name}--${policy2.as}--${policy2.for}--${policy2.to?.join(",")}`;
8154
- },
8155
8120
  squashPK: (pk) => {
8156
8121
  return `${pk.columns.join(",")};${pk.name}`;
8157
8122
  },
@@ -8254,9 +8219,6 @@ var init_pgSchema = __esm({
8254
8219
  return PgSquasher.squashUnique(unq);
8255
8220
  }
8256
8221
  );
8257
- const squashedPolicies = mapValues(it[1].policies, (policy2) => {
8258
- return action === "push" ? PgSquasher.squashPolicyPush(policy2) : PgSquasher.squashPolicy(policy2);
8259
- });
8260
8222
  return [
8261
8223
  it[0],
8262
8224
  {
@@ -8266,8 +8228,7 @@ var init_pgSchema = __esm({
8266
8228
  indexes: squashedIndexes,
8267
8229
  foreignKeys: squashedFKs,
8268
8230
  compositePrimaryKeys: squashedPKs,
8269
- uniqueConstraints: squashedUniqueConstraints,
8270
- policies: squashedPolicies
8231
+ uniqueConstraints: squashedUniqueConstraints
8271
8232
  }
8272
8233
  ];
8273
8234
  })
@@ -8290,8 +8251,7 @@ var init_pgSchema = __esm({
8290
8251
  tables: mappedTables,
8291
8252
  enums: json3.enums,
8292
8253
  schemas: json3.schemas,
8293
- sequences: mappedSequences,
8294
- roles: json3.roles
8254
+ sequences: mappedSequences
8295
8255
  };
8296
8256
  };
8297
8257
  dryPg = pgSchema.parse({
@@ -8641,7 +8601,7 @@ var init_utils = __esm({
8641
8601
  });
8642
8602
 
8643
8603
  // src/cli/views.ts
8644
- var import_hanji, warning, error, isRenamePromptItem, ResolveColumnSelect, tableKey, ResolveSelectNamed, ResolveSelect, ResolveSchemasSelect, Spinner, ProgressView;
8604
+ var import_hanji, warning, error, isRenamePromptItem, ResolveColumnSelect, tableKey, ResolveSelect, ResolveSchemasSelect, Spinner, ProgressView;
8645
8605
  var init_views = __esm({
8646
8606
  "src/cli/views.ts"() {
8647
8607
  "use strict";
@@ -8706,53 +8666,6 @@ Is ${source_default.bold.blue(
8706
8666
  tableKey = (it) => {
8707
8667
  return it.schema === "public" || !it.schema ? it.name : `${it.schema}.${it.name}`;
8708
8668
  };
8709
- ResolveSelectNamed = class extends import_hanji.Prompt {
8710
- constructor(base, data, entityType) {
8711
- super();
8712
- this.base = base;
8713
- this.entityType = entityType;
8714
- this.on("attach", (terminal) => terminal.toggleCursor("hide"));
8715
- this.state = new import_hanji.SelectState(data);
8716
- this.state.bind(this);
8717
- this.base = base;
8718
- }
8719
- render(status) {
8720
- if (status === "submitted" || status === "aborted") {
8721
- return "";
8722
- }
8723
- const key = this.base.name;
8724
- let text4 = `
8725
- Is ${source_default.bold.blue(key)} ${this.entityType} created or renamed from another ${this.entityType}?
8726
- `;
8727
- const isSelectedRenamed = isRenamePromptItem(
8728
- this.state.items[this.state.selectedIdx]
8729
- );
8730
- const selectedPrefix = isSelectedRenamed ? source_default.yellow("\u276F ") : source_default.green("\u276F ");
8731
- const labelLength = this.state.items.filter((it) => isRenamePromptItem(it)).map((_2) => {
8732
- const it = _2;
8733
- const keyFrom = it.from.name;
8734
- return key.length + 3 + keyFrom.length;
8735
- }).reduce((a, b) => {
8736
- if (a > b) {
8737
- return a;
8738
- }
8739
- return b;
8740
- }, 0);
8741
- const entityType = this.entityType;
8742
- this.state.items.forEach((it, idx) => {
8743
- const isSelected = idx === this.state.selectedIdx;
8744
- const isRenamed = isRenamePromptItem(it);
8745
- const title = isRenamed ? `${it.from.name} \u203A ${it.to.name}`.padEnd(labelLength, " ") : it.name.padEnd(labelLength, " ");
8746
- const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray(`rename ${entityType}`)}` : `${source_default.green("+")} ${title} ${source_default.gray(`create ${entityType}`)}`;
8747
- text4 += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
8748
- text4 += idx != this.state.items.length - 1 ? "\n" : "";
8749
- });
8750
- return text4;
8751
- }
8752
- result() {
8753
- return this.state.items[this.state.selectedIdx];
8754
- }
8755
- };
8756
8669
  ResolveSelect = class extends import_hanji.Prompt {
8757
8670
  constructor(base, data, entityType) {
8758
8671
  super();
@@ -8969,57 +8882,57 @@ var require_heap = __commonJS({
8969
8882
  }
8970
8883
  return [].splice.apply(a, [lo, lo - lo].concat(x)), x;
8971
8884
  };
8972
- heappush = function(array2, item, cmp) {
8885
+ heappush = function(array, item, cmp) {
8973
8886
  if (cmp == null) {
8974
8887
  cmp = defaultCmp;
8975
8888
  }
8976
- array2.push(item);
8977
- return _siftdown(array2, 0, array2.length - 1, cmp);
8889
+ array.push(item);
8890
+ return _siftdown(array, 0, array.length - 1, cmp);
8978
8891
  };
8979
- heappop = function(array2, cmp) {
8892
+ heappop = function(array, cmp) {
8980
8893
  var lastelt, returnitem;
8981
8894
  if (cmp == null) {
8982
8895
  cmp = defaultCmp;
8983
8896
  }
8984
- lastelt = array2.pop();
8985
- if (array2.length) {
8986
- returnitem = array2[0];
8987
- array2[0] = lastelt;
8988
- _siftup(array2, 0, cmp);
8897
+ lastelt = array.pop();
8898
+ if (array.length) {
8899
+ returnitem = array[0];
8900
+ array[0] = lastelt;
8901
+ _siftup(array, 0, cmp);
8989
8902
  } else {
8990
8903
  returnitem = lastelt;
8991
8904
  }
8992
8905
  return returnitem;
8993
8906
  };
8994
- heapreplace = function(array2, item, cmp) {
8907
+ heapreplace = function(array, item, cmp) {
8995
8908
  var returnitem;
8996
8909
  if (cmp == null) {
8997
8910
  cmp = defaultCmp;
8998
8911
  }
8999
- returnitem = array2[0];
9000
- array2[0] = item;
9001
- _siftup(array2, 0, cmp);
8912
+ returnitem = array[0];
8913
+ array[0] = item;
8914
+ _siftup(array, 0, cmp);
9002
8915
  return returnitem;
9003
8916
  };
9004
- heappushpop = function(array2, item, cmp) {
8917
+ heappushpop = function(array, item, cmp) {
9005
8918
  var _ref;
9006
8919
  if (cmp == null) {
9007
8920
  cmp = defaultCmp;
9008
8921
  }
9009
- if (array2.length && cmp(array2[0], item) < 0) {
9010
- _ref = [array2[0], item], item = _ref[0], array2[0] = _ref[1];
9011
- _siftup(array2, 0, cmp);
8922
+ if (array.length && cmp(array[0], item) < 0) {
8923
+ _ref = [array[0], item], item = _ref[0], array[0] = _ref[1];
8924
+ _siftup(array, 0, cmp);
9012
8925
  }
9013
8926
  return item;
9014
8927
  };
9015
- heapify = function(array2, cmp) {
8928
+ heapify = function(array, cmp) {
9016
8929
  var i, _i2, _j2, _len, _ref, _ref1, _results, _results1;
9017
8930
  if (cmp == null) {
9018
8931
  cmp = defaultCmp;
9019
8932
  }
9020
8933
  _ref1 = function() {
9021
8934
  _results1 = [];
9022
- for (var _j3 = 0, _ref2 = floor(array2.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
8935
+ for (var _j3 = 0, _ref2 = floor(array.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
9023
8936
  _results1.push(_j3);
9024
8937
  }
9025
8938
  return _results1;
@@ -9027,51 +8940,51 @@ var require_heap = __commonJS({
9027
8940
  _results = [];
9028
8941
  for (_i2 = 0, _len = _ref1.length; _i2 < _len; _i2++) {
9029
8942
  i = _ref1[_i2];
9030
- _results.push(_siftup(array2, i, cmp));
8943
+ _results.push(_siftup(array, i, cmp));
9031
8944
  }
9032
8945
  return _results;
9033
8946
  };
9034
- updateItem = function(array2, item, cmp) {
8947
+ updateItem = function(array, item, cmp) {
9035
8948
  var pos;
9036
8949
  if (cmp == null) {
9037
8950
  cmp = defaultCmp;
9038
8951
  }
9039
- pos = array2.indexOf(item);
8952
+ pos = array.indexOf(item);
9040
8953
  if (pos === -1) {
9041
8954
  return;
9042
8955
  }
9043
- _siftdown(array2, 0, pos, cmp);
9044
- return _siftup(array2, pos, cmp);
8956
+ _siftdown(array, 0, pos, cmp);
8957
+ return _siftup(array, pos, cmp);
9045
8958
  };
9046
- nlargest = function(array2, n, cmp) {
8959
+ nlargest = function(array, n, cmp) {
9047
8960
  var elem, result, _i2, _len, _ref;
9048
8961
  if (cmp == null) {
9049
8962
  cmp = defaultCmp;
9050
8963
  }
9051
- result = array2.slice(0, n);
8964
+ result = array.slice(0, n);
9052
8965
  if (!result.length) {
9053
8966
  return result;
9054
8967
  }
9055
8968
  heapify(result, cmp);
9056
- _ref = array2.slice(n);
8969
+ _ref = array.slice(n);
9057
8970
  for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
9058
8971
  elem = _ref[_i2];
9059
8972
  heappushpop(result, elem, cmp);
9060
8973
  }
9061
8974
  return result.sort(cmp).reverse();
9062
8975
  };
9063
- nsmallest = function(array2, n, cmp) {
8976
+ nsmallest = function(array, n, cmp) {
9064
8977
  var elem, i, los, result, _i2, _j2, _len, _ref, _ref1, _results;
9065
8978
  if (cmp == null) {
9066
8979
  cmp = defaultCmp;
9067
8980
  }
9068
- if (n * 10 <= array2.length) {
9069
- result = array2.slice(0, n).sort(cmp);
8981
+ if (n * 10 <= array.length) {
8982
+ result = array.slice(0, n).sort(cmp);
9070
8983
  if (!result.length) {
9071
8984
  return result;
9072
8985
  }
9073
8986
  los = result[result.length - 1];
9074
- _ref = array2.slice(n);
8987
+ _ref = array.slice(n);
9075
8988
  for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
9076
8989
  elem = _ref[_i2];
9077
8990
  if (cmp(elem, los) < 0) {
@@ -9082,51 +8995,51 @@ var require_heap = __commonJS({
9082
8995
  }
9083
8996
  return result;
9084
8997
  }
9085
- heapify(array2, cmp);
8998
+ heapify(array, cmp);
9086
8999
  _results = [];
9087
- for (i = _j2 = 0, _ref1 = min2(n, array2.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
9088
- _results.push(heappop(array2, cmp));
9000
+ for (i = _j2 = 0, _ref1 = min2(n, array.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
9001
+ _results.push(heappop(array, cmp));
9089
9002
  }
9090
9003
  return _results;
9091
9004
  };
9092
- _siftdown = function(array2, startpos, pos, cmp) {
9005
+ _siftdown = function(array, startpos, pos, cmp) {
9093
9006
  var newitem, parent, parentpos;
9094
9007
  if (cmp == null) {
9095
9008
  cmp = defaultCmp;
9096
9009
  }
9097
- newitem = array2[pos];
9010
+ newitem = array[pos];
9098
9011
  while (pos > startpos) {
9099
9012
  parentpos = pos - 1 >> 1;
9100
- parent = array2[parentpos];
9013
+ parent = array[parentpos];
9101
9014
  if (cmp(newitem, parent) < 0) {
9102
- array2[pos] = parent;
9015
+ array[pos] = parent;
9103
9016
  pos = parentpos;
9104
9017
  continue;
9105
9018
  }
9106
9019
  break;
9107
9020
  }
9108
- return array2[pos] = newitem;
9021
+ return array[pos] = newitem;
9109
9022
  };
9110
- _siftup = function(array2, pos, cmp) {
9023
+ _siftup = function(array, pos, cmp) {
9111
9024
  var childpos, endpos, newitem, rightpos, startpos;
9112
9025
  if (cmp == null) {
9113
9026
  cmp = defaultCmp;
9114
9027
  }
9115
- endpos = array2.length;
9028
+ endpos = array.length;
9116
9029
  startpos = pos;
9117
- newitem = array2[pos];
9030
+ newitem = array[pos];
9118
9031
  childpos = 2 * pos + 1;
9119
9032
  while (childpos < endpos) {
9120
9033
  rightpos = childpos + 1;
9121
- if (rightpos < endpos && !(cmp(array2[childpos], array2[rightpos]) < 0)) {
9034
+ if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) {
9122
9035
  childpos = rightpos;
9123
9036
  }
9124
- array2[pos] = array2[childpos];
9037
+ array[pos] = array[childpos];
9125
9038
  pos = childpos;
9126
9039
  childpos = 2 * pos + 1;
9127
9040
  }
9128
- array2[pos] = newitem;
9129
- return _siftdown(array2, startpos, pos, cmp);
9041
+ array[pos] = newitem;
9042
+ return _siftdown(array, startpos, pos, cmp);
9130
9043
  };
9131
9044
  Heap = function() {
9132
9045
  Heap2.push = heappush;
@@ -11053,12 +10966,12 @@ var require_lib = __commonJS({
11053
10966
  }
11054
10967
  return bestMatch;
11055
10968
  }
11056
- scalarize(array2, originals, fuzzyOriginals) {
10969
+ scalarize(array, originals, fuzzyOriginals) {
11057
10970
  const fuzzyMatches = [];
11058
10971
  if (fuzzyOriginals) {
11059
10972
  const keyScores = {};
11060
- for (let index4 = 0; index4 < array2.length; index4++) {
11061
- const item = array2[index4];
10973
+ for (let index4 = 0; index4 < array.length; index4++) {
10974
+ const item = array[index4];
11062
10975
  if (this.isScalar(item)) {
11063
10976
  continue;
11064
10977
  }
@@ -11072,8 +10985,8 @@ var require_lib = __commonJS({
11072
10985
  }
11073
10986
  }
11074
10987
  const result = [];
11075
- for (let index4 = 0; index4 < array2.length; index4++) {
11076
- const item = array2[index4];
10988
+ for (let index4 = 0; index4 < array.length; index4++) {
10989
+ const item = array[index4];
11077
10990
  if (this.isScalar(item)) {
11078
10991
  result.push(item);
11079
10992
  } else {
@@ -11295,37 +11208,6 @@ function diffColumns(left, right) {
11295
11208
  );
11296
11209
  return alteredTables;
11297
11210
  }
11298
- function diffPolicies(left, right) {
11299
- left = JSON.parse(JSON.stringify(left));
11300
- right = JSON.parse(JSON.stringify(right));
11301
- const result = (0, import_json_diff.diff)(left, right) ?? {};
11302
- const alteredTables = Object.fromEntries(
11303
- Object.entries(result).filter((it) => {
11304
- return !(it[0].includes("__added") || it[0].includes("__deleted"));
11305
- }).map((tableEntry) => {
11306
- const deletedPolicies = Object.entries(tableEntry[1].policies ?? {}).filter((it) => {
11307
- return it[0].endsWith("__deleted");
11308
- }).map((it) => {
11309
- return it[1];
11310
- });
11311
- const addedPolicies = Object.entries(tableEntry[1].policies ?? {}).filter((it) => {
11312
- return it[0].endsWith("__added");
11313
- }).map((it) => {
11314
- return it[1];
11315
- });
11316
- tableEntry[1].policies = {
11317
- added: addedPolicies,
11318
- deleted: deletedPolicies
11319
- };
11320
- const table4 = left[tableEntry[0]];
11321
- return [
11322
- tableEntry[0],
11323
- { name: table4.name, schema: table4.schema, ...tableEntry[1] }
11324
- ];
11325
- })
11326
- );
11327
- return alteredTables;
11328
- }
11329
11211
  function applyJsonDiff(json1, json22) {
11330
11212
  json1 = JSON.parse(JSON.stringify(json1));
11331
11213
  json22 = JSON.parse(JSON.stringify(json22));
@@ -11335,7 +11217,6 @@ function applyJsonDiff(json1, json22) {
11335
11217
  difference.tables = difference.tables || {};
11336
11218
  difference.enums = difference.enums || {};
11337
11219
  difference.sequences = difference.sequences || {};
11338
- difference.roles = difference.roles || {};
11339
11220
  const schemaKeys = Object.keys(difference.schemas);
11340
11221
  for (let key of schemaKeys) {
11341
11222
  if (key.endsWith("__added") || key.endsWith("__deleted")) {
@@ -11391,10 +11272,6 @@ function applyJsonDiff(json1, json22) {
11391
11272
  const alteredSequences = sequencesEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted")) && "values" in it[1]).map((it) => {
11392
11273
  return json22.sequences[it[0]];
11393
11274
  });
11394
- const rolesEntries = Object.entries(difference.roles);
11395
- const alteredRoles = rolesEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted"))).map((it) => {
11396
- return json22.roles[it[0]];
11397
- });
11398
11275
  const alteredTablesWithColumns = Object.values(difference.tables).map(
11399
11276
  (table4) => {
11400
11277
  return findAlternationsInTable(table4);
@@ -11403,8 +11280,7 @@ function applyJsonDiff(json1, json22) {
11403
11280
  return {
11404
11281
  alteredTablesWithColumns,
11405
11282
  alteredEnums,
11406
- alteredSequences,
11407
- alteredRoles
11283
+ alteredSequences
11408
11284
  };
11409
11285
  }
11410
11286
  var import_json_diff, mapArraysDiff, findAlternationsInTable, alternationsInColumn;
@@ -11464,21 +11340,6 @@ var init_jsonDiffer = __esm({
11464
11340
  return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
11465
11341
  })
11466
11342
  );
11467
- const deletedPolicies = Object.fromEntries(
11468
- Object.entries(table4.policies__deleted || {}).concat(
11469
- Object.entries(table4.policies || {}).filter((it) => it[0].includes("__deleted"))
11470
- ).map((entry) => [entry[0].replace("__deleted", ""), entry[1]])
11471
- );
11472
- const addedPolicies = Object.fromEntries(
11473
- Object.entries(table4.policies__added || {}).concat(
11474
- Object.entries(table4.policies || {}).filter((it) => it[0].includes("__added"))
11475
- ).map((entry) => [entry[0].replace("__added", ""), entry[1]])
11476
- );
11477
- const alteredPolicies = Object.fromEntries(
11478
- Object.entries(table4.policies || {}).filter((it) => {
11479
- return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
11480
- })
11481
- );
11482
11343
  const deletedForeignKeys = Object.fromEntries(
11483
11344
  Object.entries(table4.foreignKeys__deleted || {}).concat(
11484
11345
  Object.entries(table4.foreignKeys || {}).filter((it) => it[0].includes("__deleted"))
@@ -11540,10 +11401,7 @@ var init_jsonDiffer = __esm({
11540
11401
  alteredCompositePKs,
11541
11402
  addedUniqueConstraints,
11542
11403
  deletedUniqueConstraints,
11543
- alteredUniqueConstraints,
11544
- deletedPolicies,
11545
- addedPolicies,
11546
- alteredPolicies
11404
+ alteredUniqueConstraints
11547
11405
  };
11548
11406
  };
11549
11407
  alternationsInColumn = (column4) => {
@@ -11817,7 +11675,7 @@ function fromJson(statements, dialect4, action, json22) {
11817
11675
  }).filter((it) => it !== "");
11818
11676
  return result;
11819
11677
  }
11820
- 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;
11678
+ 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;
11821
11679
  var init_sqlgenerator = __esm({
11822
11680
  "src/sqlgenerator.ts"() {
11823
11681
  "use strict";
@@ -11873,109 +11731,12 @@ var init_sqlgenerator = __esm({
11873
11731
  };
11874
11732
  Convertor = class {
11875
11733
  };
11876
- PgCreateRoleConvertor = class extends Convertor {
11877
- can(statement, dialect4) {
11878
- return statement.type === "create_role" && dialect4 === "postgresql";
11879
- }
11880
- convert(statement) {
11881
- 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"}` : ""};`;
11882
- }
11883
- };
11884
- PgDropRoleConvertor = class extends Convertor {
11885
- can(statement, dialect4) {
11886
- return statement.type === "drop_role" && dialect4 === "postgresql";
11887
- }
11888
- convert(statement) {
11889
- return `DROP ROLE "${statement.name}";`;
11890
- }
11891
- };
11892
- PgRenameRoleConvertor = class extends Convertor {
11893
- can(statement, dialect4) {
11894
- return statement.type === "rename_role" && dialect4 === "postgresql";
11895
- }
11896
- convert(statement) {
11897
- return `ALTER ROLE "${statement.nameFrom}" RENAME TO "${statement.nameTo}";`;
11898
- }
11899
- };
11900
- PgAlterRoleConvertor = class extends Convertor {
11901
- can(statement, dialect4) {
11902
- return statement.type === "alter_role" && dialect4 === "postgresql";
11903
- }
11904
- convert(statement) {
11905
- return `ALTER ROLE "${statement.name}"${` WITH${statement.values.createDb ? " CREATEDB" : " NOCREATEDB"}${statement.values.createRole ? " CREATEROLE" : " NOCREATEROLE"}${statement.values.inherit ? " INHERIT" : " NOINHERIT"}`};`;
11906
- }
11907
- };
11908
- PgCreatePolicyConvertor = class extends Convertor {
11909
- can(statement, dialect4) {
11910
- return statement.type === "create_policy" && dialect4 === "postgresql";
11911
- }
11912
- convert(statement) {
11913
- const policy2 = statement.data;
11914
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11915
- const usingPart = policy2.using ? ` USING (${policy2.using})` : "";
11916
- const withCheckPart = policy2.withCheck ? ` WITH CHECK (${policy2.withCheck})` : "";
11917
- const policyToPart = policy2.to?.map(
11918
- (v) => ["current_user", "current_role", "session_user", "public"].includes(v) ? v : `"${v}"`
11919
- ).join(", ");
11920
- return `CREATE POLICY "${policy2.name}" ON ${tableNameWithSchema} AS ${policy2.as?.toUpperCase()} FOR ${policy2.for?.toUpperCase()} TO ${policyToPart}${usingPart}${withCheckPart};`;
11921
- }
11922
- };
11923
- PgDropPolicyConvertor = class extends Convertor {
11924
- can(statement, dialect4) {
11925
- return statement.type === "drop_policy" && dialect4 === "postgresql";
11926
- }
11927
- convert(statement) {
11928
- const policy2 = statement.data;
11929
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11930
- return `DROP POLICY "${policy2.name}" ON ${tableNameWithSchema} CASCADE;`;
11931
- }
11932
- };
11933
- PgRenamePolicyConvertor = class extends Convertor {
11934
- can(statement, dialect4) {
11935
- return statement.type === "rename_policy" && dialect4 === "postgresql";
11936
- }
11937
- convert(statement) {
11938
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11939
- return `ALTER POLICY "${statement.oldName}" ON ${tableNameWithSchema} RENAME TO "${statement.newName}";`;
11940
- }
11941
- };
11942
- PgAlterPolicyConvertor = class extends Convertor {
11943
- can(statement, dialect4) {
11944
- return statement.type === "alter_policy" && dialect4 === "postgresql";
11945
- }
11946
- convert(statement) {
11947
- const newPolicy = PgSquasher.unsquashPolicy(statement.newData);
11948
- const oldPolicy = PgSquasher.unsquashPolicy(statement.oldData);
11949
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11950
- const usingPart = newPolicy.using ? ` USING (${newPolicy.using})` : oldPolicy.using ? ` USING (${oldPolicy.using})` : "";
11951
- const withCheckPart = newPolicy.withCheck ? ` WITH CHECK (${newPolicy.withCheck})` : oldPolicy.withCheck ? ` WITH CHECK (${oldPolicy.withCheck})` : "";
11952
- return `ALTER POLICY "${oldPolicy.name}" ON ${tableNameWithSchema} TO ${newPolicy.to}${usingPart}${withCheckPart};`;
11953
- }
11954
- };
11955
- PgEnableRlsConvertor = class extends Convertor {
11956
- can(statement, dialect4) {
11957
- return statement.type === "enable_rls" && dialect4 === "postgresql";
11958
- }
11959
- convert(statement) {
11960
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11961
- return `ALTER TABLE ${tableNameWithSchema} ENABLE ROW LEVEL SECURITY;`;
11962
- }
11963
- };
11964
- PgDisableRlsConvertor = class extends Convertor {
11965
- can(statement, dialect4) {
11966
- return statement.type === "disable_rls" && dialect4 === "postgresql";
11967
- }
11968
- convert(statement) {
11969
- const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
11970
- return `ALTER TABLE ${tableNameWithSchema} DISABLE ROW LEVEL SECURITY;`;
11971
- }
11972
- };
11973
11734
  PgCreateTableConvertor = class extends Convertor {
11974
11735
  can(statement, dialect4) {
11975
11736
  return statement.type === "create_table" && dialect4 === "postgresql";
11976
11737
  }
11977
11738
  convert(st) {
11978
- const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints, policies } = st;
11739
+ const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints } = st;
11979
11740
  let statement = "";
11980
11741
  const name2 = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
11981
11742
  statement += `CREATE TABLE IF NOT EXISTS ${name2} (
@@ -12012,12 +11773,7 @@ var init_sqlgenerator = __esm({
12012
11773
  );`;
12013
11774
  statement += `
12014
11775
  `;
12015
- const enableRls = new PgEnableRlsConvertor().convert({
12016
- type: "enable_rls",
12017
- tableName,
12018
- schema: schema4
12019
- });
12020
- return [statement, ...policies && policies.length > 0 ? [enableRls] : []];
11776
+ return statement;
12021
11777
  }
12022
11778
  };
12023
11779
  MySqlCreateTableConvertor = class extends Convertor {
@@ -12300,20 +12056,22 @@ var init_sqlgenerator = __esm({
12300
12056
  }
12301
12057
  convert(st) {
12302
12058
  const { name: name2, values, schema: schema4 } = st;
12303
- const tableNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12059
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12304
12060
  let valuesStatement = "(";
12305
12061
  valuesStatement += values.map((it) => `'${it}'`).join(", ");
12306
12062
  valuesStatement += ")";
12307
- let statement = "DO $$ BEGIN";
12308
- statement += "\n";
12309
- statement += ` CREATE TYPE ${tableNameWithSchema} AS ENUM${valuesStatement};`;
12310
- statement += "\n";
12311
- statement += "EXCEPTION";
12312
- statement += "\n";
12313
- statement += " WHEN duplicate_object THEN null;";
12314
- statement += "\n";
12315
- statement += "END $$;";
12316
- statement += "\n";
12063
+ let statement = `CREATE TYPE ${enumNameWithSchema} AS ENUM${valuesStatement};`;
12064
+ return statement;
12065
+ }
12066
+ };
12067
+ DropTypeEnumConvertor = class extends Convertor {
12068
+ can(statement) {
12069
+ return statement.type === "drop_type_enum";
12070
+ }
12071
+ convert(st) {
12072
+ const { name: name2, schema: schema4 } = st;
12073
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12074
+ let statement = `DROP TYPE ${enumNameWithSchema};`;
12317
12075
  return statement;
12318
12076
  }
12319
12077
  };
@@ -12322,9 +12080,56 @@ var init_sqlgenerator = __esm({
12322
12080
  return statement.type === "alter_type_add_value";
12323
12081
  }
12324
12082
  convert(st) {
12325
- const { name: name2, schema: schema4, value } = st;
12326
- const schemaPrefix = schema4 && schema4 !== "public" ? `"${schema4}".` : "";
12327
- return `ALTER TYPE ${schemaPrefix}"${name2}" ADD VALUE '${value}';`;
12083
+ const { name: name2, schema: schema4, value, before } = st;
12084
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${name2}"` : `"${name2}"`;
12085
+ return `ALTER TYPE ${enumNameWithSchema} ADD VALUE '${value}'${before.length ? ` BEFORE '${before}'` : ""};`;
12086
+ }
12087
+ };
12088
+ AlterTypeSetSchemaConvertor = class extends Convertor {
12089
+ can(statement) {
12090
+ return statement.type === "move_type_enum";
12091
+ }
12092
+ convert(st) {
12093
+ const { name: name2, schemaFrom, schemaTo } = st;
12094
+ const enumNameWithSchema = schemaFrom ? `"${schemaFrom}"."${name2}"` : `"${name2}"`;
12095
+ return `ALTER TYPE ${enumNameWithSchema} SET SCHEMA "${schemaTo}";`;
12096
+ }
12097
+ };
12098
+ AlterRenameTypeConvertor = class extends Convertor {
12099
+ can(statement) {
12100
+ return statement.type === "rename_type_enum";
12101
+ }
12102
+ convert(st) {
12103
+ const { nameTo, nameFrom, schema: schema4 } = st;
12104
+ const enumNameWithSchema = schema4 ? `"${schema4}"."${nameFrom}"` : `"${nameFrom}"`;
12105
+ return `ALTER TYPE ${enumNameWithSchema} RENAME TO "${nameTo}";`;
12106
+ }
12107
+ };
12108
+ AlterTypeDropValueConvertor = class extends Convertor {
12109
+ can(statement) {
12110
+ return statement.type === "alter_type_drop_value";
12111
+ }
12112
+ convert(st) {
12113
+ const { columnsWithEnum, name: name2, newValues, schema: schema4 } = st;
12114
+ const statements = [];
12115
+ for (const withEnum of columnsWithEnum) {
12116
+ statements.push(
12117
+ `ALTER TABLE "${withEnum.schema}"."${withEnum.table}" ALTER COLUMN "${withEnum.column}" SET DATA TYPE text;`
12118
+ );
12119
+ }
12120
+ statements.push(new DropTypeEnumConvertor().convert({ name: name2, schema: schema4, type: "drop_type_enum" }));
12121
+ statements.push(new CreateTypeEnumConvertor().convert({
12122
+ name: name2,
12123
+ schema: schema4,
12124
+ values: newValues,
12125
+ type: "create_type_enum"
12126
+ }));
12127
+ for (const withEnum of columnsWithEnum) {
12128
+ statements.push(
12129
+ `ALTER TABLE "${withEnum.schema}"."${withEnum.table}" ALTER COLUMN "${withEnum.column}" SET DATA TYPE "${schema4}"."${name2}" USING "${withEnum.column}"::"${schema4}"."${name2}";`
12130
+ );
12131
+ }
12132
+ return statements;
12328
12133
  }
12329
12134
  };
12330
12135
  PgDropTableConvertor = class extends Convertor {
@@ -12332,21 +12137,9 @@ var init_sqlgenerator = __esm({
12332
12137
  return statement.type === "drop_table" && dialect4 === "postgresql";
12333
12138
  }
12334
12139
  convert(statement) {
12335
- const { tableName, schema: schema4, policies } = statement;
12140
+ const { tableName, schema: schema4 } = statement;
12336
12141
  const tableNameWithSchema = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
12337
- const dropPolicyConvertor = new PgDropPolicyConvertor();
12338
- const droppedPolicies = policies?.map((p) => {
12339
- return dropPolicyConvertor.convert({
12340
- type: "drop_policy",
12341
- tableName,
12342
- data: PgSquasher.unsquashPolicy(p),
12343
- schema: schema4
12344
- });
12345
- }) ?? [];
12346
- return [
12347
- ...droppedPolicies,
12348
- `DROP TABLE ${tableNameWithSchema};`
12349
- ];
12142
+ return `DROP TABLE ${tableNameWithSchema};`;
12350
12143
  }
12351
12144
  };
12352
12145
  MySQLDropTableConvertor = class extends Convertor {
@@ -13480,6 +13273,11 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
13480
13273
  convertors.push(new SQLiteRecreateTableConvertor());
13481
13274
  convertors.push(new LibSQLRecreateTableConvertor());
13482
13275
  convertors.push(new CreateTypeEnumConvertor());
13276
+ convertors.push(new DropTypeEnumConvertor());
13277
+ convertors.push(new AlterTypeAddValueConvertor());
13278
+ convertors.push(new AlterTypeSetSchemaConvertor());
13279
+ convertors.push(new AlterRenameTypeConvertor());
13280
+ convertors.push(new AlterTypeDropValueConvertor());
13483
13281
  convertors.push(new CreatePgSequenceConvertor());
13484
13282
  convertors.push(new DropPgSequenceConvertor());
13485
13283
  convertors.push(new RenamePgSequenceConvertor());
@@ -13511,23 +13309,12 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
13511
13309
  convertors.push(new PgDropIndexConvertor());
13512
13310
  convertors.push(new SqliteDropIndexConvertor());
13513
13311
  convertors.push(new MySqlDropIndexConvertor());
13514
- convertors.push(new AlterTypeAddValueConvertor());
13515
13312
  convertors.push(new PgAlterTableAlterColumnSetPrimaryKeyConvertor());
13516
13313
  convertors.push(new PgAlterTableAlterColumnDropPrimaryKeyConvertor());
13517
13314
  convertors.push(new PgAlterTableAlterColumnSetNotNullConvertor());
13518
13315
  convertors.push(new PgAlterTableAlterColumnDropNotNullConvertor());
13519
13316
  convertors.push(new PgAlterTableAlterColumnSetDefaultConvertor());
13520
13317
  convertors.push(new PgAlterTableAlterColumnDropDefaultConvertor());
13521
- convertors.push(new PgAlterPolicyConvertor());
13522
- convertors.push(new PgCreatePolicyConvertor());
13523
- convertors.push(new PgDropPolicyConvertor());
13524
- convertors.push(new PgRenamePolicyConvertor());
13525
- convertors.push(new PgEnableRlsConvertor());
13526
- convertors.push(new PgDisableRlsConvertor());
13527
- convertors.push(new PgDropRoleConvertor());
13528
- convertors.push(new PgAlterRoleConvertor());
13529
- convertors.push(new PgCreateRoleConvertor());
13530
- convertors.push(new PgRenameRoleConvertor());
13531
13318
  convertors.push(new PgAlterTableAlterColumnSetExpressionConvertor());
13532
13319
  convertors.push(new PgAlterTableAlterColumnDropGeneratedConvertor());
13533
13320
  convertors.push(new PgAlterTableAlterColumnAlterrGeneratedConvertor());
@@ -13822,7 +13609,7 @@ var init_sqlitePushUtils = __esm({
13822
13609
  });
13823
13610
 
13824
13611
  // src/jsonStatements.ts
13825
- 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;
13612
+ 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;
13826
13613
  var init_jsonStatements = __esm({
13827
13614
  "src/jsonStatements.ts"() {
13828
13615
  "use strict";
@@ -13833,7 +13620,7 @@ var init_jsonStatements = __esm({
13833
13620
  init_pgSchema();
13834
13621
  init_sqliteSchema();
13835
13622
  preparePgCreateTableJson = (table4, json22) => {
13836
- const { name: name2, schema: schema4, columns, compositePrimaryKeys, uniqueConstraints, policies } = table4;
13623
+ const { name: name2, schema: schema4, columns, compositePrimaryKeys, uniqueConstraints } = table4;
13837
13624
  const tableKey2 = `${schema4 || "public"}.${name2}`;
13838
13625
  const compositePkName = Object.values(compositePrimaryKeys).length > 0 ? json22.tables[tableKey2].compositePrimaryKeys[`${PgSquasher.unsquashPK(Object.values(compositePrimaryKeys)[0]).name}`].name : "";
13839
13626
  return {
@@ -13843,8 +13630,7 @@ var init_jsonStatements = __esm({
13843
13630
  columns: Object.values(columns),
13844
13631
  compositePKs: Object.values(compositePrimaryKeys),
13845
13632
  compositePkName,
13846
- uniqueConstraints: Object.values(uniqueConstraints),
13847
- policies: Object.values(policies)
13633
+ uniqueConstraints: Object.values(uniqueConstraints)
13848
13634
  };
13849
13635
  };
13850
13636
  prepareMySqlCreateTableJson = (table4, json22, internals) => {
@@ -13882,8 +13668,7 @@ var init_jsonStatements = __esm({
13882
13668
  return {
13883
13669
  type: "drop_table",
13884
13670
  tableName: table4.name,
13885
- schema: table4.schema,
13886
- policies: table4.policies ? Object.values(table4.policies) : []
13671
+ schema: table4.schema
13887
13672
  };
13888
13673
  };
13889
13674
  prepareRenameTableJson = (tableFrom, tableTo) => {
@@ -13914,6 +13699,27 @@ var init_jsonStatements = __esm({
13914
13699
  };
13915
13700
  });
13916
13701
  };
13702
+ prepareDropEnumValues = (name2, schema4, removedValues, json22) => {
13703
+ if (!removedValues.length) return [];
13704
+ const affectedColumns = [];
13705
+ for (const tableKey2 in json22.tables) {
13706
+ const table4 = json22.tables[tableKey2];
13707
+ for (const columnKey in table4.columns) {
13708
+ const column4 = table4.columns[columnKey];
13709
+ if (column4.type === name2 && column4.typeSchema === schema4) {
13710
+ affectedColumns.push({ schema: table4.schema || "public", table: table4.name, column: column4.name });
13711
+ }
13712
+ }
13713
+ }
13714
+ return [{
13715
+ type: "alter_type_drop_value",
13716
+ name: name2,
13717
+ schema: schema4,
13718
+ deletedValues: removedValues,
13719
+ newValues: json22.enums[`${schema4}.${name2}`].values,
13720
+ columnsWithEnum: affectedColumns
13721
+ }];
13722
+ };
13917
13723
  prepareDropEnumJson = (name2, schema4) => {
13918
13724
  return {
13919
13725
  type: "drop_type_enum",
@@ -13980,41 +13786,6 @@ var init_jsonStatements = __esm({
13980
13786
  schema: schema4
13981
13787
  };
13982
13788
  };
13983
- prepareCreateRoleJson = (role) => {
13984
- return {
13985
- type: "create_role",
13986
- name: role.name,
13987
- values: {
13988
- createDb: role.createDb,
13989
- createRole: role.createRole,
13990
- inherit: role.inherit
13991
- }
13992
- };
13993
- };
13994
- prepareAlterRoleJson = (role) => {
13995
- return {
13996
- type: "alter_role",
13997
- name: role.name,
13998
- values: {
13999
- createDb: role.createDb,
14000
- createRole: role.createRole,
14001
- inherit: role.inherit
14002
- }
14003
- };
14004
- };
14005
- prepareDropRoleJson = (name2) => {
14006
- return {
14007
- type: "drop_role",
14008
- name: name2
14009
- };
14010
- };
14011
- prepareRenameRoleJson = (nameFrom, nameTo) => {
14012
- return {
14013
- type: "rename_role",
14014
- nameFrom,
14015
- nameTo
14016
- };
14017
- };
14018
13789
  prepareCreateSchemasJson = (values) => {
14019
13790
  return values.map((it) => {
14020
13791
  return {
@@ -14911,46 +14682,6 @@ var init_jsonStatements = __esm({
14911
14682
  }
14912
14683
  return [...dropPkStatements, ...setPkStatements, ...statements];
14913
14684
  };
14914
- prepareRenamePolicyJsons = (tableName, schema4, renames) => {
14915
- return renames.map((it) => {
14916
- return {
14917
- type: "rename_policy",
14918
- tableName,
14919
- oldName: it.from.name,
14920
- newName: it.to.name,
14921
- schema: schema4
14922
- };
14923
- });
14924
- };
14925
- prepareCreatePolicyJsons = (tableName, schema4, policies) => {
14926
- return policies.map((it) => {
14927
- return {
14928
- type: "create_policy",
14929
- tableName,
14930
- data: it,
14931
- schema: schema4
14932
- };
14933
- });
14934
- };
14935
- prepareDropPolicyJsons = (tableName, schema4, policies) => {
14936
- return policies.map((it) => {
14937
- return {
14938
- type: "drop_policy",
14939
- tableName,
14940
- data: it,
14941
- schema: schema4
14942
- };
14943
- });
14944
- };
14945
- prepareAlterPolicyJson = (tableName, schema4, oldPolicy, newPolicy) => {
14946
- return {
14947
- type: "alter_policy",
14948
- tableName,
14949
- oldData: oldPolicy,
14950
- newData: newPolicy,
14951
- schema: schema4
14952
- };
14953
- };
14954
14685
  preparePgCreateIndexesJson = (tableName, schema4, indexes, fullSchema, action) => {
14955
14686
  if (action === "push") {
14956
14687
  return Object.values(indexes).map((indexData) => {
@@ -15656,8 +15387,7 @@ var init_snapshotsDiffer = __esm({
15656
15387
  indexes: recordType(stringType(), stringType()),
15657
15388
  foreignKeys: recordType(stringType(), stringType()),
15658
15389
  compositePrimaryKeys: recordType(stringType(), stringType()).default({}),
15659
- uniqueConstraints: recordType(stringType(), stringType()).default({}),
15660
- policies: recordType(stringType(), stringType()).default({})
15390
+ uniqueConstraints: recordType(stringType(), stringType()).default({})
15661
15391
  }).strict();
15662
15392
  alteredTableScheme = objectType({
15663
15393
  name: stringType(),
@@ -15698,22 +15428,12 @@ var init_snapshotsDiffer = __esm({
15698
15428
  __new: stringType(),
15699
15429
  __old: stringType()
15700
15430
  })
15701
- ),
15702
- addedPolicies: recordType(stringType(), stringType()),
15703
- deletedPolicies: recordType(stringType(), stringType()),
15704
- alteredPolicies: recordType(
15705
- stringType(),
15706
- objectType({
15707
- __new: stringType(),
15708
- __old: stringType()
15709
- })
15710
15431
  )
15711
15432
  }).strict();
15712
15433
  diffResultScheme = objectType({
15713
15434
  alteredTablesWithColumns: alteredTableScheme.array(),
15714
15435
  alteredEnums: changedEnumSchema.array(),
15715
- alteredSequences: sequenceSquashed.array(),
15716
- alteredRoles: roleSchema.array()
15436
+ alteredSequences: sequenceSquashed.array()
15717
15437
  }).strict();
15718
15438
  diffResultSchemeMysql = objectType({
15719
15439
  alteredTablesWithColumns: alteredTableScheme.array(),
@@ -15768,7 +15488,7 @@ var init_snapshotsDiffer = __esm({
15768
15488
  }
15769
15489
  return column4;
15770
15490
  };
15771
- applyPgSnapshotsDiff = async (json1, json22, schemasResolver2, enumsResolver2, sequencesResolver2, policyResolver2, roleResolver2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
15491
+ applyPgSnapshotsDiff = async (json1, json22, schemasResolver2, enumsResolver2, sequencesResolver2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
15772
15492
  const schemasDiff = diffSchemasOrTables(json1.schemas, json22.schemas);
15773
15493
  const {
15774
15494
  created: createdSchemas,
@@ -15918,47 +15638,6 @@ var init_snapshotsDiffer = __esm({
15918
15638
  return [tableKey2, tableValue];
15919
15639
  }
15920
15640
  );
15921
- const rolesDiff = diffSchemasOrTables(
15922
- schemasPatchedSnap1.roles,
15923
- json22.roles
15924
- );
15925
- const {
15926
- created: createdRoles,
15927
- deleted: deletedRoles,
15928
- renamed: renamedRoles
15929
- } = await roleResolver2({
15930
- created: rolesDiff.added,
15931
- deleted: rolesDiff.deleted
15932
- });
15933
- schemasPatchedSnap1.roles = mapEntries(
15934
- schemasPatchedSnap1.roles,
15935
- (_2, it) => {
15936
- const { name: name2 } = nameChangeFor(it, renamedRoles);
15937
- it.name = name2;
15938
- return [name2, it];
15939
- }
15940
- );
15941
- const rolesChangeMap = renamedRoles.reduce(
15942
- (acc, it) => {
15943
- acc[it.from.name] = {
15944
- nameFrom: it.from.name,
15945
- nameTo: it.to.name
15946
- };
15947
- return acc;
15948
- },
15949
- {}
15950
- );
15951
- schemasPatchedSnap1.roles = mapEntries(
15952
- schemasPatchedSnap1.roles,
15953
- (roleKey, roleValue) => {
15954
- const key = roleKey;
15955
- const change = rolesChangeMap[key];
15956
- if (change) {
15957
- roleValue.name = change.nameTo;
15958
- }
15959
- return [roleKey, roleValue];
15960
- }
15961
- );
15962
15641
  const tablesDiff = diffSchemasOrTables(
15963
15642
  schemasPatchedSnap1.tables,
15964
15643
  json22.tables
@@ -16037,65 +15716,6 @@ var init_snapshotsDiffer = __esm({
16037
15716
  return [tableKey2, tableValue];
16038
15717
  }
16039
15718
  );
16040
- const policyRes = diffPolicies(tablesPatchedSnap1.tables, json22.tables);
16041
- const policyRenames = [];
16042
- const policyCreates = [];
16043
- const policyDeletes = [];
16044
- for (let entry of Object.values(policyRes)) {
16045
- const { renamed, created, deleted } = await policyResolver2({
16046
- tableName: entry.name,
16047
- schema: entry.schema,
16048
- deleted: entry.policies.deleted.map(PgSquasher.unsquashPolicy),
16049
- created: entry.policies.added.map(PgSquasher.unsquashPolicy)
16050
- });
16051
- if (created.length > 0) {
16052
- policyCreates.push({
16053
- table: entry.name,
16054
- schema: entry.schema,
16055
- columns: created
16056
- });
16057
- }
16058
- if (deleted.length > 0) {
16059
- policyDeletes.push({
16060
- table: entry.name,
16061
- schema: entry.schema,
16062
- columns: deleted
16063
- });
16064
- }
16065
- if (renamed.length > 0) {
16066
- policyRenames.push({
16067
- table: entry.name,
16068
- schema: entry.schema,
16069
- renames: renamed
16070
- });
16071
- }
16072
- }
16073
- const policyRenamesDict = columnRenames.reduce(
16074
- (acc, it) => {
16075
- acc[`${it.schema || "public"}.${it.table}`] = it.renames;
16076
- return acc;
16077
- },
16078
- {}
16079
- );
16080
- const policyPatchedSnap1 = copy(tablesPatchedSnap1);
16081
- policyPatchedSnap1.tables = mapEntries(
16082
- policyPatchedSnap1.tables,
16083
- (tableKey2, tableValue) => {
16084
- const patchedPolicies = mapKeys(
16085
- tableValue.policies,
16086
- (policyKey, policy2) => {
16087
- const rens = policyRenamesDict[`${tableValue.schema || "public"}.${tableValue.name}`] || [];
16088
- const newName = columnChangeFor(policyKey, rens);
16089
- const unsquashedPolicy = PgSquasher.unsquashPolicy(policy2);
16090
- unsquashedPolicy.name = newName;
16091
- policy2 = PgSquasher.squashPolicy(unsquashedPolicy);
16092
- return newName;
16093
- }
16094
- );
16095
- tableValue.policies = patchedPolicies;
16096
- return [tableKey2, tableValue];
16097
- }
16098
- );
16099
15719
  const diffResult = applyJsonDiff(columnsPatchedSnap1, json22);
16100
15720
  const typedResult = diffResultScheme.parse(diffResult);
16101
15721
  const jsonStatements = [];
@@ -16140,15 +15760,13 @@ var init_snapshotsDiffer = __esm({
16140
15760
  const jsonDeletedUniqueConstraints = [];
16141
15761
  const jsonAlteredUniqueConstraints = [];
16142
15762
  const jsonSetTableSchemas = [];
16143
- if (movedTables) {
16144
- for (let it of movedTables) {
16145
- jsonSetTableSchemas.push({
16146
- type: "alter_table_set_schema",
16147
- tableName: it.name,
16148
- schemaFrom: it.schemaFrom || "public",
16149
- schemaTo: it.schemaTo || "public"
16150
- });
16151
- }
15763
+ for (let it of movedTables) {
15764
+ jsonSetTableSchemas.push({
15765
+ type: "alter_table_set_schema",
15766
+ tableName: it.name,
15767
+ schemaFrom: it.schemaFrom || "public",
15768
+ schemaTo: it.schemaTo || "public"
15769
+ });
16152
15770
  }
16153
15771
  for (let it of alteredTables) {
16154
15772
  let addedColumns = [];
@@ -16253,99 +15871,7 @@ var init_snapshotsDiffer = __esm({
16253
15871
  it.deletedIndexes || {}
16254
15872
  );
16255
15873
  }).flat();
16256
- const jsonCreatePoliciesStatements = [];
16257
- const jsonDropPoliciesStatements = [];
16258
- const jsonAlterPoliciesStatements = [];
16259
- const jsonRenamePoliciesStatements = [];
16260
- const jsonEnableRLSStatements = [];
16261
- const jsonDisableRLSStatements = [];
16262
- for (let it of policyRenames) {
16263
- jsonRenamePoliciesStatements.push(
16264
- ...prepareRenamePolicyJsons(it.table, it.schema, it.renames)
16265
- );
16266
- }
16267
- for (const it of policyCreates) {
16268
- jsonCreatePoliciesStatements.push(
16269
- ...prepareCreatePolicyJsons(
16270
- it.table,
16271
- it.schema,
16272
- it.columns
16273
- )
16274
- );
16275
- }
16276
- for (const it of policyDeletes) {
16277
- jsonDropPoliciesStatements.push(
16278
- ...prepareDropPolicyJsons(
16279
- it.table,
16280
- it.schema,
16281
- it.columns
16282
- )
16283
- );
16284
- }
16285
15874
  alteredTables.forEach((it) => {
16286
- Object.keys(it.alteredPolicies).forEach((policyName) => {
16287
- const newPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__new);
16288
- const oldPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__old);
16289
- if (newPolicy.as !== oldPolicy.as) {
16290
- jsonDropPoliciesStatements.push(
16291
- ...prepareDropPolicyJsons(
16292
- it.name,
16293
- it.schema,
16294
- [oldPolicy]
16295
- )
16296
- );
16297
- jsonCreatePoliciesStatements.push(
16298
- ...prepareCreatePolicyJsons(
16299
- it.name,
16300
- it.schema,
16301
- [newPolicy]
16302
- )
16303
- );
16304
- return;
16305
- }
16306
- if (newPolicy.for !== oldPolicy.for) {
16307
- jsonDropPoliciesStatements.push(
16308
- ...prepareDropPolicyJsons(
16309
- it.name,
16310
- it.schema,
16311
- [oldPolicy]
16312
- )
16313
- );
16314
- jsonCreatePoliciesStatements.push(
16315
- ...prepareCreatePolicyJsons(
16316
- it.name,
16317
- it.schema,
16318
- [newPolicy]
16319
- )
16320
- );
16321
- return;
16322
- }
16323
- jsonAlterPoliciesStatements.push(
16324
- prepareAlterPolicyJson(
16325
- it.name,
16326
- it.schema,
16327
- it.alteredPolicies[policyName].__old,
16328
- it.alteredPolicies[policyName].__new
16329
- )
16330
- );
16331
- });
16332
- for (const table4 of Object.values(json22.tables)) {
16333
- const policiesInCurrentState = Object.keys(table4.policies);
16334
- const tableInPreviousState = columnsPatchedSnap1.tables[`${table4.schema === "" ? "public" : table4.schema}.${table4.name}`];
16335
- const policiesInPreviousState = tableInPreviousState ? Object.keys(tableInPreviousState.policies) : [];
16336
- if (policiesInPreviousState.length === 0 && policiesInCurrentState.length > 0) {
16337
- jsonEnableRLSStatements.push({ type: "enable_rls", tableName: table4.name, schema: table4.schema });
16338
- }
16339
- if (policiesInPreviousState.length > 0 && policiesInCurrentState.length === 0) {
16340
- jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
16341
- }
16342
- }
16343
- for (const table4 of Object.values(columnsPatchedSnap1.tables)) {
16344
- const tableInCurrentState = json22.tables[`${table4.schema === "" ? "public" : table4.schema}.${table4.name}`];
16345
- if (tableInCurrentState === void 0) {
16346
- jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
16347
- }
16348
- }
16349
15875
  const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
16350
15876
  (current, item) => {
16351
15877
  current[item] = it.alteredIndexes[item].__old;
@@ -16415,6 +15941,9 @@ var init_snapshotsDiffer = __esm({
16415
15941
  const jsonAlterEnumsWithAddedValues = typedResult.alteredEnums.map((it) => {
16416
15942
  return prepareAddValuesToEnumJson(it.name, it.schema, it.addedValues);
16417
15943
  }).flat() ?? [];
15944
+ const jsonAlterEnumsWithDroppedValues = typedResult.alteredEnums.map((it) => {
15945
+ return prepareDropEnumValues(it.name, it.schema, it.deletedValues, curFull);
15946
+ }).flat() ?? [];
16418
15947
  const createSequences = createdSequences.map((it) => {
16419
15948
  return prepareCreateSequenceJson(it);
16420
15949
  }) ?? [];
@@ -16430,18 +15959,6 @@ var init_snapshotsDiffer = __esm({
16430
15959
  const jsonAlterSequences = typedResult.alteredSequences.map((it) => {
16431
15960
  return prepareAlterSequenceJson(it);
16432
15961
  }).flat() ?? [];
16433
- const createRoles = createdRoles.map((it) => {
16434
- return prepareCreateRoleJson(it);
16435
- }) ?? [];
16436
- const dropRoles = deletedRoles.map((it) => {
16437
- return prepareDropRoleJson(it.name);
16438
- });
16439
- const renameRoles = renamedRoles.map((it) => {
16440
- return prepareRenameRoleJson(it.from.name, it.to.name);
16441
- });
16442
- const jsonAlterRoles = typedResult.alteredRoles.map((it) => {
16443
- return prepareAlterRoleJson(it);
16444
- }).flat() ?? [];
16445
15962
  const createSchemas = prepareCreateSchemasJson(
16446
15963
  createdSchemas.map((it) => it.name)
16447
15964
  );
@@ -16454,11 +15971,6 @@ var init_snapshotsDiffer = __esm({
16454
15971
  const createTables = createdTables.map((it) => {
16455
15972
  return preparePgCreateTableJson(it, curFull);
16456
15973
  });
16457
- jsonCreatePoliciesStatements.push(...[].concat(
16458
- ...createdTables.map(
16459
- (it) => prepareCreatePolicyJsons(it.name, it.schema, Object.values(it.policies).map(PgSquasher.unsquashPolicy))
16460
- )
16461
- ));
16462
15974
  jsonStatements.push(...createSchemas);
16463
15975
  jsonStatements.push(...renameSchemas);
16464
15976
  jsonStatements.push(...createEnums);
@@ -16469,13 +15981,7 @@ var init_snapshotsDiffer = __esm({
16469
15981
  jsonStatements.push(...moveSequences);
16470
15982
  jsonStatements.push(...renameSequences);
16471
15983
  jsonStatements.push(...jsonAlterSequences);
16472
- jsonStatements.push(...renameRoles);
16473
- jsonStatements.push(...dropRoles);
16474
- jsonStatements.push(...createRoles);
16475
- jsonStatements.push(...jsonAlterRoles);
16476
15984
  jsonStatements.push(...createTables);
16477
- jsonStatements.push(...jsonEnableRLSStatements);
16478
- jsonStatements.push(...jsonDisableRLSStatements);
16479
15985
  jsonStatements.push(...jsonDropTables);
16480
15986
  jsonStatements.push(...jsonSetTableSchemas);
16481
15987
  jsonStatements.push(...jsonRenameTables);
@@ -16495,10 +16001,7 @@ var init_snapshotsDiffer = __esm({
16495
16001
  jsonStatements.push(...jsonAlteredCompositePKs);
16496
16002
  jsonStatements.push(...jsonAddedUniqueConstraints);
16497
16003
  jsonStatements.push(...jsonAlteredUniqueConstraints);
16498
- jsonStatements.push(...jsonRenamePoliciesStatements);
16499
- jsonStatements.push(...jsonDropPoliciesStatements);
16500
- jsonStatements.push(...jsonCreatePoliciesStatements);
16501
- jsonStatements.push(...jsonAlterPoliciesStatements);
16004
+ jsonStatements.push(...jsonAlterEnumsWithDroppedValues);
16502
16005
  jsonStatements.push(...dropEnums);
16503
16006
  jsonStatements.push(...dropSequences);
16504
16007
  jsonStatements.push(...dropSchemas);
@@ -16519,7 +16022,17 @@ var init_snapshotsDiffer = __esm({
16519
16022
  }
16520
16023
  return true;
16521
16024
  });
16522
- const sqlStatements = fromJson(filteredJsonStatements, "postgresql");
16025
+ const filteredEnumsJsonStatements = filteredJsonStatements.filter((st) => {
16026
+ if (st.type === "alter_type_add_value") {
16027
+ if (jsonStatements.find(
16028
+ (it) => it.type === "alter_type_drop_value" && it.name === st.name && it.schema === st.schema
16029
+ )) {
16030
+ return false;
16031
+ }
16032
+ }
16033
+ return true;
16034
+ });
16035
+ const sqlStatements = fromJson(filteredEnumsJsonStatements, "postgresql");
16523
16036
  const uniqueSqlStatements = [];
16524
16037
  sqlStatements.forEach((ss) => {
16525
16038
  if (!uniqueSqlStatements.includes(ss)) {
@@ -16535,7 +16048,7 @@ var init_snapshotsDiffer = __esm({
16535
16048
  });
16536
16049
  const _meta = prepareMigrationMeta(rSchemas, rTables, rColumns);
16537
16050
  return {
16538
- statements: filteredJsonStatements,
16051
+ statements: filteredEnumsJsonStatements,
16539
16052
  sqlStatements: uniqueSqlStatements,
16540
16053
  _meta
16541
16054
  };
@@ -17570,7 +17083,7 @@ var init_outputs = __esm({
17570
17083
  });
17571
17084
 
17572
17085
  // src/cli/commands/migrate.ts
17573
- var import_hanji2, schemasResolver, tablesResolver, sequencesResolver, roleResolver, policyResolver, enumsResolver, columnsResolver, promptColumnsConflicts, promptNamedConflict, promptNamedWithSchemasConflict, promptSchemasConflict, BREAKPOINT;
17086
+ var import_hanji2, schemasResolver, tablesResolver, sequencesResolver, enumsResolver, columnsResolver, promptColumnsConflicts, promptNamedWithSchemasConflict, promptSchemasConflict, BREAKPOINT;
17574
17087
  var init_migrate = __esm({
17575
17088
  "src/cli/commands/migrate.ts"() {
17576
17089
  "use strict";
@@ -17633,32 +17146,6 @@ var init_migrate = __esm({
17633
17146
  throw e;
17634
17147
  }
17635
17148
  };
17636
- roleResolver = async (input) => {
17637
- const result = await promptNamedConflict(
17638
- input.created,
17639
- input.deleted,
17640
- "role"
17641
- );
17642
- return {
17643
- created: result.created,
17644
- deleted: result.deleted,
17645
- renamed: result.renamed
17646
- };
17647
- };
17648
- policyResolver = async (input) => {
17649
- const result = await promptColumnsConflicts(
17650
- input.tableName,
17651
- input.created,
17652
- input.deleted
17653
- );
17654
- return {
17655
- tableName: input.tableName,
17656
- schema: input.schema,
17657
- created: result.created,
17658
- deleted: result.deleted,
17659
- renamed: result.renamed
17660
- };
17661
- };
17662
17149
  enumsResolver = async (input) => {
17663
17150
  try {
17664
17151
  const { created, deleted, moved, renamed } = await promptNamedWithSchemasConflict(
@@ -17741,56 +17228,6 @@ var init_migrate = __esm({
17741
17228
  result.deleted.push(...leftMissing);
17742
17229
  return result;
17743
17230
  };
17744
- promptNamedConflict = async (newItems, missingItems, entity) => {
17745
- if (missingItems.length === 0 || newItems.length === 0) {
17746
- return {
17747
- created: newItems,
17748
- renamed: [],
17749
- deleted: missingItems
17750
- };
17751
- }
17752
- const result = { created: [], renamed: [], deleted: [] };
17753
- let index4 = 0;
17754
- let leftMissing = [...missingItems];
17755
- do {
17756
- const created = newItems[index4];
17757
- const renames = leftMissing.map((it) => {
17758
- return { from: it, to: created };
17759
- });
17760
- const promptData = [created, ...renames];
17761
- const { status, data } = await (0, import_hanji2.render)(
17762
- new ResolveSelectNamed(created, promptData, entity)
17763
- );
17764
- if (status === "aborted") {
17765
- console.error("ERROR");
17766
- process.exit(1);
17767
- }
17768
- if (isRenamePromptItem(data)) {
17769
- console.log(
17770
- `${source_default.yellow("~")} ${data.from.name} \u203A ${data.to.name} ${source_default.gray(
17771
- `${entity} will be renamed/moved`
17772
- )}`
17773
- );
17774
- if (data.from.name !== data.to.name) {
17775
- result.renamed.push(data);
17776
- }
17777
- delete leftMissing[leftMissing.indexOf(data.from)];
17778
- leftMissing = leftMissing.filter(Boolean);
17779
- } else {
17780
- console.log(
17781
- `${source_default.green("+")} ${data.name} ${source_default.gray(
17782
- `${entity} will be created`
17783
- )}`
17784
- );
17785
- result.created.push(created);
17786
- }
17787
- index4 += 1;
17788
- } while (index4 < newItems.length);
17789
- console.log(source_default.gray(`--- all ${entity} conflicts resolved ---
17790
- `));
17791
- result.deleted.push(...leftMissing);
17792
- return result;
17793
- };
17794
17231
  promptNamedWithSchemasConflict = async (newItems, missingItems, entity) => {
17795
17232
  if (missingItems.length === 0 || newItems.length === 0) {
17796
17233
  return {
@@ -19347,8 +18784,8 @@ function parsePgArray(arrayString) {
19347
18784
  const [result] = parsePgNestedArray(arrayString, 1);
19348
18785
  return result;
19349
18786
  }
19350
- function makePgArray(array2) {
19351
- return `{${array2.map((item) => {
18787
+ function makePgArray(array) {
18788
+ return `{${array.map((item) => {
19352
18789
  if (Array.isArray(item)) {
19353
18790
  return makePgArray(item);
19354
18791
  }
@@ -20056,8 +19493,8 @@ var init_sql = __esm({
20056
19493
  sql2.param = param2;
20057
19494
  })(sql || (sql = {}));
20058
19495
  ((SQL2) => {
20059
- var _a326;
20060
- _a326 = entityKind;
19496
+ var _a324;
19497
+ _a324 = entityKind;
20061
19498
  const _Aliased = class _Aliased {
20062
19499
  constructor(sql2, fieldAlias) {
20063
19500
  /** @internal */
@@ -20073,7 +19510,7 @@ var init_sql = __esm({
20073
19510
  return new _Aliased(this.sql, this.fieldAlias);
20074
19511
  }
20075
19512
  };
20076
- __publicField(_Aliased, _a326, "SQL.Aliased");
19513
+ __publicField(_Aliased, _a324, "SQL.Aliased");
20077
19514
  let Aliased = _Aliased;
20078
19515
  SQL2.Aliased = Aliased;
20079
19516
  })(SQL || (SQL = {}));
@@ -20356,8 +19793,8 @@ function arrayContains(column4, values) {
20356
19793
  if (values.length === 0) {
20357
19794
  throw new Error("arrayContains requires at least one value");
20358
19795
  }
20359
- const array2 = sql`${bindIfParam(values, column4)}`;
20360
- return sql`${column4} @> ${array2}`;
19796
+ const array = sql`${bindIfParam(values, column4)}`;
19797
+ return sql`${column4} @> ${array}`;
20361
19798
  }
20362
19799
  return sql`${column4} @> ${bindIfParam(values, column4)}`;
20363
19800
  }
@@ -20366,8 +19803,8 @@ function arrayContained(column4, values) {
20366
19803
  if (values.length === 0) {
20367
19804
  throw new Error("arrayContained requires at least one value");
20368
19805
  }
20369
- const array2 = sql`${bindIfParam(values, column4)}`;
20370
- return sql`${column4} <@ ${array2}`;
19806
+ const array = sql`${bindIfParam(values, column4)}`;
19807
+ return sql`${column4} <@ ${array}`;
20371
19808
  }
20372
19809
  return sql`${column4} <@ ${bindIfParam(values, column4)}`;
20373
19810
  }
@@ -20376,8 +19813,8 @@ function arrayOverlaps(column4, values) {
20376
19813
  if (values.length === 0) {
20377
19814
  throw new Error("arrayOverlaps requires at least one value");
20378
19815
  }
20379
- const array2 = sql`${bindIfParam(values, column4)}`;
20380
- return sql`${column4} && ${array2}`;
19816
+ const array = sql`${bindIfParam(values, column4)}`;
19817
+ return sql`${column4} && ${array}`;
20381
19818
  }
20382
19819
  return sql`${column4} && ${bindIfParam(values, column4)}`;
20383
19820
  }
@@ -26043,67 +25480,6 @@ var init_indexes = __esm({
26043
25480
  }
26044
25481
  });
26045
25482
 
26046
- // ../drizzle-orm/dist/pg-core/policies.js
26047
- var _a147, PgPolicy;
26048
- var init_policies = __esm({
26049
- "../drizzle-orm/dist/pg-core/policies.js"() {
26050
- "use strict";
26051
- init_entity();
26052
- _a147 = entityKind;
26053
- PgPolicy = class {
26054
- constructor(name2, config) {
26055
- __publicField(this, "as");
26056
- __publicField(this, "for");
26057
- __publicField(this, "to");
26058
- __publicField(this, "using");
26059
- __publicField(this, "withCheck");
26060
- this.name = name2;
26061
- if (config) {
26062
- this.as = config.as;
26063
- this.for = config.for;
26064
- this.to = config.to;
26065
- this.using = config.using;
26066
- this.withCheck = config.withCheck;
26067
- }
26068
- }
26069
- };
26070
- __publicField(PgPolicy, _a147, "PgPolicy");
26071
- }
26072
- });
26073
-
26074
- // ../drizzle-orm/dist/pg-core/roles.js
26075
- var _a148, PgRole;
26076
- var init_roles = __esm({
26077
- "../drizzle-orm/dist/pg-core/roles.js"() {
26078
- "use strict";
26079
- init_entity();
26080
- _a148 = entityKind;
26081
- PgRole = class {
26082
- constructor(name2, config) {
26083
- /** @internal */
26084
- __publicField(this, "_existing");
26085
- /** @internal */
26086
- __publicField(this, "createDb");
26087
- /** @internal */
26088
- __publicField(this, "createRole");
26089
- /** @internal */
26090
- __publicField(this, "inherit");
26091
- this.name = name2;
26092
- if (config) {
26093
- this.createDb = config.createDb;
26094
- this.createRole = config.createRole;
26095
- this.inherit = config.inherit;
26096
- }
26097
- }
26098
- existing() {
26099
- this._existing = true;
26100
- return this;
26101
- }
26102
- };
26103
- __publicField(PgRole, _a148, "PgRole");
26104
- }
26105
- });
26106
-
26107
25483
  // ../drizzle-orm/dist/pg-core/sequence.js
26108
25484
  function pgSequenceWithSchema(name2, options, schema4) {
26109
25485
  return new PgSequence(name2, options, schema4);
@@ -26111,12 +25487,12 @@ function pgSequenceWithSchema(name2, options, schema4) {
26111
25487
  function isPgSequence(obj) {
26112
25488
  return is(obj, PgSequence);
26113
25489
  }
26114
- var _a149, PgSequence;
25490
+ var _a147, PgSequence;
26115
25491
  var init_sequence = __esm({
26116
25492
  "../drizzle-orm/dist/pg-core/sequence.js"() {
26117
25493
  "use strict";
26118
25494
  init_entity();
26119
- _a149 = entityKind;
25495
+ _a147 = entityKind;
26120
25496
  PgSequence = class {
26121
25497
  constructor(seqName, seqOptions, schema4) {
26122
25498
  this.seqName = seqName;
@@ -26124,7 +25500,7 @@ var init_sequence = __esm({
26124
25500
  this.schema = schema4;
26125
25501
  }
26126
25502
  };
26127
- __publicField(PgSequence, _a149, "PgSequence");
25503
+ __publicField(PgSequence, _a147, "PgSequence");
26128
25504
  }
26129
25505
  });
26130
25506
 
@@ -26150,7 +25526,7 @@ function pgMaterializedViewWithSchema(name2, selection, schema4) {
26150
25526
  }
26151
25527
  return new MaterializedViewBuilder(name2, schema4);
26152
25528
  }
26153
- 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;
25529
+ 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;
26154
25530
  var init_view = __esm({
26155
25531
  "../drizzle-orm/dist/pg-core/view.js"() {
26156
25532
  "use strict";
@@ -26161,7 +25537,7 @@ var init_view = __esm({
26161
25537
  init_table2();
26162
25538
  init_view_base();
26163
25539
  init_view_common2();
26164
- _a150 = entityKind;
25540
+ _a148 = entityKind;
26165
25541
  DefaultViewBuilderCore = class {
26166
25542
  constructor(name2, schema4) {
26167
25543
  __publicField(this, "config", {});
@@ -26173,8 +25549,8 @@ var init_view = __esm({
26173
25549
  return this;
26174
25550
  }
26175
25551
  };
26176
- __publicField(DefaultViewBuilderCore, _a150, "PgDefaultViewBuilderCore");
26177
- ViewBuilder = class extends (_b107 = DefaultViewBuilderCore, _a151 = entityKind, _b107) {
25552
+ __publicField(DefaultViewBuilderCore, _a148, "PgDefaultViewBuilderCore");
25553
+ ViewBuilder = class extends (_b107 = DefaultViewBuilderCore, _a149 = entityKind, _b107) {
26178
25554
  as(qb) {
26179
25555
  if (typeof qb === "function") {
26180
25556
  qb = qb(new QueryBuilder());
@@ -26200,8 +25576,8 @@ var init_view = __esm({
26200
25576
  );
26201
25577
  }
26202
25578
  };
26203
- __publicField(ViewBuilder, _a151, "PgViewBuilder");
26204
- ManualViewBuilder = class extends (_b108 = DefaultViewBuilderCore, _a152 = entityKind, _b108) {
25579
+ __publicField(ViewBuilder, _a149, "PgViewBuilder");
25580
+ ManualViewBuilder = class extends (_b108 = DefaultViewBuilderCore, _a150 = entityKind, _b108) {
26205
25581
  constructor(name2, columns, schema4) {
26206
25582
  super(name2, schema4);
26207
25583
  __publicField(this, "columns");
@@ -26246,8 +25622,8 @@ var init_view = __esm({
26246
25622
  );
26247
25623
  }
26248
25624
  };
26249
- __publicField(ManualViewBuilder, _a152, "PgManualViewBuilder");
26250
- _a153 = entityKind;
25625
+ __publicField(ManualViewBuilder, _a150, "PgManualViewBuilder");
25626
+ _a151 = entityKind;
26251
25627
  MaterializedViewBuilderCore = class {
26252
25628
  constructor(name2, schema4) {
26253
25629
  __publicField(this, "config", {});
@@ -26271,8 +25647,8 @@ var init_view = __esm({
26271
25647
  return this;
26272
25648
  }
26273
25649
  };
26274
- __publicField(MaterializedViewBuilderCore, _a153, "PgMaterializedViewBuilderCore");
26275
- MaterializedViewBuilder = class extends (_b109 = MaterializedViewBuilderCore, _a154 = entityKind, _b109) {
25650
+ __publicField(MaterializedViewBuilderCore, _a151, "PgMaterializedViewBuilderCore");
25651
+ MaterializedViewBuilder = class extends (_b109 = MaterializedViewBuilderCore, _a152 = entityKind, _b109) {
26276
25652
  as(qb) {
26277
25653
  if (typeof qb === "function") {
26278
25654
  qb = qb(new QueryBuilder());
@@ -26303,8 +25679,8 @@ var init_view = __esm({
26303
25679
  );
26304
25680
  }
26305
25681
  };
26306
- __publicField(MaterializedViewBuilder, _a154, "PgMaterializedViewBuilder");
26307
- ManualMaterializedViewBuilder = class extends (_b110 = MaterializedViewBuilderCore, _a155 = entityKind, _b110) {
25682
+ __publicField(MaterializedViewBuilder, _a152, "PgMaterializedViewBuilder");
25683
+ ManualMaterializedViewBuilder = class extends (_b110 = MaterializedViewBuilderCore, _a153 = entityKind, _b110) {
26308
25684
  constructor(name2, columns, schema4) {
26309
25685
  super(name2, schema4);
26310
25686
  __publicField(this, "columns");
@@ -26349,11 +25725,11 @@ var init_view = __esm({
26349
25725
  );
26350
25726
  }
26351
25727
  };
26352
- __publicField(ManualMaterializedViewBuilder, _a155, "PgManualMaterializedViewBuilder");
26353
- PgView = class extends (_c4 = PgViewBase, _b111 = entityKind, _a156 = PgViewConfig, _c4) {
25728
+ __publicField(ManualMaterializedViewBuilder, _a153, "PgManualMaterializedViewBuilder");
25729
+ PgView = class extends (_c4 = PgViewBase, _b111 = entityKind, _a154 = PgViewConfig, _c4) {
26354
25730
  constructor({ pgConfig, config }) {
26355
25731
  super(config);
26356
- __publicField(this, _a156);
25732
+ __publicField(this, _a154);
26357
25733
  if (pgConfig) {
26358
25734
  this[PgViewConfig] = {
26359
25735
  with: pgConfig.with
@@ -26363,10 +25739,10 @@ var init_view = __esm({
26363
25739
  };
26364
25740
  __publicField(PgView, _b111, "PgView");
26365
25741
  PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
26366
- PgMaterializedView = class extends (_c5 = PgViewBase, _b112 = entityKind, _a157 = PgMaterializedViewConfig, _c5) {
25742
+ PgMaterializedView = class extends (_c5 = PgViewBase, _b112 = entityKind, _a155 = PgMaterializedViewConfig, _c5) {
26367
25743
  constructor({ pgConfig, config }) {
26368
25744
  super(config);
26369
- __publicField(this, _a157);
25745
+ __publicField(this, _a155);
26370
25746
  this[PgMaterializedViewConfig] = {
26371
25747
  with: pgConfig?.with,
26372
25748
  using: pgConfig?.using,
@@ -26380,7 +25756,7 @@ var init_view = __esm({
26380
25756
  });
26381
25757
 
26382
25758
  // ../drizzle-orm/dist/pg-core/schema.js
26383
- var _a158, PgSchema5;
25759
+ var _a156, PgSchema5;
26384
25760
  var init_schema = __esm({
26385
25761
  "../drizzle-orm/dist/pg-core/schema.js"() {
26386
25762
  "use strict";
@@ -26390,7 +25766,7 @@ var init_schema = __esm({
26390
25766
  init_sequence();
26391
25767
  init_table2();
26392
25768
  init_view();
26393
- _a158 = entityKind;
25769
+ _a156 = entityKind;
26394
25770
  PgSchema5 = class {
26395
25771
  constructor(schemaName) {
26396
25772
  __publicField(this, "table", (name2, columns, extraConfig) => {
@@ -26417,12 +25793,12 @@ var init_schema = __esm({
26417
25793
  return true;
26418
25794
  }
26419
25795
  };
26420
- __publicField(PgSchema5, _a158, "PgSchema");
25796
+ __publicField(PgSchema5, _a156, "PgSchema");
26421
25797
  }
26422
25798
  });
26423
25799
 
26424
25800
  // ../drizzle-orm/dist/pg-core/session.js
26425
- var _a159, PgPreparedQuery, _a160, PgSession, _a161, _b113, PgTransaction;
25801
+ var _a157, PgPreparedQuery, _a158, PgSession, _a159, _b113, PgTransaction;
26426
25802
  var init_session = __esm({
26427
25803
  "../drizzle-orm/dist/pg-core/session.js"() {
26428
25804
  "use strict";
@@ -26431,7 +25807,7 @@ var init_session = __esm({
26431
25807
  init_sql2();
26432
25808
  init_tracing();
26433
25809
  init_db();
26434
- _a159 = entityKind;
25810
+ _a157 = entityKind;
26435
25811
  PgPreparedQuery = class {
26436
25812
  constructor(query) {
26437
25813
  /** @internal */
@@ -26445,8 +25821,8 @@ var init_session = __esm({
26445
25821
  return response;
26446
25822
  }
26447
25823
  };
26448
- __publicField(PgPreparedQuery, _a159, "PgPreparedQuery");
26449
- _a160 = entityKind;
25824
+ __publicField(PgPreparedQuery, _a157, "PgPreparedQuery");
25825
+ _a158 = entityKind;
26450
25826
  PgSession = class {
26451
25827
  constructor(dialect4) {
26452
25828
  this.dialect = dialect4;
@@ -26479,8 +25855,8 @@ var init_session = __esm({
26479
25855
  );
26480
25856
  }
26481
25857
  };
26482
- __publicField(PgSession, _a160, "PgSession");
26483
- PgTransaction = class extends (_b113 = PgDatabase, _a161 = entityKind, _b113) {
25858
+ __publicField(PgSession, _a158, "PgSession");
25859
+ PgTransaction = class extends (_b113 = PgDatabase, _a159 = entityKind, _b113) {
26484
25860
  constructor(dialect4, session, schema4, nestedIndex = 0) {
26485
25861
  super(dialect4, session, schema4);
26486
25862
  this.schema = schema4;
@@ -26507,7 +25883,7 @@ var init_session = __esm({
26507
25883
  return this.session.execute(sql`set transaction ${this.getTransactionConfigSQL(config)}`);
26508
25884
  }
26509
25885
  };
26510
- __publicField(PgTransaction, _a161, "PgTransaction");
25886
+ __publicField(PgTransaction, _a159, "PgTransaction");
26511
25887
  }
26512
25888
  });
26513
25889
 
@@ -26528,12 +25904,10 @@ function getTableConfig(table4) {
26528
25904
  const uniqueConstraints = [];
26529
25905
  const name2 = table4[Table.Symbol.Name];
26530
25906
  const schema4 = table4[Table.Symbol.Schema];
26531
- const policies = [];
26532
25907
  const extraConfigBuilder = table4[PgTable.Symbol.ExtraConfigBuilder];
26533
25908
  if (extraConfigBuilder !== void 0) {
26534
25909
  const extraConfig = extraConfigBuilder(table4[Table.Symbol.ExtraConfigColumns]);
26535
- const extraValues = Array.isArray(extraConfig) ? extraConfig : Object.values(extraConfig);
26536
- for (const builder of extraValues) {
25910
+ for (const builder of Object.values(extraConfig)) {
26537
25911
  if (is(builder, IndexBuilder)) {
26538
25912
  indexes.push(builder.build(table4));
26539
25913
  } else if (is(builder, CheckBuilder)) {
@@ -26544,8 +25918,6 @@ function getTableConfig(table4) {
26544
25918
  primaryKeys.push(builder.build(table4));
26545
25919
  } else if (is(builder, ForeignKeyBuilder)) {
26546
25920
  foreignKeys.push(builder.build(table4));
26547
- } else if (is(builder, PgPolicy)) {
26548
- policies.push(builder);
26549
25921
  }
26550
25922
  }
26551
25923
  }
@@ -26557,8 +25929,7 @@ function getTableConfig(table4) {
26557
25929
  primaryKeys,
26558
25930
  uniqueConstraints,
26559
25931
  name: name2,
26560
- schema: schema4,
26561
- policies
25932
+ schema: schema4
26562
25933
  };
26563
25934
  }
26564
25935
  var init_utils4 = __esm({
@@ -26570,7 +25941,6 @@ var init_utils4 = __esm({
26570
25941
  init_checks();
26571
25942
  init_foreign_keys();
26572
25943
  init_indexes();
26573
- init_policies();
26574
25944
  init_primary_keys();
26575
25945
  init_unique_constraint();
26576
25946
  }
@@ -26595,10 +25965,8 @@ var init_pg_core = __esm({
26595
25965
  init_dialect();
26596
25966
  init_foreign_keys();
26597
25967
  init_indexes();
26598
- init_policies();
26599
25968
  init_primary_keys();
26600
25969
  init_query_builders();
26601
- init_roles();
26602
25970
  init_schema();
26603
25971
  init_sequence();
26604
25972
  init_session();
@@ -26625,9 +25993,9 @@ function minRangeForIdentityBasedOn(columnType) {
26625
25993
  function stringFromDatabaseIdentityProperty(field) {
26626
25994
  return typeof field === "string" ? field : typeof field === "undefined" ? void 0 : typeof field === "bigint" ? field.toString() : String(field);
26627
25995
  }
26628
- function buildArrayString(array2, sqlType) {
25996
+ function buildArrayString(array, sqlType) {
26629
25997
  sqlType = sqlType.split("[")[0];
26630
- const values = array2.map((value) => {
25998
+ const values = array.map((value) => {
26631
25999
  if (typeof value === "number" || typeof value === "bigint") {
26632
26000
  return value.toString();
26633
26001
  } else if (typeof value === "boolean") {
@@ -26649,40 +26017,6 @@ function buildArrayString(array2, sqlType) {
26649
26017
  }).join(",");
26650
26018
  return `{${values}}`;
26651
26019
  }
26652
- function prepareRoles(entities) {
26653
- let useRoles = false;
26654
- const includeRoles = [];
26655
- const excludeRoles = [];
26656
- if (entities && entities.roles) {
26657
- if (typeof entities.roles === "object") {
26658
- if (entities.roles.provider) {
26659
- if (entities.roles.provider === "supabase") {
26660
- excludeRoles.push(...[
26661
- "anon",
26662
- "authenticator",
26663
- "authenticated",
26664
- "service_role",
26665
- "supabase_auth_admin",
26666
- "supabase_storage_admin",
26667
- "dashboard_user",
26668
- "supabase_admin"
26669
- ]);
26670
- } else if (entities.roles.provider === "neon") {
26671
- excludeRoles.push(...["authenticated", "anonymous"]);
26672
- }
26673
- }
26674
- if (entities.roles.include) {
26675
- includeRoles.push(...entities.roles.include);
26676
- }
26677
- if (entities.roles.exclude) {
26678
- excludeRoles.push(...entities.roles.exclude);
26679
- }
26680
- } else {
26681
- useRoles = entities.roles;
26682
- }
26683
- }
26684
- return { useRoles, includeRoles, excludeRoles };
26685
- }
26686
26020
  var indexName, generatePgSnapshot, trimChar, fromDatabase, defaultForColumn;
26687
26021
  var init_pgSerializer = __esm({
26688
26022
  "src/serializer/pgSerializer.ts"() {
@@ -26698,11 +26032,10 @@ var init_pgSerializer = __esm({
26698
26032
  indexName = (tableName, columns) => {
26699
26033
  return `${tableName}_${columns.join("_")}_index`;
26700
26034
  };
26701
- generatePgSnapshot = (tables, enums, schemas, sequences, roles, casing2, schemaFilter) => {
26035
+ generatePgSnapshot = (tables, enums, schemas, sequences, casing2, schemaFilter) => {
26702
26036
  const dialect4 = new PgDialect({ casing: casing2 });
26703
26037
  const result = {};
26704
26038
  const sequencesToReturn = {};
26705
- const rolesToReturn = {};
26706
26039
  const indexesInSchema = {};
26707
26040
  for (const table4 of tables) {
26708
26041
  const {
@@ -26713,8 +26046,7 @@ var init_pgSerializer = __esm({
26713
26046
  checks,
26714
26047
  schema: schema4,
26715
26048
  primaryKeys,
26716
- uniqueConstraints,
26717
- policies
26049
+ uniqueConstraints
26718
26050
  } = getTableConfig(table4);
26719
26051
  if (schemaFilter && !schemaFilter.includes(schema4 ?? "public")) {
26720
26052
  continue;
@@ -26724,7 +26056,6 @@ var init_pgSerializer = __esm({
26724
26056
  const foreignKeysObject = {};
26725
26057
  const primaryKeysObject = {};
26726
26058
  const uniqueConstraintObject = {};
26727
- const policiesObject = {};
26728
26059
  columns.forEach((column4) => {
26729
26060
  const name2 = getColumnCasing(column4, casing2);
26730
26061
  const notNull = column4.notNull;
@@ -26987,34 +26318,6 @@ ${withStyle.errorWarning(
26987
26318
  with: value.config.with ?? {}
26988
26319
  };
26989
26320
  });
26990
- policies.forEach((policy2) => {
26991
- const mappedTo = [];
26992
- if (!policy2.to) {
26993
- mappedTo.push("public");
26994
- } else {
26995
- if (policy2.to && typeof policy2.to === "string") {
26996
- mappedTo.push(policy2.to);
26997
- } else if (policy2.to && is(policy2.to, PgRole)) {
26998
- mappedTo.push(policy2.to.name);
26999
- } else if (policy2.to && Array.isArray(policy2.to)) {
27000
- policy2.to.forEach((it) => {
27001
- if (typeof it === "string") {
27002
- mappedTo.push(it);
27003
- } else if (is(it, PgRole)) {
27004
- mappedTo.push(it.name);
27005
- }
27006
- });
27007
- }
27008
- }
27009
- policiesObject[policy2.name] = {
27010
- name: policy2.name,
27011
- as: policy2.as?.toUpperCase() ?? "PERMISSIVE",
27012
- for: policy2.for?.toUpperCase() ?? "ALL",
27013
- to: mappedTo.sort(),
27014
- using: is(policy2.using, SQL) ? dialect4.sqlToQuery(policy2.using).sql : void 0,
27015
- withCheck: is(policy2.withCheck, SQL) ? dialect4.sqlToQuery(policy2.withCheck).sql : void 0
27016
- };
27017
- });
27018
26321
  const tableKey2 = `${schema4 ?? "public"}.${tableName}`;
27019
26322
  result[tableKey2] = {
27020
26323
  name: tableName,
@@ -27023,8 +26326,7 @@ ${withStyle.errorWarning(
27023
26326
  indexes: indexesObject,
27024
26327
  foreignKeys: foreignKeysObject,
27025
26328
  compositePrimaryKeys: primaryKeysObject,
27026
- uniqueConstraints: uniqueConstraintObject,
27027
- policies: policiesObject
26329
+ uniqueConstraints: uniqueConstraintObject
27028
26330
  };
27029
26331
  }
27030
26332
  for (const sequence of sequences) {
@@ -27048,16 +26350,6 @@ ${withStyle.errorWarning(
27048
26350
  } else {
27049
26351
  }
27050
26352
  }
27051
- for (const role of roles) {
27052
- if (!role._existing) {
27053
- rolesToReturn[role.name] = {
27054
- name: role.name,
27055
- createDb: role.createDb === void 0 ? false : role.createDb,
27056
- createRole: role.createRole === void 0 ? false : role.createRole,
27057
- inherit: role.inherit === void 0 ? true : role.inherit
27058
- };
27059
- }
27060
- }
27061
26353
  const enumsToReturn = enums.reduce((map, obj) => {
27062
26354
  const enumSchema3 = obj.schema || "public";
27063
26355
  const key = `${enumSchema3}.${obj.enumName}`;
@@ -27084,7 +26376,6 @@ ${withStyle.errorWarning(
27084
26376
  enums: enumsToReturn,
27085
26377
  schemas: schemasObject,
27086
26378
  sequences: sequencesToReturn,
27087
- roles: rolesToReturn,
27088
26379
  _meta: {
27089
26380
  schemas: {},
27090
26381
  tables: {},
@@ -27099,7 +26390,7 @@ ${withStyle.errorWarning(
27099
26390
  while (end > start && str[end - 1] === char3) --end;
27100
26391
  return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
27101
26392
  };
27102
- fromDatabase = async (db, tablesFilter = () => true, schemaFilters, entities, progressCallback) => {
26393
+ fromDatabase = async (db, tablesFilter = () => true, schemaFilters, progressCallback) => {
27103
26394
  const result = {};
27104
26395
  const internals = { tables: {} };
27105
26396
  const where = schemaFilters.map((t) => `table_schema = '${t}'`).join(" or ");
@@ -27181,60 +26472,6 @@ ${withStyle.errorWarning(
27181
26472
  if (progressCallback) {
27182
26473
  progressCallback("enums", Object.keys(enumsToReturn).length, "done");
27183
26474
  }
27184
- const allRoles = await db.query(
27185
- `SELECT rolname, rolinherit, rolcreatedb, rolcreaterole FROM pg_roles;`
27186
- );
27187
- const rolesToReturn = {};
27188
- const preparedRoles = prepareRoles(entities);
27189
- if (preparedRoles.useRoles || !(preparedRoles.includeRoles.length === 0 && preparedRoles.excludeRoles.length === 0)) {
27190
- for (const dbRole of allRoles) {
27191
- if (preparedRoles.useRoles) {
27192
- rolesToReturn[dbRole.rolname] = {
27193
- createDb: dbRole.rolcreatedb,
27194
- createRole: dbRole.rolcreatedb,
27195
- inherit: dbRole.rolinherit,
27196
- name: dbRole.rolname
27197
- };
27198
- } else {
27199
- if (preparedRoles.includeRoles.length === 0 && preparedRoles.excludeRoles.length === 0) continue;
27200
- if (preparedRoles.includeRoles.includes(dbRole.rolname) && preparedRoles.excludeRoles.includes(dbRole.rolname)) continue;
27201
- if (preparedRoles.excludeRoles.includes(dbRole.rolname)) continue;
27202
- if (!preparedRoles.includeRoles.includes(dbRole.rolname)) continue;
27203
- rolesToReturn[dbRole.rolname] = {
27204
- createDb: dbRole.rolcreatedb,
27205
- createRole: dbRole.rolcreaterole,
27206
- inherit: dbRole.rolinherit,
27207
- name: dbRole.rolname
27208
- };
27209
- }
27210
- }
27211
- }
27212
- const wherePolicies = schemaFilters.map((t) => `schemaname = '${t}'`).join(" or ");
27213
- const policiesByTable = {};
27214
- 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}`};`);
27215
- for (const dbPolicy of allPolicies) {
27216
- const { tablename, schemaname, to, withCheck, using, ...rest } = dbPolicy;
27217
- const tableForPolicy = policiesByTable[`${schemaname}.${tablename}`];
27218
- const parsedTo = to === "{}" ? [] : to.substring(1, to.length - 1).split(/\s*,\s*/g).sort();
27219
- const parsedWithCheck = withCheck === null ? void 0 : withCheck;
27220
- const parsedUsing = using === null ? void 0 : using;
27221
- if (tableForPolicy) {
27222
- tableForPolicy[dbPolicy.name] = { ...rest, to: parsedTo };
27223
- } else {
27224
- policiesByTable[`${schemaname}.${tablename}`] = {
27225
- [dbPolicy.name]: { ...rest, to: parsedTo, withCheck: parsedWithCheck, using: parsedUsing }
27226
- };
27227
- }
27228
- }
27229
- if (progressCallback) {
27230
- progressCallback(
27231
- "policies",
27232
- Object.values(policiesByTable).reduce((total, innerRecord) => {
27233
- return total + Object.keys(innerRecord).length;
27234
- }, 0),
27235
- "done"
27236
- );
27237
- }
27238
26475
  const sequencesInColumns = [];
27239
26476
  const all = allTables.map((row) => {
27240
26477
  return new Promise(async (res, rej) => {
@@ -27628,8 +26865,7 @@ ${withStyle.errorWarning(
27628
26865
  indexes: indexToReturn,
27629
26866
  foreignKeys: foreignKeysToReturn,
27630
26867
  compositePrimaryKeys: primaryKeys,
27631
- uniqueConstraints: uniqueConstrains,
27632
- policies: policiesByTable[`${tableSchema}.${tableName}`] ?? {}
26868
+ uniqueConstraints: uniqueConstrains
27633
26869
  };
27634
26870
  } catch (e) {
27635
26871
  rej(e);
@@ -27656,7 +26892,6 @@ ${withStyle.errorWarning(
27656
26892
  enums: enumsToReturn,
27657
26893
  schemas: schemasObject,
27658
26894
  sequences: sequencesToReturn,
27659
- roles: rolesToReturn,
27660
26895
  _meta: {
27661
26896
  schemas: {},
27662
26897
  tables: {},
@@ -27779,12 +27014,12 @@ var init_alias3 = __esm({
27779
27014
  });
27780
27015
 
27781
27016
  // ../drizzle-orm/dist/sqlite-core/checks.js
27782
- var _a162, CheckBuilder2, _a163, Check2;
27017
+ var _a160, CheckBuilder2, _a161, Check2;
27783
27018
  var init_checks2 = __esm({
27784
27019
  "../drizzle-orm/dist/sqlite-core/checks.js"() {
27785
27020
  "use strict";
27786
27021
  init_entity();
27787
- _a162 = entityKind;
27022
+ _a160 = entityKind;
27788
27023
  CheckBuilder2 = class {
27789
27024
  constructor(name2, value) {
27790
27025
  __publicField(this, "brand");
@@ -27795,8 +27030,8 @@ var init_checks2 = __esm({
27795
27030
  return new Check2(table4, this);
27796
27031
  }
27797
27032
  };
27798
- __publicField(CheckBuilder2, _a162, "SQLiteCheckBuilder");
27799
- _a163 = entityKind;
27033
+ __publicField(CheckBuilder2, _a160, "SQLiteCheckBuilder");
27034
+ _a161 = entityKind;
27800
27035
  Check2 = class {
27801
27036
  constructor(table4, builder) {
27802
27037
  __publicField(this, "name");
@@ -27806,18 +27041,18 @@ var init_checks2 = __esm({
27806
27041
  this.value = builder.value;
27807
27042
  }
27808
27043
  };
27809
- __publicField(Check2, _a163, "SQLiteCheck");
27044
+ __publicField(Check2, _a161, "SQLiteCheck");
27810
27045
  }
27811
27046
  });
27812
27047
 
27813
27048
  // ../drizzle-orm/dist/sqlite-core/foreign-keys.js
27814
- var _a164, ForeignKeyBuilder2, _a165, ForeignKey2;
27049
+ var _a162, ForeignKeyBuilder2, _a163, ForeignKey2;
27815
27050
  var init_foreign_keys2 = __esm({
27816
27051
  "../drizzle-orm/dist/sqlite-core/foreign-keys.js"() {
27817
27052
  "use strict";
27818
27053
  init_entity();
27819
27054
  init_table_utils();
27820
- _a164 = entityKind;
27055
+ _a162 = entityKind;
27821
27056
  ForeignKeyBuilder2 = class {
27822
27057
  constructor(config, actions) {
27823
27058
  /** @internal */
@@ -27848,8 +27083,8 @@ var init_foreign_keys2 = __esm({
27848
27083
  return new ForeignKey2(table4, this);
27849
27084
  }
27850
27085
  };
27851
- __publicField(ForeignKeyBuilder2, _a164, "SQLiteForeignKeyBuilder");
27852
- _a165 = entityKind;
27086
+ __publicField(ForeignKeyBuilder2, _a162, "SQLiteForeignKeyBuilder");
27087
+ _a163 = entityKind;
27853
27088
  ForeignKey2 = class {
27854
27089
  constructor(table4, builder) {
27855
27090
  __publicField(this, "reference");
@@ -27873,7 +27108,7 @@ var init_foreign_keys2 = __esm({
27873
27108
  return name2 ?? `${chunks.join("_")}_fk`;
27874
27109
  }
27875
27110
  };
27876
- __publicField(ForeignKey2, _a165, "SQLiteForeignKey");
27111
+ __publicField(ForeignKey2, _a163, "SQLiteForeignKey");
27877
27112
  }
27878
27113
  });
27879
27114
 
@@ -27881,13 +27116,13 @@ var init_foreign_keys2 = __esm({
27881
27116
  function uniqueKeyName2(table4, columns) {
27882
27117
  return `${table4[TableName]}_${columns.join("_")}_unique`;
27883
27118
  }
27884
- var _a166, UniqueConstraintBuilder2, _a167, UniqueOnConstraintBuilder2, _a168, UniqueConstraint2;
27119
+ var _a164, UniqueConstraintBuilder2, _a165, UniqueOnConstraintBuilder2, _a166, UniqueConstraint2;
27885
27120
  var init_unique_constraint2 = __esm({
27886
27121
  "../drizzle-orm/dist/sqlite-core/unique-constraint.js"() {
27887
27122
  "use strict";
27888
27123
  init_entity();
27889
27124
  init_table_utils();
27890
- _a166 = entityKind;
27125
+ _a164 = entityKind;
27891
27126
  UniqueConstraintBuilder2 = class {
27892
27127
  constructor(columns, name2) {
27893
27128
  /** @internal */
@@ -27900,8 +27135,8 @@ var init_unique_constraint2 = __esm({
27900
27135
  return new UniqueConstraint2(table4, this.columns, this.name);
27901
27136
  }
27902
27137
  };
27903
- __publicField(UniqueConstraintBuilder2, _a166, "SQLiteUniqueConstraintBuilder");
27904
- _a167 = entityKind;
27138
+ __publicField(UniqueConstraintBuilder2, _a164, "SQLiteUniqueConstraintBuilder");
27139
+ _a165 = entityKind;
27905
27140
  UniqueOnConstraintBuilder2 = class {
27906
27141
  constructor(name2) {
27907
27142
  /** @internal */
@@ -27912,8 +27147,8 @@ var init_unique_constraint2 = __esm({
27912
27147
  return new UniqueConstraintBuilder2(columns, this.name);
27913
27148
  }
27914
27149
  };
27915
- __publicField(UniqueOnConstraintBuilder2, _a167, "SQLiteUniqueOnConstraintBuilder");
27916
- _a168 = entityKind;
27150
+ __publicField(UniqueOnConstraintBuilder2, _a165, "SQLiteUniqueOnConstraintBuilder");
27151
+ _a166 = entityKind;
27917
27152
  UniqueConstraint2 = class {
27918
27153
  constructor(table4, columns, name2) {
27919
27154
  __publicField(this, "columns");
@@ -27926,12 +27161,12 @@ var init_unique_constraint2 = __esm({
27926
27161
  return this.name;
27927
27162
  }
27928
27163
  };
27929
- __publicField(UniqueConstraint2, _a168, "SQLiteUniqueConstraint");
27164
+ __publicField(UniqueConstraint2, _a166, "SQLiteUniqueConstraint");
27930
27165
  }
27931
27166
  });
27932
27167
 
27933
27168
  // ../drizzle-orm/dist/sqlite-core/columns/common.js
27934
- var _a169, _b114, SQLiteColumnBuilder, _a170, _b115, SQLiteColumn;
27169
+ var _a167, _b114, SQLiteColumnBuilder, _a168, _b115, SQLiteColumn;
27935
27170
  var init_common3 = __esm({
27936
27171
  "../drizzle-orm/dist/sqlite-core/columns/common.js"() {
27937
27172
  "use strict";
@@ -27940,7 +27175,7 @@ var init_common3 = __esm({
27940
27175
  init_entity();
27941
27176
  init_foreign_keys2();
27942
27177
  init_unique_constraint2();
27943
- SQLiteColumnBuilder = class extends (_b114 = ColumnBuilder, _a169 = entityKind, _b114) {
27178
+ SQLiteColumnBuilder = class extends (_b114 = ColumnBuilder, _a167 = entityKind, _b114) {
27944
27179
  constructor() {
27945
27180
  super(...arguments);
27946
27181
  __publicField(this, "foreignKeyConfigs", []);
@@ -27981,8 +27216,8 @@ var init_common3 = __esm({
27981
27216
  });
27982
27217
  }
27983
27218
  };
27984
- __publicField(SQLiteColumnBuilder, _a169, "SQLiteColumnBuilder");
27985
- SQLiteColumn = class extends (_b115 = Column2, _a170 = entityKind, _b115) {
27219
+ __publicField(SQLiteColumnBuilder, _a167, "SQLiteColumnBuilder");
27220
+ SQLiteColumn = class extends (_b115 = Column2, _a168 = entityKind, _b115) {
27986
27221
  constructor(table4, config) {
27987
27222
  if (!config.uniqueName) {
27988
27223
  config.uniqueName = uniqueKeyName2(table4, [config.name]);
@@ -27991,7 +27226,7 @@ var init_common3 = __esm({
27991
27226
  this.table = table4;
27992
27227
  }
27993
27228
  };
27994
- __publicField(SQLiteColumn, _a170, "SQLiteColumn");
27229
+ __publicField(SQLiteColumn, _a168, "SQLiteColumn");
27995
27230
  }
27996
27231
  });
27997
27232
 
@@ -28006,14 +27241,14 @@ function blob(a, b) {
28006
27241
  }
28007
27242
  return new SQLiteBlobBufferBuilder(name2);
28008
27243
  }
28009
- var _a171, _b116, SQLiteBigIntBuilder, _a172, _b117, SQLiteBigInt, _a173, _b118, SQLiteBlobJsonBuilder, _a174, _b119, SQLiteBlobJson, _a175, _b120, SQLiteBlobBufferBuilder, _a176, _b121, SQLiteBlobBuffer;
27244
+ var _a169, _b116, SQLiteBigIntBuilder, _a170, _b117, SQLiteBigInt, _a171, _b118, SQLiteBlobJsonBuilder, _a172, _b119, SQLiteBlobJson, _a173, _b120, SQLiteBlobBufferBuilder, _a174, _b121, SQLiteBlobBuffer;
28010
27245
  var init_blob = __esm({
28011
27246
  "../drizzle-orm/dist/sqlite-core/columns/blob.js"() {
28012
27247
  "use strict";
28013
27248
  init_entity();
28014
27249
  init_utils2();
28015
27250
  init_common3();
28016
- SQLiteBigIntBuilder = class extends (_b116 = SQLiteColumnBuilder, _a171 = entityKind, _b116) {
27251
+ SQLiteBigIntBuilder = class extends (_b116 = SQLiteColumnBuilder, _a169 = entityKind, _b116) {
28017
27252
  constructor(name2) {
28018
27253
  super(name2, "bigint", "SQLiteBigInt");
28019
27254
  }
@@ -28022,8 +27257,8 @@ var init_blob = __esm({
28022
27257
  return new SQLiteBigInt(table4, this.config);
28023
27258
  }
28024
27259
  };
28025
- __publicField(SQLiteBigIntBuilder, _a171, "SQLiteBigIntBuilder");
28026
- SQLiteBigInt = class extends (_b117 = SQLiteColumn, _a172 = entityKind, _b117) {
27260
+ __publicField(SQLiteBigIntBuilder, _a169, "SQLiteBigIntBuilder");
27261
+ SQLiteBigInt = class extends (_b117 = SQLiteColumn, _a170 = entityKind, _b117) {
28027
27262
  getSQLType() {
28028
27263
  return "blob";
28029
27264
  }
@@ -28034,8 +27269,8 @@ var init_blob = __esm({
28034
27269
  return Buffer.from(value.toString());
28035
27270
  }
28036
27271
  };
28037
- __publicField(SQLiteBigInt, _a172, "SQLiteBigInt");
28038
- SQLiteBlobJsonBuilder = class extends (_b118 = SQLiteColumnBuilder, _a173 = entityKind, _b118) {
27272
+ __publicField(SQLiteBigInt, _a170, "SQLiteBigInt");
27273
+ SQLiteBlobJsonBuilder = class extends (_b118 = SQLiteColumnBuilder, _a171 = entityKind, _b118) {
28039
27274
  constructor(name2) {
28040
27275
  super(name2, "json", "SQLiteBlobJson");
28041
27276
  }
@@ -28047,8 +27282,8 @@ var init_blob = __esm({
28047
27282
  );
28048
27283
  }
28049
27284
  };
28050
- __publicField(SQLiteBlobJsonBuilder, _a173, "SQLiteBlobJsonBuilder");
28051
- SQLiteBlobJson = class extends (_b119 = SQLiteColumn, _a174 = entityKind, _b119) {
27285
+ __publicField(SQLiteBlobJsonBuilder, _a171, "SQLiteBlobJsonBuilder");
27286
+ SQLiteBlobJson = class extends (_b119 = SQLiteColumn, _a172 = entityKind, _b119) {
28052
27287
  getSQLType() {
28053
27288
  return "blob";
28054
27289
  }
@@ -28059,8 +27294,8 @@ var init_blob = __esm({
28059
27294
  return Buffer.from(JSON.stringify(value));
28060
27295
  }
28061
27296
  };
28062
- __publicField(SQLiteBlobJson, _a174, "SQLiteBlobJson");
28063
- SQLiteBlobBufferBuilder = class extends (_b120 = SQLiteColumnBuilder, _a175 = entityKind, _b120) {
27297
+ __publicField(SQLiteBlobJson, _a172, "SQLiteBlobJson");
27298
+ SQLiteBlobBufferBuilder = class extends (_b120 = SQLiteColumnBuilder, _a173 = entityKind, _b120) {
28064
27299
  constructor(name2) {
28065
27300
  super(name2, "buffer", "SQLiteBlobBuffer");
28066
27301
  }
@@ -28069,13 +27304,13 @@ var init_blob = __esm({
28069
27304
  return new SQLiteBlobBuffer(table4, this.config);
28070
27305
  }
28071
27306
  };
28072
- __publicField(SQLiteBlobBufferBuilder, _a175, "SQLiteBlobBufferBuilder");
28073
- SQLiteBlobBuffer = class extends (_b121 = SQLiteColumn, _a176 = entityKind, _b121) {
27307
+ __publicField(SQLiteBlobBufferBuilder, _a173, "SQLiteBlobBufferBuilder");
27308
+ SQLiteBlobBuffer = class extends (_b121 = SQLiteColumn, _a174 = entityKind, _b121) {
28074
27309
  getSQLType() {
28075
27310
  return "blob";
28076
27311
  }
28077
27312
  };
28078
- __publicField(SQLiteBlobBuffer, _a176, "SQLiteBlobBuffer");
27313
+ __publicField(SQLiteBlobBuffer, _a174, "SQLiteBlobBuffer");
28079
27314
  }
28080
27315
  });
28081
27316
 
@@ -28090,14 +27325,14 @@ function customType2(customTypeParams) {
28090
27325
  );
28091
27326
  };
28092
27327
  }
28093
- var _a177, _b122, SQLiteCustomColumnBuilder, _a178, _b123, SQLiteCustomColumn;
27328
+ var _a175, _b122, SQLiteCustomColumnBuilder, _a176, _b123, SQLiteCustomColumn;
28094
27329
  var init_custom2 = __esm({
28095
27330
  "../drizzle-orm/dist/sqlite-core/columns/custom.js"() {
28096
27331
  "use strict";
28097
27332
  init_entity();
28098
27333
  init_utils2();
28099
27334
  init_common3();
28100
- SQLiteCustomColumnBuilder = class extends (_b122 = SQLiteColumnBuilder, _a177 = entityKind, _b122) {
27335
+ SQLiteCustomColumnBuilder = class extends (_b122 = SQLiteColumnBuilder, _a175 = entityKind, _b122) {
28101
27336
  constructor(name2, fieldConfig, customTypeParams) {
28102
27337
  super(name2, "custom", "SQLiteCustomColumn");
28103
27338
  this.config.fieldConfig = fieldConfig;
@@ -28111,8 +27346,8 @@ var init_custom2 = __esm({
28111
27346
  );
28112
27347
  }
28113
27348
  };
28114
- __publicField(SQLiteCustomColumnBuilder, _a177, "SQLiteCustomColumnBuilder");
28115
- SQLiteCustomColumn = class extends (_b123 = SQLiteColumn, _a178 = entityKind, _b123) {
27349
+ __publicField(SQLiteCustomColumnBuilder, _a175, "SQLiteCustomColumnBuilder");
27350
+ SQLiteCustomColumn = class extends (_b123 = SQLiteColumn, _a176 = entityKind, _b123) {
28116
27351
  constructor(table4, config) {
28117
27352
  super(table4, config);
28118
27353
  __publicField(this, "sqlName");
@@ -28132,7 +27367,7 @@ var init_custom2 = __esm({
28132
27367
  return typeof this.mapTo === "function" ? this.mapTo(value) : value;
28133
27368
  }
28134
27369
  };
28135
- __publicField(SQLiteCustomColumn, _a178, "SQLiteCustomColumn");
27370
+ __publicField(SQLiteCustomColumn, _a176, "SQLiteCustomColumn");
28136
27371
  }
28137
27372
  });
28138
27373
 
@@ -28147,7 +27382,7 @@ function integer2(a, b) {
28147
27382
  }
28148
27383
  return new SQLiteIntegerBuilder(name2);
28149
27384
  }
28150
- 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;
27385
+ 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;
28151
27386
  var init_integer2 = __esm({
28152
27387
  "../drizzle-orm/dist/sqlite-core/columns/integer.js"() {
28153
27388
  "use strict";
@@ -28155,7 +27390,7 @@ var init_integer2 = __esm({
28155
27390
  init_sql();
28156
27391
  init_utils2();
28157
27392
  init_common3();
28158
- SQLiteBaseIntegerBuilder = class extends (_b124 = SQLiteColumnBuilder, _a179 = entityKind, _b124) {
27393
+ SQLiteBaseIntegerBuilder = class extends (_b124 = SQLiteColumnBuilder, _a177 = entityKind, _b124) {
28159
27394
  constructor(name2, dataType, columnType) {
28160
27395
  super(name2, dataType, columnType);
28161
27396
  this.config.autoIncrement = false;
@@ -28168,8 +27403,8 @@ var init_integer2 = __esm({
28168
27403
  return super.primaryKey();
28169
27404
  }
28170
27405
  };
28171
- __publicField(SQLiteBaseIntegerBuilder, _a179, "SQLiteBaseIntegerBuilder");
28172
- SQLiteBaseInteger = class extends (_b125 = SQLiteColumn, _a180 = entityKind, _b125) {
27406
+ __publicField(SQLiteBaseIntegerBuilder, _a177, "SQLiteBaseIntegerBuilder");
27407
+ SQLiteBaseInteger = class extends (_b125 = SQLiteColumn, _a178 = entityKind, _b125) {
28173
27408
  constructor() {
28174
27409
  super(...arguments);
28175
27410
  __publicField(this, "autoIncrement", this.config.autoIncrement);
@@ -28178,8 +27413,8 @@ var init_integer2 = __esm({
28178
27413
  return "integer";
28179
27414
  }
28180
27415
  };
28181
- __publicField(SQLiteBaseInteger, _a180, "SQLiteBaseInteger");
28182
- SQLiteIntegerBuilder = class extends (_b126 = SQLiteBaseIntegerBuilder, _a181 = entityKind, _b126) {
27416
+ __publicField(SQLiteBaseInteger, _a178, "SQLiteBaseInteger");
27417
+ SQLiteIntegerBuilder = class extends (_b126 = SQLiteBaseIntegerBuilder, _a179 = entityKind, _b126) {
28183
27418
  constructor(name2) {
28184
27419
  super(name2, "number", "SQLiteInteger");
28185
27420
  }
@@ -28190,11 +27425,11 @@ var init_integer2 = __esm({
28190
27425
  );
28191
27426
  }
28192
27427
  };
28193
- __publicField(SQLiteIntegerBuilder, _a181, "SQLiteIntegerBuilder");
28194
- SQLiteInteger = class extends (_b127 = SQLiteBaseInteger, _a182 = entityKind, _b127) {
27428
+ __publicField(SQLiteIntegerBuilder, _a179, "SQLiteIntegerBuilder");
27429
+ SQLiteInteger = class extends (_b127 = SQLiteBaseInteger, _a180 = entityKind, _b127) {
28195
27430
  };
28196
- __publicField(SQLiteInteger, _a182, "SQLiteInteger");
28197
- SQLiteTimestampBuilder = class extends (_b128 = SQLiteBaseIntegerBuilder, _a183 = entityKind, _b128) {
27431
+ __publicField(SQLiteInteger, _a180, "SQLiteInteger");
27432
+ SQLiteTimestampBuilder = class extends (_b128 = SQLiteBaseIntegerBuilder, _a181 = entityKind, _b128) {
28198
27433
  constructor(name2, mode) {
28199
27434
  super(name2, "date", "SQLiteTimestamp");
28200
27435
  this.config.mode = mode;
@@ -28214,8 +27449,8 @@ var init_integer2 = __esm({
28214
27449
  );
28215
27450
  }
28216
27451
  };
28217
- __publicField(SQLiteTimestampBuilder, _a183, "SQLiteTimestampBuilder");
28218
- SQLiteTimestamp = class extends (_b129 = SQLiteBaseInteger, _a184 = entityKind, _b129) {
27452
+ __publicField(SQLiteTimestampBuilder, _a181, "SQLiteTimestampBuilder");
27453
+ SQLiteTimestamp = class extends (_b129 = SQLiteBaseInteger, _a182 = entityKind, _b129) {
28219
27454
  constructor() {
28220
27455
  super(...arguments);
28221
27456
  __publicField(this, "mode", this.config.mode);
@@ -28234,8 +27469,8 @@ var init_integer2 = __esm({
28234
27469
  return unix;
28235
27470
  }
28236
27471
  };
28237
- __publicField(SQLiteTimestamp, _a184, "SQLiteTimestamp");
28238
- SQLiteBooleanBuilder = class extends (_b130 = SQLiteBaseIntegerBuilder, _a185 = entityKind, _b130) {
27472
+ __publicField(SQLiteTimestamp, _a182, "SQLiteTimestamp");
27473
+ SQLiteBooleanBuilder = class extends (_b130 = SQLiteBaseIntegerBuilder, _a183 = entityKind, _b130) {
28239
27474
  constructor(name2, mode) {
28240
27475
  super(name2, "boolean", "SQLiteBoolean");
28241
27476
  this.config.mode = mode;
@@ -28247,8 +27482,8 @@ var init_integer2 = __esm({
28247
27482
  );
28248
27483
  }
28249
27484
  };
28250
- __publicField(SQLiteBooleanBuilder, _a185, "SQLiteBooleanBuilder");
28251
- SQLiteBoolean = class extends (_b131 = SQLiteBaseInteger, _a186 = entityKind, _b131) {
27485
+ __publicField(SQLiteBooleanBuilder, _a183, "SQLiteBooleanBuilder");
27486
+ SQLiteBoolean = class extends (_b131 = SQLiteBaseInteger, _a184 = entityKind, _b131) {
28252
27487
  constructor() {
28253
27488
  super(...arguments);
28254
27489
  __publicField(this, "mode", this.config.mode);
@@ -28260,7 +27495,7 @@ var init_integer2 = __esm({
28260
27495
  return value ? 1 : 0;
28261
27496
  }
28262
27497
  };
28263
- __publicField(SQLiteBoolean, _a186, "SQLiteBoolean");
27498
+ __publicField(SQLiteBoolean, _a184, "SQLiteBoolean");
28264
27499
  }
28265
27500
  });
28266
27501
 
@@ -28268,13 +27503,13 @@ var init_integer2 = __esm({
28268
27503
  function numeric2(name2) {
28269
27504
  return new SQLiteNumericBuilder(name2 ?? "");
28270
27505
  }
28271
- var _a187, _b132, SQLiteNumericBuilder, _a188, _b133, SQLiteNumeric;
27506
+ var _a185, _b132, SQLiteNumericBuilder, _a186, _b133, SQLiteNumeric;
28272
27507
  var init_numeric2 = __esm({
28273
27508
  "../drizzle-orm/dist/sqlite-core/columns/numeric.js"() {
28274
27509
  "use strict";
28275
27510
  init_entity();
28276
27511
  init_common3();
28277
- SQLiteNumericBuilder = class extends (_b132 = SQLiteColumnBuilder, _a187 = entityKind, _b132) {
27512
+ SQLiteNumericBuilder = class extends (_b132 = SQLiteColumnBuilder, _a185 = entityKind, _b132) {
28278
27513
  constructor(name2) {
28279
27514
  super(name2, "string", "SQLiteNumeric");
28280
27515
  }
@@ -28286,13 +27521,13 @@ var init_numeric2 = __esm({
28286
27521
  );
28287
27522
  }
28288
27523
  };
28289
- __publicField(SQLiteNumericBuilder, _a187, "SQLiteNumericBuilder");
28290
- SQLiteNumeric = class extends (_b133 = SQLiteColumn, _a188 = entityKind, _b133) {
27524
+ __publicField(SQLiteNumericBuilder, _a185, "SQLiteNumericBuilder");
27525
+ SQLiteNumeric = class extends (_b133 = SQLiteColumn, _a186 = entityKind, _b133) {
28291
27526
  getSQLType() {
28292
27527
  return "numeric";
28293
27528
  }
28294
27529
  };
28295
- __publicField(SQLiteNumeric, _a188, "SQLiteNumeric");
27530
+ __publicField(SQLiteNumeric, _a186, "SQLiteNumeric");
28296
27531
  }
28297
27532
  });
28298
27533
 
@@ -28300,13 +27535,13 @@ var init_numeric2 = __esm({
28300
27535
  function real2(name2) {
28301
27536
  return new SQLiteRealBuilder(name2 ?? "");
28302
27537
  }
28303
- var _a189, _b134, SQLiteRealBuilder, _a190, _b135, SQLiteReal;
27538
+ var _a187, _b134, SQLiteRealBuilder, _a188, _b135, SQLiteReal;
28304
27539
  var init_real2 = __esm({
28305
27540
  "../drizzle-orm/dist/sqlite-core/columns/real.js"() {
28306
27541
  "use strict";
28307
27542
  init_entity();
28308
27543
  init_common3();
28309
- SQLiteRealBuilder = class extends (_b134 = SQLiteColumnBuilder, _a189 = entityKind, _b134) {
27544
+ SQLiteRealBuilder = class extends (_b134 = SQLiteColumnBuilder, _a187 = entityKind, _b134) {
28310
27545
  constructor(name2) {
28311
27546
  super(name2, "number", "SQLiteReal");
28312
27547
  }
@@ -28315,13 +27550,13 @@ var init_real2 = __esm({
28315
27550
  return new SQLiteReal(table4, this.config);
28316
27551
  }
28317
27552
  };
28318
- __publicField(SQLiteRealBuilder, _a189, "SQLiteRealBuilder");
28319
- SQLiteReal = class extends (_b135 = SQLiteColumn, _a190 = entityKind, _b135) {
27553
+ __publicField(SQLiteRealBuilder, _a187, "SQLiteRealBuilder");
27554
+ SQLiteReal = class extends (_b135 = SQLiteColumn, _a188 = entityKind, _b135) {
28320
27555
  getSQLType() {
28321
27556
  return "real";
28322
27557
  }
28323
27558
  };
28324
- __publicField(SQLiteReal, _a190, "SQLiteReal");
27559
+ __publicField(SQLiteReal, _a188, "SQLiteReal");
28325
27560
  }
28326
27561
  });
28327
27562
 
@@ -28333,14 +27568,14 @@ function text2(a, b = {}) {
28333
27568
  }
28334
27569
  return new SQLiteTextBuilder(name2, config);
28335
27570
  }
28336
- var _a191, _b136, SQLiteTextBuilder, _a192, _b137, SQLiteText, _a193, _b138, SQLiteTextJsonBuilder, _a194, _b139, SQLiteTextJson;
27571
+ var _a189, _b136, SQLiteTextBuilder, _a190, _b137, SQLiteText, _a191, _b138, SQLiteTextJsonBuilder, _a192, _b139, SQLiteTextJson;
28337
27572
  var init_text2 = __esm({
28338
27573
  "../drizzle-orm/dist/sqlite-core/columns/text.js"() {
28339
27574
  "use strict";
28340
27575
  init_entity();
28341
27576
  init_utils2();
28342
27577
  init_common3();
28343
- SQLiteTextBuilder = class extends (_b136 = SQLiteColumnBuilder, _a191 = entityKind, _b136) {
27578
+ SQLiteTextBuilder = class extends (_b136 = SQLiteColumnBuilder, _a189 = entityKind, _b136) {
28344
27579
  constructor(name2, config) {
28345
27580
  super(name2, "string", "SQLiteText");
28346
27581
  this.config.enumValues = config.enum;
@@ -28351,8 +27586,8 @@ var init_text2 = __esm({
28351
27586
  return new SQLiteText(table4, this.config);
28352
27587
  }
28353
27588
  };
28354
- __publicField(SQLiteTextBuilder, _a191, "SQLiteTextBuilder");
28355
- SQLiteText = class extends (_b137 = SQLiteColumn, _a192 = entityKind, _b137) {
27589
+ __publicField(SQLiteTextBuilder, _a189, "SQLiteTextBuilder");
27590
+ SQLiteText = class extends (_b137 = SQLiteColumn, _a190 = entityKind, _b137) {
28356
27591
  constructor(table4, config) {
28357
27592
  super(table4, config);
28358
27593
  __publicField(this, "enumValues", this.config.enumValues);
@@ -28362,8 +27597,8 @@ var init_text2 = __esm({
28362
27597
  return `text${this.config.length ? `(${this.config.length})` : ""}`;
28363
27598
  }
28364
27599
  };
28365
- __publicField(SQLiteText, _a192, "SQLiteText");
28366
- SQLiteTextJsonBuilder = class extends (_b138 = SQLiteColumnBuilder, _a193 = entityKind, _b138) {
27600
+ __publicField(SQLiteText, _a190, "SQLiteText");
27601
+ SQLiteTextJsonBuilder = class extends (_b138 = SQLiteColumnBuilder, _a191 = entityKind, _b138) {
28367
27602
  constructor(name2) {
28368
27603
  super(name2, "json", "SQLiteTextJson");
28369
27604
  }
@@ -28375,8 +27610,8 @@ var init_text2 = __esm({
28375
27610
  );
28376
27611
  }
28377
27612
  };
28378
- __publicField(SQLiteTextJsonBuilder, _a193, "SQLiteTextJsonBuilder");
28379
- SQLiteTextJson = class extends (_b139 = SQLiteColumn, _a194 = entityKind, _b139) {
27613
+ __publicField(SQLiteTextJsonBuilder, _a191, "SQLiteTextJsonBuilder");
27614
+ SQLiteTextJson = class extends (_b139 = SQLiteColumn, _a192 = entityKind, _b139) {
28380
27615
  getSQLType() {
28381
27616
  return "text";
28382
27617
  }
@@ -28387,7 +27622,7 @@ var init_text2 = __esm({
28387
27622
  return JSON.stringify(value);
28388
27623
  }
28389
27624
  };
28390
- __publicField(SQLiteTextJson, _a194, "SQLiteTextJson");
27625
+ __publicField(SQLiteTextJson, _a192, "SQLiteTextJson");
28391
27626
  }
28392
27627
  });
28393
27628
 
@@ -28449,7 +27684,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
28449
27684
  }
28450
27685
  return table4;
28451
27686
  }
28452
- var InlineForeignKeys2, _a195, _b140, _c6, _d3, _e2, SQLiteTable, sqliteTable;
27687
+ var InlineForeignKeys2, _a193, _b140, _c6, _d3, _e2, SQLiteTable, sqliteTable;
28453
27688
  var init_table3 = __esm({
28454
27689
  "../drizzle-orm/dist/sqlite-core/table.js"() {
28455
27690
  "use strict";
@@ -28457,7 +27692,7 @@ var init_table3 = __esm({
28457
27692
  init_table();
28458
27693
  init_all2();
28459
27694
  InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
28460
- SQLiteTable = class extends (_e2 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a195 = Table.Symbol.ExtraConfigBuilder, _e2) {
27695
+ SQLiteTable = class extends (_e2 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a193 = Table.Symbol.ExtraConfigBuilder, _e2) {
28461
27696
  constructor() {
28462
27697
  super(...arguments);
28463
27698
  /** @internal */
@@ -28465,7 +27700,7 @@ var init_table3 = __esm({
28465
27700
  /** @internal */
28466
27701
  __publicField(this, _b140, []);
28467
27702
  /** @internal */
28468
- __publicField(this, _a195);
27703
+ __publicField(this, _a193);
28469
27704
  }
28470
27705
  };
28471
27706
  __publicField(SQLiteTable, _d3, "SQLiteTable");
@@ -28480,7 +27715,7 @@ var init_table3 = __esm({
28480
27715
  });
28481
27716
 
28482
27717
  // ../drizzle-orm/dist/sqlite-core/query-builders/delete.js
28483
- var _a196, _b141, SQLiteDeleteBase;
27718
+ var _a194, _b141, SQLiteDeleteBase;
28484
27719
  var init_delete2 = __esm({
28485
27720
  "../drizzle-orm/dist/sqlite-core/query-builders/delete.js"() {
28486
27721
  "use strict";
@@ -28488,7 +27723,7 @@ var init_delete2 = __esm({
28488
27723
  init_query_promise();
28489
27724
  init_table3();
28490
27725
  init_utils2();
28491
- SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a196 = entityKind, _b141) {
27726
+ SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a194 = entityKind, _b141) {
28492
27727
  constructor(table4, session, dialect4, withList) {
28493
27728
  super();
28494
27729
  /** @internal */
@@ -28574,12 +27809,12 @@ var init_delete2 = __esm({
28574
27809
  return this;
28575
27810
  }
28576
27811
  };
28577
- __publicField(SQLiteDeleteBase, _a196, "SQLiteDelete");
27812
+ __publicField(SQLiteDeleteBase, _a194, "SQLiteDelete");
28578
27813
  }
28579
27814
  });
28580
27815
 
28581
27816
  // ../drizzle-orm/dist/sqlite-core/query-builders/insert.js
28582
- var _a197, SQLiteInsertBuilder, _a198, _b142, SQLiteInsertBase;
27817
+ var _a195, SQLiteInsertBuilder, _a196, _b142, SQLiteInsertBase;
28583
27818
  var init_insert2 = __esm({
28584
27819
  "../drizzle-orm/dist/sqlite-core/query-builders/insert.js"() {
28585
27820
  "use strict";
@@ -28589,7 +27824,7 @@ var init_insert2 = __esm({
28589
27824
  init_table3();
28590
27825
  init_table();
28591
27826
  init_utils2();
28592
- _a197 = entityKind;
27827
+ _a195 = entityKind;
28593
27828
  SQLiteInsertBuilder = class {
28594
27829
  constructor(table4, session, dialect4, withList) {
28595
27830
  this.table = table4;
@@ -28614,8 +27849,8 @@ var init_insert2 = __esm({
28614
27849
  return new SQLiteInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList);
28615
27850
  }
28616
27851
  };
28617
- __publicField(SQLiteInsertBuilder, _a197, "SQLiteInsertBuilder");
28618
- SQLiteInsertBase = class extends (_b142 = QueryPromise, _a198 = entityKind, _b142) {
27852
+ __publicField(SQLiteInsertBuilder, _a195, "SQLiteInsertBuilder");
27853
+ SQLiteInsertBase = class extends (_b142 = QueryPromise, _a196 = entityKind, _b142) {
28619
27854
  constructor(table4, values, session, dialect4, withList) {
28620
27855
  super();
28621
27856
  /** @internal */
@@ -28742,25 +27977,25 @@ var init_insert2 = __esm({
28742
27977
  return this;
28743
27978
  }
28744
27979
  };
28745
- __publicField(SQLiteInsertBase, _a198, "SQLiteInsert");
27980
+ __publicField(SQLiteInsertBase, _a196, "SQLiteInsert");
28746
27981
  }
28747
27982
  });
28748
27983
 
28749
27984
  // ../drizzle-orm/dist/sqlite-core/view-base.js
28750
- var _a199, _b143, SQLiteViewBase;
27985
+ var _a197, _b143, SQLiteViewBase;
28751
27986
  var init_view_base2 = __esm({
28752
27987
  "../drizzle-orm/dist/sqlite-core/view-base.js"() {
28753
27988
  "use strict";
28754
27989
  init_entity();
28755
27990
  init_sql();
28756
- SQLiteViewBase = class extends (_b143 = View, _a199 = entityKind, _b143) {
27991
+ SQLiteViewBase = class extends (_b143 = View, _a197 = entityKind, _b143) {
28757
27992
  };
28758
- __publicField(SQLiteViewBase, _a199, "SQLiteViewBase");
27993
+ __publicField(SQLiteViewBase, _a197, "SQLiteViewBase");
28759
27994
  }
28760
27995
  });
28761
27996
 
28762
27997
  // ../drizzle-orm/dist/sqlite-core/dialect.js
28763
- var _a200, SQLiteDialect, _a201, _b144, SQLiteSyncDialect, _a202, _b145, SQLiteAsyncDialect;
27998
+ var _a198, SQLiteDialect, _a199, _b144, SQLiteSyncDialect, _a200, _b145, SQLiteAsyncDialect;
28764
27999
  var init_dialect2 = __esm({
28765
28000
  "../drizzle-orm/dist/sqlite-core/dialect.js"() {
28766
28001
  "use strict";
@@ -28779,7 +28014,7 @@ var init_dialect2 = __esm({
28779
28014
  init_utils2();
28780
28015
  init_view_common();
28781
28016
  init_view_base2();
28782
- _a200 = entityKind;
28017
+ _a198 = entityKind;
28783
28018
  SQLiteDialect = class {
28784
28019
  constructor(config) {
28785
28020
  /** @internal */
@@ -29291,8 +28526,8 @@ var init_dialect2 = __esm({
29291
28526
  };
29292
28527
  }
29293
28528
  };
29294
- __publicField(SQLiteDialect, _a200, "SQLiteDialect");
29295
- SQLiteSyncDialect = class extends (_b144 = SQLiteDialect, _a201 = entityKind, _b144) {
28529
+ __publicField(SQLiteDialect, _a198, "SQLiteDialect");
28530
+ SQLiteSyncDialect = class extends (_b144 = SQLiteDialect, _a199 = entityKind, _b144) {
29296
28531
  migrate(migrations, session, config) {
29297
28532
  const migrationsTable = config === void 0 ? "__drizzle_migrations" : typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations";
29298
28533
  const migrationTableCreate = sql`
@@ -29326,8 +28561,8 @@ var init_dialect2 = __esm({
29326
28561
  }
29327
28562
  }
29328
28563
  };
29329
- __publicField(SQLiteSyncDialect, _a201, "SQLiteSyncDialect");
29330
- SQLiteAsyncDialect = class extends (_b145 = SQLiteDialect, _a202 = entityKind, _b145) {
28564
+ __publicField(SQLiteSyncDialect, _a199, "SQLiteSyncDialect");
28565
+ SQLiteAsyncDialect = class extends (_b145 = SQLiteDialect, _a200 = entityKind, _b145) {
29331
28566
  async migrate(migrations, session, config) {
29332
28567
  const migrationsTable = config === void 0 ? "__drizzle_migrations" : typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations";
29333
28568
  const migrationTableCreate = sql`
@@ -29356,7 +28591,7 @@ var init_dialect2 = __esm({
29356
28591
  });
29357
28592
  }
29358
28593
  };
29359
- __publicField(SQLiteAsyncDialect, _a202, "SQLiteAsyncDialect");
28594
+ __publicField(SQLiteAsyncDialect, _a200, "SQLiteAsyncDialect");
29360
28595
  }
29361
28596
  });
29362
28597
 
@@ -29378,7 +28613,7 @@ function createSetOperator2(type, isAll) {
29378
28613
  return leftSelect.addSetOperators(setOperators);
29379
28614
  };
29380
28615
  }
29381
- var _a203, SQLiteSelectBuilder, _a204, _b146, SQLiteSelectQueryBuilderBase, _a205, _b147, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
28616
+ var _a201, SQLiteSelectBuilder, _a202, _b146, SQLiteSelectQueryBuilderBase, _a203, _b147, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
29382
28617
  var init_select3 = __esm({
29383
28618
  "../drizzle-orm/dist/sqlite-core/query-builders/select.js"() {
29384
28619
  "use strict";
@@ -29392,7 +28627,7 @@ var init_select3 = __esm({
29392
28627
  init_utils2();
29393
28628
  init_view_common();
29394
28629
  init_view_base2();
29395
- _a203 = entityKind;
28630
+ _a201 = entityKind;
29396
28631
  SQLiteSelectBuilder = class {
29397
28632
  constructor(config) {
29398
28633
  __publicField(this, "fields");
@@ -29433,8 +28668,8 @@ var init_select3 = __esm({
29433
28668
  });
29434
28669
  }
29435
28670
  };
29436
- __publicField(SQLiteSelectBuilder, _a203, "SQLiteSelectBuilder");
29437
- SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a204 = entityKind, _b146) {
28671
+ __publicField(SQLiteSelectBuilder, _a201, "SQLiteSelectBuilder");
28672
+ SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a202 = entityKind, _b146) {
29438
28673
  constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
29439
28674
  super();
29440
28675
  __publicField(this, "_");
@@ -29939,8 +29174,8 @@ var init_select3 = __esm({
29939
29174
  return this;
29940
29175
  }
29941
29176
  };
29942
- __publicField(SQLiteSelectQueryBuilderBase, _a204, "SQLiteSelectQueryBuilder");
29943
- SQLiteSelectBase = class extends (_b147 = SQLiteSelectQueryBuilderBase, _a205 = entityKind, _b147) {
29177
+ __publicField(SQLiteSelectQueryBuilderBase, _a202, "SQLiteSelectQueryBuilder");
29178
+ SQLiteSelectBase = class extends (_b147 = SQLiteSelectQueryBuilderBase, _a203 = entityKind, _b147) {
29944
29179
  constructor() {
29945
29180
  super(...arguments);
29946
29181
  __publicField(this, "run", (placeholderValues) => {
@@ -29978,7 +29213,7 @@ var init_select3 = __esm({
29978
29213
  return this.all();
29979
29214
  }
29980
29215
  };
29981
- __publicField(SQLiteSelectBase, _a205, "SQLiteSelect");
29216
+ __publicField(SQLiteSelectBase, _a203, "SQLiteSelect");
29982
29217
  applyMixins(SQLiteSelectBase, [QueryPromise]);
29983
29218
  getSQLiteSetOperators = () => ({
29984
29219
  union: union2,
@@ -29994,7 +29229,7 @@ var init_select3 = __esm({
29994
29229
  });
29995
29230
 
29996
29231
  // ../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js
29997
- var _a206, QueryBuilder2;
29232
+ var _a204, QueryBuilder2;
29998
29233
  var init_query_builder3 = __esm({
29999
29234
  "../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js"() {
30000
29235
  "use strict";
@@ -30003,7 +29238,7 @@ var init_query_builder3 = __esm({
30003
29238
  init_dialect2();
30004
29239
  init_subquery();
30005
29240
  init_select3();
30006
- _a206 = entityKind;
29241
+ _a204 = entityKind;
30007
29242
  QueryBuilder2 = class {
30008
29243
  constructor(dialect4) {
30009
29244
  __publicField(this, "dialect");
@@ -30065,7 +29300,7 @@ var init_query_builder3 = __esm({
30065
29300
  return this.dialect;
30066
29301
  }
30067
29302
  };
30068
- __publicField(QueryBuilder2, _a206, "SQLiteQueryBuilder");
29303
+ __publicField(QueryBuilder2, _a204, "SQLiteQueryBuilder");
30069
29304
  }
30070
29305
  });
30071
29306
 
@@ -30077,7 +29312,7 @@ var init_select_types2 = __esm({
30077
29312
  });
30078
29313
 
30079
29314
  // ../drizzle-orm/dist/sqlite-core/query-builders/update.js
30080
- var _a207, SQLiteUpdateBuilder, _a208, _b148, SQLiteUpdateBase;
29315
+ var _a205, SQLiteUpdateBuilder, _a206, _b148, SQLiteUpdateBase;
30081
29316
  var init_update2 = __esm({
30082
29317
  "../drizzle-orm/dist/sqlite-core/query-builders/update.js"() {
30083
29318
  "use strict";
@@ -30085,7 +29320,7 @@ var init_update2 = __esm({
30085
29320
  init_query_promise();
30086
29321
  init_table3();
30087
29322
  init_utils2();
30088
- _a207 = entityKind;
29323
+ _a205 = entityKind;
30089
29324
  SQLiteUpdateBuilder = class {
30090
29325
  constructor(table4, session, dialect4, withList) {
30091
29326
  this.table = table4;
@@ -30103,8 +29338,8 @@ var init_update2 = __esm({
30103
29338
  );
30104
29339
  }
30105
29340
  };
30106
- __publicField(SQLiteUpdateBuilder, _a207, "SQLiteUpdateBuilder");
30107
- SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a208 = entityKind, _b148) {
29341
+ __publicField(SQLiteUpdateBuilder, _a205, "SQLiteUpdateBuilder");
29342
+ SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a206 = entityKind, _b148) {
30108
29343
  constructor(table4, set, session, dialect4, withList) {
30109
29344
  super();
30110
29345
  /** @internal */
@@ -30193,7 +29428,7 @@ var init_update2 = __esm({
30193
29428
  return this;
30194
29429
  }
30195
29430
  };
30196
- __publicField(SQLiteUpdateBase, _a208, "SQLiteUpdate");
29431
+ __publicField(SQLiteUpdateBase, _a206, "SQLiteUpdate");
30197
29432
  }
30198
29433
  });
30199
29434
 
@@ -30211,17 +29446,17 @@ var init_query_builders2 = __esm({
30211
29446
  });
30212
29447
 
30213
29448
  // ../drizzle-orm/dist/sqlite-core/query-builders/count.js
30214
- var _a209, _b149, _c7, _SQLiteCountBuilder, SQLiteCountBuilder;
29449
+ var _a207, _b149, _c7, _SQLiteCountBuilder, SQLiteCountBuilder;
30215
29450
  var init_count2 = __esm({
30216
29451
  "../drizzle-orm/dist/sqlite-core/query-builders/count.js"() {
30217
29452
  "use strict";
30218
29453
  init_entity();
30219
29454
  init_sql();
30220
- _SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c7 = SQL, _b149 = entityKind, _a209 = Symbol.toStringTag, _c7) {
29455
+ _SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c7 = SQL, _b149 = entityKind, _a207 = Symbol.toStringTag, _c7) {
30221
29456
  constructor(params) {
30222
29457
  super(_SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
30223
29458
  __publicField(this, "sql");
30224
- __publicField(this, _a209, "SQLiteCountBuilderAsync");
29459
+ __publicField(this, _a207, "SQLiteCountBuilderAsync");
30225
29460
  __publicField(this, "session");
30226
29461
  this.params = params;
30227
29462
  this.session = params.session;
@@ -30264,14 +29499,14 @@ var init_count2 = __esm({
30264
29499
  });
30265
29500
 
30266
29501
  // ../drizzle-orm/dist/sqlite-core/query-builders/query.js
30267
- var _a210, RelationalQueryBuilder2, _a211, _b150, SQLiteRelationalQuery, _a212, _b151, SQLiteSyncRelationalQuery;
29502
+ var _a208, RelationalQueryBuilder2, _a209, _b150, SQLiteRelationalQuery, _a210, _b151, SQLiteSyncRelationalQuery;
30268
29503
  var init_query2 = __esm({
30269
29504
  "../drizzle-orm/dist/sqlite-core/query-builders/query.js"() {
30270
29505
  "use strict";
30271
29506
  init_entity();
30272
29507
  init_query_promise();
30273
29508
  init_relations();
30274
- _a210 = entityKind;
29509
+ _a208 = entityKind;
30275
29510
  RelationalQueryBuilder2 = class {
30276
29511
  constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
30277
29512
  this.mode = mode;
@@ -30330,8 +29565,8 @@ var init_query2 = __esm({
30330
29565
  );
30331
29566
  }
30332
29567
  };
30333
- __publicField(RelationalQueryBuilder2, _a210, "SQLiteAsyncRelationalQueryBuilder");
30334
- SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a211 = entityKind, _b150) {
29568
+ __publicField(RelationalQueryBuilder2, _a208, "SQLiteAsyncRelationalQueryBuilder");
29569
+ SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a209 = entityKind, _b150) {
30335
29570
  constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
30336
29571
  super();
30337
29572
  /** @internal */
@@ -30407,24 +29642,24 @@ var init_query2 = __esm({
30407
29642
  return this.executeRaw();
30408
29643
  }
30409
29644
  };
30410
- __publicField(SQLiteRelationalQuery, _a211, "SQLiteAsyncRelationalQuery");
30411
- SQLiteSyncRelationalQuery = class extends (_b151 = SQLiteRelationalQuery, _a212 = entityKind, _b151) {
29645
+ __publicField(SQLiteRelationalQuery, _a209, "SQLiteAsyncRelationalQuery");
29646
+ SQLiteSyncRelationalQuery = class extends (_b151 = SQLiteRelationalQuery, _a210 = entityKind, _b151) {
30412
29647
  sync() {
30413
29648
  return this.executeRaw();
30414
29649
  }
30415
29650
  };
30416
- __publicField(SQLiteSyncRelationalQuery, _a212, "SQLiteSyncRelationalQuery");
29651
+ __publicField(SQLiteSyncRelationalQuery, _a210, "SQLiteSyncRelationalQuery");
30417
29652
  }
30418
29653
  });
30419
29654
 
30420
29655
  // ../drizzle-orm/dist/sqlite-core/query-builders/raw.js
30421
- var _a213, _b152, SQLiteRaw;
29656
+ var _a211, _b152, SQLiteRaw;
30422
29657
  var init_raw2 = __esm({
30423
29658
  "../drizzle-orm/dist/sqlite-core/query-builders/raw.js"() {
30424
29659
  "use strict";
30425
29660
  init_entity();
30426
29661
  init_query_promise();
30427
- SQLiteRaw = class extends (_b152 = QueryPromise, _a213 = entityKind, _b152) {
29662
+ SQLiteRaw = class extends (_b152 = QueryPromise, _a211 = entityKind, _b152) {
30428
29663
  constructor(execute, getSQL, action, dialect4, mapBatchResult) {
30429
29664
  super();
30430
29665
  /** @internal */
@@ -30449,12 +29684,12 @@ var init_raw2 = __esm({
30449
29684
  return false;
30450
29685
  }
30451
29686
  };
30452
- __publicField(SQLiteRaw, _a213, "SQLiteRaw");
29687
+ __publicField(SQLiteRaw, _a211, "SQLiteRaw");
30453
29688
  }
30454
29689
  });
30455
29690
 
30456
29691
  // ../drizzle-orm/dist/sqlite-core/db.js
30457
- var _a214, BaseSQLiteDatabase;
29692
+ var _a212, BaseSQLiteDatabase;
30458
29693
  var init_db2 = __esm({
30459
29694
  "../drizzle-orm/dist/sqlite-core/db.js"() {
30460
29695
  "use strict";
@@ -30466,7 +29701,7 @@ var init_db2 = __esm({
30466
29701
  init_count2();
30467
29702
  init_query2();
30468
29703
  init_raw2();
30469
- _a214 = entityKind;
29704
+ _a212 = entityKind;
30470
29705
  BaseSQLiteDatabase = class {
30471
29706
  constructor(resultKind, dialect4, session, schema4) {
30472
29707
  __publicField(this, "query");
@@ -30748,17 +29983,17 @@ var init_db2 = __esm({
30748
29983
  return this.session.transaction(transaction, config);
30749
29984
  }
30750
29985
  };
30751
- __publicField(BaseSQLiteDatabase, _a214, "BaseSQLiteDatabase");
29986
+ __publicField(BaseSQLiteDatabase, _a212, "BaseSQLiteDatabase");
30752
29987
  }
30753
29988
  });
30754
29989
 
30755
29990
  // ../drizzle-orm/dist/sqlite-core/indexes.js
30756
- var _a215, IndexBuilderOn2, _a216, IndexBuilder2, _a217, Index4;
29991
+ var _a213, IndexBuilderOn2, _a214, IndexBuilder2, _a215, Index4;
30757
29992
  var init_indexes2 = __esm({
30758
29993
  "../drizzle-orm/dist/sqlite-core/indexes.js"() {
30759
29994
  "use strict";
30760
29995
  init_entity();
30761
- _a215 = entityKind;
29996
+ _a213 = entityKind;
30762
29997
  IndexBuilderOn2 = class {
30763
29998
  constructor(name2, unique) {
30764
29999
  this.name = name2;
@@ -30768,8 +30003,8 @@ var init_indexes2 = __esm({
30768
30003
  return new IndexBuilder2(this.name, columns, this.unique);
30769
30004
  }
30770
30005
  };
30771
- __publicField(IndexBuilderOn2, _a215, "SQLiteIndexBuilderOn");
30772
- _a216 = entityKind;
30006
+ __publicField(IndexBuilderOn2, _a213, "SQLiteIndexBuilderOn");
30007
+ _a214 = entityKind;
30773
30008
  IndexBuilder2 = class {
30774
30009
  constructor(name2, columns, unique) {
30775
30010
  /** @internal */
@@ -30793,26 +30028,26 @@ var init_indexes2 = __esm({
30793
30028
  return new Index4(this.config, table4);
30794
30029
  }
30795
30030
  };
30796
- __publicField(IndexBuilder2, _a216, "SQLiteIndexBuilder");
30797
- _a217 = entityKind;
30031
+ __publicField(IndexBuilder2, _a214, "SQLiteIndexBuilder");
30032
+ _a215 = entityKind;
30798
30033
  Index4 = class {
30799
30034
  constructor(config, table4) {
30800
30035
  __publicField(this, "config");
30801
30036
  this.config = { ...config, table: table4 };
30802
30037
  }
30803
30038
  };
30804
- __publicField(Index4, _a217, "SQLiteIndex");
30039
+ __publicField(Index4, _a215, "SQLiteIndex");
30805
30040
  }
30806
30041
  });
30807
30042
 
30808
30043
  // ../drizzle-orm/dist/sqlite-core/primary-keys.js
30809
- var _a218, PrimaryKeyBuilder2, _a219, PrimaryKey2;
30044
+ var _a216, PrimaryKeyBuilder2, _a217, PrimaryKey2;
30810
30045
  var init_primary_keys2 = __esm({
30811
30046
  "../drizzle-orm/dist/sqlite-core/primary-keys.js"() {
30812
30047
  "use strict";
30813
30048
  init_entity();
30814
30049
  init_table3();
30815
- _a218 = entityKind;
30050
+ _a216 = entityKind;
30816
30051
  PrimaryKeyBuilder2 = class {
30817
30052
  constructor(columns, name2) {
30818
30053
  /** @internal */
@@ -30827,8 +30062,8 @@ var init_primary_keys2 = __esm({
30827
30062
  return new PrimaryKey2(table4, this.columns, this.name);
30828
30063
  }
30829
30064
  };
30830
- __publicField(PrimaryKeyBuilder2, _a218, "SQLitePrimaryKeyBuilder");
30831
- _a219 = entityKind;
30065
+ __publicField(PrimaryKeyBuilder2, _a216, "SQLitePrimaryKeyBuilder");
30066
+ _a217 = entityKind;
30832
30067
  PrimaryKey2 = class {
30833
30068
  constructor(table4, columns, name2) {
30834
30069
  __publicField(this, "columns");
@@ -30841,12 +30076,12 @@ var init_primary_keys2 = __esm({
30841
30076
  return this.name ?? `${this.table[SQLiteTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
30842
30077
  }
30843
30078
  };
30844
- __publicField(PrimaryKey2, _a219, "SQLitePrimaryKey");
30079
+ __publicField(PrimaryKey2, _a217, "SQLitePrimaryKey");
30845
30080
  }
30846
30081
  });
30847
30082
 
30848
30083
  // ../drizzle-orm/dist/sqlite-core/session.js
30849
- var _a220, _b153, ExecuteResultSync, _a221, SQLitePreparedQuery, _a222, SQLiteSession, _a223, _b154, SQLiteTransaction;
30084
+ var _a218, _b153, ExecuteResultSync, _a219, SQLitePreparedQuery, _a220, SQLiteSession, _a221, _b154, SQLiteTransaction;
30850
30085
  var init_session2 = __esm({
30851
30086
  "../drizzle-orm/dist/sqlite-core/session.js"() {
30852
30087
  "use strict";
@@ -30854,7 +30089,7 @@ var init_session2 = __esm({
30854
30089
  init_errors();
30855
30090
  init_query_promise();
30856
30091
  init_db2();
30857
- ExecuteResultSync = class extends (_b153 = QueryPromise, _a220 = entityKind, _b153) {
30092
+ ExecuteResultSync = class extends (_b153 = QueryPromise, _a218 = entityKind, _b153) {
30858
30093
  constructor(resultCb) {
30859
30094
  super();
30860
30095
  this.resultCb = resultCb;
@@ -30866,8 +30101,8 @@ var init_session2 = __esm({
30866
30101
  return this.resultCb();
30867
30102
  }
30868
30103
  };
30869
- __publicField(ExecuteResultSync, _a220, "ExecuteResultSync");
30870
- _a221 = entityKind;
30104
+ __publicField(ExecuteResultSync, _a218, "ExecuteResultSync");
30105
+ _a219 = entityKind;
30871
30106
  SQLitePreparedQuery = class {
30872
30107
  constructor(mode, executeMethod, query) {
30873
30108
  /** @internal */
@@ -30908,8 +30143,8 @@ var init_session2 = __esm({
30908
30143
  }
30909
30144
  }
30910
30145
  };
30911
- __publicField(SQLitePreparedQuery, _a221, "PreparedQuery");
30912
- _a222 = entityKind;
30146
+ __publicField(SQLitePreparedQuery, _a219, "PreparedQuery");
30147
+ _a220 = entityKind;
30913
30148
  SQLiteSession = class {
30914
30149
  constructor(dialect4) {
30915
30150
  this.dialect = dialect4;
@@ -30955,8 +30190,8 @@ var init_session2 = __esm({
30955
30190
  throw new Error("Not implemented");
30956
30191
  }
30957
30192
  };
30958
- __publicField(SQLiteSession, _a222, "SQLiteSession");
30959
- SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a223 = entityKind, _b154) {
30193
+ __publicField(SQLiteSession, _a220, "SQLiteSession");
30194
+ SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a221 = entityKind, _b154) {
30960
30195
  constructor(resultType, dialect4, session, schema4, nestedIndex = 0) {
30961
30196
  super(resultType, dialect4, session, schema4);
30962
30197
  this.schema = schema4;
@@ -30966,7 +30201,7 @@ var init_session2 = __esm({
30966
30201
  throw new TransactionRollbackError();
30967
30202
  }
30968
30203
  };
30969
- __publicField(SQLiteTransaction, _a223, "SQLiteTransaction");
30204
+ __publicField(SQLiteTransaction, _a221, "SQLiteTransaction");
30970
30205
  }
30971
30206
  });
30972
30207
 
@@ -31037,7 +30272,7 @@ var init_utils6 = __esm({
31037
30272
  });
31038
30273
 
31039
30274
  // ../drizzle-orm/dist/sqlite-core/view.js
31040
- var _a224, ViewBuilderCore, _a225, _b155, ViewBuilder2, _a226, _b156, ManualViewBuilder2, _a227, _b157, _c8, SQLiteView;
30275
+ var _a222, ViewBuilderCore, _a223, _b155, ViewBuilder2, _a224, _b156, ManualViewBuilder2, _a225, _b157, _c8, SQLiteView;
31041
30276
  var init_view2 = __esm({
31042
30277
  "../drizzle-orm/dist/sqlite-core/view.js"() {
31043
30278
  "use strict";
@@ -31048,15 +30283,15 @@ var init_view2 = __esm({
31048
30283
  init_table3();
31049
30284
  init_view_base2();
31050
30285
  init_view_common3();
31051
- _a224 = entityKind;
30286
+ _a222 = entityKind;
31052
30287
  ViewBuilderCore = class {
31053
30288
  constructor(name2) {
31054
30289
  __publicField(this, "config", {});
31055
30290
  this.name = name2;
31056
30291
  }
31057
30292
  };
31058
- __publicField(ViewBuilderCore, _a224, "SQLiteViewBuilderCore");
31059
- ViewBuilder2 = class extends (_b155 = ViewBuilderCore, _a225 = entityKind, _b155) {
30293
+ __publicField(ViewBuilderCore, _a222, "SQLiteViewBuilderCore");
30294
+ ViewBuilder2 = class extends (_b155 = ViewBuilderCore, _a223 = entityKind, _b155) {
31060
30295
  as(qb) {
31061
30296
  if (typeof qb === "function") {
31062
30297
  qb = qb(new QueryBuilder2());
@@ -31082,8 +30317,8 @@ var init_view2 = __esm({
31082
30317
  );
31083
30318
  }
31084
30319
  };
31085
- __publicField(ViewBuilder2, _a225, "SQLiteViewBuilder");
31086
- ManualViewBuilder2 = class extends (_b156 = ViewBuilderCore, _a226 = entityKind, _b156) {
30320
+ __publicField(ViewBuilder2, _a223, "SQLiteViewBuilder");
30321
+ ManualViewBuilder2 = class extends (_b156 = ViewBuilderCore, _a224 = entityKind, _b156) {
31087
30322
  constructor(name2, columns) {
31088
30323
  super(name2);
31089
30324
  __publicField(this, "columns");
@@ -31128,12 +30363,12 @@ var init_view2 = __esm({
31128
30363
  );
31129
30364
  }
31130
30365
  };
31131
- __publicField(ManualViewBuilder2, _a226, "SQLiteManualViewBuilder");
31132
- SQLiteView = class extends (_c8 = SQLiteViewBase, _b157 = entityKind, _a227 = SQLiteViewConfig, _c8) {
30366
+ __publicField(ManualViewBuilder2, _a224, "SQLiteManualViewBuilder");
30367
+ SQLiteView = class extends (_c8 = SQLiteViewBase, _b157 = entityKind, _a225 = SQLiteViewConfig, _c8) {
31133
30368
  constructor({ sqliteConfig, config }) {
31134
30369
  super(config);
31135
30370
  /** @internal */
31136
- __publicField(this, _a227);
30371
+ __publicField(this, _a225);
31137
30372
  this[SQLiteViewConfig] = sqliteConfig;
31138
30373
  }
31139
30374
  };
@@ -31670,12 +30905,12 @@ var init_alias4 = __esm({
31670
30905
  });
31671
30906
 
31672
30907
  // ../drizzle-orm/dist/mysql-core/checks.js
31673
- var _a228, CheckBuilder3, _a229, Check3;
30908
+ var _a226, CheckBuilder3, _a227, Check3;
31674
30909
  var init_checks3 = __esm({
31675
30910
  "../drizzle-orm/dist/mysql-core/checks.js"() {
31676
30911
  "use strict";
31677
30912
  init_entity();
31678
- _a228 = entityKind;
30913
+ _a226 = entityKind;
31679
30914
  CheckBuilder3 = class {
31680
30915
  constructor(name2, value) {
31681
30916
  __publicField(this, "brand");
@@ -31687,8 +30922,8 @@ var init_checks3 = __esm({
31687
30922
  return new Check3(table4, this);
31688
30923
  }
31689
30924
  };
31690
- __publicField(CheckBuilder3, _a228, "MySqlCheckBuilder");
31691
- _a229 = entityKind;
30925
+ __publicField(CheckBuilder3, _a226, "MySqlCheckBuilder");
30926
+ _a227 = entityKind;
31692
30927
  Check3 = class {
31693
30928
  constructor(table4, builder) {
31694
30929
  __publicField(this, "name");
@@ -31698,18 +30933,18 @@ var init_checks3 = __esm({
31698
30933
  this.value = builder.value;
31699
30934
  }
31700
30935
  };
31701
- __publicField(Check3, _a229, "MySqlCheck");
30936
+ __publicField(Check3, _a227, "MySqlCheck");
31702
30937
  }
31703
30938
  });
31704
30939
 
31705
30940
  // ../drizzle-orm/dist/mysql-core/foreign-keys.js
31706
- var _a230, ForeignKeyBuilder3, _a231, ForeignKey3;
30941
+ var _a228, ForeignKeyBuilder3, _a229, ForeignKey3;
31707
30942
  var init_foreign_keys3 = __esm({
31708
30943
  "../drizzle-orm/dist/mysql-core/foreign-keys.js"() {
31709
30944
  "use strict";
31710
30945
  init_entity();
31711
30946
  init_table_utils();
31712
- _a230 = entityKind;
30947
+ _a228 = entityKind;
31713
30948
  ForeignKeyBuilder3 = class {
31714
30949
  constructor(config, actions) {
31715
30950
  /** @internal */
@@ -31740,8 +30975,8 @@ var init_foreign_keys3 = __esm({
31740
30975
  return new ForeignKey3(table4, this);
31741
30976
  }
31742
30977
  };
31743
- __publicField(ForeignKeyBuilder3, _a230, "MySqlForeignKeyBuilder");
31744
- _a231 = entityKind;
30978
+ __publicField(ForeignKeyBuilder3, _a228, "MySqlForeignKeyBuilder");
30979
+ _a229 = entityKind;
31745
30980
  ForeignKey3 = class {
31746
30981
  constructor(table4, builder) {
31747
30982
  __publicField(this, "reference");
@@ -31765,7 +31000,7 @@ var init_foreign_keys3 = __esm({
31765
31000
  return name2 ?? `${chunks.join("_")}_fk`;
31766
31001
  }
31767
31002
  };
31768
- __publicField(ForeignKey3, _a231, "MySqlForeignKey");
31003
+ __publicField(ForeignKey3, _a229, "MySqlForeignKey");
31769
31004
  }
31770
31005
  });
31771
31006
 
@@ -31773,13 +31008,13 @@ var init_foreign_keys3 = __esm({
31773
31008
  function uniqueKeyName3(table4, columns) {
31774
31009
  return `${table4[TableName]}_${columns.join("_")}_unique`;
31775
31010
  }
31776
- var _a232, UniqueConstraintBuilder3, _a233, UniqueOnConstraintBuilder3, _a234, UniqueConstraint3;
31011
+ var _a230, UniqueConstraintBuilder3, _a231, UniqueOnConstraintBuilder3, _a232, UniqueConstraint3;
31777
31012
  var init_unique_constraint3 = __esm({
31778
31013
  "../drizzle-orm/dist/mysql-core/unique-constraint.js"() {
31779
31014
  "use strict";
31780
31015
  init_entity();
31781
31016
  init_table_utils();
31782
- _a232 = entityKind;
31017
+ _a230 = entityKind;
31783
31018
  UniqueConstraintBuilder3 = class {
31784
31019
  constructor(columns, name2) {
31785
31020
  /** @internal */
@@ -31792,8 +31027,8 @@ var init_unique_constraint3 = __esm({
31792
31027
  return new UniqueConstraint3(table4, this.columns, this.name);
31793
31028
  }
31794
31029
  };
31795
- __publicField(UniqueConstraintBuilder3, _a232, "MySqlUniqueConstraintBuilder");
31796
- _a233 = entityKind;
31030
+ __publicField(UniqueConstraintBuilder3, _a230, "MySqlUniqueConstraintBuilder");
31031
+ _a231 = entityKind;
31797
31032
  UniqueOnConstraintBuilder3 = class {
31798
31033
  constructor(name2) {
31799
31034
  /** @internal */
@@ -31804,8 +31039,8 @@ var init_unique_constraint3 = __esm({
31804
31039
  return new UniqueConstraintBuilder3(columns, this.name);
31805
31040
  }
31806
31041
  };
31807
- __publicField(UniqueOnConstraintBuilder3, _a233, "MySqlUniqueOnConstraintBuilder");
31808
- _a234 = entityKind;
31042
+ __publicField(UniqueOnConstraintBuilder3, _a231, "MySqlUniqueOnConstraintBuilder");
31043
+ _a232 = entityKind;
31809
31044
  UniqueConstraint3 = class {
31810
31045
  constructor(table4, columns, name2) {
31811
31046
  __publicField(this, "columns");
@@ -31819,12 +31054,12 @@ var init_unique_constraint3 = __esm({
31819
31054
  return this.name;
31820
31055
  }
31821
31056
  };
31822
- __publicField(UniqueConstraint3, _a234, "MySqlUniqueConstraint");
31057
+ __publicField(UniqueConstraint3, _a232, "MySqlUniqueConstraint");
31823
31058
  }
31824
31059
  });
31825
31060
 
31826
31061
  // ../drizzle-orm/dist/mysql-core/columns/common.js
31827
- var _a235, _b158, MySqlColumnBuilder, _a236, _b159, MySqlColumn, _a237, _b160, MySqlColumnBuilderWithAutoIncrement, _a238, _b161, MySqlColumnWithAutoIncrement;
31062
+ var _a233, _b158, MySqlColumnBuilder, _a234, _b159, MySqlColumn, _a235, _b160, MySqlColumnBuilderWithAutoIncrement, _a236, _b161, MySqlColumnWithAutoIncrement;
31828
31063
  var init_common4 = __esm({
31829
31064
  "../drizzle-orm/dist/mysql-core/columns/common.js"() {
31830
31065
  "use strict";
@@ -31833,7 +31068,7 @@ var init_common4 = __esm({
31833
31068
  init_entity();
31834
31069
  init_foreign_keys3();
31835
31070
  init_unique_constraint3();
31836
- MySqlColumnBuilder = class extends (_b158 = ColumnBuilder, _a235 = entityKind, _b158) {
31071
+ MySqlColumnBuilder = class extends (_b158 = ColumnBuilder, _a233 = entityKind, _b158) {
31837
31072
  constructor() {
31838
31073
  super(...arguments);
31839
31074
  __publicField(this, "foreignKeyConfigs", []);
@@ -31874,8 +31109,8 @@ var init_common4 = __esm({
31874
31109
  });
31875
31110
  }
31876
31111
  };
31877
- __publicField(MySqlColumnBuilder, _a235, "MySqlColumnBuilder");
31878
- MySqlColumn = class extends (_b159 = Column2, _a236 = entityKind, _b159) {
31112
+ __publicField(MySqlColumnBuilder, _a233, "MySqlColumnBuilder");
31113
+ MySqlColumn = class extends (_b159 = Column2, _a234 = entityKind, _b159) {
31879
31114
  constructor(table4, config) {
31880
31115
  if (!config.uniqueName) {
31881
31116
  config.uniqueName = uniqueKeyName3(table4, [config.name]);
@@ -31884,8 +31119,8 @@ var init_common4 = __esm({
31884
31119
  this.table = table4;
31885
31120
  }
31886
31121
  };
31887
- __publicField(MySqlColumn, _a236, "MySqlColumn");
31888
- MySqlColumnBuilderWithAutoIncrement = class extends (_b160 = MySqlColumnBuilder, _a237 = entityKind, _b160) {
31122
+ __publicField(MySqlColumn, _a234, "MySqlColumn");
31123
+ MySqlColumnBuilderWithAutoIncrement = class extends (_b160 = MySqlColumnBuilder, _a235 = entityKind, _b160) {
31889
31124
  constructor(name2, dataType, columnType) {
31890
31125
  super(name2, dataType, columnType);
31891
31126
  this.config.autoIncrement = false;
@@ -31896,14 +31131,14 @@ var init_common4 = __esm({
31896
31131
  return this;
31897
31132
  }
31898
31133
  };
31899
- __publicField(MySqlColumnBuilderWithAutoIncrement, _a237, "MySqlColumnBuilderWithAutoIncrement");
31900
- MySqlColumnWithAutoIncrement = class extends (_b161 = MySqlColumn, _a238 = entityKind, _b161) {
31134
+ __publicField(MySqlColumnBuilderWithAutoIncrement, _a235, "MySqlColumnBuilderWithAutoIncrement");
31135
+ MySqlColumnWithAutoIncrement = class extends (_b161 = MySqlColumn, _a236 = entityKind, _b161) {
31901
31136
  constructor() {
31902
31137
  super(...arguments);
31903
31138
  __publicField(this, "autoIncrement", this.config.autoIncrement);
31904
31139
  }
31905
31140
  };
31906
- __publicField(MySqlColumnWithAutoIncrement, _a238, "MySqlColumnWithAutoIncrement");
31141
+ __publicField(MySqlColumnWithAutoIncrement, _a236, "MySqlColumnWithAutoIncrement");
31907
31142
  }
31908
31143
  });
31909
31144
 
@@ -31915,14 +31150,14 @@ function bigint2(a, b) {
31915
31150
  }
31916
31151
  return new MySqlBigInt64Builder(name2, config.unsigned);
31917
31152
  }
31918
- var _a239, _b162, MySqlBigInt53Builder, _a240, _b163, MySqlBigInt53, _a241, _b164, MySqlBigInt64Builder, _a242, _b165, MySqlBigInt64;
31153
+ var _a237, _b162, MySqlBigInt53Builder, _a238, _b163, MySqlBigInt53, _a239, _b164, MySqlBigInt64Builder, _a240, _b165, MySqlBigInt64;
31919
31154
  var init_bigint2 = __esm({
31920
31155
  "../drizzle-orm/dist/mysql-core/columns/bigint.js"() {
31921
31156
  "use strict";
31922
31157
  init_entity();
31923
31158
  init_utils2();
31924
31159
  init_common4();
31925
- MySqlBigInt53Builder = class extends (_b162 = MySqlColumnBuilderWithAutoIncrement, _a239 = entityKind, _b162) {
31160
+ MySqlBigInt53Builder = class extends (_b162 = MySqlColumnBuilderWithAutoIncrement, _a237 = entityKind, _b162) {
31926
31161
  constructor(name2, unsigned = false) {
31927
31162
  super(name2, "number", "MySqlBigInt53");
31928
31163
  this.config.unsigned = unsigned;
@@ -31935,8 +31170,8 @@ var init_bigint2 = __esm({
31935
31170
  );
31936
31171
  }
31937
31172
  };
31938
- __publicField(MySqlBigInt53Builder, _a239, "MySqlBigInt53Builder");
31939
- MySqlBigInt53 = class extends (_b163 = MySqlColumnWithAutoIncrement, _a240 = entityKind, _b163) {
31173
+ __publicField(MySqlBigInt53Builder, _a237, "MySqlBigInt53Builder");
31174
+ MySqlBigInt53 = class extends (_b163 = MySqlColumnWithAutoIncrement, _a238 = entityKind, _b163) {
31940
31175
  getSQLType() {
31941
31176
  return `bigint${this.config.unsigned ? " unsigned" : ""}`;
31942
31177
  }
@@ -31947,8 +31182,8 @@ var init_bigint2 = __esm({
31947
31182
  return Number(value);
31948
31183
  }
31949
31184
  };
31950
- __publicField(MySqlBigInt53, _a240, "MySqlBigInt53");
31951
- MySqlBigInt64Builder = class extends (_b164 = MySqlColumnBuilderWithAutoIncrement, _a241 = entityKind, _b164) {
31185
+ __publicField(MySqlBigInt53, _a238, "MySqlBigInt53");
31186
+ MySqlBigInt64Builder = class extends (_b164 = MySqlColumnBuilderWithAutoIncrement, _a239 = entityKind, _b164) {
31952
31187
  constructor(name2, unsigned = false) {
31953
31188
  super(name2, "bigint", "MySqlBigInt64");
31954
31189
  this.config.unsigned = unsigned;
@@ -31961,8 +31196,8 @@ var init_bigint2 = __esm({
31961
31196
  );
31962
31197
  }
31963
31198
  };
31964
- __publicField(MySqlBigInt64Builder, _a241, "MySqlBigInt64Builder");
31965
- MySqlBigInt64 = class extends (_b165 = MySqlColumnWithAutoIncrement, _a242 = entityKind, _b165) {
31199
+ __publicField(MySqlBigInt64Builder, _a239, "MySqlBigInt64Builder");
31200
+ MySqlBigInt64 = class extends (_b165 = MySqlColumnWithAutoIncrement, _a240 = entityKind, _b165) {
31966
31201
  getSQLType() {
31967
31202
  return `bigint${this.config.unsigned ? " unsigned" : ""}`;
31968
31203
  }
@@ -31971,7 +31206,7 @@ var init_bigint2 = __esm({
31971
31206
  return BigInt(value);
31972
31207
  }
31973
31208
  };
31974
- __publicField(MySqlBigInt64, _a242, "MySqlBigInt64");
31209
+ __publicField(MySqlBigInt64, _a240, "MySqlBigInt64");
31975
31210
  }
31976
31211
  });
31977
31212
 
@@ -31980,14 +31215,14 @@ function binary(a, b = {}) {
31980
31215
  const { name: name2, config } = getColumnNameAndConfig(a, b);
31981
31216
  return new MySqlBinaryBuilder(name2, config.length);
31982
31217
  }
31983
- var _a243, _b166, MySqlBinaryBuilder, _a244, _b167, MySqlBinary;
31218
+ var _a241, _b166, MySqlBinaryBuilder, _a242, _b167, MySqlBinary;
31984
31219
  var init_binary = __esm({
31985
31220
  "../drizzle-orm/dist/mysql-core/columns/binary.js"() {
31986
31221
  "use strict";
31987
31222
  init_entity();
31988
31223
  init_utils2();
31989
31224
  init_common4();
31990
- MySqlBinaryBuilder = class extends (_b166 = MySqlColumnBuilder, _a243 = entityKind, _b166) {
31225
+ MySqlBinaryBuilder = class extends (_b166 = MySqlColumnBuilder, _a241 = entityKind, _b166) {
31991
31226
  constructor(name2, length) {
31992
31227
  super(name2, "string", "MySqlBinary");
31993
31228
  this.config.length = length;
@@ -31997,8 +31232,8 @@ var init_binary = __esm({
31997
31232
  return new MySqlBinary(table4, this.config);
31998
31233
  }
31999
31234
  };
32000
- __publicField(MySqlBinaryBuilder, _a243, "MySqlBinaryBuilder");
32001
- MySqlBinary = class extends (_b167 = MySqlColumn, _a244 = entityKind, _b167) {
31235
+ __publicField(MySqlBinaryBuilder, _a241, "MySqlBinaryBuilder");
31236
+ MySqlBinary = class extends (_b167 = MySqlColumn, _a242 = entityKind, _b167) {
32002
31237
  constructor() {
32003
31238
  super(...arguments);
32004
31239
  __publicField(this, "length", this.config.length);
@@ -32007,7 +31242,7 @@ var init_binary = __esm({
32007
31242
  return this.length === void 0 ? `binary` : `binary(${this.length})`;
32008
31243
  }
32009
31244
  };
32010
- __publicField(MySqlBinary, _a244, "MySqlBinary");
31245
+ __publicField(MySqlBinary, _a242, "MySqlBinary");
32011
31246
  }
32012
31247
  });
32013
31248
 
@@ -32015,13 +31250,13 @@ var init_binary = __esm({
32015
31250
  function boolean2(name2) {
32016
31251
  return new MySqlBooleanBuilder(name2 ?? "");
32017
31252
  }
32018
- var _a245, _b168, MySqlBooleanBuilder, _a246, _b169, MySqlBoolean;
31253
+ var _a243, _b168, MySqlBooleanBuilder, _a244, _b169, MySqlBoolean;
32019
31254
  var init_boolean2 = __esm({
32020
31255
  "../drizzle-orm/dist/mysql-core/columns/boolean.js"() {
32021
31256
  "use strict";
32022
31257
  init_entity();
32023
31258
  init_common4();
32024
- MySqlBooleanBuilder = class extends (_b168 = MySqlColumnBuilder, _a245 = entityKind, _b168) {
31259
+ MySqlBooleanBuilder = class extends (_b168 = MySqlColumnBuilder, _a243 = entityKind, _b168) {
32025
31260
  constructor(name2) {
32026
31261
  super(name2, "boolean", "MySqlBoolean");
32027
31262
  }
@@ -32033,8 +31268,8 @@ var init_boolean2 = __esm({
32033
31268
  );
32034
31269
  }
32035
31270
  };
32036
- __publicField(MySqlBooleanBuilder, _a245, "MySqlBooleanBuilder");
32037
- MySqlBoolean = class extends (_b169 = MySqlColumn, _a246 = entityKind, _b169) {
31271
+ __publicField(MySqlBooleanBuilder, _a243, "MySqlBooleanBuilder");
31272
+ MySqlBoolean = class extends (_b169 = MySqlColumn, _a244 = entityKind, _b169) {
32038
31273
  getSQLType() {
32039
31274
  return "boolean";
32040
31275
  }
@@ -32045,7 +31280,7 @@ var init_boolean2 = __esm({
32045
31280
  return value === 1;
32046
31281
  }
32047
31282
  };
32048
- __publicField(MySqlBoolean, _a246, "MySqlBoolean");
31283
+ __publicField(MySqlBoolean, _a244, "MySqlBoolean");
32049
31284
  }
32050
31285
  });
32051
31286
 
@@ -32054,14 +31289,14 @@ function char2(a, b = {}) {
32054
31289
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32055
31290
  return new MySqlCharBuilder(name2, config);
32056
31291
  }
32057
- var _a247, _b170, MySqlCharBuilder, _a248, _b171, MySqlChar;
31292
+ var _a245, _b170, MySqlCharBuilder, _a246, _b171, MySqlChar;
32058
31293
  var init_char2 = __esm({
32059
31294
  "../drizzle-orm/dist/mysql-core/columns/char.js"() {
32060
31295
  "use strict";
32061
31296
  init_entity();
32062
31297
  init_utils2();
32063
31298
  init_common4();
32064
- MySqlCharBuilder = class extends (_b170 = MySqlColumnBuilder, _a247 = entityKind, _b170) {
31299
+ MySqlCharBuilder = class extends (_b170 = MySqlColumnBuilder, _a245 = entityKind, _b170) {
32065
31300
  constructor(name2, config) {
32066
31301
  super(name2, "string", "MySqlChar");
32067
31302
  this.config.length = config.length;
@@ -32075,8 +31310,8 @@ var init_char2 = __esm({
32075
31310
  );
32076
31311
  }
32077
31312
  };
32078
- __publicField(MySqlCharBuilder, _a247, "MySqlCharBuilder");
32079
- MySqlChar = class extends (_b171 = MySqlColumn, _a248 = entityKind, _b171) {
31313
+ __publicField(MySqlCharBuilder, _a245, "MySqlCharBuilder");
31314
+ MySqlChar = class extends (_b171 = MySqlColumn, _a246 = entityKind, _b171) {
32080
31315
  constructor() {
32081
31316
  super(...arguments);
32082
31317
  __publicField(this, "length", this.config.length);
@@ -32086,7 +31321,7 @@ var init_char2 = __esm({
32086
31321
  return this.length === void 0 ? `char` : `char(${this.length})`;
32087
31322
  }
32088
31323
  };
32089
- __publicField(MySqlChar, _a248, "MySqlChar");
31324
+ __publicField(MySqlChar, _a246, "MySqlChar");
32090
31325
  }
32091
31326
  });
32092
31327
 
@@ -32097,14 +31332,14 @@ function customType3(customTypeParams) {
32097
31332
  return new MySqlCustomColumnBuilder(name2, config, customTypeParams);
32098
31333
  };
32099
31334
  }
32100
- var _a249, _b172, MySqlCustomColumnBuilder, _a250, _b173, MySqlCustomColumn;
31335
+ var _a247, _b172, MySqlCustomColumnBuilder, _a248, _b173, MySqlCustomColumn;
32101
31336
  var init_custom3 = __esm({
32102
31337
  "../drizzle-orm/dist/mysql-core/columns/custom.js"() {
32103
31338
  "use strict";
32104
31339
  init_entity();
32105
31340
  init_utils2();
32106
31341
  init_common4();
32107
- MySqlCustomColumnBuilder = class extends (_b172 = MySqlColumnBuilder, _a249 = entityKind, _b172) {
31342
+ MySqlCustomColumnBuilder = class extends (_b172 = MySqlColumnBuilder, _a247 = entityKind, _b172) {
32108
31343
  constructor(name2, fieldConfig, customTypeParams) {
32109
31344
  super(name2, "custom", "MySqlCustomColumn");
32110
31345
  this.config.fieldConfig = fieldConfig;
@@ -32118,8 +31353,8 @@ var init_custom3 = __esm({
32118
31353
  );
32119
31354
  }
32120
31355
  };
32121
- __publicField(MySqlCustomColumnBuilder, _a249, "MySqlCustomColumnBuilder");
32122
- MySqlCustomColumn = class extends (_b173 = MySqlColumn, _a250 = entityKind, _b173) {
31356
+ __publicField(MySqlCustomColumnBuilder, _a247, "MySqlCustomColumnBuilder");
31357
+ MySqlCustomColumn = class extends (_b173 = MySqlColumn, _a248 = entityKind, _b173) {
32123
31358
  constructor(table4, config) {
32124
31359
  super(table4, config);
32125
31360
  __publicField(this, "sqlName");
@@ -32139,7 +31374,7 @@ var init_custom3 = __esm({
32139
31374
  return typeof this.mapTo === "function" ? this.mapTo(value) : value;
32140
31375
  }
32141
31376
  };
32142
- __publicField(MySqlCustomColumn, _a250, "MySqlCustomColumn");
31377
+ __publicField(MySqlCustomColumn, _a248, "MySqlCustomColumn");
32143
31378
  }
32144
31379
  });
32145
31380
 
@@ -32151,14 +31386,14 @@ function date2(a, b) {
32151
31386
  }
32152
31387
  return new MySqlDateBuilder(name2);
32153
31388
  }
32154
- var _a251, _b174, MySqlDateBuilder, _a252, _b175, MySqlDate, _a253, _b176, MySqlDateStringBuilder, _a254, _b177, MySqlDateString;
31389
+ var _a249, _b174, MySqlDateBuilder, _a250, _b175, MySqlDate, _a251, _b176, MySqlDateStringBuilder, _a252, _b177, MySqlDateString;
32155
31390
  var init_date2 = __esm({
32156
31391
  "../drizzle-orm/dist/mysql-core/columns/date.js"() {
32157
31392
  "use strict";
32158
31393
  init_entity();
32159
31394
  init_utils2();
32160
31395
  init_common4();
32161
- MySqlDateBuilder = class extends (_b174 = MySqlColumnBuilder, _a251 = entityKind, _b174) {
31396
+ MySqlDateBuilder = class extends (_b174 = MySqlColumnBuilder, _a249 = entityKind, _b174) {
32162
31397
  constructor(name2) {
32163
31398
  super(name2, "date", "MySqlDate");
32164
31399
  }
@@ -32167,8 +31402,8 @@ var init_date2 = __esm({
32167
31402
  return new MySqlDate(table4, this.config);
32168
31403
  }
32169
31404
  };
32170
- __publicField(MySqlDateBuilder, _a251, "MySqlDateBuilder");
32171
- MySqlDate = class extends (_b175 = MySqlColumn, _a252 = entityKind, _b175) {
31405
+ __publicField(MySqlDateBuilder, _a249, "MySqlDateBuilder");
31406
+ MySqlDate = class extends (_b175 = MySqlColumn, _a250 = entityKind, _b175) {
32172
31407
  constructor(table4, config) {
32173
31408
  super(table4, config);
32174
31409
  }
@@ -32179,8 +31414,8 @@ var init_date2 = __esm({
32179
31414
  return new Date(value);
32180
31415
  }
32181
31416
  };
32182
- __publicField(MySqlDate, _a252, "MySqlDate");
32183
- MySqlDateStringBuilder = class extends (_b176 = MySqlColumnBuilder, _a253 = entityKind, _b176) {
31417
+ __publicField(MySqlDate, _a250, "MySqlDate");
31418
+ MySqlDateStringBuilder = class extends (_b176 = MySqlColumnBuilder, _a251 = entityKind, _b176) {
32184
31419
  constructor(name2) {
32185
31420
  super(name2, "string", "MySqlDateString");
32186
31421
  }
@@ -32192,8 +31427,8 @@ var init_date2 = __esm({
32192
31427
  );
32193
31428
  }
32194
31429
  };
32195
- __publicField(MySqlDateStringBuilder, _a253, "MySqlDateStringBuilder");
32196
- MySqlDateString = class extends (_b177 = MySqlColumn, _a254 = entityKind, _b177) {
31430
+ __publicField(MySqlDateStringBuilder, _a251, "MySqlDateStringBuilder");
31431
+ MySqlDateString = class extends (_b177 = MySqlColumn, _a252 = entityKind, _b177) {
32197
31432
  constructor(table4, config) {
32198
31433
  super(table4, config);
32199
31434
  }
@@ -32201,7 +31436,7 @@ var init_date2 = __esm({
32201
31436
  return `date`;
32202
31437
  }
32203
31438
  };
32204
- __publicField(MySqlDateString, _a254, "MySqlDateString");
31439
+ __publicField(MySqlDateString, _a252, "MySqlDateString");
32205
31440
  }
32206
31441
  });
32207
31442
 
@@ -32213,14 +31448,14 @@ function datetime(a, b) {
32213
31448
  }
32214
31449
  return new MySqlDateTimeBuilder(name2, config);
32215
31450
  }
32216
- var _a255, _b178, MySqlDateTimeBuilder, _a256, _b179, MySqlDateTime, _a257, _b180, MySqlDateTimeStringBuilder, _a258, _b181, MySqlDateTimeString;
31451
+ var _a253, _b178, MySqlDateTimeBuilder, _a254, _b179, MySqlDateTime, _a255, _b180, MySqlDateTimeStringBuilder, _a256, _b181, MySqlDateTimeString;
32217
31452
  var init_datetime = __esm({
32218
31453
  "../drizzle-orm/dist/mysql-core/columns/datetime.js"() {
32219
31454
  "use strict";
32220
31455
  init_entity();
32221
31456
  init_utils2();
32222
31457
  init_common4();
32223
- MySqlDateTimeBuilder = class extends (_b178 = MySqlColumnBuilder, _a255 = entityKind, _b178) {
31458
+ MySqlDateTimeBuilder = class extends (_b178 = MySqlColumnBuilder, _a253 = entityKind, _b178) {
32224
31459
  constructor(name2, config) {
32225
31460
  super(name2, "date", "MySqlDateTime");
32226
31461
  this.config.fsp = config?.fsp;
@@ -32233,8 +31468,8 @@ var init_datetime = __esm({
32233
31468
  );
32234
31469
  }
32235
31470
  };
32236
- __publicField(MySqlDateTimeBuilder, _a255, "MySqlDateTimeBuilder");
32237
- MySqlDateTime = class extends (_b179 = MySqlColumn, _a256 = entityKind, _b179) {
31471
+ __publicField(MySqlDateTimeBuilder, _a253, "MySqlDateTimeBuilder");
31472
+ MySqlDateTime = class extends (_b179 = MySqlColumn, _a254 = entityKind, _b179) {
32238
31473
  constructor(table4, config) {
32239
31474
  super(table4, config);
32240
31475
  __publicField(this, "fsp");
@@ -32251,8 +31486,8 @@ var init_datetime = __esm({
32251
31486
  return /* @__PURE__ */ new Date(value.replace(" ", "T") + "Z");
32252
31487
  }
32253
31488
  };
32254
- __publicField(MySqlDateTime, _a256, "MySqlDateTime");
32255
- MySqlDateTimeStringBuilder = class extends (_b180 = MySqlColumnBuilder, _a257 = entityKind, _b180) {
31489
+ __publicField(MySqlDateTime, _a254, "MySqlDateTime");
31490
+ MySqlDateTimeStringBuilder = class extends (_b180 = MySqlColumnBuilder, _a255 = entityKind, _b180) {
32256
31491
  constructor(name2, config) {
32257
31492
  super(name2, "string", "MySqlDateTimeString");
32258
31493
  this.config.fsp = config?.fsp;
@@ -32265,8 +31500,8 @@ var init_datetime = __esm({
32265
31500
  );
32266
31501
  }
32267
31502
  };
32268
- __publicField(MySqlDateTimeStringBuilder, _a257, "MySqlDateTimeStringBuilder");
32269
- MySqlDateTimeString = class extends (_b181 = MySqlColumn, _a258 = entityKind, _b181) {
31503
+ __publicField(MySqlDateTimeStringBuilder, _a255, "MySqlDateTimeStringBuilder");
31504
+ MySqlDateTimeString = class extends (_b181 = MySqlColumn, _a256 = entityKind, _b181) {
32270
31505
  constructor(table4, config) {
32271
31506
  super(table4, config);
32272
31507
  __publicField(this, "fsp");
@@ -32277,7 +31512,7 @@ var init_datetime = __esm({
32277
31512
  return `datetime${precision}`;
32278
31513
  }
32279
31514
  };
32280
- __publicField(MySqlDateTimeString, _a258, "MySqlDateTimeString");
31515
+ __publicField(MySqlDateTimeString, _a256, "MySqlDateTimeString");
32281
31516
  }
32282
31517
  });
32283
31518
 
@@ -32286,14 +31521,14 @@ function decimal(a, b = {}) {
32286
31521
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32287
31522
  return new MySqlDecimalBuilder(name2, config.precision, config.scale);
32288
31523
  }
32289
- var _a259, _b182, MySqlDecimalBuilder, _a260, _b183, MySqlDecimal;
31524
+ var _a257, _b182, MySqlDecimalBuilder, _a258, _b183, MySqlDecimal;
32290
31525
  var init_decimal = __esm({
32291
31526
  "../drizzle-orm/dist/mysql-core/columns/decimal.js"() {
32292
31527
  "use strict";
32293
31528
  init_entity();
32294
31529
  init_utils2();
32295
31530
  init_common4();
32296
- MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b182) {
31531
+ MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a257 = entityKind, _b182) {
32297
31532
  constructor(name2, precision, scale) {
32298
31533
  super(name2, "string", "MySqlDecimal");
32299
31534
  this.config.precision = precision;
@@ -32307,8 +31542,8 @@ var init_decimal = __esm({
32307
31542
  );
32308
31543
  }
32309
31544
  };
32310
- __publicField(MySqlDecimalBuilder, _a259, "MySqlDecimalBuilder");
32311
- MySqlDecimal = class extends (_b183 = MySqlColumnWithAutoIncrement, _a260 = entityKind, _b183) {
31545
+ __publicField(MySqlDecimalBuilder, _a257, "MySqlDecimalBuilder");
31546
+ MySqlDecimal = class extends (_b183 = MySqlColumnWithAutoIncrement, _a258 = entityKind, _b183) {
32312
31547
  constructor() {
32313
31548
  super(...arguments);
32314
31549
  __publicField(this, "precision", this.config.precision);
@@ -32324,7 +31559,7 @@ var init_decimal = __esm({
32324
31559
  }
32325
31560
  }
32326
31561
  };
32327
- __publicField(MySqlDecimal, _a260, "MySqlDecimal");
31562
+ __publicField(MySqlDecimal, _a258, "MySqlDecimal");
32328
31563
  }
32329
31564
  });
32330
31565
 
@@ -32333,14 +31568,14 @@ function double(a, b) {
32333
31568
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32334
31569
  return new MySqlDoubleBuilder(name2, config);
32335
31570
  }
32336
- var _a261, _b184, MySqlDoubleBuilder, _a262, _b185, MySqlDouble;
31571
+ var _a259, _b184, MySqlDoubleBuilder, _a260, _b185, MySqlDouble;
32337
31572
  var init_double = __esm({
32338
31573
  "../drizzle-orm/dist/mysql-core/columns/double.js"() {
32339
31574
  "use strict";
32340
31575
  init_entity();
32341
31576
  init_utils2();
32342
31577
  init_common4();
32343
- MySqlDoubleBuilder = class extends (_b184 = MySqlColumnBuilderWithAutoIncrement, _a261 = entityKind, _b184) {
31578
+ MySqlDoubleBuilder = class extends (_b184 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b184) {
32344
31579
  constructor(name2, config) {
32345
31580
  super(name2, "number", "MySqlDouble");
32346
31581
  this.config.precision = config?.precision;
@@ -32351,8 +31586,8 @@ var init_double = __esm({
32351
31586
  return new MySqlDouble(table4, this.config);
32352
31587
  }
32353
31588
  };
32354
- __publicField(MySqlDoubleBuilder, _a261, "MySqlDoubleBuilder");
32355
- MySqlDouble = class extends (_b185 = MySqlColumnWithAutoIncrement, _a262 = entityKind, _b185) {
31589
+ __publicField(MySqlDoubleBuilder, _a259, "MySqlDoubleBuilder");
31590
+ MySqlDouble = class extends (_b185 = MySqlColumnWithAutoIncrement, _a260 = entityKind, _b185) {
32356
31591
  constructor() {
32357
31592
  super(...arguments);
32358
31593
  __publicField(this, "precision", this.config.precision);
@@ -32368,7 +31603,7 @@ var init_double = __esm({
32368
31603
  }
32369
31604
  }
32370
31605
  };
32371
- __publicField(MySqlDouble, _a262, "MySqlDouble");
31606
+ __publicField(MySqlDouble, _a260, "MySqlDouble");
32372
31607
  }
32373
31608
  });
32374
31609
 
@@ -32380,14 +31615,14 @@ function mysqlEnum(a, b) {
32380
31615
  }
32381
31616
  return new MySqlEnumColumnBuilder(name2, values);
32382
31617
  }
32383
- var _a263, _b186, MySqlEnumColumnBuilder, _a264, _b187, MySqlEnumColumn;
31618
+ var _a261, _b186, MySqlEnumColumnBuilder, _a262, _b187, MySqlEnumColumn;
32384
31619
  var init_enum2 = __esm({
32385
31620
  "../drizzle-orm/dist/mysql-core/columns/enum.js"() {
32386
31621
  "use strict";
32387
31622
  init_entity();
32388
31623
  init_utils2();
32389
31624
  init_common4();
32390
- MySqlEnumColumnBuilder = class extends (_b186 = MySqlColumnBuilder, _a263 = entityKind, _b186) {
31625
+ MySqlEnumColumnBuilder = class extends (_b186 = MySqlColumnBuilder, _a261 = entityKind, _b186) {
32391
31626
  constructor(name2, values) {
32392
31627
  super(name2, "string", "MySqlEnumColumn");
32393
31628
  this.config.enumValues = values;
@@ -32400,8 +31635,8 @@ var init_enum2 = __esm({
32400
31635
  );
32401
31636
  }
32402
31637
  };
32403
- __publicField(MySqlEnumColumnBuilder, _a263, "MySqlEnumColumnBuilder");
32404
- MySqlEnumColumn = class extends (_b187 = MySqlColumn, _a264 = entityKind, _b187) {
31638
+ __publicField(MySqlEnumColumnBuilder, _a261, "MySqlEnumColumnBuilder");
31639
+ MySqlEnumColumn = class extends (_b187 = MySqlColumn, _a262 = entityKind, _b187) {
32405
31640
  constructor() {
32406
31641
  super(...arguments);
32407
31642
  __publicField(this, "enumValues", this.config.enumValues);
@@ -32410,7 +31645,7 @@ var init_enum2 = __esm({
32410
31645
  return `enum(${this.enumValues.map((value) => `'${value}'`).join(",")})`;
32411
31646
  }
32412
31647
  };
32413
- __publicField(MySqlEnumColumn, _a264, "MySqlEnumColumn");
31648
+ __publicField(MySqlEnumColumn, _a262, "MySqlEnumColumn");
32414
31649
  }
32415
31650
  });
32416
31651
 
@@ -32418,13 +31653,13 @@ var init_enum2 = __esm({
32418
31653
  function float(name2) {
32419
31654
  return new MySqlFloatBuilder(name2 ?? "");
32420
31655
  }
32421
- var _a265, _b188, MySqlFloatBuilder, _a266, _b189, MySqlFloat;
31656
+ var _a263, _b188, MySqlFloatBuilder, _a264, _b189, MySqlFloat;
32422
31657
  var init_float = __esm({
32423
31658
  "../drizzle-orm/dist/mysql-core/columns/float.js"() {
32424
31659
  "use strict";
32425
31660
  init_entity();
32426
31661
  init_common4();
32427
- MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b188) {
31662
+ MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a263 = entityKind, _b188) {
32428
31663
  constructor(name2) {
32429
31664
  super(name2, "number", "MySqlFloat");
32430
31665
  }
@@ -32433,13 +31668,13 @@ var init_float = __esm({
32433
31668
  return new MySqlFloat(table4, this.config);
32434
31669
  }
32435
31670
  };
32436
- __publicField(MySqlFloatBuilder, _a265, "MySqlFloatBuilder");
32437
- MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b189) {
31671
+ __publicField(MySqlFloatBuilder, _a263, "MySqlFloatBuilder");
31672
+ MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a264 = entityKind, _b189) {
32438
31673
  getSQLType() {
32439
31674
  return "float";
32440
31675
  }
32441
31676
  };
32442
- __publicField(MySqlFloat, _a266, "MySqlFloat");
31677
+ __publicField(MySqlFloat, _a264, "MySqlFloat");
32443
31678
  }
32444
31679
  });
32445
31680
 
@@ -32448,14 +31683,14 @@ function int(a, b) {
32448
31683
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32449
31684
  return new MySqlIntBuilder(name2, config);
32450
31685
  }
32451
- var _a267, _b190, MySqlIntBuilder, _a268, _b191, MySqlInt;
31686
+ var _a265, _b190, MySqlIntBuilder, _a266, _b191, MySqlInt;
32452
31687
  var init_int = __esm({
32453
31688
  "../drizzle-orm/dist/mysql-core/columns/int.js"() {
32454
31689
  "use strict";
32455
31690
  init_entity();
32456
31691
  init_utils2();
32457
31692
  init_common4();
32458
- MySqlIntBuilder = class extends (_b190 = MySqlColumnBuilderWithAutoIncrement, _a267 = entityKind, _b190) {
31693
+ MySqlIntBuilder = class extends (_b190 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b190) {
32459
31694
  constructor(name2, config) {
32460
31695
  super(name2, "number", "MySqlInt");
32461
31696
  this.config.unsigned = config ? config.unsigned : false;
@@ -32465,8 +31700,8 @@ var init_int = __esm({
32465
31700
  return new MySqlInt(table4, this.config);
32466
31701
  }
32467
31702
  };
32468
- __publicField(MySqlIntBuilder, _a267, "MySqlIntBuilder");
32469
- MySqlInt = class extends (_b191 = MySqlColumnWithAutoIncrement, _a268 = entityKind, _b191) {
31703
+ __publicField(MySqlIntBuilder, _a265, "MySqlIntBuilder");
31704
+ MySqlInt = class extends (_b191 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b191) {
32470
31705
  getSQLType() {
32471
31706
  return `int${this.config.unsigned ? " unsigned" : ""}`;
32472
31707
  }
@@ -32477,7 +31712,7 @@ var init_int = __esm({
32477
31712
  return value;
32478
31713
  }
32479
31714
  };
32480
- __publicField(MySqlInt, _a268, "MySqlInt");
31715
+ __publicField(MySqlInt, _a266, "MySqlInt");
32481
31716
  }
32482
31717
  });
32483
31718
 
@@ -32485,13 +31720,13 @@ var init_int = __esm({
32485
31720
  function json2(name2) {
32486
31721
  return new MySqlJsonBuilder(name2 ?? "");
32487
31722
  }
32488
- var _a269, _b192, MySqlJsonBuilder, _a270, _b193, MySqlJson;
31723
+ var _a267, _b192, MySqlJsonBuilder, _a268, _b193, MySqlJson;
32489
31724
  var init_json2 = __esm({
32490
31725
  "../drizzle-orm/dist/mysql-core/columns/json.js"() {
32491
31726
  "use strict";
32492
31727
  init_entity();
32493
31728
  init_common4();
32494
- MySqlJsonBuilder = class extends (_b192 = MySqlColumnBuilder, _a269 = entityKind, _b192) {
31729
+ MySqlJsonBuilder = class extends (_b192 = MySqlColumnBuilder, _a267 = entityKind, _b192) {
32495
31730
  constructor(name2) {
32496
31731
  super(name2, "json", "MySqlJson");
32497
31732
  }
@@ -32500,8 +31735,8 @@ var init_json2 = __esm({
32500
31735
  return new MySqlJson(table4, this.config);
32501
31736
  }
32502
31737
  };
32503
- __publicField(MySqlJsonBuilder, _a269, "MySqlJsonBuilder");
32504
- MySqlJson = class extends (_b193 = MySqlColumn, _a270 = entityKind, _b193) {
31738
+ __publicField(MySqlJsonBuilder, _a267, "MySqlJsonBuilder");
31739
+ MySqlJson = class extends (_b193 = MySqlColumn, _a268 = entityKind, _b193) {
32505
31740
  getSQLType() {
32506
31741
  return "json";
32507
31742
  }
@@ -32509,7 +31744,7 @@ var init_json2 = __esm({
32509
31744
  return JSON.stringify(value);
32510
31745
  }
32511
31746
  };
32512
- __publicField(MySqlJson, _a270, "MySqlJson");
31747
+ __publicField(MySqlJson, _a268, "MySqlJson");
32513
31748
  }
32514
31749
  });
32515
31750
 
@@ -32518,14 +31753,14 @@ function mediumint(a, b) {
32518
31753
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32519
31754
  return new MySqlMediumIntBuilder(name2, config);
32520
31755
  }
32521
- var _a271, _b194, MySqlMediumIntBuilder, _a272, _b195, MySqlMediumInt;
31756
+ var _a269, _b194, MySqlMediumIntBuilder, _a270, _b195, MySqlMediumInt;
32522
31757
  var init_mediumint = __esm({
32523
31758
  "../drizzle-orm/dist/mysql-core/columns/mediumint.js"() {
32524
31759
  "use strict";
32525
31760
  init_entity();
32526
31761
  init_utils2();
32527
31762
  init_common4();
32528
- MySqlMediumIntBuilder = class extends (_b194 = MySqlColumnBuilderWithAutoIncrement, _a271 = entityKind, _b194) {
31763
+ MySqlMediumIntBuilder = class extends (_b194 = MySqlColumnBuilderWithAutoIncrement, _a269 = entityKind, _b194) {
32529
31764
  constructor(name2, config) {
32530
31765
  super(name2, "number", "MySqlMediumInt");
32531
31766
  this.config.unsigned = config ? config.unsigned : false;
@@ -32538,8 +31773,8 @@ var init_mediumint = __esm({
32538
31773
  );
32539
31774
  }
32540
31775
  };
32541
- __publicField(MySqlMediumIntBuilder, _a271, "MySqlMediumIntBuilder");
32542
- MySqlMediumInt = class extends (_b195 = MySqlColumnWithAutoIncrement, _a272 = entityKind, _b195) {
31776
+ __publicField(MySqlMediumIntBuilder, _a269, "MySqlMediumIntBuilder");
31777
+ MySqlMediumInt = class extends (_b195 = MySqlColumnWithAutoIncrement, _a270 = entityKind, _b195) {
32543
31778
  getSQLType() {
32544
31779
  return `mediumint${this.config.unsigned ? " unsigned" : ""}`;
32545
31780
  }
@@ -32550,7 +31785,7 @@ var init_mediumint = __esm({
32550
31785
  return value;
32551
31786
  }
32552
31787
  };
32553
- __publicField(MySqlMediumInt, _a272, "MySqlMediumInt");
31788
+ __publicField(MySqlMediumInt, _a270, "MySqlMediumInt");
32554
31789
  }
32555
31790
  });
32556
31791
 
@@ -32559,14 +31794,14 @@ function real3(a, b = {}) {
32559
31794
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32560
31795
  return new MySqlRealBuilder(name2, config);
32561
31796
  }
32562
- var _a273, _b196, MySqlRealBuilder, _a274, _b197, MySqlReal;
31797
+ var _a271, _b196, MySqlRealBuilder, _a272, _b197, MySqlReal;
32563
31798
  var init_real3 = __esm({
32564
31799
  "../drizzle-orm/dist/mysql-core/columns/real.js"() {
32565
31800
  "use strict";
32566
31801
  init_entity();
32567
31802
  init_utils2();
32568
31803
  init_common4();
32569
- MySqlRealBuilder = class extends (_b196 = MySqlColumnBuilderWithAutoIncrement, _a273 = entityKind, _b196) {
31804
+ MySqlRealBuilder = class extends (_b196 = MySqlColumnBuilderWithAutoIncrement, _a271 = entityKind, _b196) {
32570
31805
  constructor(name2, config) {
32571
31806
  super(name2, "number", "MySqlReal");
32572
31807
  this.config.precision = config?.precision;
@@ -32577,8 +31812,8 @@ var init_real3 = __esm({
32577
31812
  return new MySqlReal(table4, this.config);
32578
31813
  }
32579
31814
  };
32580
- __publicField(MySqlRealBuilder, _a273, "MySqlRealBuilder");
32581
- MySqlReal = class extends (_b197 = MySqlColumnWithAutoIncrement, _a274 = entityKind, _b197) {
31815
+ __publicField(MySqlRealBuilder, _a271, "MySqlRealBuilder");
31816
+ MySqlReal = class extends (_b197 = MySqlColumnWithAutoIncrement, _a272 = entityKind, _b197) {
32582
31817
  constructor() {
32583
31818
  super(...arguments);
32584
31819
  __publicField(this, "precision", this.config.precision);
@@ -32594,7 +31829,7 @@ var init_real3 = __esm({
32594
31829
  }
32595
31830
  }
32596
31831
  };
32597
- __publicField(MySqlReal, _a274, "MySqlReal");
31832
+ __publicField(MySqlReal, _a272, "MySqlReal");
32598
31833
  }
32599
31834
  });
32600
31835
 
@@ -32602,13 +31837,13 @@ var init_real3 = __esm({
32602
31837
  function serial2(name2) {
32603
31838
  return new MySqlSerialBuilder(name2 ?? "");
32604
31839
  }
32605
- var _a275, _b198, MySqlSerialBuilder, _a276, _b199, MySqlSerial;
31840
+ var _a273, _b198, MySqlSerialBuilder, _a274, _b199, MySqlSerial;
32606
31841
  var init_serial2 = __esm({
32607
31842
  "../drizzle-orm/dist/mysql-core/columns/serial.js"() {
32608
31843
  "use strict";
32609
31844
  init_entity();
32610
31845
  init_common4();
32611
- MySqlSerialBuilder = class extends (_b198 = MySqlColumnBuilderWithAutoIncrement, _a275 = entityKind, _b198) {
31846
+ MySqlSerialBuilder = class extends (_b198 = MySqlColumnBuilderWithAutoIncrement, _a273 = entityKind, _b198) {
32612
31847
  constructor(name2) {
32613
31848
  super(name2, "number", "MySqlSerial");
32614
31849
  this.config.hasDefault = true;
@@ -32619,8 +31854,8 @@ var init_serial2 = __esm({
32619
31854
  return new MySqlSerial(table4, this.config);
32620
31855
  }
32621
31856
  };
32622
- __publicField(MySqlSerialBuilder, _a275, "MySqlSerialBuilder");
32623
- MySqlSerial = class extends (_b199 = MySqlColumnWithAutoIncrement, _a276 = entityKind, _b199) {
31857
+ __publicField(MySqlSerialBuilder, _a273, "MySqlSerialBuilder");
31858
+ MySqlSerial = class extends (_b199 = MySqlColumnWithAutoIncrement, _a274 = entityKind, _b199) {
32624
31859
  getSQLType() {
32625
31860
  return "serial";
32626
31861
  }
@@ -32631,7 +31866,7 @@ var init_serial2 = __esm({
32631
31866
  return value;
32632
31867
  }
32633
31868
  };
32634
- __publicField(MySqlSerial, _a276, "MySqlSerial");
31869
+ __publicField(MySqlSerial, _a274, "MySqlSerial");
32635
31870
  }
32636
31871
  });
32637
31872
 
@@ -32640,14 +31875,14 @@ function smallint2(a, b) {
32640
31875
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32641
31876
  return new MySqlSmallIntBuilder(name2, config);
32642
31877
  }
32643
- var _a277, _b200, MySqlSmallIntBuilder, _a278, _b201, MySqlSmallInt;
31878
+ var _a275, _b200, MySqlSmallIntBuilder, _a276, _b201, MySqlSmallInt;
32644
31879
  var init_smallint2 = __esm({
32645
31880
  "../drizzle-orm/dist/mysql-core/columns/smallint.js"() {
32646
31881
  "use strict";
32647
31882
  init_entity();
32648
31883
  init_utils2();
32649
31884
  init_common4();
32650
- MySqlSmallIntBuilder = class extends (_b200 = MySqlColumnBuilderWithAutoIncrement, _a277 = entityKind, _b200) {
31885
+ MySqlSmallIntBuilder = class extends (_b200 = MySqlColumnBuilderWithAutoIncrement, _a275 = entityKind, _b200) {
32651
31886
  constructor(name2, config) {
32652
31887
  super(name2, "number", "MySqlSmallInt");
32653
31888
  this.config.unsigned = config ? config.unsigned : false;
@@ -32660,8 +31895,8 @@ var init_smallint2 = __esm({
32660
31895
  );
32661
31896
  }
32662
31897
  };
32663
- __publicField(MySqlSmallIntBuilder, _a277, "MySqlSmallIntBuilder");
32664
- MySqlSmallInt = class extends (_b201 = MySqlColumnWithAutoIncrement, _a278 = entityKind, _b201) {
31898
+ __publicField(MySqlSmallIntBuilder, _a275, "MySqlSmallIntBuilder");
31899
+ MySqlSmallInt = class extends (_b201 = MySqlColumnWithAutoIncrement, _a276 = entityKind, _b201) {
32665
31900
  getSQLType() {
32666
31901
  return `smallint${this.config.unsigned ? " unsigned" : ""}`;
32667
31902
  }
@@ -32672,7 +31907,7 @@ var init_smallint2 = __esm({
32672
31907
  return value;
32673
31908
  }
32674
31909
  };
32675
- __publicField(MySqlSmallInt, _a278, "MySqlSmallInt");
31910
+ __publicField(MySqlSmallInt, _a276, "MySqlSmallInt");
32676
31911
  }
32677
31912
  });
32678
31913
 
@@ -32681,14 +31916,14 @@ function text3(a, b = {}) {
32681
31916
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32682
31917
  return new MySqlTextBuilder(name2, "text", config);
32683
31918
  }
32684
- var _a279, _b202, MySqlTextBuilder, _a280, _b203, MySqlText;
31919
+ var _a277, _b202, MySqlTextBuilder, _a278, _b203, MySqlText;
32685
31920
  var init_text3 = __esm({
32686
31921
  "../drizzle-orm/dist/mysql-core/columns/text.js"() {
32687
31922
  "use strict";
32688
31923
  init_entity();
32689
31924
  init_utils2();
32690
31925
  init_common4();
32691
- MySqlTextBuilder = class extends (_b202 = MySqlColumnBuilder, _a279 = entityKind, _b202) {
31926
+ MySqlTextBuilder = class extends (_b202 = MySqlColumnBuilder, _a277 = entityKind, _b202) {
32692
31927
  constructor(name2, textType, config) {
32693
31928
  super(name2, "string", "MySqlText");
32694
31929
  this.config.textType = textType;
@@ -32699,8 +31934,8 @@ var init_text3 = __esm({
32699
31934
  return new MySqlText(table4, this.config);
32700
31935
  }
32701
31936
  };
32702
- __publicField(MySqlTextBuilder, _a279, "MySqlTextBuilder");
32703
- MySqlText = class extends (_b203 = MySqlColumn, _a280 = entityKind, _b203) {
31937
+ __publicField(MySqlTextBuilder, _a277, "MySqlTextBuilder");
31938
+ MySqlText = class extends (_b203 = MySqlColumn, _a278 = entityKind, _b203) {
32704
31939
  constructor() {
32705
31940
  super(...arguments);
32706
31941
  __publicField(this, "textType", this.config.textType);
@@ -32710,7 +31945,7 @@ var init_text3 = __esm({
32710
31945
  return this.textType;
32711
31946
  }
32712
31947
  };
32713
- __publicField(MySqlText, _a280, "MySqlText");
31948
+ __publicField(MySqlText, _a278, "MySqlText");
32714
31949
  }
32715
31950
  });
32716
31951
 
@@ -32719,14 +31954,14 @@ function time2(a, b) {
32719
31954
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32720
31955
  return new MySqlTimeBuilder(name2, config);
32721
31956
  }
32722
- var _a281, _b204, MySqlTimeBuilder, _a282, _b205, MySqlTime;
31957
+ var _a279, _b204, MySqlTimeBuilder, _a280, _b205, MySqlTime;
32723
31958
  var init_time2 = __esm({
32724
31959
  "../drizzle-orm/dist/mysql-core/columns/time.js"() {
32725
31960
  "use strict";
32726
31961
  init_entity();
32727
31962
  init_utils2();
32728
31963
  init_common4();
32729
- MySqlTimeBuilder = class extends (_b204 = MySqlColumnBuilder, _a281 = entityKind, _b204) {
31964
+ MySqlTimeBuilder = class extends (_b204 = MySqlColumnBuilder, _a279 = entityKind, _b204) {
32730
31965
  constructor(name2, config) {
32731
31966
  super(name2, "string", "MySqlTime");
32732
31967
  this.config.fsp = config?.fsp;
@@ -32736,8 +31971,8 @@ var init_time2 = __esm({
32736
31971
  return new MySqlTime(table4, this.config);
32737
31972
  }
32738
31973
  };
32739
- __publicField(MySqlTimeBuilder, _a281, "MySqlTimeBuilder");
32740
- MySqlTime = class extends (_b205 = MySqlColumn, _a282 = entityKind, _b205) {
31974
+ __publicField(MySqlTimeBuilder, _a279, "MySqlTimeBuilder");
31975
+ MySqlTime = class extends (_b205 = MySqlColumn, _a280 = entityKind, _b205) {
32741
31976
  constructor() {
32742
31977
  super(...arguments);
32743
31978
  __publicField(this, "fsp", this.config.fsp);
@@ -32747,19 +31982,19 @@ var init_time2 = __esm({
32747
31982
  return `time${precision}`;
32748
31983
  }
32749
31984
  };
32750
- __publicField(MySqlTime, _a282, "MySqlTime");
31985
+ __publicField(MySqlTime, _a280, "MySqlTime");
32751
31986
  }
32752
31987
  });
32753
31988
 
32754
31989
  // ../drizzle-orm/dist/mysql-core/columns/date.common.js
32755
- var _a283, _b206, MySqlDateColumnBaseBuilder, _a284, _b207, MySqlDateBaseColumn;
31990
+ var _a281, _b206, MySqlDateColumnBaseBuilder, _a282, _b207, MySqlDateBaseColumn;
32756
31991
  var init_date_common2 = __esm({
32757
31992
  "../drizzle-orm/dist/mysql-core/columns/date.common.js"() {
32758
31993
  "use strict";
32759
31994
  init_entity();
32760
31995
  init_sql();
32761
31996
  init_common4();
32762
- MySqlDateColumnBaseBuilder = class extends (_b206 = MySqlColumnBuilder, _a283 = entityKind, _b206) {
31997
+ MySqlDateColumnBaseBuilder = class extends (_b206 = MySqlColumnBuilder, _a281 = entityKind, _b206) {
32763
31998
  defaultNow() {
32764
31999
  return this.default(sql`(now())`);
32765
32000
  }
@@ -32770,14 +32005,14 @@ var init_date_common2 = __esm({
32770
32005
  return this;
32771
32006
  }
32772
32007
  };
32773
- __publicField(MySqlDateColumnBaseBuilder, _a283, "MySqlDateColumnBuilder");
32774
- MySqlDateBaseColumn = class extends (_b207 = MySqlColumn, _a284 = entityKind, _b207) {
32008
+ __publicField(MySqlDateColumnBaseBuilder, _a281, "MySqlDateColumnBuilder");
32009
+ MySqlDateBaseColumn = class extends (_b207 = MySqlColumn, _a282 = entityKind, _b207) {
32775
32010
  constructor() {
32776
32011
  super(...arguments);
32777
32012
  __publicField(this, "hasOnUpdateNow", this.config.hasOnUpdateNow);
32778
32013
  }
32779
32014
  };
32780
- __publicField(MySqlDateBaseColumn, _a284, "MySqlDateColumn");
32015
+ __publicField(MySqlDateBaseColumn, _a282, "MySqlDateColumn");
32781
32016
  }
32782
32017
  });
32783
32018
 
@@ -32789,14 +32024,14 @@ function timestamp2(a, b = {}) {
32789
32024
  }
32790
32025
  return new MySqlTimestampBuilder(name2, config);
32791
32026
  }
32792
- var _a285, _b208, MySqlTimestampBuilder, _a286, _b209, MySqlTimestamp, _a287, _b210, MySqlTimestampStringBuilder, _a288, _b211, MySqlTimestampString;
32027
+ var _a283, _b208, MySqlTimestampBuilder, _a284, _b209, MySqlTimestamp, _a285, _b210, MySqlTimestampStringBuilder, _a286, _b211, MySqlTimestampString;
32793
32028
  var init_timestamp2 = __esm({
32794
32029
  "../drizzle-orm/dist/mysql-core/columns/timestamp.js"() {
32795
32030
  "use strict";
32796
32031
  init_entity();
32797
32032
  init_utils2();
32798
32033
  init_date_common2();
32799
- MySqlTimestampBuilder = class extends (_b208 = MySqlDateColumnBaseBuilder, _a285 = entityKind, _b208) {
32034
+ MySqlTimestampBuilder = class extends (_b208 = MySqlDateColumnBaseBuilder, _a283 = entityKind, _b208) {
32800
32035
  constructor(name2, config) {
32801
32036
  super(name2, "date", "MySqlTimestamp");
32802
32037
  this.config.fsp = config?.fsp;
@@ -32809,8 +32044,8 @@ var init_timestamp2 = __esm({
32809
32044
  );
32810
32045
  }
32811
32046
  };
32812
- __publicField(MySqlTimestampBuilder, _a285, "MySqlTimestampBuilder");
32813
- MySqlTimestamp = class extends (_b209 = MySqlDateBaseColumn, _a286 = entityKind, _b209) {
32047
+ __publicField(MySqlTimestampBuilder, _a283, "MySqlTimestampBuilder");
32048
+ MySqlTimestamp = class extends (_b209 = MySqlDateBaseColumn, _a284 = entityKind, _b209) {
32814
32049
  constructor() {
32815
32050
  super(...arguments);
32816
32051
  __publicField(this, "fsp", this.config.fsp);
@@ -32826,8 +32061,8 @@ var init_timestamp2 = __esm({
32826
32061
  return value.toISOString().slice(0, -1).replace("T", " ");
32827
32062
  }
32828
32063
  };
32829
- __publicField(MySqlTimestamp, _a286, "MySqlTimestamp");
32830
- MySqlTimestampStringBuilder = class extends (_b210 = MySqlDateColumnBaseBuilder, _a287 = entityKind, _b210) {
32064
+ __publicField(MySqlTimestamp, _a284, "MySqlTimestamp");
32065
+ MySqlTimestampStringBuilder = class extends (_b210 = MySqlDateColumnBaseBuilder, _a285 = entityKind, _b210) {
32831
32066
  constructor(name2, config) {
32832
32067
  super(name2, "string", "MySqlTimestampString");
32833
32068
  this.config.fsp = config?.fsp;
@@ -32840,8 +32075,8 @@ var init_timestamp2 = __esm({
32840
32075
  );
32841
32076
  }
32842
32077
  };
32843
- __publicField(MySqlTimestampStringBuilder, _a287, "MySqlTimestampStringBuilder");
32844
- MySqlTimestampString = class extends (_b211 = MySqlDateBaseColumn, _a288 = entityKind, _b211) {
32078
+ __publicField(MySqlTimestampStringBuilder, _a285, "MySqlTimestampStringBuilder");
32079
+ MySqlTimestampString = class extends (_b211 = MySqlDateBaseColumn, _a286 = entityKind, _b211) {
32845
32080
  constructor() {
32846
32081
  super(...arguments);
32847
32082
  __publicField(this, "fsp", this.config.fsp);
@@ -32851,7 +32086,7 @@ var init_timestamp2 = __esm({
32851
32086
  return `timestamp${precision}`;
32852
32087
  }
32853
32088
  };
32854
- __publicField(MySqlTimestampString, _a288, "MySqlTimestampString");
32089
+ __publicField(MySqlTimestampString, _a286, "MySqlTimestampString");
32855
32090
  }
32856
32091
  });
32857
32092
 
@@ -32860,14 +32095,14 @@ function tinyint(a, b) {
32860
32095
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32861
32096
  return new MySqlTinyIntBuilder(name2, config);
32862
32097
  }
32863
- var _a289, _b212, MySqlTinyIntBuilder, _a290, _b213, MySqlTinyInt;
32098
+ var _a287, _b212, MySqlTinyIntBuilder, _a288, _b213, MySqlTinyInt;
32864
32099
  var init_tinyint = __esm({
32865
32100
  "../drizzle-orm/dist/mysql-core/columns/tinyint.js"() {
32866
32101
  "use strict";
32867
32102
  init_entity();
32868
32103
  init_utils2();
32869
32104
  init_common4();
32870
- MySqlTinyIntBuilder = class extends (_b212 = MySqlColumnBuilderWithAutoIncrement, _a289 = entityKind, _b212) {
32105
+ MySqlTinyIntBuilder = class extends (_b212 = MySqlColumnBuilderWithAutoIncrement, _a287 = entityKind, _b212) {
32871
32106
  constructor(name2, config) {
32872
32107
  super(name2, "number", "MySqlTinyInt");
32873
32108
  this.config.unsigned = config ? config.unsigned : false;
@@ -32880,8 +32115,8 @@ var init_tinyint = __esm({
32880
32115
  );
32881
32116
  }
32882
32117
  };
32883
- __publicField(MySqlTinyIntBuilder, _a289, "MySqlTinyIntBuilder");
32884
- MySqlTinyInt = class extends (_b213 = MySqlColumnWithAutoIncrement, _a290 = entityKind, _b213) {
32118
+ __publicField(MySqlTinyIntBuilder, _a287, "MySqlTinyIntBuilder");
32119
+ MySqlTinyInt = class extends (_b213 = MySqlColumnWithAutoIncrement, _a288 = entityKind, _b213) {
32885
32120
  getSQLType() {
32886
32121
  return `tinyint${this.config.unsigned ? " unsigned" : ""}`;
32887
32122
  }
@@ -32892,7 +32127,7 @@ var init_tinyint = __esm({
32892
32127
  return value;
32893
32128
  }
32894
32129
  };
32895
- __publicField(MySqlTinyInt, _a290, "MySqlTinyInt");
32130
+ __publicField(MySqlTinyInt, _a288, "MySqlTinyInt");
32896
32131
  }
32897
32132
  });
32898
32133
 
@@ -32901,14 +32136,14 @@ function varbinary(a, b) {
32901
32136
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32902
32137
  return new MySqlVarBinaryBuilder(name2, config);
32903
32138
  }
32904
- var _a291, _b214, MySqlVarBinaryBuilder, _a292, _b215, MySqlVarBinary;
32139
+ var _a289, _b214, MySqlVarBinaryBuilder, _a290, _b215, MySqlVarBinary;
32905
32140
  var init_varbinary = __esm({
32906
32141
  "../drizzle-orm/dist/mysql-core/columns/varbinary.js"() {
32907
32142
  "use strict";
32908
32143
  init_entity();
32909
32144
  init_utils2();
32910
32145
  init_common4();
32911
- MySqlVarBinaryBuilder = class extends (_b214 = MySqlColumnBuilder, _a291 = entityKind, _b214) {
32146
+ MySqlVarBinaryBuilder = class extends (_b214 = MySqlColumnBuilder, _a289 = entityKind, _b214) {
32912
32147
  /** @internal */
32913
32148
  constructor(name2, config) {
32914
32149
  super(name2, "string", "MySqlVarBinary");
@@ -32922,8 +32157,8 @@ var init_varbinary = __esm({
32922
32157
  );
32923
32158
  }
32924
32159
  };
32925
- __publicField(MySqlVarBinaryBuilder, _a291, "MySqlVarBinaryBuilder");
32926
- MySqlVarBinary = class extends (_b215 = MySqlColumn, _a292 = entityKind, _b215) {
32160
+ __publicField(MySqlVarBinaryBuilder, _a289, "MySqlVarBinaryBuilder");
32161
+ MySqlVarBinary = class extends (_b215 = MySqlColumn, _a290 = entityKind, _b215) {
32927
32162
  constructor() {
32928
32163
  super(...arguments);
32929
32164
  __publicField(this, "length", this.config.length);
@@ -32932,7 +32167,7 @@ var init_varbinary = __esm({
32932
32167
  return this.length === void 0 ? `varbinary` : `varbinary(${this.length})`;
32933
32168
  }
32934
32169
  };
32935
- __publicField(MySqlVarBinary, _a292, "MySqlVarBinary");
32170
+ __publicField(MySqlVarBinary, _a290, "MySqlVarBinary");
32936
32171
  }
32937
32172
  });
32938
32173
 
@@ -32941,14 +32176,14 @@ function varchar2(a, b) {
32941
32176
  const { name: name2, config } = getColumnNameAndConfig(a, b);
32942
32177
  return new MySqlVarCharBuilder(name2, config);
32943
32178
  }
32944
- var _a293, _b216, MySqlVarCharBuilder, _a294, _b217, MySqlVarChar;
32179
+ var _a291, _b216, MySqlVarCharBuilder, _a292, _b217, MySqlVarChar;
32945
32180
  var init_varchar2 = __esm({
32946
32181
  "../drizzle-orm/dist/mysql-core/columns/varchar.js"() {
32947
32182
  "use strict";
32948
32183
  init_entity();
32949
32184
  init_utils2();
32950
32185
  init_common4();
32951
- MySqlVarCharBuilder = class extends (_b216 = MySqlColumnBuilder, _a293 = entityKind, _b216) {
32186
+ MySqlVarCharBuilder = class extends (_b216 = MySqlColumnBuilder, _a291 = entityKind, _b216) {
32952
32187
  /** @internal */
32953
32188
  constructor(name2, config) {
32954
32189
  super(name2, "string", "MySqlVarChar");
@@ -32963,8 +32198,8 @@ var init_varchar2 = __esm({
32963
32198
  );
32964
32199
  }
32965
32200
  };
32966
- __publicField(MySqlVarCharBuilder, _a293, "MySqlVarCharBuilder");
32967
- MySqlVarChar = class extends (_b217 = MySqlColumn, _a294 = entityKind, _b217) {
32201
+ __publicField(MySqlVarCharBuilder, _a291, "MySqlVarCharBuilder");
32202
+ MySqlVarChar = class extends (_b217 = MySqlColumn, _a292 = entityKind, _b217) {
32968
32203
  constructor() {
32969
32204
  super(...arguments);
32970
32205
  __publicField(this, "length", this.config.length);
@@ -32974,7 +32209,7 @@ var init_varchar2 = __esm({
32974
32209
  return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
32975
32210
  }
32976
32211
  };
32977
- __publicField(MySqlVarChar, _a294, "MySqlVarChar");
32212
+ __publicField(MySqlVarChar, _a292, "MySqlVarChar");
32978
32213
  }
32979
32214
  });
32980
32215
 
@@ -32982,13 +32217,13 @@ var init_varchar2 = __esm({
32982
32217
  function year(name2) {
32983
32218
  return new MySqlYearBuilder(name2 ?? "");
32984
32219
  }
32985
- var _a295, _b218, MySqlYearBuilder, _a296, _b219, MySqlYear;
32220
+ var _a293, _b218, MySqlYearBuilder, _a294, _b219, MySqlYear;
32986
32221
  var init_year = __esm({
32987
32222
  "../drizzle-orm/dist/mysql-core/columns/year.js"() {
32988
32223
  "use strict";
32989
32224
  init_entity();
32990
32225
  init_common4();
32991
- MySqlYearBuilder = class extends (_b218 = MySqlColumnBuilder, _a295 = entityKind, _b218) {
32226
+ MySqlYearBuilder = class extends (_b218 = MySqlColumnBuilder, _a293 = entityKind, _b218) {
32992
32227
  constructor(name2) {
32993
32228
  super(name2, "number", "MySqlYear");
32994
32229
  }
@@ -32997,13 +32232,13 @@ var init_year = __esm({
32997
32232
  return new MySqlYear(table4, this.config);
32998
32233
  }
32999
32234
  };
33000
- __publicField(MySqlYearBuilder, _a295, "MySqlYearBuilder");
33001
- MySqlYear = class extends (_b219 = MySqlColumn, _a296 = entityKind, _b219) {
32235
+ __publicField(MySqlYearBuilder, _a293, "MySqlYearBuilder");
32236
+ MySqlYear = class extends (_b219 = MySqlColumn, _a294 = entityKind, _b219) {
33002
32237
  getSQLType() {
33003
32238
  return `year`;
33004
32239
  }
33005
32240
  };
33006
- __publicField(MySqlYear, _a296, "MySqlYear");
32241
+ __publicField(MySqlYear, _a294, "MySqlYear");
33007
32242
  }
33008
32243
  });
33009
32244
 
@@ -33040,17 +32275,17 @@ var init_columns3 = __esm({
33040
32275
  });
33041
32276
 
33042
32277
  // ../drizzle-orm/dist/mysql-core/query-builders/count.js
33043
- var _a297, _b220, _c9, _MySqlCountBuilder, MySqlCountBuilder;
32278
+ var _a295, _b220, _c9, _MySqlCountBuilder, MySqlCountBuilder;
33044
32279
  var init_count3 = __esm({
33045
32280
  "../drizzle-orm/dist/mysql-core/query-builders/count.js"() {
33046
32281
  "use strict";
33047
32282
  init_entity();
33048
32283
  init_sql();
33049
- _MySqlCountBuilder = class _MySqlCountBuilder extends (_c9 = SQL, _b220 = entityKind, _a297 = Symbol.toStringTag, _c9) {
32284
+ _MySqlCountBuilder = class _MySqlCountBuilder extends (_c9 = SQL, _b220 = entityKind, _a295 = Symbol.toStringTag, _c9) {
33050
32285
  constructor(params) {
33051
32286
  super(_MySqlCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
33052
32287
  __publicField(this, "sql");
33053
- __publicField(this, _a297, "MySqlCountBuilder");
32288
+ __publicField(this, _a295, "MySqlCountBuilder");
33054
32289
  __publicField(this, "session");
33055
32290
  this.params = params;
33056
32291
  this.mapWith(Number);
@@ -33094,13 +32329,13 @@ var init_count3 = __esm({
33094
32329
  });
33095
32330
 
33096
32331
  // ../drizzle-orm/dist/mysql-core/query-builders/delete.js
33097
- var _a298, _b221, MySqlDeleteBase;
32332
+ var _a296, _b221, MySqlDeleteBase;
33098
32333
  var init_delete3 = __esm({
33099
32334
  "../drizzle-orm/dist/mysql-core/query-builders/delete.js"() {
33100
32335
  "use strict";
33101
32336
  init_entity();
33102
32337
  init_query_promise();
33103
- MySqlDeleteBase = class extends (_b221 = QueryPromise, _a298 = entityKind, _b221) {
32338
+ MySqlDeleteBase = class extends (_b221 = QueryPromise, _a296 = entityKind, _b221) {
33104
32339
  constructor(table4, session, dialect4, withList) {
33105
32340
  super();
33106
32341
  __publicField(this, "config");
@@ -33170,12 +32405,12 @@ var init_delete3 = __esm({
33170
32405
  return this;
33171
32406
  }
33172
32407
  };
33173
- __publicField(MySqlDeleteBase, _a298, "MySqlDelete");
32408
+ __publicField(MySqlDeleteBase, _a296, "MySqlDelete");
33174
32409
  }
33175
32410
  });
33176
32411
 
33177
32412
  // ../drizzle-orm/dist/mysql-core/query-builders/insert.js
33178
- var _a299, MySqlInsertBuilder, _a300, _b222, MySqlInsertBase;
32413
+ var _a297, MySqlInsertBuilder, _a298, _b222, MySqlInsertBase;
33179
32414
  var init_insert3 = __esm({
33180
32415
  "../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
33181
32416
  "use strict";
@@ -33184,7 +32419,7 @@ var init_insert3 = __esm({
33184
32419
  init_sql();
33185
32420
  init_table();
33186
32421
  init_utils2();
33187
- _a299 = entityKind;
32422
+ _a297 = entityKind;
33188
32423
  MySqlInsertBuilder = class {
33189
32424
  constructor(table4, session, dialect4) {
33190
32425
  __publicField(this, "shouldIgnore", false);
@@ -33213,8 +32448,8 @@ var init_insert3 = __esm({
33213
32448
  return new MySqlInsertBase(this.table, mappedValues, this.shouldIgnore, this.session, this.dialect);
33214
32449
  }
33215
32450
  };
33216
- __publicField(MySqlInsertBuilder, _a299, "MySqlInsertBuilder");
33217
- MySqlInsertBase = class extends (_b222 = QueryPromise, _a300 = entityKind, _b222) {
32451
+ __publicField(MySqlInsertBuilder, _a297, "MySqlInsertBuilder");
32452
+ MySqlInsertBase = class extends (_b222 = QueryPromise, _a298 = entityKind, _b222) {
33218
32453
  constructor(table4, values, ignore, session, dialect4) {
33219
32454
  super();
33220
32455
  __publicField(this, "config");
@@ -33295,7 +32530,7 @@ var init_insert3 = __esm({
33295
32530
  return this;
33296
32531
  }
33297
32532
  };
33298
- __publicField(MySqlInsertBase, _a300, "MySqlInsert");
32533
+ __publicField(MySqlInsertBase, _a298, "MySqlInsert");
33299
32534
  }
33300
32535
  });
33301
32536
 
@@ -33379,7 +32614,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
33379
32614
  }
33380
32615
  return table4;
33381
32616
  }
33382
- var InlineForeignKeys3, _a301, _b223, _c10, _d4, _e3, MySqlTable, mysqlTable;
32617
+ var InlineForeignKeys3, _a299, _b223, _c10, _d4, _e3, MySqlTable, mysqlTable;
33383
32618
  var init_table4 = __esm({
33384
32619
  "../drizzle-orm/dist/mysql-core/table.js"() {
33385
32620
  "use strict";
@@ -33387,7 +32622,7 @@ var init_table4 = __esm({
33387
32622
  init_table();
33388
32623
  init_all3();
33389
32624
  InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
33390
- MySqlTable = class extends (_e3 = Table, _d4 = entityKind, _c10 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a301 = Table.Symbol.ExtraConfigBuilder, _e3) {
32625
+ MySqlTable = class extends (_e3 = Table, _d4 = entityKind, _c10 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a299 = Table.Symbol.ExtraConfigBuilder, _e3) {
33391
32626
  constructor() {
33392
32627
  super(...arguments);
33393
32628
  /** @internal */
@@ -33395,7 +32630,7 @@ var init_table4 = __esm({
33395
32630
  /** @internal */
33396
32631
  __publicField(this, _b223, []);
33397
32632
  /** @internal */
33398
- __publicField(this, _a301);
32633
+ __publicField(this, _a299);
33399
32634
  }
33400
32635
  };
33401
32636
  __publicField(MySqlTable, _d4, "MySqlTable");
@@ -33410,20 +32645,20 @@ var init_table4 = __esm({
33410
32645
  });
33411
32646
 
33412
32647
  // ../drizzle-orm/dist/mysql-core/view-base.js
33413
- var _a302, _b224, MySqlViewBase;
32648
+ var _a300, _b224, MySqlViewBase;
33414
32649
  var init_view_base3 = __esm({
33415
32650
  "../drizzle-orm/dist/mysql-core/view-base.js"() {
33416
32651
  "use strict";
33417
32652
  init_entity();
33418
32653
  init_sql();
33419
- MySqlViewBase = class extends (_b224 = View, _a302 = entityKind, _b224) {
32654
+ MySqlViewBase = class extends (_b224 = View, _a300 = entityKind, _b224) {
33420
32655
  };
33421
- __publicField(MySqlViewBase, _a302, "MySqlViewBase");
32656
+ __publicField(MySqlViewBase, _a300, "MySqlViewBase");
33422
32657
  }
33423
32658
  });
33424
32659
 
33425
32660
  // ../drizzle-orm/dist/mysql-core/dialect.js
33426
- var _a303, MySqlDialect;
32661
+ var _a301, MySqlDialect;
33427
32662
  var init_dialect3 = __esm({
33428
32663
  "../drizzle-orm/dist/mysql-core/dialect.js"() {
33429
32664
  "use strict";
@@ -33442,7 +32677,7 @@ var init_dialect3 = __esm({
33442
32677
  init_common4();
33443
32678
  init_table4();
33444
32679
  init_view_base3();
33445
- _a303 = entityKind;
32680
+ _a301 = entityKind;
33446
32681
  MySqlDialect = class {
33447
32682
  constructor(config) {
33448
32683
  /** @internal */
@@ -34224,7 +33459,7 @@ var init_dialect3 = __esm({
34224
33459
  };
34225
33460
  }
34226
33461
  };
34227
- __publicField(MySqlDialect, _a303, "MySqlDialect");
33462
+ __publicField(MySqlDialect, _a301, "MySqlDialect");
34228
33463
  }
34229
33464
  });
34230
33465
 
@@ -34246,7 +33481,7 @@ function createSetOperator3(type, isAll) {
34246
33481
  return leftSelect.addSetOperators(setOperators);
34247
33482
  };
34248
33483
  }
34249
- var _a304, MySqlSelectBuilder, _a305, _b225, MySqlSelectQueryBuilderBase, _a306, _b226, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
33484
+ var _a302, MySqlSelectBuilder, _a303, _b225, MySqlSelectQueryBuilderBase, _a304, _b226, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
34250
33485
  var init_select4 = __esm({
34251
33486
  "../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
34252
33487
  "use strict";
@@ -34261,7 +33496,7 @@ var init_select4 = __esm({
34261
33496
  init_utils2();
34262
33497
  init_view_common();
34263
33498
  init_view_base3();
34264
- _a304 = entityKind;
33499
+ _a302 = entityKind;
34265
33500
  MySqlSelectBuilder = class {
34266
33501
  constructor(config) {
34267
33502
  __publicField(this, "fields");
@@ -34306,8 +33541,8 @@ var init_select4 = __esm({
34306
33541
  );
34307
33542
  }
34308
33543
  };
34309
- __publicField(MySqlSelectBuilder, _a304, "MySqlSelectBuilder");
34310
- MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a305 = entityKind, _b225) {
33544
+ __publicField(MySqlSelectBuilder, _a302, "MySqlSelectBuilder");
33545
+ MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a303 = entityKind, _b225) {
34311
33546
  constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
34312
33547
  super();
34313
33548
  __publicField(this, "_");
@@ -34908,8 +34143,8 @@ var init_select4 = __esm({
34908
34143
  return this;
34909
34144
  }
34910
34145
  };
34911
- __publicField(MySqlSelectQueryBuilderBase, _a305, "MySqlSelectQueryBuilder");
34912
- MySqlSelectBase = class extends (_b226 = MySqlSelectQueryBuilderBase, _a306 = entityKind, _b226) {
34146
+ __publicField(MySqlSelectQueryBuilderBase, _a303, "MySqlSelectQueryBuilder");
34147
+ MySqlSelectBase = class extends (_b226 = MySqlSelectQueryBuilderBase, _a304 = entityKind, _b226) {
34913
34148
  constructor() {
34914
34149
  super(...arguments);
34915
34150
  __publicField(this, "execute", (placeholderValues) => {
@@ -34933,7 +34168,7 @@ var init_select4 = __esm({
34933
34168
  return query;
34934
34169
  }
34935
34170
  };
34936
- __publicField(MySqlSelectBase, _a306, "MySqlSelect");
34171
+ __publicField(MySqlSelectBase, _a304, "MySqlSelect");
34937
34172
  applyMixins(MySqlSelectBase, [QueryPromise]);
34938
34173
  getMySqlSetOperators = () => ({
34939
34174
  union: union3,
@@ -34953,7 +34188,7 @@ var init_select4 = __esm({
34953
34188
  });
34954
34189
 
34955
34190
  // ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
34956
- var _a307, QueryBuilder3;
34191
+ var _a305, QueryBuilder3;
34957
34192
  var init_query_builder4 = __esm({
34958
34193
  "../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
34959
34194
  "use strict";
@@ -34962,7 +34197,7 @@ var init_query_builder4 = __esm({
34962
34197
  init_selection_proxy();
34963
34198
  init_subquery();
34964
34199
  init_select4();
34965
- _a307 = entityKind;
34200
+ _a305 = entityKind;
34966
34201
  QueryBuilder3 = class {
34967
34202
  constructor(dialect4) {
34968
34203
  __publicField(this, "dialect");
@@ -35024,7 +34259,7 @@ var init_query_builder4 = __esm({
35024
34259
  return this.dialect;
35025
34260
  }
35026
34261
  };
35027
- __publicField(QueryBuilder3, _a307, "MySqlQueryBuilder");
34262
+ __publicField(QueryBuilder3, _a305, "MySqlQueryBuilder");
35028
34263
  }
35029
34264
  });
35030
34265
 
@@ -35036,14 +34271,14 @@ var init_select_types3 = __esm({
35036
34271
  });
35037
34272
 
35038
34273
  // ../drizzle-orm/dist/mysql-core/query-builders/update.js
35039
- var _a308, MySqlUpdateBuilder, _a309, _b227, MySqlUpdateBase;
34274
+ var _a306, MySqlUpdateBuilder, _a307, _b227, MySqlUpdateBase;
35040
34275
  var init_update3 = __esm({
35041
34276
  "../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
35042
34277
  "use strict";
35043
34278
  init_entity();
35044
34279
  init_query_promise();
35045
34280
  init_utils2();
35046
- _a308 = entityKind;
34281
+ _a306 = entityKind;
35047
34282
  MySqlUpdateBuilder = class {
35048
34283
  constructor(table4, session, dialect4, withList) {
35049
34284
  this.table = table4;
@@ -35055,8 +34290,8 @@ var init_update3 = __esm({
35055
34290
  return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
35056
34291
  }
35057
34292
  };
35058
- __publicField(MySqlUpdateBuilder, _a308, "MySqlUpdateBuilder");
35059
- MySqlUpdateBase = class extends (_b227 = QueryPromise, _a309 = entityKind, _b227) {
34293
+ __publicField(MySqlUpdateBuilder, _a306, "MySqlUpdateBuilder");
34294
+ MySqlUpdateBase = class extends (_b227 = QueryPromise, _a307 = entityKind, _b227) {
35060
34295
  constructor(table4, set, session, dialect4, withList) {
35061
34296
  super();
35062
34297
  __publicField(this, "config");
@@ -35129,7 +34364,7 @@ var init_update3 = __esm({
35129
34364
  return this;
35130
34365
  }
35131
34366
  };
35132
- __publicField(MySqlUpdateBase, _a309, "MySqlUpdate");
34367
+ __publicField(MySqlUpdateBase, _a307, "MySqlUpdate");
35133
34368
  }
35134
34369
  });
35135
34370
 
@@ -35147,14 +34382,14 @@ var init_query_builders3 = __esm({
35147
34382
  });
35148
34383
 
35149
34384
  // ../drizzle-orm/dist/mysql-core/query-builders/query.js
35150
- var _a310, RelationalQueryBuilder3, _a311, _b228, MySqlRelationalQuery;
34385
+ var _a308, RelationalQueryBuilder3, _a309, _b228, MySqlRelationalQuery;
35151
34386
  var init_query3 = __esm({
35152
34387
  "../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
35153
34388
  "use strict";
35154
34389
  init_entity();
35155
34390
  init_query_promise();
35156
34391
  init_relations();
35157
- _a310 = entityKind;
34392
+ _a308 = entityKind;
35158
34393
  RelationalQueryBuilder3 = class {
35159
34394
  constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, mode) {
35160
34395
  this.fullSchema = fullSchema;
@@ -35195,8 +34430,8 @@ var init_query3 = __esm({
35195
34430
  );
35196
34431
  }
35197
34432
  };
35198
- __publicField(RelationalQueryBuilder3, _a310, "MySqlRelationalQueryBuilder");
35199
- MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a311 = entityKind, _b228) {
34433
+ __publicField(RelationalQueryBuilder3, _a308, "MySqlRelationalQueryBuilder");
34434
+ MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a309 = entityKind, _b228) {
35200
34435
  constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, queryMode, mode) {
35201
34436
  super();
35202
34437
  this.fullSchema = fullSchema;
@@ -35260,12 +34495,12 @@ var init_query3 = __esm({
35260
34495
  return this.prepare().execute();
35261
34496
  }
35262
34497
  };
35263
- __publicField(MySqlRelationalQuery, _a311, "MySqlRelationalQuery");
34498
+ __publicField(MySqlRelationalQuery, _a309, "MySqlRelationalQuery");
35264
34499
  }
35265
34500
  });
35266
34501
 
35267
34502
  // ../drizzle-orm/dist/mysql-core/db.js
35268
- var _a312, MySqlDatabase;
34503
+ var _a310, MySqlDatabase;
35269
34504
  var init_db3 = __esm({
35270
34505
  "../drizzle-orm/dist/mysql-core/db.js"() {
35271
34506
  "use strict";
@@ -35276,7 +34511,7 @@ var init_db3 = __esm({
35276
34511
  init_count3();
35277
34512
  init_query_builders3();
35278
34513
  init_query3();
35279
- _a312 = entityKind;
34514
+ _a310 = entityKind;
35280
34515
  MySqlDatabase = class {
35281
34516
  constructor(dialect4, session, schema4, mode) {
35282
34517
  __publicField(this, "query");
@@ -35489,17 +34724,17 @@ var init_db3 = __esm({
35489
34724
  return this.session.transaction(transaction, config);
35490
34725
  }
35491
34726
  };
35492
- __publicField(MySqlDatabase, _a312, "MySqlDatabase");
34727
+ __publicField(MySqlDatabase, _a310, "MySqlDatabase");
35493
34728
  }
35494
34729
  });
35495
34730
 
35496
34731
  // ../drizzle-orm/dist/mysql-core/indexes.js
35497
- var _a313, IndexBuilderOn3, _a314, IndexBuilder3, _a315, Index5;
34732
+ var _a311, IndexBuilderOn3, _a312, IndexBuilder3, _a313, Index5;
35498
34733
  var init_indexes3 = __esm({
35499
34734
  "../drizzle-orm/dist/mysql-core/indexes.js"() {
35500
34735
  "use strict";
35501
34736
  init_entity();
35502
- _a313 = entityKind;
34737
+ _a311 = entityKind;
35503
34738
  IndexBuilderOn3 = class {
35504
34739
  constructor(name2, unique) {
35505
34740
  this.name = name2;
@@ -35509,8 +34744,8 @@ var init_indexes3 = __esm({
35509
34744
  return new IndexBuilder3(this.name, columns, this.unique);
35510
34745
  }
35511
34746
  };
35512
- __publicField(IndexBuilderOn3, _a313, "MySqlIndexBuilderOn");
35513
- _a314 = entityKind;
34747
+ __publicField(IndexBuilderOn3, _a311, "MySqlIndexBuilderOn");
34748
+ _a312 = entityKind;
35514
34749
  IndexBuilder3 = class {
35515
34750
  constructor(name2, columns, unique) {
35516
34751
  /** @internal */
@@ -35538,26 +34773,26 @@ var init_indexes3 = __esm({
35538
34773
  return new Index5(this.config, table4);
35539
34774
  }
35540
34775
  };
35541
- __publicField(IndexBuilder3, _a314, "MySqlIndexBuilder");
35542
- _a315 = entityKind;
34776
+ __publicField(IndexBuilder3, _a312, "MySqlIndexBuilder");
34777
+ _a313 = entityKind;
35543
34778
  Index5 = class {
35544
34779
  constructor(config, table4) {
35545
34780
  __publicField(this, "config");
35546
34781
  this.config = { ...config, table: table4 };
35547
34782
  }
35548
34783
  };
35549
- __publicField(Index5, _a315, "MySqlIndex");
34784
+ __publicField(Index5, _a313, "MySqlIndex");
35550
34785
  }
35551
34786
  });
35552
34787
 
35553
34788
  // ../drizzle-orm/dist/mysql-core/primary-keys.js
35554
- var _a316, PrimaryKeyBuilder3, _a317, PrimaryKey3;
34789
+ var _a314, PrimaryKeyBuilder3, _a315, PrimaryKey3;
35555
34790
  var init_primary_keys3 = __esm({
35556
34791
  "../drizzle-orm/dist/mysql-core/primary-keys.js"() {
35557
34792
  "use strict";
35558
34793
  init_entity();
35559
34794
  init_table4();
35560
- _a316 = entityKind;
34795
+ _a314 = entityKind;
35561
34796
  PrimaryKeyBuilder3 = class {
35562
34797
  constructor(columns, name2) {
35563
34798
  /** @internal */
@@ -35572,8 +34807,8 @@ var init_primary_keys3 = __esm({
35572
34807
  return new PrimaryKey3(table4, this.columns, this.name);
35573
34808
  }
35574
34809
  };
35575
- __publicField(PrimaryKeyBuilder3, _a316, "MySqlPrimaryKeyBuilder");
35576
- _a317 = entityKind;
34810
+ __publicField(PrimaryKeyBuilder3, _a314, "MySqlPrimaryKeyBuilder");
34811
+ _a315 = entityKind;
35577
34812
  PrimaryKey3 = class {
35578
34813
  constructor(table4, columns, name2) {
35579
34814
  __publicField(this, "columns");
@@ -35586,7 +34821,7 @@ var init_primary_keys3 = __esm({
35586
34821
  return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
35587
34822
  }
35588
34823
  };
35589
- __publicField(PrimaryKey3, _a317, "MySqlPrimaryKey");
34824
+ __publicField(PrimaryKey3, _a315, "MySqlPrimaryKey");
35590
34825
  }
35591
34826
  });
35592
34827
 
@@ -35606,7 +34841,7 @@ function mysqlViewWithSchema(name2, selection, schema4) {
35606
34841
  }
35607
34842
  return new ViewBuilder3(name2, schema4);
35608
34843
  }
35609
- var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231, _c11, MySqlView;
34844
+ var _a316, ViewBuilderCore2, _a317, _b229, ViewBuilder3, _a318, _b230, ManualViewBuilder3, _a319, _b231, _c11, MySqlView;
35610
34845
  var init_view3 = __esm({
35611
34846
  "../drizzle-orm/dist/mysql-core/view.js"() {
35612
34847
  "use strict";
@@ -35617,7 +34852,7 @@ var init_view3 = __esm({
35617
34852
  init_table4();
35618
34853
  init_view_base3();
35619
34854
  init_view_common4();
35620
- _a318 = entityKind;
34855
+ _a316 = entityKind;
35621
34856
  ViewBuilderCore2 = class {
35622
34857
  constructor(name2, schema4) {
35623
34858
  __publicField(this, "config", {});
@@ -35641,8 +34876,8 @@ var init_view3 = __esm({
35641
34876
  return this;
35642
34877
  }
35643
34878
  };
35644
- __publicField(ViewBuilderCore2, _a318, "MySqlViewBuilder");
35645
- ViewBuilder3 = class extends (_b229 = ViewBuilderCore2, _a319 = entityKind, _b229) {
34879
+ __publicField(ViewBuilderCore2, _a316, "MySqlViewBuilder");
34880
+ ViewBuilder3 = class extends (_b229 = ViewBuilderCore2, _a317 = entityKind, _b229) {
35646
34881
  as(qb) {
35647
34882
  if (typeof qb === "function") {
35648
34883
  qb = qb(new QueryBuilder3());
@@ -35668,8 +34903,8 @@ var init_view3 = __esm({
35668
34903
  );
35669
34904
  }
35670
34905
  };
35671
- __publicField(ViewBuilder3, _a319, "MySqlViewBuilder");
35672
- ManualViewBuilder3 = class extends (_b230 = ViewBuilderCore2, _a320 = entityKind, _b230) {
34906
+ __publicField(ViewBuilder3, _a317, "MySqlViewBuilder");
34907
+ ManualViewBuilder3 = class extends (_b230 = ViewBuilderCore2, _a318 = entityKind, _b230) {
35673
34908
  constructor(name2, columns, schema4) {
35674
34909
  super(name2, schema4);
35675
34910
  __publicField(this, "columns");
@@ -35714,11 +34949,11 @@ var init_view3 = __esm({
35714
34949
  );
35715
34950
  }
35716
34951
  };
35717
- __publicField(ManualViewBuilder3, _a320, "MySqlManualViewBuilder");
35718
- MySqlView = class extends (_c11 = MySqlViewBase, _b231 = entityKind, _a321 = MySqlViewConfig, _c11) {
34952
+ __publicField(ManualViewBuilder3, _a318, "MySqlManualViewBuilder");
34953
+ MySqlView = class extends (_c11 = MySqlViewBase, _b231 = entityKind, _a319 = MySqlViewConfig, _c11) {
35719
34954
  constructor({ mysqlConfig, config }) {
35720
34955
  super(config);
35721
- __publicField(this, _a321);
34956
+ __publicField(this, _a319);
35722
34957
  this[MySqlViewConfig] = mysqlConfig;
35723
34958
  }
35724
34959
  };
@@ -35727,14 +34962,14 @@ var init_view3 = __esm({
35727
34962
  });
35728
34963
 
35729
34964
  // ../drizzle-orm/dist/mysql-core/schema.js
35730
- var _a322, MySqlSchema5;
34965
+ var _a320, MySqlSchema5;
35731
34966
  var init_schema2 = __esm({
35732
34967
  "../drizzle-orm/dist/mysql-core/schema.js"() {
35733
34968
  "use strict";
35734
34969
  init_entity();
35735
34970
  init_table4();
35736
34971
  init_view3();
35737
- _a322 = entityKind;
34972
+ _a320 = entityKind;
35738
34973
  MySqlSchema5 = class {
35739
34974
  constructor(schemaName) {
35740
34975
  __publicField(this, "table", (name2, columns, extraConfig) => {
@@ -35746,12 +34981,12 @@ var init_schema2 = __esm({
35746
34981
  this.schemaName = schemaName;
35747
34982
  }
35748
34983
  };
35749
- __publicField(MySqlSchema5, _a322, "MySqlSchema");
34984
+ __publicField(MySqlSchema5, _a320, "MySqlSchema");
35750
34985
  }
35751
34986
  });
35752
34987
 
35753
34988
  // ../drizzle-orm/dist/mysql-core/session.js
35754
- var _a323, MySqlPreparedQuery, _a324, MySqlSession, _a325, _b232, MySqlTransaction;
34989
+ var _a321, MySqlPreparedQuery, _a322, MySqlSession, _a323, _b232, MySqlTransaction;
35755
34990
  var init_session3 = __esm({
35756
34991
  "../drizzle-orm/dist/mysql-core/session.js"() {
35757
34992
  "use strict";
@@ -35759,15 +34994,15 @@ var init_session3 = __esm({
35759
34994
  init_errors();
35760
34995
  init_sql();
35761
34996
  init_db3();
35762
- _a323 = entityKind;
34997
+ _a321 = entityKind;
35763
34998
  MySqlPreparedQuery = class {
35764
34999
  constructor() {
35765
35000
  /** @internal */
35766
35001
  __publicField(this, "joinsNotNullableMap");
35767
35002
  }
35768
35003
  };
35769
- __publicField(MySqlPreparedQuery, _a323, "MySqlPreparedQuery");
35770
- _a324 = entityKind;
35004
+ __publicField(MySqlPreparedQuery, _a321, "MySqlPreparedQuery");
35005
+ _a322 = entityKind;
35771
35006
  MySqlSession = class {
35772
35007
  constructor(dialect4) {
35773
35008
  this.dialect = dialect4;
@@ -35802,8 +35037,8 @@ var init_session3 = __esm({
35802
35037
  return parts.length ? sql`start transaction ${sql.raw(parts.join(" "))}` : void 0;
35803
35038
  }
35804
35039
  };
35805
- __publicField(MySqlSession, _a324, "MySqlSession");
35806
- MySqlTransaction = class extends (_b232 = MySqlDatabase, _a325 = entityKind, _b232) {
35040
+ __publicField(MySqlSession, _a322, "MySqlSession");
35041
+ MySqlTransaction = class extends (_b232 = MySqlDatabase, _a323 = entityKind, _b232) {
35807
35042
  constructor(dialect4, session, schema4, nestedIndex, mode) {
35808
35043
  super(dialect4, session, schema4, mode);
35809
35044
  this.schema = schema4;
@@ -35813,7 +35048,7 @@ var init_session3 = __esm({
35813
35048
  throw new TransactionRollbackError();
35814
35049
  }
35815
35050
  };
35816
- __publicField(MySqlTransaction, _a325, "MySqlTransaction");
35051
+ __publicField(MySqlTransaction, _a323, "MySqlTransaction");
35817
35052
  }
35818
35053
  });
35819
35054
 
@@ -36511,13 +35746,6 @@ var init_cli = __esm({
36511
35746
  breakpoints: booleanType().optional().default(true),
36512
35747
  migrations: objectType({
36513
35748
  prefix: prefix.optional().default("index")
36514
- }).optional(),
36515
- entities: objectType({
36516
- roles: booleanType().or(objectType({
36517
- provider: stringType().optional(),
36518
- include: stringType().array().optional(),
36519
- exclude: stringType().array().optional()
36520
- })).optional().default(false)
36521
35749
  }).optional()
36522
35750
  }).passthrough();
36523
35751
  configCheck = objectType({
@@ -36784,7 +36012,6 @@ var init_pgImports = __esm({
36784
36012
  const enums = [];
36785
36013
  const schemas = [];
36786
36014
  const sequences = [];
36787
- const roles = [];
36788
36015
  const i0values = Object.values(exports2);
36789
36016
  i0values.forEach((t) => {
36790
36017
  if (isPgEnum(t)) {
@@ -36800,11 +36027,8 @@ var init_pgImports = __esm({
36800
36027
  if (isPgSequence(t)) {
36801
36028
  sequences.push(t);
36802
36029
  }
36803
- if (is(t, PgRole)) {
36804
- roles.push(t);
36805
- }
36806
36030
  });
36807
- return { tables, enums, schemas, sequences, roles };
36031
+ return { tables, enums, schemas, sequences };
36808
36032
  };
36809
36033
  }
36810
36034
  });
@@ -37212,7 +36436,7 @@ init_mjs();
37212
36436
  init_global();
37213
36437
  init_pgSerializer();
37214
36438
  init_views();
37215
- var pgPushIntrospect = async (db, filters, schemaFilters, entities = { roles: true }) => {
36439
+ var pgPushIntrospect = async (db, filters, schemaFilters) => {
37216
36440
  const matchers = filters.map((it) => {
37217
36441
  return new Minimatch(it);
37218
36442
  });
@@ -37240,7 +36464,7 @@ var pgPushIntrospect = async (db, filters, schemaFilters, entities = { roles: tr
37240
36464
  );
37241
36465
  const res = await (0, import_hanji3.renderWithTask)(
37242
36466
  progress,
37243
- fromDatabase(db, filter2, schemaFilters, entities)
36467
+ fromDatabase(db, filter2, schemaFilters)
37244
36468
  );
37245
36469
  const schema4 = { id: originUUID, prevId: "", ...res };
37246
36470
  const { internal, ...schemaWithoutInternals } = schema4;
@@ -37718,7 +36942,6 @@ var generateDrizzleJson = (imports, prevId, schemaFilters, casing2) => {
37718
36942
  prepared.enums,
37719
36943
  prepared.schemas,
37720
36944
  prepared.sequences,
37721
- prepared.roles,
37722
36945
  casing2,
37723
36946
  schemaFilters
37724
36947
  );
@@ -37740,8 +36963,6 @@ var generateMigration = async (prev, cur) => {
37740
36963
  schemasResolver,
37741
36964
  enumsResolver,
37742
36965
  sequencesResolver,
37743
- policyResolver,
37744
- roleResolver,
37745
36966
  tablesResolver,
37746
36967
  columnsResolver,
37747
36968
  validatedPrev,
@@ -37774,8 +36995,6 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
37774
36995
  schemasResolver,
37775
36996
  enumsResolver,
37776
36997
  sequencesResolver,
37777
- policyResolver,
37778
- roleResolver,
37779
36998
  tablesResolver,
37780
36999
  columnsResolver,
37781
37000
  validatedPrev,