drizzle-kit 0.20.8 → 0.20.9-1dc10f5

Sign up to get free protection for your applications and to get access to all the features.
package/bin.cjs CHANGED
@@ -469,8 +469,8 @@ var init_lib = __esm({
469
469
  };
470
470
  overrideErrorMap = errorMap;
471
471
  makeIssue = (params) => {
472
- const { data, path: path4, errorMaps, issueData } = params;
473
- const fullPath = [...path4, ...issueData.path || []];
472
+ const { data, path: path5, errorMaps, issueData } = params;
473
+ const fullPath = [...path5, ...issueData.path || []];
474
474
  const fullIssue = {
475
475
  ...issueData,
476
476
  path: fullPath
@@ -552,10 +552,10 @@ var init_lib = __esm({
552
552
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
553
553
  })(errorUtil || (errorUtil = {}));
554
554
  ParseInputLazyPath = class {
555
- constructor(parent, value, path4, key) {
555
+ constructor(parent, value, path5, key) {
556
556
  this.parent = parent;
557
557
  this.data = value;
558
- this._path = path4;
558
+ this._path = path5;
559
559
  this._key = key;
560
560
  }
561
561
  get path() {
@@ -4907,6 +4907,7 @@ var init_pgSchema = __esm({
4907
4907
  tableFrom: stringType(),
4908
4908
  columnsFrom: stringType().array(),
4909
4909
  tableTo: stringType(),
4910
+ schemaTo: stringType(),
4910
4911
  columnsTo: stringType().array(),
4911
4912
  onUpdate: stringType().optional(),
4912
4913
  onDelete: stringType().optional()
@@ -5064,7 +5065,7 @@ var init_pgSchema = __esm({
5064
5065
  return result;
5065
5066
  },
5066
5067
  squashFK: (fk4) => {
5067
- return `${fk4.name};${fk4.tableFrom};${fk4.columnsFrom.join(",")};${fk4.tableTo};${fk4.columnsTo.join(",")};${fk4.onUpdate ?? ""};${fk4.onDelete ?? ""}`;
5068
+ return `${fk4.name};${fk4.tableFrom};${fk4.columnsFrom.join(",")};${fk4.tableTo};${fk4.columnsTo.join(",")};${fk4.onUpdate ?? ""};${fk4.onDelete ?? ""};${fk4.schemaTo ?? ""}`;
5068
5069
  },
5069
5070
  squashPK: (pk) => {
5070
5071
  return `${pk.columns.join(",")};${pk.name}`;
@@ -5092,12 +5093,14 @@ var init_pgSchema = __esm({
5092
5093
  tableTo,
5093
5094
  columnsToStr,
5094
5095
  onUpdate,
5095
- onDelete
5096
+ onDelete,
5097
+ schemaTo
5096
5098
  ] = input.split(";");
5097
5099
  const result = fk2.parse({
5098
5100
  name,
5099
5101
  tableFrom,
5100
5102
  columnsFrom: columnsFromStr.split(","),
5103
+ schemaTo,
5101
5104
  tableTo,
5102
5105
  columnsTo: columnsToStr.split(","),
5103
5106
  onUpdate,
@@ -5774,7 +5777,7 @@ var require_ms = __commonJS({
5774
5777
  // node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
5775
5778
  var require_common = __commonJS({
5776
5779
  "node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports, module2) {
5777
- function setup(env2) {
5780
+ function setup(env3) {
5778
5781
  createDebug.debug = createDebug;
5779
5782
  createDebug.default = createDebug;
5780
5783
  createDebug.coerce = coerce2;
@@ -5783,8 +5786,8 @@ var require_common = __commonJS({
5783
5786
  createDebug.enabled = enabled;
5784
5787
  createDebug.humanize = require_ms();
5785
5788
  createDebug.destroy = destroy;
5786
- Object.keys(env2).forEach((key) => {
5787
- createDebug[key] = env2[key];
5789
+ Object.keys(env3).forEach((key) => {
5790
+ createDebug[key] = env3[key];
5788
5791
  });
5789
5792
  createDebug.names = [];
5790
5793
  createDebug.skips = [];
@@ -6120,23 +6123,23 @@ var require_has_flag = __commonJS({
6120
6123
  var require_supports_color = __commonJS({
6121
6124
  "node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
6122
6125
  "use strict";
6123
- var os2 = require("os");
6126
+ var os3 = require("os");
6124
6127
  var tty2 = require("tty");
6125
6128
  var hasFlag2 = require_has_flag();
6126
- var { env: env2 } = process;
6129
+ var { env: env3 } = process;
6127
6130
  var forceColor;
6128
6131
  if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
6129
6132
  forceColor = 0;
6130
6133
  } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
6131
6134
  forceColor = 1;
6132
6135
  }
6133
- if ("FORCE_COLOR" in env2) {
6134
- if (env2.FORCE_COLOR === "true") {
6136
+ if ("FORCE_COLOR" in env3) {
6137
+ if (env3.FORCE_COLOR === "true") {
6135
6138
  forceColor = 1;
6136
- } else if (env2.FORCE_COLOR === "false") {
6139
+ } else if (env3.FORCE_COLOR === "false") {
6137
6140
  forceColor = 0;
6138
6141
  } else {
6139
- forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
6142
+ forceColor = env3.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env3.FORCE_COLOR, 10), 3);
6140
6143
  }
6141
6144
  }
6142
6145
  function translateLevel2(level) {
@@ -6164,44 +6167,44 @@ var require_supports_color = __commonJS({
6164
6167
  return 0;
6165
6168
  }
6166
6169
  const min = forceColor || 0;
6167
- if (env2.TERM === "dumb") {
6170
+ if (env3.TERM === "dumb") {
6168
6171
  return min;
6169
6172
  }
6170
6173
  if (process.platform === "win32") {
6171
- const osRelease = os2.release().split(".");
6174
+ const osRelease = os3.release().split(".");
6172
6175
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
6173
6176
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
6174
6177
  }
6175
6178
  return 1;
6176
6179
  }
6177
- if ("CI" in env2) {
6178
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
6180
+ if ("CI" in env3) {
6181
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") {
6179
6182
  return 1;
6180
6183
  }
6181
6184
  return min;
6182
6185
  }
6183
- if ("TEAMCITY_VERSION" in env2) {
6184
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
6186
+ if ("TEAMCITY_VERSION" in env3) {
6187
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
6185
6188
  }
6186
- if (env2.COLORTERM === "truecolor") {
6189
+ if (env3.COLORTERM === "truecolor") {
6187
6190
  return 3;
6188
6191
  }
6189
- if ("TERM_PROGRAM" in env2) {
6190
- const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
6191
- switch (env2.TERM_PROGRAM) {
6192
+ if ("TERM_PROGRAM" in env3) {
6193
+ const version = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
6194
+ switch (env3.TERM_PROGRAM) {
6192
6195
  case "iTerm.app":
6193
6196
  return version >= 3 ? 3 : 2;
6194
6197
  case "Apple_Terminal":
6195
6198
  return 2;
6196
6199
  }
6197
6200
  }
6198
- if (/-256(color)?$/i.test(env2.TERM)) {
6201
+ if (/-256(color)?$/i.test(env3.TERM)) {
6199
6202
  return 2;
6200
6203
  }
6201
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
6204
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
6202
6205
  return 1;
6203
6206
  }
6204
- if ("COLORTERM" in env2) {
6207
+ if ("COLORTERM" in env3) {
6205
6208
  return 1;
6206
6209
  }
6207
6210
  return min;
@@ -6572,16 +6575,16 @@ var require_node2 = __commonJS({
6572
6575
  }
6573
6576
  exports2.urlGenerate = urlGenerate;
6574
6577
  function normalize(aPath) {
6575
- var path4 = aPath;
6578
+ var path5 = aPath;
6576
6579
  var url = urlParse(aPath);
6577
6580
  if (url) {
6578
6581
  if (!url.path) {
6579
6582
  return aPath;
6580
6583
  }
6581
- path4 = url.path;
6584
+ path5 = url.path;
6582
6585
  }
6583
- var isAbsolute = exports2.isAbsolute(path4);
6584
- var parts = path4.split(/\/+/);
6586
+ var isAbsolute = exports2.isAbsolute(path5);
6587
+ var parts = path5.split(/\/+/);
6585
6588
  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
6586
6589
  part = parts[i];
6587
6590
  if (part === ".") {
@@ -6598,15 +6601,15 @@ var require_node2 = __commonJS({
6598
6601
  }
6599
6602
  }
6600
6603
  }
6601
- path4 = parts.join("/");
6602
- if (path4 === "") {
6603
- path4 = isAbsolute ? "/" : ".";
6604
+ path5 = parts.join("/");
6605
+ if (path5 === "") {
6606
+ path5 = isAbsolute ? "/" : ".";
6604
6607
  }
6605
6608
  if (url) {
6606
- url.path = path4;
6609
+ url.path = path5;
6607
6610
  return urlGenerate(url);
6608
6611
  }
6609
- return path4;
6612
+ return path5;
6610
6613
  }
6611
6614
  exports2.normalize = normalize;
6612
6615
  function join22(aRoot, aPath) {
@@ -7243,13 +7246,13 @@ var require_node2 = __commonJS({
7243
7246
  function randomIntInRange(low, high) {
7244
7247
  return Math.round(low + Math.random() * (high - low));
7245
7248
  }
7246
- function doQuickSort(ary, comparator, p, r) {
7247
- if (p < r) {
7248
- var pivotIndex = randomIntInRange(p, r);
7249
- var i = p - 1;
7249
+ function doQuickSort(ary, comparator, p2, r) {
7250
+ if (p2 < r) {
7251
+ var pivotIndex = randomIntInRange(p2, r);
7252
+ var i = p2 - 1;
7250
7253
  swap(ary, pivotIndex, r);
7251
7254
  var pivot = ary[r];
7252
- for (var j = p; j < r; j++) {
7255
+ for (var j = p2; j < r; j++) {
7253
7256
  if (comparator(ary[j], pivot) <= 0) {
7254
7257
  i += 1;
7255
7258
  swap(ary, i, j);
@@ -7257,7 +7260,7 @@ var require_node2 = __commonJS({
7257
7260
  }
7258
7261
  swap(ary, i + 1, j);
7259
7262
  var q = i + 1;
7260
- doQuickSort(ary, comparator, p, q - 1);
7263
+ doQuickSort(ary, comparator, p2, q - 1);
7261
7264
  doQuickSort(ary, comparator, q + 1, r);
7262
7265
  }
7263
7266
  }
@@ -8136,7 +8139,7 @@ var require_node2 = __commonJS({
8136
8139
  });
8137
8140
  var require_source_map_support = __commonJS2((exports2, module22) => {
8138
8141
  var SourceMapConsumer = require_source_map().SourceMapConsumer;
8139
- var path4 = require("path");
8142
+ var path5 = require("path");
8140
8143
  var fs32;
8141
8144
  try {
8142
8145
  fs32 = require("fs");
@@ -8209,15 +8212,15 @@ var require_node2 = __commonJS({
8209
8212
  function supportRelativeURL(file, url) {
8210
8213
  if (!file)
8211
8214
  return url;
8212
- var dir = path4.dirname(file);
8215
+ var dir = path5.dirname(file);
8213
8216
  var match2 = /^\w+:\/\/[^\/]*/.exec(dir);
8214
8217
  var protocol = match2 ? match2[0] : "";
8215
8218
  var startPath = dir.slice(protocol.length);
8216
8219
  if (protocol && /^\/\w\:/.test(startPath)) {
8217
8220
  protocol += "/";
8218
- return protocol + path4.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
8221
+ return protocol + path5.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
8219
8222
  }
8220
- return protocol + path4.resolve(dir.slice(protocol.length), url);
8223
+ return protocol + path5.resolve(dir.slice(protocol.length), url);
8221
8224
  }
8222
8225
  function retrieveSourceMapURL(source) {
8223
8226
  var fileData;
@@ -8697,7 +8700,7 @@ var require_node2 = __commonJS({
8697
8700
  });
8698
8701
  };
8699
8702
  }
8700
- var readFile = (fp) => new Promise((resolve2, reject) => {
8703
+ var readFile2 = (fp) => new Promise((resolve2, reject) => {
8701
8704
  _fs.default.readFile(fp, "utf8", (err2, data) => {
8702
8705
  if (err2)
8703
8706
  return reject(err2);
@@ -8895,7 +8898,7 @@ var require_node2 = __commonJS({
8895
8898
  data: _this3.packageJsonCache.get(filepath)[options.packageKey]
8896
8899
  };
8897
8900
  }
8898
- const data = _this3.options.parseJSON(yield readFile(filepath));
8901
+ const data = _this3.options.parseJSON(yield readFile2(filepath));
8899
8902
  return {
8900
8903
  path: filepath,
8901
8904
  data
@@ -8903,7 +8906,7 @@ var require_node2 = __commonJS({
8903
8906
  }
8904
8907
  return {
8905
8908
  path: filepath,
8906
- data: yield readFile(filepath)
8909
+ data: yield readFile2(filepath)
8907
8910
  };
8908
8911
  }
8909
8912
  return {};
@@ -9013,12 +9016,12 @@ var require_node2 = __commonJS({
9013
9016
  Object.defineProperty(exports2, "__esModule", { value: true });
9014
9017
  exports2.removeExtension = exports2.fileExistsAsync = exports2.readJsonFromDiskAsync = exports2.readJsonFromDiskSync = exports2.fileExistsSync = void 0;
9015
9018
  var fs32 = require("fs");
9016
- function fileExistsSync(path4) {
9017
- if (!fs32.existsSync(path4)) {
9019
+ function fileExistsSync(path5) {
9020
+ if (!fs32.existsSync(path5)) {
9018
9021
  return false;
9019
9022
  }
9020
9023
  try {
9021
- var stats = fs32.statSync(path4);
9024
+ var stats = fs32.statSync(path5);
9022
9025
  return stats.isFile();
9023
9026
  } catch (err2) {
9024
9027
  return false;
@@ -9032,8 +9035,8 @@ var require_node2 = __commonJS({
9032
9035
  return require(packageJsonPath);
9033
9036
  }
9034
9037
  exports2.readJsonFromDiskSync = readJsonFromDiskSync;
9035
- function readJsonFromDiskAsync(path4, callback) {
9036
- fs32.readFile(path4, "utf8", function(err2, result) {
9038
+ function readJsonFromDiskAsync(path5, callback) {
9039
+ fs32.readFile(path5, "utf8", function(err2, result) {
9037
9040
  if (err2 || !result) {
9038
9041
  return callback();
9039
9042
  }
@@ -9051,8 +9054,8 @@ var require_node2 = __commonJS({
9051
9054
  });
9052
9055
  }
9053
9056
  exports2.fileExistsAsync = fileExistsAsync;
9054
- function removeExtension(path4) {
9055
- return path4.substring(0, path4.lastIndexOf(".")) || path4;
9057
+ function removeExtension(path5) {
9058
+ return path5.substring(0, path5.lastIndexOf(".")) || path5;
9056
9059
  }
9057
9060
  exports2.removeExtension = removeExtension;
9058
9061
  });
@@ -9060,7 +9063,7 @@ var require_node2 = __commonJS({
9060
9063
  "use strict";
9061
9064
  Object.defineProperty(exports2, "__esModule", { value: true });
9062
9065
  exports2.getAbsoluteMappingEntries = void 0;
9063
- var path4 = require("path");
9066
+ var path5 = require("path");
9064
9067
  function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
9065
9068
  var sortedKeys = sortByLongestPrefix(Object.keys(paths));
9066
9069
  var absolutePaths = [];
@@ -9069,7 +9072,7 @@ var require_node2 = __commonJS({
9069
9072
  absolutePaths.push({
9070
9073
  pattern: key,
9071
9074
  paths: paths[key].map(function(pathToResolve) {
9072
- return path4.resolve(absoluteBaseUrl, pathToResolve);
9075
+ return path5.resolve(absoluteBaseUrl, pathToResolve);
9073
9076
  })
9074
9077
  });
9075
9078
  }
@@ -9096,7 +9099,7 @@ var require_node2 = __commonJS({
9096
9099
  "use strict";
9097
9100
  Object.defineProperty(exports2, "__esModule", { value: true });
9098
9101
  exports2.exhaustiveTypeException = exports2.getStrippedPath = exports2.getPathsToTry = void 0;
9099
- var path4 = require("path");
9102
+ var path5 = require("path");
9100
9103
  var path_1 = require("path");
9101
9104
  var filesystem_1 = require_filesystem();
9102
9105
  function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
@@ -9116,9 +9119,9 @@ var require_node2 = __commonJS({
9116
9119
  }));
9117
9120
  pathsToTry.push({
9118
9121
  type: "package",
9119
- path: path4.join(physicalPath, "/package.json")
9122
+ path: path5.join(physicalPath, "/package.json")
9120
9123
  });
9121
- var indexPath = path4.join(physicalPath, "/index");
9124
+ var indexPath = path5.join(physicalPath, "/index");
9122
9125
  pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
9123
9126
  return { type: "index", path: indexPath + e };
9124
9127
  }));
@@ -9166,7 +9169,7 @@ var require_node2 = __commonJS({
9166
9169
  "use strict";
9167
9170
  Object.defineProperty(exports2, "__esModule", { value: true });
9168
9171
  exports2.matchFromAbsolutePaths = exports2.createMatchPath = void 0;
9169
- var path4 = require("path");
9172
+ var path5 = require("path");
9170
9173
  var Filesystem = require_filesystem();
9171
9174
  var MappingEntry = require_mapping_entry();
9172
9175
  var TryPath = require_try_path();
@@ -9210,7 +9213,7 @@ var require_node2 = __commonJS({
9210
9213
  return obj[key];
9211
9214
  }, packageJson);
9212
9215
  if (candidateMapping && typeof candidateMapping === "string") {
9213
- var candidateFilePath = path4.join(path4.dirname(packageJsonPath), candidateMapping);
9216
+ var candidateFilePath = path5.join(path5.dirname(packageJsonPath), candidateMapping);
9214
9217
  if (fileExists(candidateFilePath)) {
9215
9218
  return candidateFilePath;
9216
9219
  }
@@ -9250,7 +9253,7 @@ var require_node2 = __commonJS({
9250
9253
  "use strict";
9251
9254
  Object.defineProperty(exports2, "__esModule", { value: true });
9252
9255
  exports2.matchFromAbsolutePathsAsync = exports2.createMatchPathAsync = void 0;
9253
- var path4 = require("path");
9256
+ var path5 = require("path");
9254
9257
  var TryPath = require_try_path();
9255
9258
  var MappingEntry = require_mapping_entry();
9256
9259
  var Filesystem = require_filesystem();
@@ -9304,7 +9307,7 @@ var require_node2 = __commonJS({
9304
9307
  if (typeof mainFieldMapping !== "string") {
9305
9308
  return tryNext();
9306
9309
  }
9307
- var mappedFilePath = path4.join(path4.dirname(packageJsonPath), mainFieldMapping);
9310
+ var mappedFilePath = path5.join(path5.dirname(packageJsonPath), mainFieldMapping);
9308
9311
  fileExistsAsync(mappedFilePath, function(err2, exists) {
9309
9312
  if (err2) {
9310
9313
  return doneCallback(err2);
@@ -9954,8 +9957,8 @@ var require_node2 = __commonJS({
9954
9957
  }
9955
9958
  function literal(s) {
9956
9959
  for (const c2 of s) {
9957
- const p = peek();
9958
- if (p !== c2) {
9960
+ const p2 = peek();
9961
+ if (p2 !== c2) {
9959
9962
  throw invalidChar(read());
9960
9963
  }
9961
9964
  read();
@@ -10469,9 +10472,9 @@ var require_node2 = __commonJS({
10469
10472
  __assign = Object.assign || function(t) {
10470
10473
  for (var s, i = 1, n = arguments.length; i < n; i++) {
10471
10474
  s = arguments[i];
10472
- for (var p in s)
10473
- if (Object.prototype.hasOwnProperty.call(s, p))
10474
- t[p] = s[p];
10475
+ for (var p2 in s)
10476
+ if (Object.prototype.hasOwnProperty.call(s, p2))
10477
+ t[p2] = s[p2];
10475
10478
  }
10476
10479
  return t;
10477
10480
  };
@@ -10479,7 +10482,7 @@ var require_node2 = __commonJS({
10479
10482
  };
10480
10483
  Object.defineProperty(exports2, "__esModule", { value: true });
10481
10484
  exports2.loadTsconfig = exports2.walkForTsConfig = exports2.tsConfigLoader = void 0;
10482
- var path4 = require("path");
10485
+ var path5 = require("path");
10483
10486
  var fs32 = require("fs");
10484
10487
  var JSON5 = require_lib32();
10485
10488
  var StripBom = require_strip_bom();
@@ -10509,14 +10512,14 @@ var require_node2 = __commonJS({
10509
10512
  }
10510
10513
  function resolveConfigPath(cwd, filename) {
10511
10514
  if (filename) {
10512
- var absolutePath = fs32.lstatSync(filename).isDirectory() ? path4.resolve(filename, "./tsconfig.json") : path4.resolve(cwd, filename);
10515
+ var absolutePath = fs32.lstatSync(filename).isDirectory() ? path5.resolve(filename, "./tsconfig.json") : path5.resolve(cwd, filename);
10513
10516
  return absolutePath;
10514
10517
  }
10515
10518
  if (fs32.statSync(cwd).isFile()) {
10516
- return path4.resolve(cwd);
10519
+ return path5.resolve(cwd);
10517
10520
  }
10518
10521
  var configAbsolutePath = walkForTsConfig(cwd);
10519
- return configAbsolutePath ? path4.resolve(configAbsolutePath) : void 0;
10522
+ return configAbsolutePath ? path5.resolve(configAbsolutePath) : void 0;
10520
10523
  }
10521
10524
  function walkForTsConfig(directory, readdirSync3) {
10522
10525
  if (readdirSync3 === void 0) {
@@ -10527,10 +10530,10 @@ var require_node2 = __commonJS({
10527
10530
  for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
10528
10531
  var fileToCheck = filesToCheck_1[_i];
10529
10532
  if (files.indexOf(fileToCheck) !== -1) {
10530
- return path4.join(directory, fileToCheck);
10533
+ return path5.join(directory, fileToCheck);
10531
10534
  }
10532
10535
  }
10533
- var parentDirectory = path4.dirname(directory);
10536
+ var parentDirectory = path5.dirname(directory);
10534
10537
  if (directory === parentDirectory) {
10535
10538
  return void 0;
10536
10539
  }
@@ -10577,15 +10580,15 @@ var require_node2 = __commonJS({
10577
10580
  if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
10578
10581
  extendedConfigValue += ".json";
10579
10582
  }
10580
- var currentDir = path4.dirname(configFilePath);
10581
- var extendedConfigPath = path4.join(currentDir, extendedConfigValue);
10583
+ var currentDir = path5.dirname(configFilePath);
10584
+ var extendedConfigPath = path5.join(currentDir, extendedConfigValue);
10582
10585
  if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync4(extendedConfigPath)) {
10583
- extendedConfigPath = path4.join(currentDir, "node_modules", extendedConfigValue);
10586
+ extendedConfigPath = path5.join(currentDir, "node_modules", extendedConfigValue);
10584
10587
  }
10585
10588
  var config = loadTsconfig(extendedConfigPath, existsSync4, readFileSync4) || {};
10586
10589
  if ((_a3 = config.compilerOptions) === null || _a3 === void 0 ? void 0 : _a3.baseUrl) {
10587
- var extendsDir = path4.dirname(extendedConfigValue);
10588
- config.compilerOptions.baseUrl = path4.join(extendsDir, config.compilerOptions.baseUrl);
10590
+ var extendsDir = path5.dirname(extendedConfigValue);
10591
+ config.compilerOptions.baseUrl = path5.join(extendsDir, config.compilerOptions.baseUrl);
10589
10592
  }
10590
10593
  return config;
10591
10594
  }
@@ -10600,7 +10603,7 @@ var require_node2 = __commonJS({
10600
10603
  Object.defineProperty(exports2, "__esModule", { value: true });
10601
10604
  exports2.configLoader = exports2.loadConfig = void 0;
10602
10605
  var TsConfigLoader2 = require_tsconfig_loader();
10603
- var path4 = require("path");
10606
+ var path5 = require("path");
10604
10607
  function loadConfig2(cwd) {
10605
10608
  if (cwd === void 0) {
10606
10609
  cwd = process.cwd();
@@ -10611,7 +10614,7 @@ var require_node2 = __commonJS({
10611
10614
  function configLoader(_a3) {
10612
10615
  var cwd = _a3.cwd, explicitParams = _a3.explicitParams, _b = _a3.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
10613
10616
  if (explicitParams) {
10614
- var absoluteBaseUrl = path4.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path4.join(cwd, explicitParams.baseUrl);
10617
+ var absoluteBaseUrl = path5.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path5.join(cwd, explicitParams.baseUrl);
10615
10618
  return {
10616
10619
  resultType: "success",
10617
10620
  configFileAbsolutePath: "",
@@ -10638,7 +10641,7 @@ var require_node2 = __commonJS({
10638
10641
  resultType: "success",
10639
10642
  configFileAbsolutePath: loadResult.tsConfigPath,
10640
10643
  baseUrl: loadResult.baseUrl,
10641
- absoluteBaseUrl: path4.resolve(path4.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
10644
+ absoluteBaseUrl: path5.resolve(path5.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
10642
10645
  paths: loadResult.paths || {},
10643
10646
  addMatchAll: loadResult.baseUrl !== void 0
10644
10647
  };
@@ -11094,8 +11097,8 @@ var require_node2 = __commonJS({
11094
11097
  });
11095
11098
  var getOptions = (cwd) => {
11096
11099
  var _a3, _b, _c, _d;
11097
- const { data, path: path4 } = joycon.loadSync(["tsconfig.json", "jsconfig.json"], cwd);
11098
- if (path4 && data) {
11100
+ const { data, path: path5 } = joycon.loadSync(["tsconfig.json", "jsconfig.json"], cwd);
11101
+ if (path5 && data) {
11099
11102
  return {
11100
11103
  jsxFactory: (_a3 = data.compilerOptions) == null ? void 0 : _a3.jsxFactory,
11101
11104
  jsxFragment: (_b = data.compilerOptions) == null ? void 0 : _b.jsxFragmentFactory,
@@ -11443,14 +11446,14 @@ var init_utils = __esm({
11443
11446
  )
11444
11447
  );
11445
11448
  }
11446
- const path4 = (0, import_path.join)((0, import_path.resolve)(configPath ?? defaultConfigPath));
11447
- if (!(0, import_fs.existsSync)(path4)) {
11448
- console.log(`${path4} file does not exist`);
11449
+ const path5 = (0, import_path.join)((0, import_path.resolve)(configPath ?? defaultConfigPath));
11450
+ if (!(0, import_fs.existsSync)(path5)) {
11451
+ console.log(`${path5} file does not exist`);
11449
11452
  process.exit(1);
11450
11453
  }
11451
- console.log(source_default.grey(`Reading config file '${path4}'`));
11454
+ console.log(source_default.grey(`Reading config file '${path5}'`));
11452
11455
  const { unregister } = await safeRegister();
11453
- const required = require(`${path4}`);
11456
+ const required = require(`${path5}`);
11454
11457
  const content = required.default ?? required;
11455
11458
  unregister();
11456
11459
  const res = mySqlCliConfigSchema.safeParse(content);
@@ -11473,14 +11476,14 @@ var init_utils = __esm({
11473
11476
  if (!configPath) {
11474
11477
  console.log(source_default.gray(`No config path provided, using default path`));
11475
11478
  }
11476
- const path4 = (0, import_path.join)((0, import_path.resolve)(configPath ?? defaultConfigPath));
11477
- if (!(0, import_fs.existsSync)(path4)) {
11478
- console.log(source_default.red(`${path4} file does not exist`));
11479
+ const path5 = (0, import_path.join)((0, import_path.resolve)(configPath ?? defaultConfigPath));
11480
+ if (!(0, import_fs.existsSync)(path5)) {
11481
+ console.log(source_default.red(`${path5} file does not exist`));
11479
11482
  process.exit(1);
11480
11483
  }
11481
- console.log(source_default.grey(`Reading config file '${path4}'`));
11484
+ console.log(source_default.grey(`Reading config file '${path5}'`));
11482
11485
  const { unregister } = await safeRegister();
11483
- const required = require(`${path4}`);
11486
+ const required = require(`${path5}`);
11484
11487
  const content = required.default ?? required;
11485
11488
  unregister();
11486
11489
  return content;
@@ -12173,10 +12176,9 @@ var pgSerializer_exports = {};
12173
12176
  __export(pgSerializer_exports, {
12174
12177
  fromDatabase: () => fromDatabase2,
12175
12178
  generatePgSnapshot: () => generatePgSnapshot,
12176
- indexName: () => indexName2,
12177
- toDrizzle: () => toDrizzle
12179
+ indexName: () => indexName2
12178
12180
  });
12179
- var import_pg_core2, import_pg_core3, import_drizzle_orm5, dialect4, indexName2, generatePgSnapshot, trimChar, fromDatabase2, columnToDefault, defaultForColumn, toDrizzle;
12181
+ var import_pg_core2, import_pg_core3, import_drizzle_orm5, dialect4, indexName2, generatePgSnapshot, trimChar, fromDatabase2, columnToDefault, defaultForColumn;
12180
12182
  var init_pgSerializer = __esm({
12181
12183
  "src/serializer/pgSerializer.ts"() {
12182
12184
  import_pg_core2 = require("drizzle-orm/pg-core");
@@ -12314,12 +12316,14 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
12314
12316
  const onUpdate = fk4.onUpdate;
12315
12317
  const reference = fk4.reference();
12316
12318
  const tableTo = (0, import_drizzle_orm5.getTableName)(reference.foreignTable);
12319
+ const schemaTo = (0, import_pg_core3.getTableConfig)(reference.foreignTable).schema;
12317
12320
  const columnsFrom = reference.columns.map((it) => it.name);
12318
12321
  const columnsTo = reference.foreignColumns.map((it) => it.name);
12319
12322
  return {
12320
12323
  name,
12321
12324
  tableFrom,
12322
12325
  tableTo,
12326
+ schemaTo,
12323
12327
  columnsFrom,
12324
12328
  columnsTo,
12325
12329
  onDelete,
@@ -12496,24 +12500,29 @@ ${withStyle.errorWarning(
12496
12500
  }
12497
12501
  const tableForeignKeys = await db.query(
12498
12502
  `SELECT
12499
- tc.table_schema,
12500
- tc.constraint_name,
12501
- tc.table_name,
12502
- kcu.column_name,
12503
- ccu.table_schema AS foreign_table_schema,
12504
- ccu.table_name AS foreign_table_name,
12505
- ccu.column_name AS foreign_column_name,
12506
- rc.delete_rule, rc.update_rule
12507
- FROM
12508
- information_schema.table_constraints AS tc
12509
- JOIN information_schema.key_column_usage AS kcu
12510
- ON tc.constraint_name = kcu.constraint_name
12511
- AND tc.table_schema = kcu.table_schema
12512
- JOIN information_schema.constraint_column_usage AS ccu
12513
- ON ccu.constraint_name = tc.constraint_name
12514
- AND ccu.table_schema = tc.table_schema
12515
- JOIN information_schema.referential_constraints AS rc
12516
- ON ccu.constraint_name = rc.constraint_name
12503
+ tc.table_schema,
12504
+ tc.constraint_name,
12505
+ tc.table_name,
12506
+ kcu.column_name,
12507
+ (
12508
+ SELECT ccu.table_schema
12509
+ FROM information_schema.constraint_column_usage ccu
12510
+ WHERE ccu.constraint_name = tc.constraint_name
12511
+ LIMIT 1
12512
+ ) AS foreign_table_schema,
12513
+ ccu.table_name AS foreign_table_name,
12514
+ ccu.column_name AS foreign_column_name,
12515
+ rc.delete_rule,
12516
+ rc.update_rule
12517
+ FROM
12518
+ information_schema.table_constraints AS tc
12519
+ JOIN information_schema.key_column_usage AS kcu
12520
+ ON tc.constraint_name = kcu.constraint_name
12521
+ AND tc.table_schema = kcu.table_schema
12522
+ JOIN information_schema.constraint_column_usage AS ccu
12523
+ ON ccu.constraint_name = tc.constraint_name
12524
+ JOIN information_schema.referential_constraints AS rc
12525
+ ON ccu.constraint_name = rc.constraint_name
12517
12526
  WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name='${tableName}' and tc.table_schema='${tableSchema}';`
12518
12527
  );
12519
12528
  foreignKeysCount += tableForeignKeys.length;
@@ -12524,6 +12533,7 @@ ${withStyle.errorWarning(
12524
12533
  const columnFrom = fk4.column_name;
12525
12534
  const tableTo = fk4.foreign_table_name;
12526
12535
  const columnTo = fk4.foreign_column_name;
12536
+ const schemaTo = fk4.foreign_table_schema;
12527
12537
  const foreignKeyName = fk4.constraint_name;
12528
12538
  const onUpdate = fk4.update_rule.toLowerCase();
12529
12539
  const onDelete = fk4.delete_rule.toLowerCase();
@@ -12535,6 +12545,7 @@ ${withStyle.errorWarning(
12535
12545
  name: foreignKeyName,
12536
12546
  tableFrom: tableName,
12537
12547
  tableTo,
12548
+ schemaTo,
12538
12549
  columnsFrom: [columnFrom],
12539
12550
  columnsTo: [columnTo],
12540
12551
  onDelete,
@@ -12806,108 +12817,6 @@ ${withStyle.errorWarning(
12806
12817
  }
12807
12818
  }
12808
12819
  };
12809
- toDrizzle = (schema4, schemaName) => {
12810
- const tables = {};
12811
- Object.values(schema4.tables).forEach((t) => {
12812
- const columns = {};
12813
- Object.values(t.columns).forEach((c) => {
12814
- const columnName = c.name;
12815
- const type = c.type;
12816
- let columnBuilder;
12817
- if (type === "bigint") {
12818
- columnBuilder = new import_pg_core2.PgBigInt53Builder(columnName);
12819
- } else if (type === "bigserial") {
12820
- columnBuilder = new import_pg_core2.PgBigSerial53Builder(columnName);
12821
- } else if (type === "boolean") {
12822
- columnBuilder = new import_pg_core2.PgBooleanBuilder(columnName);
12823
- } else if (type === "cidr") {
12824
- columnBuilder = new import_pg_core2.PgCidrBuilder(columnName);
12825
- } else if (type === "date") {
12826
- columnBuilder = new import_pg_core2.PgDateBuilder(columnName);
12827
- } else if (type === "double precision") {
12828
- columnBuilder = new import_pg_core2.PgDoublePrecisionBuilder(columnName);
12829
- } else if (type === "inet") {
12830
- columnBuilder = new import_pg_core2.PgInetBuilder(columnName);
12831
- } else if (type === "integer") {
12832
- columnBuilder = new import_pg_core2.PgIntegerBuilder(columnName);
12833
- } else if (type === "interval" || type.startsWith("interval ")) {
12834
- columnBuilder = new import_pg_core2.PgIntervalBuilder(columnName, {});
12835
- } else if (type === "json") {
12836
- columnBuilder = new import_pg_core2.PgJsonBuilder(columnName);
12837
- } else if (type === "jsonb") {
12838
- columnBuilder = new import_pg_core2.PgJsonbBuilder(columnName);
12839
- } else if (type === "macaddr") {
12840
- columnBuilder = new import_pg_core2.PgMacaddrBuilder(columnName);
12841
- } else if (type === "macaddr8") {
12842
- columnBuilder = new import_pg_core2.PgMacaddr8Builder(columnName);
12843
- } else if (type === "numeric" || type.startsWith("numeric(")) {
12844
- columnBuilder = new import_pg_core2.PgNumericBuilder(columnName);
12845
- } else if (type === "real") {
12846
- columnBuilder = new import_pg_core2.PgRealBuilder(columnName);
12847
- } else if (type === "serial") {
12848
- columnBuilder = new import_pg_core2.PgSerialBuilder(columnName);
12849
- } else if (type === "smallint") {
12850
- columnBuilder = new import_pg_core2.PgSmallIntBuilder(columnName);
12851
- } else if (type === "smallserial") {
12852
- columnBuilder = new import_pg_core2.PgSmallSerialBuilder(columnName);
12853
- } else if (type === "text") {
12854
- columnBuilder = new import_pg_core2.PgTextBuilder(columnName, {});
12855
- } else if (type === "time" || type.startsWith("time(") || type === "time with time zone") {
12856
- columnBuilder = new import_pg_core2.PgTimeBuilder(columnName, false, void 0);
12857
- } else if (type === "timestamp" || type.startsWith("timestamp(") || type === "timestamp with time zone") {
12858
- columnBuilder = new import_pg_core2.PgTimestampBuilder(columnName, false, void 0);
12859
- } else if (type === "uuid") {
12860
- columnBuilder = new import_pg_core2.PgUUIDBuilder(columnName);
12861
- } else if (type === "varchar" || type.startsWith("varchar(")) {
12862
- columnBuilder = new import_pg_core2.PgVarcharBuilder(columnName, {});
12863
- } else if (type === "char" || type.startsWith("char(")) {
12864
- columnBuilder = new import_pg_core2.PgCharBuilder(columnName, {});
12865
- } else {
12866
- columnBuilder = (0, import_pg_core2.customType)({
12867
- dataType() {
12868
- return type;
12869
- }
12870
- })(columnName);
12871
- }
12872
- if (c.notNull) {
12873
- columnBuilder = columnBuilder.notNull();
12874
- }
12875
- if (c.default) {
12876
- columnBuilder = columnBuilder.default(c.default);
12877
- }
12878
- if (c.primaryKey) {
12879
- columnBuilder = columnBuilder.primaryKey();
12880
- }
12881
- columns[columnName] = columnBuilder;
12882
- });
12883
- if (schemaName === "public") {
12884
- tables[t.name] = (0, import_pg_core2.pgTable)(t.name, columns, (cb) => {
12885
- const res = {};
12886
- Object.values(t.compositePrimaryKeys).forEach((cpk) => {
12887
- const gh = cpk.columns.map((c) => cb[c]);
12888
- res[cpk.name] = new import_pg_core2.PrimaryKeyBuilder(
12889
- gh,
12890
- cpk.name
12891
- );
12892
- });
12893
- return res;
12894
- });
12895
- } else {
12896
- tables[t.name] = (0, import_pg_core2.pgSchema)(schemaName).table(t.name, columns, (cb) => {
12897
- const res = {};
12898
- Object.values(t.compositePrimaryKeys).forEach((cpk) => {
12899
- const gh = cpk.columns.map((c) => cb[c]);
12900
- res[cpk.name] = new import_pg_core2.PrimaryKeyBuilder(
12901
- gh,
12902
- cpk.name
12903
- );
12904
- });
12905
- return res;
12906
- });
12907
- }
12908
- });
12909
- return tables;
12910
- };
12911
12820
  }
12912
12821
  });
12913
12822
 
@@ -12946,8 +12855,7 @@ var init_sqliteImports = __esm({
12946
12855
  var sqliteSerializer_exports = {};
12947
12856
  __export(sqliteSerializer_exports, {
12948
12857
  fromDatabase: () => fromDatabase3,
12949
- generateSqliteSnapshot: () => generateSqliteSnapshot,
12950
- toDrizzle: () => toDrizzle2
12858
+ generateSqliteSnapshot: () => generateSqliteSnapshot
12951
12859
  });
12952
12860
  function mapSqlToSqliteType(sqlType) {
12953
12861
  if ([
@@ -12984,7 +12892,7 @@ function mapSqlToSqliteType(sqlType) {
12984
12892
  return "numeric";
12985
12893
  }
12986
12894
  }
12987
- var import_drizzle_orm7, import_sqlite_core2, dialect5, generateSqliteSnapshot, fromDatabase3, toDrizzle2;
12895
+ var import_drizzle_orm7, import_sqlite_core2, dialect5, generateSqliteSnapshot, fromDatabase3;
12988
12896
  var init_sqliteSerializer = __esm({
12989
12897
  "src/serializer/sqliteSerializer.ts"() {
12990
12898
  import_drizzle_orm7 = require("drizzle-orm");
@@ -13352,50 +13260,6 @@ WHERE
13352
13260
  }
13353
13261
  };
13354
13262
  };
13355
- toDrizzle2 = (schema4) => {
13356
- const tables = {};
13357
- Object.values(schema4.tables).forEach((t) => {
13358
- const columns = {};
13359
- Object.values(t.columns).forEach((c) => {
13360
- const columnName = c.name;
13361
- const type = c.type;
13362
- let columnBuilder;
13363
- if (type === "integer") {
13364
- columnBuilder = new import_sqlite_core2.SQLiteIntegerBuilder(columnName);
13365
- } else if (type === "text") {
13366
- columnBuilder = new import_sqlite_core2.SQLiteTextBuilder(columnName, {});
13367
- } else if (type === "blob") {
13368
- columnBuilder = new import_sqlite_core2.SQLiteBlobBufferBuilder(columnName);
13369
- } else if (type === "real") {
13370
- columnBuilder = new import_sqlite_core2.SQLiteRealBuilder(columnName);
13371
- } else {
13372
- columnBuilder = new import_sqlite_core2.SQLiteNumericBuilder(columnName);
13373
- }
13374
- if (c.notNull) {
13375
- columnBuilder = columnBuilder.notNull();
13376
- }
13377
- if (c.default) {
13378
- columnBuilder = columnBuilder.default(c.default);
13379
- }
13380
- if (c.primaryKey) {
13381
- columnBuilder = columnBuilder.primaryKey();
13382
- }
13383
- columns[columnName] = columnBuilder;
13384
- });
13385
- tables[t.name] = (0, import_sqlite_core2.sqliteTable)(t.name, columns, (cb) => {
13386
- const res = {};
13387
- Object.values(t.compositePrimaryKeys).forEach((cpk) => {
13388
- const gh = cpk.columns.map((c) => cb[c]);
13389
- res[cpk.name] = new import_sqlite_core2.PrimaryKeyBuilder(
13390
- gh,
13391
- cpk.name
13392
- );
13393
- });
13394
- return res;
13395
- });
13396
- });
13397
- return tables;
13398
- };
13399
13263
  }
13400
13264
  });
13401
13265
 
@@ -13429,8 +13293,8 @@ var init_serializer = __esm({
13429
13293
  }
13430
13294
  }).sql;
13431
13295
  };
13432
- serializeMySql = async (path4) => {
13433
- const filenames = prepareFilenames(path4);
13296
+ serializeMySql = async (path5) => {
13297
+ const filenames = prepareFilenames(path5);
13434
13298
  console.log(source_default.gray(`Reading schema files:
13435
13299
  ${filenames.join("\n")}
13436
13300
  `));
@@ -13439,25 +13303,25 @@ ${filenames.join("\n")}
13439
13303
  const { tables, enums, schemas } = await prepareFromMySqlImports2(filenames);
13440
13304
  return generateMySqlSnapshot2(tables, enums, schemas);
13441
13305
  };
13442
- serializePg = async (path4, schemaFilter) => {
13443
- const filenames = prepareFilenames(path4);
13306
+ serializePg = async (path5, schemaFilter) => {
13307
+ const filenames = prepareFilenames(path5);
13444
13308
  const { prepareFromPgImports: prepareFromPgImports2 } = await Promise.resolve().then(() => (init_pgImports(), pgImports_exports));
13445
13309
  const { generatePgSnapshot: generatePgSnapshot2 } = await Promise.resolve().then(() => (init_pgSerializer(), pgSerializer_exports));
13446
13310
  const { tables, enums, schemas } = await prepareFromPgImports2(filenames);
13447
13311
  return generatePgSnapshot2(tables, enums, schemas, schemaFilter);
13448
13312
  };
13449
- serializeSQLite = async (path4) => {
13450
- const filenames = prepareFilenames(path4);
13313
+ serializeSQLite = async (path5) => {
13314
+ const filenames = prepareFilenames(path5);
13451
13315
  const { prepareFromSqliteImports: prepareFromSqliteImports2 } = await Promise.resolve().then(() => (init_sqliteImports(), sqliteImports_exports));
13452
13316
  const { generateSqliteSnapshot: generateSqliteSnapshot2 } = await Promise.resolve().then(() => (init_sqliteSerializer(), sqliteSerializer_exports));
13453
13317
  const { tables, enums } = await prepareFromSqliteImports2(filenames);
13454
13318
  return generateSqliteSnapshot2(tables, enums);
13455
13319
  };
13456
- prepareFilenames = (path4) => {
13457
- if (typeof path4 === "string") {
13458
- path4 = [path4];
13320
+ prepareFilenames = (path5) => {
13321
+ if (typeof path5 === "string") {
13322
+ path5 = [path5];
13459
13323
  }
13460
- const result = path4.reduce((result2, cur) => {
13324
+ const result = path5.reduce((result2, cur) => {
13461
13325
  const globbed = glob.sync(cur);
13462
13326
  globbed.forEach((it) => {
13463
13327
  const fileName = import_fs2.default.lstatSync(it).isDirectory() ? null : import_path2.default.resolve(it);
@@ -13471,7 +13335,7 @@ ${filenames.join("\n")}
13471
13335
  return !(it.endsWith(".ts") || it.endsWith(".js") || it.endsWith(".cjs") || it.endsWith(".mjs") || it.endsWith(".mts") || it.endsWith(".cts"));
13472
13336
  });
13473
13337
  if (res.length === 0) {
13474
- console.log(error(`No schema files found for path config [${path4.map((it) => `'${it}'`).join(", ")}]`));
13338
+ console.log(error(`No schema files found for path config [${path5.map((it) => `'${it}'`).join(", ")}]`));
13475
13339
  console.log(error(`If path represents a file - please make sure to use .ts or other extension in the path`));
13476
13340
  process.exit(1);
13477
13341
  }
@@ -16314,14 +16178,15 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
16314
16178
  columnsFrom,
16315
16179
  columnsTo,
16316
16180
  onDelete,
16317
- onUpdate
16181
+ onUpdate,
16182
+ schemaTo
16318
16183
  } = PgSquasher.unsquashFK(statement.data);
16319
16184
  const onDeleteStatement = onDelete ? ` ON DELETE ${onDelete}` : "";
16320
16185
  const onUpdateStatement = onUpdate ? ` ON UPDATE ${onUpdate}` : "";
16321
16186
  const fromColumnsString = columnsFrom.map((it) => `"${it}"`).join(",");
16322
16187
  const toColumnsString = columnsTo.map((it) => `"${it}"`).join(",");
16323
16188
  const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${tableFrom}"` : `"${tableFrom}"`;
16324
- const tableToNameWithSchema = statement.schema ? `"${statement.schema}"."${tableTo}"` : `"${tableTo}"`;
16189
+ const tableToNameWithSchema = statement.schema ? `"${schemaTo}"."${tableTo}"` : `"${tableTo}"`;
16325
16190
  const alterStatement = `ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT "${name}" FOREIGN KEY (${fromColumnsString}) REFERENCES ${tableToNameWithSchema}(${toColumnsString})${onDeleteStatement}${onUpdateStatement}`;
16326
16191
  let sql2 = "DO $$ BEGIN\n";
16327
16192
  sql2 += " " + alterStatement + ";\n";
@@ -18014,11 +17879,11 @@ var init_pgUp = __esm({
18014
17879
  path: it,
18015
17880
  raw: report.rawMap[it]
18016
17881
  })).forEach((it) => {
18017
- const path4 = it.path;
17882
+ const path5 = it.path;
18018
17883
  const result = updateUpToV4(it.raw, prevId);
18019
17884
  prevId = result.id;
18020
- console.log(`[${source_default.green("\u2713")}] ${path4}`);
18021
- (0, import_fs5.writeFileSync)(path4, JSON.stringify(result, null, 2));
17885
+ console.log(`[${source_default.green("\u2713")}] ${path5}`);
17886
+ (0, import_fs5.writeFileSync)(path5, JSON.stringify(result, null, 2));
18022
17887
  });
18023
17888
  console.log("Everything's fine \u{1F436}\u{1F525}");
18024
17889
  };
@@ -18269,10 +18134,10 @@ var init_mysqlUp = __esm({
18269
18134
  path: it,
18270
18135
  raw: report.rawMap[it]
18271
18136
  })).forEach((it) => {
18272
- const path4 = it.path;
18137
+ const path5 = it.path;
18273
18138
  const result = updateToLatestV4(it.raw);
18274
- console.log(`[${source_default.green("\u2713")}] ${path4}`);
18275
- import_fs6.default.writeFileSync(path4, JSON.stringify(result, null, 2));
18139
+ console.log(`[${source_default.green("\u2713")}] ${path5}`);
18140
+ import_fs6.default.writeFileSync(path5, JSON.stringify(result, null, 2));
18276
18141
  });
18277
18142
  console.log("Everything's fine \u{1F436}\u{1F525}");
18278
18143
  };
@@ -18765,7 +18630,7 @@ var init_upFolders = __esm({
18765
18630
  date.setUTCMinutes(Number(it.substring(10, 12)));
18766
18631
  date.setUTCSeconds(Number(it.substring(12, 14)));
18767
18632
  date.setUTCMilliseconds(0);
18768
- const path4 = (0, import_path4.join)(out, it);
18633
+ const path5 = (0, import_path4.join)(out, it);
18769
18634
  const pathJson = (0, import_path4.join)(out, it, "snapshot.json");
18770
18635
  const pathSQL = (0, import_path4.join)(out, it, "migration.sql");
18771
18636
  const snapshot = JSON.parse((0, import_fs7.readFileSync)(pathJson).toString());
@@ -18776,7 +18641,7 @@ var init_upFolders = __esm({
18776
18641
  json: snapshot,
18777
18642
  date,
18778
18643
  sql: sql2,
18779
- path: path4
18644
+ path: path5
18780
18645
  });
18781
18646
  res2.idx += 1;
18782
18647
  return res2;
@@ -19182,7 +19047,7 @@ var init_introspect_pg = __esm({
19182
19047
  const schemaStatements = Object.entries(schemas).map((it) => {
19183
19048
  return `export const ${it[1]} = pgSchema("${it[0]}");
19184
19049
  `;
19185
- }).join();
19050
+ }).join("");
19186
19051
  const tableStatements = Object.values(schema4.tables).map((table4) => {
19187
19052
  const tableSchema = schemas[table4.schema];
19188
19053
  const func = tableSchema ? `${tableSchema}.table` : "pgTable";
@@ -19677,14 +19542,14 @@ var require_brace_expansion = __commonJS({
19677
19542
  var pre = m.pre;
19678
19543
  var body = m.body;
19679
19544
  var post = m.post;
19680
- var p = pre.split(",");
19681
- p[p.length - 1] += "{" + body + "}";
19545
+ var p2 = pre.split(",");
19546
+ p2[p2.length - 1] += "{" + body + "}";
19682
19547
  var postParts = parseCommaParts(post);
19683
19548
  if (post.length) {
19684
- p[p.length - 1] += postParts.shift();
19685
- p.push.apply(p, postParts);
19549
+ p2[p2.length - 1] += postParts.shift();
19550
+ p2.push.apply(p2, postParts);
19686
19551
  }
19687
- parts.push.apply(parts, p);
19552
+ parts.push.apply(parts, p2);
19688
19553
  return parts;
19689
19554
  }
19690
19555
  function expandTop(str) {
@@ -19739,8 +19604,8 @@ var require_brace_expansion = __commonJS({
19739
19604
  if (n.length === 1) {
19740
19605
  n = expand2(n[0], false).map(embrace);
19741
19606
  if (n.length === 1) {
19742
- return post.map(function(p) {
19743
- return m.pre + n[0] + p;
19607
+ return post.map(function(p2) {
19608
+ return m.pre + n[0] + p2;
19744
19609
  });
19745
19610
  }
19746
19611
  }
@@ -19944,12 +19809,12 @@ var init_mjs = __esm({
19944
19809
  init_unescape();
19945
19810
  init_escape();
19946
19811
  init_unescape();
19947
- minimatch = (p, pattern, options = {}) => {
19812
+ minimatch = (p2, pattern, options = {}) => {
19948
19813
  assertValidPattern(pattern);
19949
19814
  if (!options.nocomment && pattern.charAt(0) === "#") {
19950
19815
  return false;
19951
19816
  }
19952
- return new Minimatch(pattern, options).match(p);
19817
+ return new Minimatch(pattern, options).match(p2);
19953
19818
  };
19954
19819
  starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
19955
19820
  starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
@@ -20027,7 +19892,7 @@ var init_mjs = __esm({
20027
19892
  }, {});
20028
19893
  reSpecials = charSet("().*{}+?[]^$\\!");
20029
19894
  addPatternStartSet = charSet("[.(");
20030
- filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
19895
+ filter = (pattern, options = {}) => (p2) => minimatch(p2, pattern, options);
20031
19896
  minimatch.filter = filter;
20032
19897
  ext = (a, b = {}) => Object.assign({}, a, b);
20033
19898
  defaults = (def) => {
@@ -20035,7 +19900,7 @@ var init_mjs = __esm({
20035
19900
  return minimatch;
20036
19901
  }
20037
19902
  const orig = minimatch;
20038
- const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
19903
+ const m = (p2, pattern, options = {}) => orig(p2, pattern, ext(def, options));
20039
19904
  return Object.assign(m, {
20040
19905
  Minimatch: class Minimatch extends orig.Minimatch {
20041
19906
  constructor(pattern, options = {}) {
@@ -20181,9 +20046,9 @@ var init_mjs = __esm({
20181
20046
  this.set = set2.filter((s) => s.indexOf(false) === -1);
20182
20047
  if (this.isWindows) {
20183
20048
  for (let i = 0; i < this.set.length; i++) {
20184
- const p = this.set[i];
20185
- if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
20186
- p[2] = "?";
20049
+ const p2 = this.set[i];
20050
+ if (p2[0] === "" && p2[1] === "" && this.globParts[i][2] === "?" && typeof p2[3] === "string" && /^[a-z]:$/i.test(p2[3])) {
20051
+ p2[2] = "?";
20187
20052
  }
20188
20053
  }
20189
20054
  }
@@ -20260,10 +20125,10 @@ var init_mjs = __esm({
20260
20125
  didSomething = false;
20261
20126
  if (!this.preserveMultipleSlashes) {
20262
20127
  for (let i = 1; i < parts.length - 1; i++) {
20263
- const p = parts[i];
20264
- if (i === 1 && p === "" && parts[0] === "")
20128
+ const p2 = parts[i];
20129
+ if (i === 1 && p2 === "" && parts[0] === "")
20265
20130
  continue;
20266
- if (p === "." || p === "") {
20131
+ if (p2 === "." || p2 === "") {
20267
20132
  didSomething = true;
20268
20133
  parts.splice(i, 1);
20269
20134
  i--;
@@ -20276,8 +20141,8 @@ var init_mjs = __esm({
20276
20141
  }
20277
20142
  let dd = 0;
20278
20143
  while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
20279
- const p = parts[dd - 1];
20280
- if (p && p !== "." && p !== ".." && p !== "**") {
20144
+ const p2 = parts[dd - 1];
20145
+ if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") {
20281
20146
  didSomething = true;
20282
20147
  parts.splice(dd - 1, 2);
20283
20148
  dd -= 2;
@@ -20319,11 +20184,11 @@ var init_mjs = __esm({
20319
20184
  parts.splice(gs + 1, gss - gs);
20320
20185
  }
20321
20186
  let next = parts[gs + 1];
20322
- const p = parts[gs + 2];
20323
- const p2 = parts[gs + 3];
20187
+ const p2 = parts[gs + 2];
20188
+ const p22 = parts[gs + 3];
20324
20189
  if (next !== "..")
20325
20190
  continue;
20326
- if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
20191
+ if (!p2 || p2 === "." || p2 === ".." || !p22 || p22 === "." || p22 === "..") {
20327
20192
  continue;
20328
20193
  }
20329
20194
  didSomething = true;
@@ -20335,10 +20200,10 @@ var init_mjs = __esm({
20335
20200
  }
20336
20201
  if (!this.preserveMultipleSlashes) {
20337
20202
  for (let i = 1; i < parts.length - 1; i++) {
20338
- const p = parts[i];
20339
- if (i === 1 && p === "" && parts[0] === "")
20203
+ const p2 = parts[i];
20204
+ if (i === 1 && p2 === "" && parts[0] === "")
20340
20205
  continue;
20341
- if (p === "." || p === "") {
20206
+ if (p2 === "." || p2 === "") {
20342
20207
  didSomething = true;
20343
20208
  parts.splice(i, 1);
20344
20209
  i--;
@@ -20351,8 +20216,8 @@ var init_mjs = __esm({
20351
20216
  }
20352
20217
  let dd = 0;
20353
20218
  while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
20354
- const p = parts[dd - 1];
20355
- if (p && p !== "." && p !== ".." && p !== "**") {
20219
+ const p2 = parts[dd - 1];
20220
+ if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") {
20356
20221
  didSomething = true;
20357
20222
  const needDot = dd === 1 && parts[dd + 1] === "**";
20358
20223
  const splin = needDot ? ["."] : [];
@@ -20474,14 +20339,14 @@ var init_mjs = __esm({
20474
20339
  this.debug("matchOne", file.length, pattern.length);
20475
20340
  for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
20476
20341
  this.debug("matchOne loop");
20477
- var p = pattern[pi];
20342
+ var p2 = pattern[pi];
20478
20343
  var f = file[fi];
20479
- this.debug(pattern, p, f);
20480
- if (p === false) {
20344
+ this.debug(pattern, p2, f);
20345
+ if (p2 === false) {
20481
20346
  return false;
20482
20347
  }
20483
- if (p === GLOBSTAR) {
20484
- this.debug("GLOBSTAR", [pattern, p, f]);
20348
+ if (p2 === GLOBSTAR) {
20349
+ this.debug("GLOBSTAR", [pattern, p2, f]);
20485
20350
  var fr = fi;
20486
20351
  var pr = pi + 1;
20487
20352
  if (pr === pl) {
@@ -20516,12 +20381,12 @@ var init_mjs = __esm({
20516
20381
  return false;
20517
20382
  }
20518
20383
  let hit;
20519
- if (typeof p === "string") {
20520
- hit = f === p;
20521
- this.debug("string match", p, f, hit);
20384
+ if (typeof p2 === "string") {
20385
+ hit = f === p2;
20386
+ this.debug("string match", p2, f, hit);
20522
20387
  } else {
20523
- hit = p.test(f);
20524
- this.debug("pattern match", p, f, hit);
20388
+ hit = p2.test(f);
20389
+ this.debug("pattern match", p2, f, hit);
20525
20390
  }
20526
20391
  if (!hit)
20527
20392
  return false;
@@ -20570,7 +20435,7 @@ var init_mjs = __esm({
20570
20435
  let dotTravAllowed = pattern.charAt(0) === ".";
20571
20436
  let dotFileAllowed = options.dot || dotTravAllowed;
20572
20437
  const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
20573
- const subPatternStart = (p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
20438
+ const subPatternStart = (p2) => p2.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
20574
20439
  const clearStateChar = () => {
20575
20440
  if (stateChar) {
20576
20441
  switch (stateChar) {
@@ -20773,11 +20638,11 @@ var init_mjs = __esm({
20773
20638
  const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
20774
20639
  const flags = options.nocase ? "i" : "";
20775
20640
  let re = set2.map((pattern) => {
20776
- const pp = pattern.map((p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src);
20777
- pp.forEach((p, i) => {
20641
+ const pp = pattern.map((p2) => typeof p2 === "string" ? regExpEscape(p2) : p2 === GLOBSTAR ? GLOBSTAR : p2._src);
20642
+ pp.forEach((p2, i) => {
20778
20643
  const next = pp[i + 1];
20779
20644
  const prev = pp[i - 1];
20780
- if (p !== GLOBSTAR || prev === GLOBSTAR) {
20645
+ if (p2 !== GLOBSTAR || prev === GLOBSTAR) {
20781
20646
  return;
20782
20647
  }
20783
20648
  if (prev === void 0) {
@@ -20793,7 +20658,7 @@ var init_mjs = __esm({
20793
20658
  pp[i + 1] = GLOBSTAR;
20794
20659
  }
20795
20660
  });
20796
- return pp.filter((p) => p !== GLOBSTAR).join("/");
20661
+ return pp.filter((p2) => p2 !== GLOBSTAR).join("/");
20797
20662
  }).join("|");
20798
20663
  re = "^(?:" + re + ")$";
20799
20664
  if (this.negate)
@@ -20805,13 +20670,13 @@ var init_mjs = __esm({
20805
20670
  }
20806
20671
  return this.regexp;
20807
20672
  }
20808
- slashSplit(p) {
20673
+ slashSplit(p2) {
20809
20674
  if (this.preserveMultipleSlashes) {
20810
- return p.split("/");
20811
- } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
20812
- return ["", ...p.split(/\/+/)];
20675
+ return p2.split("/");
20676
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p2)) {
20677
+ return ["", ...p2.split(/\/+/)];
20813
20678
  } else {
20814
- return p.split(/\/+/);
20679
+ return p2.split(/\/+/);
20815
20680
  }
20816
20681
  }
20817
20682
  match(f, partial = this.partial) {
@@ -21263,56 +21128,56 @@ var require_textParsers = __commonJS({
21263
21128
  if (!value) {
21264
21129
  return null;
21265
21130
  }
21266
- var p = arrayParser.create(value, function(entry) {
21131
+ var p2 = arrayParser.create(value, function(entry) {
21267
21132
  if (entry !== null) {
21268
21133
  entry = parsePoint(entry);
21269
21134
  }
21270
21135
  return entry;
21271
21136
  });
21272
- return p.parse();
21137
+ return p2.parse();
21273
21138
  };
21274
21139
  var parseFloatArray = function(value) {
21275
21140
  if (!value) {
21276
21141
  return null;
21277
21142
  }
21278
- var p = arrayParser.create(value, function(entry) {
21143
+ var p2 = arrayParser.create(value, function(entry) {
21279
21144
  if (entry !== null) {
21280
21145
  entry = parseFloat(entry);
21281
21146
  }
21282
21147
  return entry;
21283
21148
  });
21284
- return p.parse();
21149
+ return p2.parse();
21285
21150
  };
21286
21151
  var parseStringArray = function(value) {
21287
21152
  if (!value) {
21288
21153
  return null;
21289
21154
  }
21290
- var p = arrayParser.create(value);
21291
- return p.parse();
21155
+ var p2 = arrayParser.create(value);
21156
+ return p2.parse();
21292
21157
  };
21293
21158
  var parseDateArray = function(value) {
21294
21159
  if (!value) {
21295
21160
  return null;
21296
21161
  }
21297
- var p = arrayParser.create(value, function(entry) {
21162
+ var p2 = arrayParser.create(value, function(entry) {
21298
21163
  if (entry !== null) {
21299
21164
  entry = parseDate(entry);
21300
21165
  }
21301
21166
  return entry;
21302
21167
  });
21303
- return p.parse();
21168
+ return p2.parse();
21304
21169
  };
21305
21170
  var parseIntervalArray = function(value) {
21306
21171
  if (!value) {
21307
21172
  return null;
21308
21173
  }
21309
- var p = arrayParser.create(value, function(entry) {
21174
+ var p2 = arrayParser.create(value, function(entry) {
21310
21175
  if (entry !== null) {
21311
21176
  entry = parseInterval(entry);
21312
21177
  }
21313
21178
  return entry;
21314
21179
  });
21315
- return p.parse();
21180
+ return p2.parse();
21316
21181
  };
21317
21182
  var parseByteAArray = function(value) {
21318
21183
  if (!value) {
@@ -23978,7 +23843,7 @@ var require_split2 = __commonJS({
23978
23843
  var require_helper = __commonJS({
23979
23844
  "node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/helper.js"(exports, module2) {
23980
23845
  "use strict";
23981
- var path4 = require("path");
23846
+ var path5 = require("path");
23982
23847
  var Stream = require("stream").Stream;
23983
23848
  var split = require_split2();
23984
23849
  var util2 = require("util");
@@ -24016,8 +23881,8 @@ var require_helper = __commonJS({
24016
23881
  return old;
24017
23882
  };
24018
23883
  module2.exports.getFileName = function(rawEnv) {
24019
- var env2 = rawEnv || process.env;
24020
- var file = env2.PGPASSFILE || (isWin ? path4.join(env2.APPDATA || "./", "postgresql", "pgpass.conf") : path4.join(env2.HOME || "./", ".pgpass"));
23884
+ var env3 = rawEnv || process.env;
23885
+ var file = env3.PGPASSFILE || (isWin ? path5.join(env3.APPDATA || "./", "postgresql", "pgpass.conf") : path5.join(env3.HOME || "./", ".pgpass"));
24021
23886
  return file;
24022
23887
  };
24023
23888
  module2.exports.usePgPass = function(stats, fname) {
@@ -24149,7 +24014,7 @@ var require_helper = __commonJS({
24149
24014
  var require_lib = __commonJS({
24150
24015
  "node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
24151
24016
  "use strict";
24152
- var path4 = require("path");
24017
+ var path5 = require("path");
24153
24018
  var fs9 = require("fs");
24154
24019
  var helper = require_helper();
24155
24020
  module2.exports = function(connInfo, cb) {
@@ -26319,6 +26184,15 @@ var init_sqliteIntrospect = __esm({
26319
26184
  }
26320
26185
  });
26321
26186
 
26187
+ // src/serializer/schemaToDrizzle.ts
26188
+ var import_pg_core4, import_sqlite_core3;
26189
+ var init_schemaToDrizzle = __esm({
26190
+ "src/serializer/schemaToDrizzle.ts"() {
26191
+ import_pg_core4 = require("drizzle-orm/pg-core");
26192
+ import_sqlite_core3 = require("drizzle-orm/sqlite-core");
26193
+ }
26194
+ });
26195
+
26322
26196
  // node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
26323
26197
  var require_constants = __commonJS({
26324
26198
  "node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js"(exports, module2) {
@@ -27397,9 +27271,9 @@ var require_yallist = __commonJS({
27397
27271
  var head = this.head;
27398
27272
  var tail = this.tail;
27399
27273
  for (var walker = head; walker !== null; walker = walker.prev) {
27400
- var p = walker.prev;
27274
+ var p2 = walker.prev;
27401
27275
  walker.prev = walker.next;
27402
- walker.next = p;
27276
+ walker.next = p2;
27403
27277
  }
27404
27278
  this.head = tail;
27405
27279
  this.tail = head;
@@ -27897,20 +27771,20 @@ var require_range = __commonJS({
27897
27771
  };
27898
27772
  var replaceTilde = (comp, options) => {
27899
27773
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
27900
- return comp.replace(r, (_2, M, m, p, pr) => {
27901
- debug("tilde", comp, _2, M, m, p, pr);
27774
+ return comp.replace(r, (_2, M, m, p2, pr) => {
27775
+ debug("tilde", comp, _2, M, m, p2, pr);
27902
27776
  let ret;
27903
27777
  if (isX(M)) {
27904
27778
  ret = "";
27905
27779
  } else if (isX(m)) {
27906
27780
  ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
27907
- } else if (isX(p)) {
27781
+ } else if (isX(p2)) {
27908
27782
  ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
27909
27783
  } else if (pr) {
27910
27784
  debug("replaceTilde pr", pr);
27911
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
27785
+ ret = `>=${M}.${m}.${p2}-${pr} <${M}.${+m + 1}.0-0`;
27912
27786
  } else {
27913
- ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
27787
+ ret = `>=${M}.${m}.${p2} <${M}.${+m + 1}.0-0`;
27914
27788
  }
27915
27789
  debug("tilde return", ret);
27916
27790
  return ret;
@@ -27923,14 +27797,14 @@ var require_range = __commonJS({
27923
27797
  debug("caret", comp, options);
27924
27798
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
27925
27799
  const z2 = options.includePrerelease ? "-0" : "";
27926
- return comp.replace(r, (_2, M, m, p, pr) => {
27927
- debug("caret", comp, _2, M, m, p, pr);
27800
+ return comp.replace(r, (_2, M, m, p2, pr) => {
27801
+ debug("caret", comp, _2, M, m, p2, pr);
27928
27802
  let ret;
27929
27803
  if (isX(M)) {
27930
27804
  ret = "";
27931
27805
  } else if (isX(m)) {
27932
27806
  ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`;
27933
- } else if (isX(p)) {
27807
+ } else if (isX(p2)) {
27934
27808
  if (M === "0") {
27935
27809
  ret = `>=${M}.${m}.0${z2} <${M}.${+m + 1}.0-0`;
27936
27810
  } else {
@@ -27940,23 +27814,23 @@ var require_range = __commonJS({
27940
27814
  debug("replaceCaret pr", pr);
27941
27815
  if (M === "0") {
27942
27816
  if (m === "0") {
27943
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
27817
+ ret = `>=${M}.${m}.${p2}-${pr} <${M}.${m}.${+p2 + 1}-0`;
27944
27818
  } else {
27945
- ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
27819
+ ret = `>=${M}.${m}.${p2}-${pr} <${M}.${+m + 1}.0-0`;
27946
27820
  }
27947
27821
  } else {
27948
- ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
27822
+ ret = `>=${M}.${m}.${p2}-${pr} <${+M + 1}.0.0-0`;
27949
27823
  }
27950
27824
  } else {
27951
27825
  debug("no pr");
27952
27826
  if (M === "0") {
27953
27827
  if (m === "0") {
27954
- ret = `>=${M}.${m}.${p}${z2} <${M}.${m}.${+p + 1}-0`;
27828
+ ret = `>=${M}.${m}.${p2}${z2} <${M}.${m}.${+p2 + 1}-0`;
27955
27829
  } else {
27956
- ret = `>=${M}.${m}.${p}${z2} <${M}.${+m + 1}.0-0`;
27830
+ ret = `>=${M}.${m}.${p2}${z2} <${M}.${+m + 1}.0-0`;
27957
27831
  }
27958
27832
  } else {
27959
- ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
27833
+ ret = `>=${M}.${m}.${p2} <${+M + 1}.0.0-0`;
27960
27834
  }
27961
27835
  }
27962
27836
  debug("caret return", ret);
@@ -27970,11 +27844,11 @@ var require_range = __commonJS({
27970
27844
  var replaceXRange = (comp, options) => {
27971
27845
  comp = comp.trim();
27972
27846
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
27973
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
27974
- debug("xRange", comp, ret, gtlt, M, m, p, pr);
27847
+ return comp.replace(r, (ret, gtlt, M, m, p2, pr) => {
27848
+ debug("xRange", comp, ret, gtlt, M, m, p2, pr);
27975
27849
  const xM = isX(M);
27976
27850
  const xm = xM || isX(m);
27977
- const xp = xm || isX(p);
27851
+ const xp = xm || isX(p2);
27978
27852
  const anyX = xp;
27979
27853
  if (gtlt === "=" && anyX) {
27980
27854
  gtlt = "";
@@ -27990,16 +27864,16 @@ var require_range = __commonJS({
27990
27864
  if (xm) {
27991
27865
  m = 0;
27992
27866
  }
27993
- p = 0;
27867
+ p2 = 0;
27994
27868
  if (gtlt === ">") {
27995
27869
  gtlt = ">=";
27996
27870
  if (xm) {
27997
27871
  M = +M + 1;
27998
27872
  m = 0;
27999
- p = 0;
27873
+ p2 = 0;
28000
27874
  } else {
28001
27875
  m = +m + 1;
28002
- p = 0;
27876
+ p2 = 0;
28003
27877
  }
28004
27878
  } else if (gtlt === "<=") {
28005
27879
  gtlt = "<";
@@ -28012,7 +27886,7 @@ var require_range = __commonJS({
28012
27886
  if (gtlt === "<") {
28013
27887
  pr = "-0";
28014
27888
  }
28015
- ret = `${gtlt + M}.${m}.${p}${pr}`;
27889
+ ret = `${gtlt + M}.${m}.${p2}${pr}`;
28016
27890
  } else if (xm) {
28017
27891
  ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
28018
27892
  } else if (xp) {
@@ -31814,10 +31688,10 @@ var require_long = __commonJS({
31814
31688
  radix = radix || 10;
31815
31689
  if (radix < 2 || 36 < radix)
31816
31690
  throw RangeError("radix");
31817
- var p;
31818
- if ((p = str.indexOf("-")) > 0)
31691
+ var p2;
31692
+ if ((p2 = str.indexOf("-")) > 0)
31819
31693
  throw Error("interior hyphen");
31820
- else if (p === 0) {
31694
+ else if (p2 === 0) {
31821
31695
  return fromString(str.substring(1), unsigned, radix).neg();
31822
31696
  }
31823
31697
  var radixToPower = fromNumber(pow_dbl(radix, 8));
@@ -37690,8 +37564,8 @@ var require_change_user = __commonJS({
37690
37564
  if (typeof this.database !== "string") {
37691
37565
  throw new Error('"database" connection config property must be a string');
37692
37566
  }
37693
- const p = this.serializeToBuffer(Packet.MockBuffer());
37694
- return this.serializeToBuffer(Buffer.allocUnsafe(p.offset));
37567
+ const p2 = this.serializeToBuffer(Packet.MockBuffer());
37568
+ return this.serializeToBuffer(Buffer.allocUnsafe(p2.offset));
37695
37569
  }
37696
37570
  };
37697
37571
  module2.exports = ChangeUser;
@@ -38174,8 +38048,8 @@ var require_handshake_response = __commonJS({
38174
38048
  if (typeof this.database !== "string") {
38175
38049
  throw new Error('"database" connection config property must be a string');
38176
38050
  }
38177
- const p = this.serializeResponse(Packet.MockBuffer());
38178
- return this.serializeResponse(Buffer.alloc(p.offset));
38051
+ const p2 = this.serializeResponse(Packet.MockBuffer());
38052
+ return this.serializeResponse(Buffer.alloc(p2.offset));
38179
38053
  }
38180
38054
  static fromPacket(packet) {
38181
38055
  const args = {};
@@ -38605,7 +38479,7 @@ var require_text_row = __commonJS({
38605
38479
  var require_packets = __commonJS({
38606
38480
  "node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/packets/index.js"(exports, module2) {
38607
38481
  "use strict";
38608
- var process4 = require("process");
38482
+ var process5 = require("process");
38609
38483
  var AuthSwitchRequest = require_auth_switch_request();
38610
38484
  var AuthSwitchRequestMoreData = require_auth_switch_request_more_data();
38611
38485
  var AuthSwitchResponse = require_auth_switch_response();
@@ -38646,13 +38520,13 @@ var require_packets = __commonJS({
38646
38520
  };
38647
38521
  Object.entries(ctorMap).forEach(([name, ctor]) => {
38648
38522
  module2.exports[name] = ctor;
38649
- if (process4.env.NODE_DEBUG) {
38523
+ if (process5.env.NODE_DEBUG) {
38650
38524
  if (ctor.prototype.toPacket) {
38651
38525
  const old = ctor.prototype.toPacket;
38652
38526
  ctor.prototype.toPacket = function() {
38653
- const p = old.call(this);
38654
- p._name = name;
38655
- return p;
38527
+ const p2 = old.call(this);
38528
+ p2._name = name;
38529
+ return p2;
38656
38530
  };
38657
38531
  }
38658
38532
  }
@@ -39249,8 +39123,8 @@ var require_compressed_protocol = __commonJS({
39249
39123
  connection._lastWrittenPacketId = 0;
39250
39124
  connection._lastReceivedPacketId = 0;
39251
39125
  connection._handleCompressedPacket = handleCompressedPacket;
39252
- connection._inflatedPacketsParser = new PacketParser((p) => {
39253
- connection.handlePacket(p);
39126
+ connection._inflatedPacketsParser = new PacketParser((p2) => {
39127
+ connection.handlePacket(p2);
39254
39128
  }, 4);
39255
39129
  connection._inflatedPacketsParser._lastPacket = 0;
39256
39130
  connection.packetParser = new PacketParser((packet) => {
@@ -40289,7 +40163,7 @@ var require_text_parser = __commonJS({
40289
40163
  var require_query4 = __commonJS({
40290
40164
  "node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/commands/query.js"(exports, module2) {
40291
40165
  "use strict";
40292
- var process4 = require("process");
40166
+ var process5 = require("process");
40293
40167
  var Timers = require("timers");
40294
40168
  var Readable = require("stream").Readable;
40295
40169
  var Command2 = require_command();
@@ -40358,11 +40232,11 @@ var require_query4 = __commonJS({
40358
40232
  fields = this._fields;
40359
40233
  }
40360
40234
  if (fields) {
40361
- process4.nextTick(() => {
40235
+ process5.nextTick(() => {
40362
40236
  this.onResult(null, rows, fields);
40363
40237
  });
40364
40238
  } else {
40365
- process4.nextTick(() => {
40239
+ process5.nextTick(() => {
40366
40240
  this.onResult(null, rows);
40367
40241
  });
40368
40242
  }
@@ -40407,12 +40281,12 @@ var require_query4 = __commonJS({
40407
40281
  this._fields.push([]);
40408
40282
  return this.readField;
40409
40283
  }
40410
- _streamLocalInfile(connection, path4) {
40284
+ _streamLocalInfile(connection, path5) {
40411
40285
  if (this._streamFactory) {
40412
- this._localStream = this._streamFactory(path4);
40286
+ this._localStream = this._streamFactory(path5);
40413
40287
  } else {
40414
40288
  this._localStreamError = new Error(
40415
- `As a result of LOCAL INFILE command server wants to read ${path4} file, but as of v2.0 you must provide streamFactory option returning ReadStream.`
40289
+ `As a result of LOCAL INFILE command server wants to read ${path5} file, but as of v2.0 you must provide streamFactory option returning ReadStream.`
40416
40290
  );
40417
40291
  connection.writePacket(EmptyPacket);
40418
40292
  return this.infileOk;
@@ -42337,10 +42211,10 @@ var require_lru_cache2 = __commonJS({
42337
42211
  if (aborted && !ignoreAbort && !updateCache) {
42338
42212
  return fetchFail(ac.signal.reason);
42339
42213
  }
42340
- if (this.valList[index4] === p) {
42214
+ if (this.valList[index4] === p2) {
42341
42215
  if (v2 === void 0) {
42342
- if (p.__staleWhileFetching) {
42343
- this.valList[index4] = p.__staleWhileFetching;
42216
+ if (p2.__staleWhileFetching) {
42217
+ this.valList[index4] = p2.__staleWhileFetching;
42344
42218
  } else {
42345
42219
  this.delete(k);
42346
42220
  }
@@ -42364,20 +42238,20 @@ var require_lru_cache2 = __commonJS({
42364
42238
  const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
42365
42239
  const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
42366
42240
  const noDelete = allowStale || options.noDeleteOnFetchRejection;
42367
- if (this.valList[index4] === p) {
42368
- const del = !noDelete || p.__staleWhileFetching === void 0;
42241
+ if (this.valList[index4] === p2) {
42242
+ const del = !noDelete || p2.__staleWhileFetching === void 0;
42369
42243
  if (del) {
42370
42244
  this.delete(k);
42371
42245
  } else if (!allowStaleAborted) {
42372
- this.valList[index4] = p.__staleWhileFetching;
42246
+ this.valList[index4] = p2.__staleWhileFetching;
42373
42247
  }
42374
42248
  }
42375
42249
  if (allowStale) {
42376
- if (options.status && p.__staleWhileFetching !== void 0) {
42250
+ if (options.status && p2.__staleWhileFetching !== void 0) {
42377
42251
  options.status.returnedStale = true;
42378
42252
  }
42379
- return p.__staleWhileFetching;
42380
- } else if (p.__returned === p) {
42253
+ return p2.__staleWhileFetching;
42254
+ } else if (p2.__returned === p2) {
42381
42255
  throw er;
42382
42256
  }
42383
42257
  };
@@ -42394,23 +42268,23 @@ var require_lru_cache2 = __commonJS({
42394
42268
  };
42395
42269
  if (options.status)
42396
42270
  options.status.fetchDispatched = true;
42397
- const p = new Promise(pcall).then(cb, eb);
42398
- p.__abortController = ac;
42399
- p.__staleWhileFetching = v;
42400
- p.__returned = null;
42271
+ const p2 = new Promise(pcall).then(cb, eb);
42272
+ p2.__abortController = ac;
42273
+ p2.__staleWhileFetching = v;
42274
+ p2.__returned = null;
42401
42275
  if (index4 === void 0) {
42402
- this.set(k, p, { ...fetchOpts.options, status: void 0 });
42276
+ this.set(k, p2, { ...fetchOpts.options, status: void 0 });
42403
42277
  index4 = this.keyMap.get(k);
42404
42278
  } else {
42405
- this.valList[index4] = p;
42279
+ this.valList[index4] = p2;
42406
42280
  }
42407
- return p;
42281
+ return p2;
42408
42282
  }
42409
- isBackgroundFetch(p) {
42410
- return p && typeof p === "object" && typeof p.then === "function" && Object.prototype.hasOwnProperty.call(
42411
- p,
42283
+ isBackgroundFetch(p2) {
42284
+ return p2 && typeof p2 === "object" && typeof p2.then === "function" && Object.prototype.hasOwnProperty.call(
42285
+ p2,
42412
42286
  "__staleWhileFetching"
42413
- ) && Object.prototype.hasOwnProperty.call(p, "__returned") && (p.__returned === p || p.__returned === null);
42287
+ ) && Object.prototype.hasOwnProperty.call(p2, "__returned") && (p2.__returned === p2 || p2.__returned === null);
42414
42288
  }
42415
42289
  // this takes the union of get() and set() opts, because it does both
42416
42290
  async fetch(k, {
@@ -42464,8 +42338,8 @@ var require_lru_cache2 = __commonJS({
42464
42338
  if (index4 === void 0) {
42465
42339
  if (status)
42466
42340
  status.fetch = "miss";
42467
- const p = this.backgroundFetch(k, index4, options, fetchContext);
42468
- return p.__returned = p;
42341
+ const p2 = this.backgroundFetch(k, index4, options, fetchContext);
42342
+ return p2.__returned = p2;
42469
42343
  } else {
42470
42344
  const v = this.valList[index4];
42471
42345
  if (this.isBackgroundFetch(v)) {
@@ -42488,15 +42362,15 @@ var require_lru_cache2 = __commonJS({
42488
42362
  this.statusTTL(status, index4);
42489
42363
  return v;
42490
42364
  }
42491
- const p = this.backgroundFetch(k, index4, options, fetchContext);
42492
- const hasStale = p.__staleWhileFetching !== void 0;
42365
+ const p2 = this.backgroundFetch(k, index4, options, fetchContext);
42366
+ const hasStale = p2.__staleWhileFetching !== void 0;
42493
42367
  const staleVal = hasStale && allowStale;
42494
42368
  if (status) {
42495
42369
  status.fetch = hasStale && isStale ? "stale" : "refresh";
42496
42370
  if (staleVal && isStale)
42497
42371
  status.returnedStale = true;
42498
42372
  }
42499
- return staleVal ? p.__staleWhileFetching : p.__returned = p;
42373
+ return staleVal ? p2.__staleWhileFetching : p2.__returned = p2;
42500
42374
  }
42501
42375
  }
42502
42376
  get(k, {
@@ -42542,9 +42416,9 @@ var require_lru_cache2 = __commonJS({
42542
42416
  status.get = "miss";
42543
42417
  }
42544
42418
  }
42545
- connect(p, n) {
42546
- this.prev[n] = p;
42547
- this.next[p] = n;
42419
+ connect(p2, n) {
42420
+ this.prev[n] = p2;
42421
+ this.next[p2] = n;
42548
42422
  }
42549
42423
  moveToTail(index4) {
42550
42424
  if (index4 !== this.tail) {
@@ -42754,7 +42628,7 @@ var require_named_placeholders = __commonJS({
42754
42628
  }
42755
42629
  return s;
42756
42630
  }
42757
- function join6(tree) {
42631
+ function join7(tree) {
42758
42632
  if (tree.length == 1) {
42759
42633
  return tree;
42760
42634
  }
@@ -42780,7 +42654,7 @@ var require_named_placeholders = __commonJS({
42780
42654
  if (cache && (tree = cache.get(query))) {
42781
42655
  return toArrayParams(tree, paramsObj);
42782
42656
  }
42783
- tree = join6(parse(query));
42657
+ tree = join7(parse(query));
42784
42658
  if (cache) {
42785
42659
  cache.set(query, tree);
42786
42660
  }
@@ -42880,8 +42754,8 @@ var require_connection2 = __commonJS({
42880
42754
  this._outOfOrderPackets = [];
42881
42755
  this.clientEncoding = CharsetToEncoding[this.config.charsetNumber];
42882
42756
  this.stream.on("error", this._handleNetworkError.bind(this));
42883
- this.packetParser = new PacketParser((p) => {
42884
- this.handlePacket(p);
42757
+ this.packetParser = new PacketParser((p2) => {
42758
+ this.handlePacket(p2);
42885
42759
  });
42886
42760
  this.stream.on("data", (data) => {
42887
42761
  if (this.connectTimeout) {
@@ -43662,7 +43536,7 @@ var require_pool_connection = __commonJS({
43662
43536
  var require_pool = __commonJS({
43663
43537
  "node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/pool.js"(exports, module2) {
43664
43538
  "use strict";
43665
- var process4 = require("process");
43539
+ var process5 = require("process");
43666
43540
  var mysql = require_mysql2();
43667
43541
  var EventEmitter = require("events").EventEmitter;
43668
43542
  var PoolConnection = require_pool_connection();
@@ -43693,13 +43567,13 @@ var require_pool = __commonJS({
43693
43567
  }
43694
43568
  getConnection(cb) {
43695
43569
  if (this._closed) {
43696
- return process4.nextTick(() => cb(new Error("Pool is closed.")));
43570
+ return process5.nextTick(() => cb(new Error("Pool is closed.")));
43697
43571
  }
43698
43572
  let connection;
43699
43573
  if (this._freeConnections.length > 0) {
43700
43574
  connection = this._freeConnections.shift();
43701
43575
  this.emit("acquire", connection);
43702
- return process4.nextTick(() => cb(null, connection));
43576
+ return process5.nextTick(() => cb(null, connection));
43703
43577
  }
43704
43578
  if (this.config.connectionLimit === 0 || this._allConnections.length < this.config.connectionLimit) {
43705
43579
  connection = new PoolConnection(this, {
@@ -43719,7 +43593,7 @@ var require_pool = __commonJS({
43719
43593
  });
43720
43594
  }
43721
43595
  if (!this.config.waitForConnections) {
43722
- return process4.nextTick(() => cb(new Error("No connections available.")));
43596
+ return process5.nextTick(() => cb(new Error("No connections available.")));
43723
43597
  }
43724
43598
  if (this.config.queueLimit && this._connectionQueue.length >= this.config.queueLimit) {
43725
43599
  return cb(new Error("Queue limit reached."));
@@ -43732,11 +43606,11 @@ var require_pool = __commonJS({
43732
43606
  if (!connection._pool) {
43733
43607
  if (this._connectionQueue.length) {
43734
43608
  cb = this._connectionQueue.shift();
43735
- process4.nextTick(this.getConnection.bind(this, cb));
43609
+ process5.nextTick(this.getConnection.bind(this, cb));
43736
43610
  }
43737
43611
  } else if (this._connectionQueue.length) {
43738
43612
  cb = this._connectionQueue.shift();
43739
- process4.nextTick(cb.bind(null, null, connection));
43613
+ process5.nextTick(cb.bind(null, null, connection));
43740
43614
  } else {
43741
43615
  this._freeConnections.push(connection);
43742
43616
  this.emit("release", connection);
@@ -43874,7 +43748,7 @@ var require_pool_config = __commonJS({
43874
43748
  var require_pool_cluster = __commonJS({
43875
43749
  "node_modules/.pnpm/mysql2@2.3.3/node_modules/mysql2/lib/pool_cluster.js"(exports, module2) {
43876
43750
  "use strict";
43877
- var process4 = require("process");
43751
+ var process5 = require("process");
43878
43752
  var Pool = require_pool();
43879
43753
  var PoolConfig = require_pool_config();
43880
43754
  var Connection2 = require_connection2();
@@ -44038,7 +43912,7 @@ var require_pool_cluster = __commonJS({
44038
43912
  }
44039
43913
  };
44040
43914
  if (this._closed) {
44041
- process4.nextTick(cb);
43915
+ process5.nextTick(cb);
44042
43916
  return;
44043
43917
  }
44044
43918
  this._closed = true;
@@ -44055,7 +43929,7 @@ var require_pool_cluster = __commonJS({
44055
43929
  this._nodes[id].pool.end(onEnd);
44056
43930
  }
44057
43931
  if (waitingClose === 0) {
44058
- process4.nextTick(onEnd);
43932
+ process5.nextTick(onEnd);
44059
43933
  }
44060
43934
  }
44061
43935
  _findNodeIds(pattern) {
@@ -44709,15 +44583,15 @@ var require_promise = __commonJS({
44709
44583
  });
44710
44584
 
44711
44585
  // src/orm-extenstions/d1-driver/session.ts
44712
- var import_drizzle_orm10, import_drizzle_orm11, import_drizzle_orm12, import_sqlite_core3, import_drizzle_orm13, _a, SQLiteWranglerD1Session, _a2, PreparedQuery;
44586
+ var import_drizzle_orm10, import_drizzle_orm11, import_drizzle_orm12, import_sqlite_core4, import_drizzle_orm13, _a, SQLiteWranglerD1Session, _a2, PreparedQuery;
44713
44587
  var init_session = __esm({
44714
44588
  "src/orm-extenstions/d1-driver/session.ts"() {
44715
44589
  import_drizzle_orm10 = require("drizzle-orm");
44716
44590
  import_drizzle_orm11 = require("drizzle-orm");
44717
44591
  import_drizzle_orm12 = require("drizzle-orm");
44718
- import_sqlite_core3 = require("drizzle-orm/sqlite-core");
44592
+ import_sqlite_core4 = require("drizzle-orm/sqlite-core");
44719
44593
  import_drizzle_orm13 = require("drizzle-orm");
44720
- SQLiteWranglerD1Session = class extends import_sqlite_core3.SQLiteSession {
44594
+ SQLiteWranglerD1Session = class extends import_sqlite_core4.SQLiteSession {
44721
44595
  constructor(client, configPath, dbName, dialect6, schema4, options = {}) {
44722
44596
  super(dialect6);
44723
44597
  this.client = client;
@@ -44746,7 +44620,7 @@ var init_session = __esm({
44746
44620
  };
44747
44621
  _a = import_drizzle_orm10.entityKind;
44748
44622
  SQLiteWranglerD1Session[_a] = "SQLiteD1Session";
44749
- PreparedQuery = class extends import_sqlite_core3.SQLitePreparedQuery {
44623
+ PreparedQuery = class extends import_sqlite_core4.SQLitePreparedQuery {
44750
44624
  constructor(stmt, configPath, dbName, queryString, params, logger, fields, executeMethod, customResultMapper) {
44751
44625
  super("async", executeMethod, {
44752
44626
  sql: queryString,
@@ -44871,20 +44745,20 @@ function drizzle(client, configPath, dbName, config = {}) {
44871
44745
  const session = new SQLiteWranglerD1Session(client, configPath, dbName, dialect6, schema4, {
44872
44746
  logger
44873
44747
  });
44874
- return new import_sqlite_core4.BaseSQLiteDatabase(
44748
+ return new import_sqlite_core5.BaseSQLiteDatabase(
44875
44749
  "async",
44876
44750
  dialect6,
44877
44751
  session,
44878
44752
  schema4
44879
44753
  );
44880
44754
  }
44881
- var import_drizzle_orm14, import_sqlite_core4, WranglerDialect;
44755
+ var import_drizzle_orm14, import_sqlite_core5, WranglerDialect;
44882
44756
  var init_driver = __esm({
44883
44757
  "src/orm-extenstions/d1-driver/driver.ts"() {
44884
44758
  import_drizzle_orm14 = require("drizzle-orm");
44885
- import_sqlite_core4 = require("drizzle-orm/sqlite-core");
44759
+ import_sqlite_core5 = require("drizzle-orm/sqlite-core");
44886
44760
  init_session();
44887
- WranglerDialect = class extends import_sqlite_core4.SQLiteAsyncDialect {
44761
+ WranglerDialect = class extends import_sqlite_core5.SQLiteAsyncDialect {
44888
44762
  sqlToQuery(sql2) {
44889
44763
  return sql2.toQuery({
44890
44764
  escapeName: this.escapeName,
@@ -44904,7 +44778,7 @@ var require_windows = __commonJS({
44904
44778
  module2.exports = isexe;
44905
44779
  isexe.sync = sync2;
44906
44780
  var fs9 = require("fs");
44907
- function checkPathExt(path4, options) {
44781
+ function checkPathExt(path5, options) {
44908
44782
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
44909
44783
  if (!pathext) {
44910
44784
  return true;
@@ -44914,26 +44788,26 @@ var require_windows = __commonJS({
44914
44788
  return true;
44915
44789
  }
44916
44790
  for (var i = 0; i < pathext.length; i++) {
44917
- var p = pathext[i].toLowerCase();
44918
- if (p && path4.substr(-p.length).toLowerCase() === p) {
44791
+ var p2 = pathext[i].toLowerCase();
44792
+ if (p2 && path5.substr(-p2.length).toLowerCase() === p2) {
44919
44793
  return true;
44920
44794
  }
44921
44795
  }
44922
44796
  return false;
44923
44797
  }
44924
- function checkStat(stat, path4, options) {
44798
+ function checkStat(stat, path5, options) {
44925
44799
  if (!stat.isSymbolicLink() && !stat.isFile()) {
44926
44800
  return false;
44927
44801
  }
44928
- return checkPathExt(path4, options);
44802
+ return checkPathExt(path5, options);
44929
44803
  }
44930
- function isexe(path4, options, cb) {
44931
- fs9.stat(path4, function(er, stat) {
44932
- cb(er, er ? false : checkStat(stat, path4, options));
44804
+ function isexe(path5, options, cb) {
44805
+ fs9.stat(path5, function(er, stat) {
44806
+ cb(er, er ? false : checkStat(stat, path5, options));
44933
44807
  });
44934
44808
  }
44935
- function sync2(path4, options) {
44936
- return checkStat(fs9.statSync(path4), path4, options);
44809
+ function sync2(path5, options) {
44810
+ return checkStat(fs9.statSync(path5), path5, options);
44937
44811
  }
44938
44812
  }
44939
44813
  });
@@ -44944,13 +44818,13 @@ var require_mode = __commonJS({
44944
44818
  module2.exports = isexe;
44945
44819
  isexe.sync = sync2;
44946
44820
  var fs9 = require("fs");
44947
- function isexe(path4, options, cb) {
44948
- fs9.stat(path4, function(er, stat) {
44821
+ function isexe(path5, options, cb) {
44822
+ fs9.stat(path5, function(er, stat) {
44949
44823
  cb(er, er ? false : checkStat(stat, options));
44950
44824
  });
44951
44825
  }
44952
- function sync2(path4, options) {
44953
- return checkStat(fs9.statSync(path4), options);
44826
+ function sync2(path5, options) {
44827
+ return checkStat(fs9.statSync(path5), options);
44954
44828
  }
44955
44829
  function checkStat(stat, options) {
44956
44830
  return stat.isFile() && checkMode(stat, options);
@@ -44983,7 +44857,7 @@ var require_isexe = __commonJS({
44983
44857
  }
44984
44858
  module2.exports = isexe;
44985
44859
  isexe.sync = sync2;
44986
- function isexe(path4, options, cb) {
44860
+ function isexe(path5, options, cb) {
44987
44861
  if (typeof options === "function") {
44988
44862
  cb = options;
44989
44863
  options = {};
@@ -44993,7 +44867,7 @@ var require_isexe = __commonJS({
44993
44867
  throw new TypeError("callback not provided");
44994
44868
  }
44995
44869
  return new Promise(function(resolve2, reject) {
44996
- isexe(path4, options || {}, function(er, is9) {
44870
+ isexe(path5, options || {}, function(er, is9) {
44997
44871
  if (er) {
44998
44872
  reject(er);
44999
44873
  } else {
@@ -45002,7 +44876,7 @@ var require_isexe = __commonJS({
45002
44876
  });
45003
44877
  });
45004
44878
  }
45005
- core(path4, options || {}, function(er, is9) {
44879
+ core(path5, options || {}, function(er, is9) {
45006
44880
  if (er) {
45007
44881
  if (er.code === "EACCES" || options && options.ignoreErrors) {
45008
44882
  er = null;
@@ -45012,9 +44886,9 @@ var require_isexe = __commonJS({
45012
44886
  cb(er, is9);
45013
44887
  });
45014
44888
  }
45015
- function sync2(path4, options) {
44889
+ function sync2(path5, options) {
45016
44890
  try {
45017
- return core.sync(path4, options || {});
44891
+ return core.sync(path5, options || {});
45018
44892
  } catch (er) {
45019
44893
  if (options && options.ignoreErrors || er.code === "EACCES") {
45020
44894
  return false;
@@ -45030,7 +44904,7 @@ var require_isexe = __commonJS({
45030
44904
  var require_lib4 = __commonJS({
45031
44905
  "node_modules/.pnpm/which@3.0.1/node_modules/which/lib/index.js"(exports, module2) {
45032
44906
  var isexe = require_isexe();
45033
- var { join: join6, delimiter, sep: sep2, posix } = require("path");
44907
+ var { join: join7, delimiter, sep: sep2, posix } = require("path");
45034
44908
  var isWindows = process.platform === "win32";
45035
44909
  var rSlash = new RegExp(`[${posix.sep}${sep2 === posix.sep ? "" : sep2}]`.replace(/(\\)/g, "\\$1"));
45036
44910
  var rRel = new RegExp(`^\\.${rSlash.source}`);
@@ -45063,15 +44937,15 @@ var require_lib4 = __commonJS({
45063
44937
  var getPathPart = (raw, cmd) => {
45064
44938
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
45065
44939
  const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "";
45066
- return prefix + join6(pathPart, cmd);
44940
+ return prefix + join7(pathPart, cmd);
45067
44941
  };
45068
44942
  var which2 = async (cmd, opt = {}) => {
45069
44943
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
45070
44944
  const found = [];
45071
44945
  for (const envPart of pathEnv) {
45072
- const p = getPathPart(envPart, cmd);
44946
+ const p2 = getPathPart(envPart, cmd);
45073
44947
  for (const ext2 of pathExt) {
45074
- const withExt = p + ext2;
44948
+ const withExt = p2 + ext2;
45075
44949
  const is9 = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
45076
44950
  if (is9) {
45077
44951
  if (!opt.all) {
@@ -45093,9 +44967,9 @@ var require_lib4 = __commonJS({
45093
44967
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
45094
44968
  const found = [];
45095
44969
  for (const pathEnvPart of pathEnv) {
45096
- const p = getPathPart(pathEnvPart, cmd);
44970
+ const p2 = getPathPart(pathEnvPart, cmd);
45097
44971
  for (const ext2 of pathExt) {
45098
- const withExt = p + ext2;
44972
+ const withExt = p2 + ext2;
45099
44973
  const is9 = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
45100
44974
  if (is9) {
45101
44975
  if (!opt.all) {
@@ -46256,7 +46130,7 @@ var init_core = __esm({
46256
46130
  }
46257
46131
  $ = new Proxy(function(pieces, ...args) {
46258
46132
  const from = new Error().stack.split(/^\s*at\s/m)[2].trim();
46259
- if (pieces.some((p) => p == void 0)) {
46133
+ if (pieces.some((p2) => p2 == void 0)) {
46260
46134
  throw new Error(`Malformed command at ${from}`);
46261
46135
  }
46262
46136
  let resolve2, reject;
@@ -46398,7 +46272,7 @@ var init_core = __esm({
46398
46272
  return this.child.stderr;
46399
46273
  }
46400
46274
  get exitCode() {
46401
- return this.then((p) => p.exitCode, (p) => p.exitCode);
46275
+ return this.then((p2) => p2.exitCode, (p2) => p2.exitCode);
46402
46276
  }
46403
46277
  then(onfulfilled, onrejected) {
46404
46278
  if (this.isHalted && !this.child) {
@@ -46438,9 +46312,9 @@ var init_core = __esm({
46438
46312
  if (!this.child.pid)
46439
46313
  throw new Error("The process pid is undefined.");
46440
46314
  let children = await psTree(this.child.pid);
46441
- for (const p of children) {
46315
+ for (const p2 of children) {
46442
46316
  try {
46443
- process.kill(+p.PID, signal);
46317
+ process.kill(+p2.PID, signal);
46444
46318
  } catch (e) {
46445
46319
  }
46446
46320
  }
@@ -46701,9 +46575,9 @@ var require_path = __commonJS({
46701
46575
  "use strict";
46702
46576
  Object.defineProperty(exports, "__esModule", { value: true });
46703
46577
  exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
46704
- var os2 = require("os");
46705
- var path4 = require("path");
46706
- var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
46578
+ var os3 = require("os");
46579
+ var path5 = require("path");
46580
+ var IS_WINDOWS_PLATFORM = os3.platform() === "win32";
46707
46581
  var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
46708
46582
  var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
46709
46583
  var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g;
@@ -46714,7 +46588,7 @@ var require_path = __commonJS({
46714
46588
  }
46715
46589
  exports.unixify = unixify;
46716
46590
  function makeAbsolute(cwd, filepath) {
46717
- return path4.resolve(cwd, filepath);
46591
+ return path5.resolve(cwd, filepath);
46718
46592
  }
46719
46593
  exports.makeAbsolute = makeAbsolute;
46720
46594
  function removeLeadingDotSegment(entry) {
@@ -47561,11 +47435,11 @@ var require_expand = __commonJS({
47561
47435
  let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
47562
47436
  let walk = (node, parent = {}) => {
47563
47437
  node.queue = [];
47564
- let p = parent;
47438
+ let p2 = parent;
47565
47439
  let q = parent.queue;
47566
- while (p.type !== "brace" && p.type !== "root" && p.parent) {
47567
- p = p.parent;
47568
- q = p.queue;
47440
+ while (p2.type !== "brace" && p2.type !== "root" && p2.parent) {
47441
+ p2 = p2.parent;
47442
+ q = p2.queue;
47569
47443
  }
47570
47444
  if (node.invalid || node.dollar) {
47571
47445
  q.push(append(q.pop(), stringify(node, options)));
@@ -48035,7 +47909,7 @@ var require_braces = __commonJS({
48035
47909
  var require_constants3 = __commonJS({
48036
47910
  "node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module2) {
48037
47911
  "use strict";
48038
- var path4 = require("path");
47912
+ var path5 = require("path");
48039
47913
  var WIN_SLASH = "\\\\/";
48040
47914
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
48041
47915
  var DOT_LITERAL = "\\.";
@@ -48205,7 +48079,7 @@ var require_constants3 = __commonJS({
48205
48079
  /* | */
48206
48080
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
48207
48081
  /* \uFEFF */
48208
- SEP: path4.sep,
48082
+ SEP: path5.sep,
48209
48083
  /**
48210
48084
  * Create EXTGLOB_CHARS
48211
48085
  */
@@ -48232,7 +48106,7 @@ var require_constants3 = __commonJS({
48232
48106
  var require_utils5 = __commonJS({
48233
48107
  "node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports) {
48234
48108
  "use strict";
48235
- var path4 = require("path");
48109
+ var path5 = require("path");
48236
48110
  var win32 = process.platform === "win32";
48237
48111
  var {
48238
48112
  REGEX_BACKSLASH,
@@ -48261,7 +48135,7 @@ var require_utils5 = __commonJS({
48261
48135
  if (options && typeof options.windows === "boolean") {
48262
48136
  return options.windows;
48263
48137
  }
48264
- return win32 === true || path4.sep === "\\";
48138
+ return win32 === true || path5.sep === "\\";
48265
48139
  };
48266
48140
  exports.escapeLast = (input, char, lastIdx) => {
48267
48141
  const idx = input.lastIndexOf(char, lastIdx);
@@ -49409,7 +49283,7 @@ var require_parse3 = __commonJS({
49409
49283
  var require_picomatch = __commonJS({
49410
49284
  "node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports, module2) {
49411
49285
  "use strict";
49412
- var path4 = require("path");
49286
+ var path5 = require("path");
49413
49287
  var scan = require_scan();
49414
49288
  var parse = require_parse3();
49415
49289
  var utils = require_utils5();
@@ -49495,12 +49369,12 @@ var require_picomatch = __commonJS({
49495
49369
  };
49496
49370
  picomatch.matchBase = (input, glob2, options, posix = utils.isWindows(options)) => {
49497
49371
  const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
49498
- return regex.test(path4.basename(input));
49372
+ return regex.test(path5.basename(input));
49499
49373
  };
49500
49374
  picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
49501
49375
  picomatch.parse = (pattern, options) => {
49502
49376
  if (Array.isArray(pattern))
49503
- return pattern.map((p) => picomatch.parse(p, options));
49377
+ return pattern.map((p2) => picomatch.parse(p2, options));
49504
49378
  return parse(pattern, { ...options, fastpaths: false });
49505
49379
  };
49506
49380
  picomatch.scan = (input, options) => scan(input, options);
@@ -49604,7 +49478,7 @@ var require_micromatch = __commonJS({
49604
49478
  throw new Error(`No matches found for "${patterns.join(", ")}"`);
49605
49479
  }
49606
49480
  if (options.nonull === true || options.nullglob === true) {
49607
- return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
49481
+ return options.unescape ? patterns.map((p2) => p2.replace(/\\/g, "")) : patterns;
49608
49482
  }
49609
49483
  }
49610
49484
  return matches;
@@ -49635,7 +49509,7 @@ var require_micromatch = __commonJS({
49635
49509
  throw new TypeError(`Expected a string: "${util2.inspect(str)}"`);
49636
49510
  }
49637
49511
  if (Array.isArray(pattern)) {
49638
- return pattern.some((p) => micromatch.contains(str, p, options));
49512
+ return pattern.some((p2) => micromatch.contains(str, p2, options));
49639
49513
  }
49640
49514
  if (typeof pattern === "string") {
49641
49515
  if (isEmptyString(str) || isEmptyString(pattern)) {
@@ -49681,7 +49555,7 @@ var require_micromatch = __commonJS({
49681
49555
  if (typeof str !== "string") {
49682
49556
  throw new TypeError(`Expected a string: "${util2.inspect(str)}"`);
49683
49557
  }
49684
- return [].concat(patterns).every((p) => picomatch(p, options)(str));
49558
+ return [].concat(patterns).every((p2) => picomatch(p2, options)(str));
49685
49559
  };
49686
49560
  micromatch.capture = (glob2, input, options) => {
49687
49561
  let posix = utils.isWindows(options);
@@ -49725,7 +49599,7 @@ var require_pattern = __commonJS({
49725
49599
  "use strict";
49726
49600
  Object.defineProperty(exports, "__esModule", { value: true });
49727
49601
  exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
49728
- var path4 = require("path");
49602
+ var path5 = require("path");
49729
49603
  var globParent = require_glob_parent();
49730
49604
  var micromatch = require_micromatch();
49731
49605
  var GLOBSTAR2 = "**";
@@ -49820,7 +49694,7 @@ var require_pattern = __commonJS({
49820
49694
  }
49821
49695
  exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
49822
49696
  function isAffectDepthOfReadingPattern(pattern) {
49823
- const basename = path4.basename(pattern);
49697
+ const basename = path5.basename(pattern);
49824
49698
  return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
49825
49699
  }
49826
49700
  exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -49919,8 +49793,8 @@ var require_utils6 = __commonJS({
49919
49793
  exports.errno = errno;
49920
49794
  var fs9 = require_fs();
49921
49795
  exports.fs = fs9;
49922
- var path4 = require_path();
49923
- exports.path = path4;
49796
+ var path5 = require_path();
49797
+ exports.path = path5;
49924
49798
  var pattern = require_pattern();
49925
49799
  exports.pattern = pattern;
49926
49800
  var stream = require_stream2();
@@ -50032,8 +49906,8 @@ var require_async = __commonJS({
50032
49906
  "use strict";
50033
49907
  Object.defineProperty(exports, "__esModule", { value: true });
50034
49908
  exports.read = void 0;
50035
- function read(path4, settings, callback) {
50036
- settings.fs.lstat(path4, (lstatError, lstat) => {
49909
+ function read(path5, settings, callback) {
49910
+ settings.fs.lstat(path5, (lstatError, lstat) => {
50037
49911
  if (lstatError !== null) {
50038
49912
  callFailureCallback(callback, lstatError);
50039
49913
  return;
@@ -50042,7 +49916,7 @@ var require_async = __commonJS({
50042
49916
  callSuccessCallback(callback, lstat);
50043
49917
  return;
50044
49918
  }
50045
- settings.fs.stat(path4, (statError, stat) => {
49919
+ settings.fs.stat(path5, (statError, stat) => {
50046
49920
  if (statError !== null) {
50047
49921
  if (settings.throwErrorOnBrokenSymbolicLink) {
50048
49922
  callFailureCallback(callback, statError);
@@ -50074,13 +49948,13 @@ var require_sync = __commonJS({
50074
49948
  "use strict";
50075
49949
  Object.defineProperty(exports, "__esModule", { value: true });
50076
49950
  exports.read = void 0;
50077
- function read(path4, settings) {
50078
- const lstat = settings.fs.lstatSync(path4);
49951
+ function read(path5, settings) {
49952
+ const lstat = settings.fs.lstatSync(path5);
50079
49953
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
50080
49954
  return lstat;
50081
49955
  }
50082
49956
  try {
50083
- const stat = settings.fs.statSync(path4);
49957
+ const stat = settings.fs.statSync(path5);
50084
49958
  if (settings.markSymbolicLink) {
50085
49959
  stat.isSymbolicLink = () => true;
50086
49960
  }
@@ -50151,17 +50025,17 @@ var require_out = __commonJS({
50151
50025
  var sync2 = require_sync();
50152
50026
  var settings_1 = require_settings();
50153
50027
  exports.Settings = settings_1.default;
50154
- function stat(path4, optionsOrSettingsOrCallback, callback) {
50028
+ function stat(path5, optionsOrSettingsOrCallback, callback) {
50155
50029
  if (typeof optionsOrSettingsOrCallback === "function") {
50156
- async.read(path4, getSettings(), optionsOrSettingsOrCallback);
50030
+ async.read(path5, getSettings(), optionsOrSettingsOrCallback);
50157
50031
  return;
50158
50032
  }
50159
- async.read(path4, getSettings(optionsOrSettingsOrCallback), callback);
50033
+ async.read(path5, getSettings(optionsOrSettingsOrCallback), callback);
50160
50034
  }
50161
50035
  exports.stat = stat;
50162
- function statSync(path4, optionsOrSettings) {
50036
+ function statSync(path5, optionsOrSettings) {
50163
50037
  const settings = getSettings(optionsOrSettings);
50164
- return sync2.read(path4, settings);
50038
+ return sync2.read(path5, settings);
50165
50039
  }
50166
50040
  exports.statSync = statSync;
50167
50041
  function getSettings(settingsOrOptions = {}) {
@@ -50380,16 +50254,16 @@ var require_async2 = __commonJS({
50380
50254
  return;
50381
50255
  }
50382
50256
  const tasks = names.map((name) => {
50383
- const path4 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
50257
+ const path5 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
50384
50258
  return (done) => {
50385
- fsStat.stat(path4, settings.fsStatSettings, (error2, stats) => {
50259
+ fsStat.stat(path5, settings.fsStatSettings, (error2, stats) => {
50386
50260
  if (error2 !== null) {
50387
50261
  done(error2);
50388
50262
  return;
50389
50263
  }
50390
50264
  const entry = {
50391
50265
  name,
50392
- path: path4,
50266
+ path: path5,
50393
50267
  dirent: utils.fs.createDirentFromStats(name, stats)
50394
50268
  };
50395
50269
  if (settings.stats) {
@@ -50507,7 +50381,7 @@ var require_settings2 = __commonJS({
50507
50381
  "node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
50508
50382
  "use strict";
50509
50383
  Object.defineProperty(exports, "__esModule", { value: true });
50510
- var path4 = require("path");
50384
+ var path5 = require("path");
50511
50385
  var fsStat = require_out();
50512
50386
  var fs9 = require_fs4();
50513
50387
  var Settings = class {
@@ -50515,7 +50389,7 @@ var require_settings2 = __commonJS({
50515
50389
  this._options = _options;
50516
50390
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
50517
50391
  this.fs = fs9.createFileSystemAdapter(this._options.fs);
50518
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path4.sep);
50392
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path5.sep);
50519
50393
  this.stats = this._getValue(this._options.stats, false);
50520
50394
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
50521
50395
  this.fsStatSettings = new fsStat.Settings({
@@ -50542,17 +50416,17 @@ var require_out2 = __commonJS({
50542
50416
  var sync2 = require_sync2();
50543
50417
  var settings_1 = require_settings2();
50544
50418
  exports.Settings = settings_1.default;
50545
- function scandir(path4, optionsOrSettingsOrCallback, callback) {
50419
+ function scandir(path5, optionsOrSettingsOrCallback, callback) {
50546
50420
  if (typeof optionsOrSettingsOrCallback === "function") {
50547
- async.read(path4, getSettings(), optionsOrSettingsOrCallback);
50421
+ async.read(path5, getSettings(), optionsOrSettingsOrCallback);
50548
50422
  return;
50549
50423
  }
50550
- async.read(path4, getSettings(optionsOrSettingsOrCallback), callback);
50424
+ async.read(path5, getSettings(optionsOrSettingsOrCallback), callback);
50551
50425
  }
50552
50426
  exports.scandir = scandir;
50553
- function scandirSync(path4, optionsOrSettings) {
50427
+ function scandirSync(path5, optionsOrSettings) {
50554
50428
  const settings = getSettings(optionsOrSettings);
50555
- return sync2.read(path4, settings);
50429
+ return sync2.read(path5, settings);
50556
50430
  }
50557
50431
  exports.scandirSync = scandirSync;
50558
50432
  function getSettings(settingsOrOptions = {}) {
@@ -50790,7 +50664,7 @@ var require_queue = __commonJS({
50790
50664
  queue.drained = drained;
50791
50665
  return queue;
50792
50666
  function push(value) {
50793
- var p = new Promise(function(resolve2, reject) {
50667
+ var p2 = new Promise(function(resolve2, reject) {
50794
50668
  pushCb(value, function(err2, result) {
50795
50669
  if (err2) {
50796
50670
  reject(err2);
@@ -50799,11 +50673,11 @@ var require_queue = __commonJS({
50799
50673
  resolve2(result);
50800
50674
  });
50801
50675
  });
50802
- p.catch(noop2);
50803
- return p;
50676
+ p2.catch(noop2);
50677
+ return p2;
50804
50678
  }
50805
50679
  function unshift(value) {
50806
- var p = new Promise(function(resolve2, reject) {
50680
+ var p2 = new Promise(function(resolve2, reject) {
50807
50681
  unshiftCb(value, function(err2, result) {
50808
50682
  if (err2) {
50809
50683
  reject(err2);
@@ -50812,8 +50686,8 @@ var require_queue = __commonJS({
50812
50686
  resolve2(result);
50813
50687
  });
50814
50688
  });
50815
- p.catch(noop2);
50816
- return p;
50689
+ p2.catch(noop2);
50690
+ return p2;
50817
50691
  }
50818
50692
  function drained() {
50819
50693
  if (queue.idle()) {
@@ -50822,13 +50696,13 @@ var require_queue = __commonJS({
50822
50696
  });
50823
50697
  }
50824
50698
  var previousDrain = queue.drain;
50825
- var p = new Promise(function(resolve2) {
50699
+ var p2 = new Promise(function(resolve2) {
50826
50700
  queue.drain = function() {
50827
50701
  previousDrain();
50828
50702
  resolve2();
50829
50703
  };
50830
50704
  });
50831
- return p;
50705
+ return p2;
50832
50706
  }
50833
50707
  }
50834
50708
  module2.exports = fastqueue;
@@ -51156,7 +51030,7 @@ var require_settings3 = __commonJS({
51156
51030
  "node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
51157
51031
  "use strict";
51158
51032
  Object.defineProperty(exports, "__esModule", { value: true });
51159
- var path4 = require("path");
51033
+ var path5 = require("path");
51160
51034
  var fsScandir = require_out2();
51161
51035
  var Settings = class {
51162
51036
  constructor(_options = {}) {
@@ -51166,7 +51040,7 @@ var require_settings3 = __commonJS({
51166
51040
  this.deepFilter = this._getValue(this._options.deepFilter, null);
51167
51041
  this.entryFilter = this._getValue(this._options.entryFilter, null);
51168
51042
  this.errorFilter = this._getValue(this._options.errorFilter, null);
51169
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path4.sep);
51043
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path5.sep);
51170
51044
  this.fsScandirSettings = new fsScandir.Settings({
51171
51045
  followSymbolicLinks: this._options.followSymbolicLinks,
51172
51046
  fs: this._options.fs,
@@ -51228,7 +51102,7 @@ var require_reader2 = __commonJS({
51228
51102
  "node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/readers/reader.js"(exports) {
51229
51103
  "use strict";
51230
51104
  Object.defineProperty(exports, "__esModule", { value: true });
51231
- var path4 = require("path");
51105
+ var path5 = require("path");
51232
51106
  var fsStat = require_out();
51233
51107
  var utils = require_utils6();
51234
51108
  var Reader = class {
@@ -51241,7 +51115,7 @@ var require_reader2 = __commonJS({
51241
51115
  });
51242
51116
  }
51243
51117
  _getFullEntryPath(filepath) {
51244
- return path4.resolve(this._settings.cwd, filepath);
51118
+ return path5.resolve(this._settings.cwd, filepath);
51245
51119
  }
51246
51120
  _makeEntry(stats, pattern) {
51247
51121
  const entry = {
@@ -51635,7 +51509,7 @@ var require_provider = __commonJS({
51635
51509
  "node_modules/.pnpm/fast-glob@3.3.1/node_modules/fast-glob/out/providers/provider.js"(exports) {
51636
51510
  "use strict";
51637
51511
  Object.defineProperty(exports, "__esModule", { value: true });
51638
- var path4 = require("path");
51512
+ var path5 = require("path");
51639
51513
  var deep_1 = require_deep();
51640
51514
  var entry_1 = require_entry();
51641
51515
  var error_1 = require_error();
@@ -51649,7 +51523,7 @@ var require_provider = __commonJS({
51649
51523
  this.entryTransformer = new entry_2.default(this._settings);
51650
51524
  }
51651
51525
  _getRootDirectory(task) {
51652
- return path4.resolve(this._settings.cwd, task.base);
51526
+ return path5.resolve(this._settings.cwd, task.base);
51653
51527
  }
51654
51528
  _getReaderOptions(task) {
51655
51529
  const basePath = task.base === "." ? "" : task.base;
@@ -51831,8 +51705,8 @@ var require_settings4 = __commonJS({
51831
51705
  Object.defineProperty(exports, "__esModule", { value: true });
51832
51706
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
51833
51707
  var fs9 = require("fs");
51834
- var os2 = require("os");
51835
- var CPU_COUNT = Math.max(os2.cpus().length, 1);
51708
+ var os3 = require("os");
51709
+ var CPU_COUNT = Math.max(os3.cpus().length, 1);
51836
51710
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
51837
51711
  lstat: fs9.lstat,
51838
51712
  lstatSync: fs9.lstatSync,
@@ -52031,15 +51905,15 @@ var require_path_type = __commonJS({
52031
51905
  var require_dir_glob = __commonJS({
52032
51906
  "node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.js"(exports, module2) {
52033
51907
  "use strict";
52034
- var path4 = require("path");
51908
+ var path5 = require("path");
52035
51909
  var pathType = require_path_type();
52036
51910
  var getExtensions = (extensions) => extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0];
52037
51911
  var getPath = (filepath, cwd) => {
52038
51912
  const pth = filepath[0] === "!" ? filepath.slice(1) : filepath;
52039
- return path4.isAbsolute(pth) ? pth : path4.join(cwd, pth);
51913
+ return path5.isAbsolute(pth) ? pth : path5.join(cwd, pth);
52040
51914
  };
52041
51915
  var addExtensions = (file, extensions) => {
52042
- if (path4.extname(file)) {
51916
+ if (path5.extname(file)) {
52043
51917
  return `**/${file}`;
52044
51918
  }
52045
51919
  return `**/${file}.${getExtensions(extensions)}`;
@@ -52052,15 +51926,15 @@ var require_dir_glob = __commonJS({
52052
51926
  throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``);
52053
51927
  }
52054
51928
  if (options.files && options.extensions) {
52055
- return options.files.map((x) => path4.posix.join(directory, addExtensions(x, options.extensions)));
51929
+ return options.files.map((x) => path5.posix.join(directory, addExtensions(x, options.extensions)));
52056
51930
  }
52057
51931
  if (options.files) {
52058
- return options.files.map((x) => path4.posix.join(directory, `**/${x}`));
51932
+ return options.files.map((x) => path5.posix.join(directory, `**/${x}`));
52059
51933
  }
52060
51934
  if (options.extensions) {
52061
- return [path4.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)];
51935
+ return [path5.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)];
52062
51936
  }
52063
- return [path4.posix.join(directory, "**")];
51937
+ return [path5.posix.join(directory, "**")];
52064
51938
  };
52065
51939
  module2.exports = async (input, options) => {
52066
51940
  options = {
@@ -52306,17 +52180,17 @@ var require_ignore = __commonJS({
52306
52180
  var throwError = (message, Ctor) => {
52307
52181
  throw new Ctor(message);
52308
52182
  };
52309
- var checkPath = (path4, originalPath, doThrow) => {
52310
- if (!isString2(path4)) {
52183
+ var checkPath = (path5, originalPath, doThrow) => {
52184
+ if (!isString2(path5)) {
52311
52185
  return doThrow(
52312
52186
  `path must be a string, but got \`${originalPath}\``,
52313
52187
  TypeError
52314
52188
  );
52315
52189
  }
52316
- if (!path4) {
52190
+ if (!path5) {
52317
52191
  return doThrow(`path must not be empty`, TypeError);
52318
52192
  }
52319
- if (checkPath.isNotRelative(path4)) {
52193
+ if (checkPath.isNotRelative(path5)) {
52320
52194
  const r = "`path.relative()`d";
52321
52195
  return doThrow(
52322
52196
  `path should be a ${r} string, but got "${originalPath}"`,
@@ -52325,9 +52199,9 @@ var require_ignore = __commonJS({
52325
52199
  }
52326
52200
  return true;
52327
52201
  };
52328
- var isNotRelative = (path4) => REGEX_TEST_INVALID_PATH.test(path4);
52202
+ var isNotRelative = (path5) => REGEX_TEST_INVALID_PATH.test(path5);
52329
52203
  checkPath.isNotRelative = isNotRelative;
52330
- checkPath.convert = (p) => p;
52204
+ checkPath.convert = (p2) => p2;
52331
52205
  var Ignore = class {
52332
52206
  constructor({
52333
52207
  ignorecase = true,
@@ -52384,7 +52258,7 @@ var require_ignore = __commonJS({
52384
52258
  // setting `checkUnignored` to `false` could reduce additional
52385
52259
  // path matching.
52386
52260
  // @returns {TestResult} true if a file is ignored
52387
- _testOne(path4, checkUnignored) {
52261
+ _testOne(path5, checkUnignored) {
52388
52262
  let ignored = false;
52389
52263
  let unignored = false;
52390
52264
  this._rules.forEach((rule) => {
@@ -52392,7 +52266,7 @@ var require_ignore = __commonJS({
52392
52266
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
52393
52267
  return;
52394
52268
  }
52395
- const matched = rule.regex.test(path4);
52269
+ const matched = rule.regex.test(path5);
52396
52270
  if (matched) {
52397
52271
  ignored = !negative;
52398
52272
  unignored = negative;
@@ -52405,24 +52279,24 @@ var require_ignore = __commonJS({
52405
52279
  }
52406
52280
  // @returns {TestResult}
52407
52281
  _test(originalPath, cache, checkUnignored, slices) {
52408
- const path4 = originalPath && checkPath.convert(originalPath);
52282
+ const path5 = originalPath && checkPath.convert(originalPath);
52409
52283
  checkPath(
52410
- path4,
52284
+ path5,
52411
52285
  originalPath,
52412
52286
  this._allowRelativePaths ? RETURN_FALSE : throwError
52413
52287
  );
52414
- return this._t(path4, cache, checkUnignored, slices);
52288
+ return this._t(path5, cache, checkUnignored, slices);
52415
52289
  }
52416
- _t(path4, cache, checkUnignored, slices) {
52417
- if (path4 in cache) {
52418
- return cache[path4];
52290
+ _t(path5, cache, checkUnignored, slices) {
52291
+ if (path5 in cache) {
52292
+ return cache[path5];
52419
52293
  }
52420
52294
  if (!slices) {
52421
- slices = path4.split(SLASH);
52295
+ slices = path5.split(SLASH);
52422
52296
  }
52423
52297
  slices.pop();
52424
52298
  if (!slices.length) {
52425
- return cache[path4] = this._testOne(path4, checkUnignored);
52299
+ return cache[path5] = this._testOne(path5, checkUnignored);
52426
52300
  }
52427
52301
  const parent = this._t(
52428
52302
  slices.join(SLASH) + SLASH,
@@ -52430,24 +52304,24 @@ var require_ignore = __commonJS({
52430
52304
  checkUnignored,
52431
52305
  slices
52432
52306
  );
52433
- return cache[path4] = parent.ignored ? parent : this._testOne(path4, checkUnignored);
52307
+ return cache[path5] = parent.ignored ? parent : this._testOne(path5, checkUnignored);
52434
52308
  }
52435
- ignores(path4) {
52436
- return this._test(path4, this._ignoreCache, false).ignored;
52309
+ ignores(path5) {
52310
+ return this._test(path5, this._ignoreCache, false).ignored;
52437
52311
  }
52438
52312
  createFilter() {
52439
- return (path4) => !this.ignores(path4);
52313
+ return (path5) => !this.ignores(path5);
52440
52314
  }
52441
52315
  filter(paths) {
52442
52316
  return makeArray(paths).filter(this.createFilter());
52443
52317
  }
52444
52318
  // @returns {TestResult}
52445
- test(path4) {
52446
- return this._test(path4, this._testCache, true);
52319
+ test(path5) {
52320
+ return this._test(path5, this._testCache, true);
52447
52321
  }
52448
52322
  };
52449
52323
  var factory = (options) => new Ignore(options);
52450
- var isPathValid = (path4) => checkPath(path4 && checkPath.convert(path4), path4, RETURN_FALSE);
52324
+ var isPathValid = (path5) => checkPath(path5 && checkPath.convert(path5), path5, RETURN_FALSE);
52451
52325
  factory.isPathValid = isPathValid;
52452
52326
  factory.default = factory;
52453
52327
  module2.exports = factory;
@@ -52458,19 +52332,19 @@ var require_ignore = __commonJS({
52458
52332
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
52459
52333
  checkPath.convert = makePosix;
52460
52334
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
52461
- checkPath.isNotRelative = (path4) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path4) || isNotRelative(path4);
52335
+ checkPath.isNotRelative = (path5) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path5) || isNotRelative(path5);
52462
52336
  }
52463
52337
  }
52464
52338
  });
52465
52339
 
52466
52340
  // node_modules/.pnpm/slash@4.0.0/node_modules/slash/index.js
52467
- function slash(path4) {
52468
- const isExtendedLengthPath = /^\\\\\?\\/.test(path4);
52469
- const hasNonAscii = /[^\u0000-\u0080]+/.test(path4);
52341
+ function slash(path5) {
52342
+ const isExtendedLengthPath = /^\\\\\?\\/.test(path5);
52343
+ const hasNonAscii = /[^\u0000-\u0080]+/.test(path5);
52470
52344
  if (isExtendedLengthPath || hasNonAscii) {
52471
- return path4;
52345
+ return path5;
52472
52346
  }
52473
- return path4.replace(/\\/g, "/");
52347
+ return path5.replace(/\\/g, "/");
52474
52348
  }
52475
52349
  var init_slash = __esm({
52476
52350
  "node_modules/.pnpm/slash@4.0.0/node_modules/slash/index.js"() {
@@ -52656,9 +52530,9 @@ var init_globby = __esm({
52656
52530
  createFilterFunction = (isIgnored) => {
52657
52531
  const seen = /* @__PURE__ */ new Set();
52658
52532
  return (fastGlobResult) => {
52659
- const path4 = fastGlobResult.path || fastGlobResult;
52660
- const pathKey = import_node_path2.default.normalize(path4);
52661
- const seenOrIgnored = seen.has(pathKey) || isIgnored && isIgnored(path4);
52533
+ const path5 = fastGlobResult.path || fastGlobResult;
52534
+ const pathKey = import_node_path2.default.normalize(path5);
52535
+ const seenOrIgnored = seen.has(pathKey) || isIgnored && isIgnored(path5);
52662
52536
  seen.add(pathKey);
52663
52537
  return !seenOrIgnored;
52664
52538
  };
@@ -53064,17 +52938,17 @@ var require_visit = __commonJS({
53064
52938
  visit.BREAK = BREAK;
53065
52939
  visit.SKIP = SKIP;
53066
52940
  visit.REMOVE = REMOVE;
53067
- function visit_(key, node, visitor, path4) {
53068
- const ctrl = callVisitor(key, node, visitor, path4);
52941
+ function visit_(key, node, visitor, path5) {
52942
+ const ctrl = callVisitor(key, node, visitor, path5);
53069
52943
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
53070
- replaceNode(key, path4, ctrl);
53071
- return visit_(key, ctrl, visitor, path4);
52944
+ replaceNode(key, path5, ctrl);
52945
+ return visit_(key, ctrl, visitor, path5);
53072
52946
  }
53073
52947
  if (typeof ctrl !== "symbol") {
53074
52948
  if (identity.isCollection(node)) {
53075
- path4 = Object.freeze(path4.concat(node));
52949
+ path5 = Object.freeze(path5.concat(node));
53076
52950
  for (let i = 0; i < node.items.length; ++i) {
53077
- const ci = visit_(i, node.items[i], visitor, path4);
52951
+ const ci = visit_(i, node.items[i], visitor, path5);
53078
52952
  if (typeof ci === "number")
53079
52953
  i = ci - 1;
53080
52954
  else if (ci === BREAK)
@@ -53085,13 +52959,13 @@ var require_visit = __commonJS({
53085
52959
  }
53086
52960
  }
53087
52961
  } else if (identity.isPair(node)) {
53088
- path4 = Object.freeze(path4.concat(node));
53089
- const ck = visit_("key", node.key, visitor, path4);
52962
+ path5 = Object.freeze(path5.concat(node));
52963
+ const ck = visit_("key", node.key, visitor, path5);
53090
52964
  if (ck === BREAK)
53091
52965
  return BREAK;
53092
52966
  else if (ck === REMOVE)
53093
52967
  node.key = null;
53094
- const cv = visit_("value", node.value, visitor, path4);
52968
+ const cv = visit_("value", node.value, visitor, path5);
53095
52969
  if (cv === BREAK)
53096
52970
  return BREAK;
53097
52971
  else if (cv === REMOVE)
@@ -53112,17 +52986,17 @@ var require_visit = __commonJS({
53112
52986
  visitAsync.BREAK = BREAK;
53113
52987
  visitAsync.SKIP = SKIP;
53114
52988
  visitAsync.REMOVE = REMOVE;
53115
- async function visitAsync_(key, node, visitor, path4) {
53116
- const ctrl = await callVisitor(key, node, visitor, path4);
52989
+ async function visitAsync_(key, node, visitor, path5) {
52990
+ const ctrl = await callVisitor(key, node, visitor, path5);
53117
52991
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
53118
- replaceNode(key, path4, ctrl);
53119
- return visitAsync_(key, ctrl, visitor, path4);
52992
+ replaceNode(key, path5, ctrl);
52993
+ return visitAsync_(key, ctrl, visitor, path5);
53120
52994
  }
53121
52995
  if (typeof ctrl !== "symbol") {
53122
52996
  if (identity.isCollection(node)) {
53123
- path4 = Object.freeze(path4.concat(node));
52997
+ path5 = Object.freeze(path5.concat(node));
53124
52998
  for (let i = 0; i < node.items.length; ++i) {
53125
- const ci = await visitAsync_(i, node.items[i], visitor, path4);
52999
+ const ci = await visitAsync_(i, node.items[i], visitor, path5);
53126
53000
  if (typeof ci === "number")
53127
53001
  i = ci - 1;
53128
53002
  else if (ci === BREAK)
@@ -53133,13 +53007,13 @@ var require_visit = __commonJS({
53133
53007
  }
53134
53008
  }
53135
53009
  } else if (identity.isPair(node)) {
53136
- path4 = Object.freeze(path4.concat(node));
53137
- const ck = await visitAsync_("key", node.key, visitor, path4);
53010
+ path5 = Object.freeze(path5.concat(node));
53011
+ const ck = await visitAsync_("key", node.key, visitor, path5);
53138
53012
  if (ck === BREAK)
53139
53013
  return BREAK;
53140
53014
  else if (ck === REMOVE)
53141
53015
  node.key = null;
53142
- const cv = await visitAsync_("value", node.value, visitor, path4);
53016
+ const cv = await visitAsync_("value", node.value, visitor, path5);
53143
53017
  if (cv === BREAK)
53144
53018
  return BREAK;
53145
53019
  else if (cv === REMOVE)
@@ -53166,24 +53040,24 @@ var require_visit = __commonJS({
53166
53040
  }
53167
53041
  return visitor;
53168
53042
  }
53169
- function callVisitor(key, node, visitor, path4) {
53043
+ function callVisitor(key, node, visitor, path5) {
53170
53044
  var _a3, _b, _c, _d, _e;
53171
53045
  if (typeof visitor === "function")
53172
- return visitor(key, node, path4);
53046
+ return visitor(key, node, path5);
53173
53047
  if (identity.isMap(node))
53174
- return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node, path4);
53048
+ return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node, path5);
53175
53049
  if (identity.isSeq(node))
53176
- return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path4);
53050
+ return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path5);
53177
53051
  if (identity.isPair(node))
53178
- return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path4);
53052
+ return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path5);
53179
53053
  if (identity.isScalar(node))
53180
- return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path4);
53054
+ return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path5);
53181
53055
  if (identity.isAlias(node))
53182
- return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path4);
53056
+ return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path5);
53183
53057
  return void 0;
53184
53058
  }
53185
- function replaceNode(key, path4, node) {
53186
- const parent = path4[path4.length - 1];
53059
+ function replaceNode(key, path5, node) {
53060
+ const parent = path5[path5.length - 1];
53187
53061
  if (identity.isCollection(parent)) {
53188
53062
  parent.items[key] = node;
53189
53063
  } else if (identity.isPair(parent)) {
@@ -53779,10 +53653,10 @@ var require_Collection = __commonJS({
53779
53653
  var createNode = require_createNode();
53780
53654
  var identity = require_identity();
53781
53655
  var Node = require_Node();
53782
- function collectionFromPath(schema4, path4, value) {
53656
+ function collectionFromPath(schema4, path5, value) {
53783
53657
  let v = value;
53784
- for (let i = path4.length - 1; i >= 0; --i) {
53785
- const k = path4[i];
53658
+ for (let i = path5.length - 1; i >= 0; --i) {
53659
+ const k = path5[i];
53786
53660
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
53787
53661
  const a = [];
53788
53662
  a[k] = v;
@@ -53801,7 +53675,7 @@ var require_Collection = __commonJS({
53801
53675
  sourceObjects: /* @__PURE__ */ new Map()
53802
53676
  });
53803
53677
  }
53804
- var isEmptyPath = (path4) => path4 == null || typeof path4 === "object" && !!path4[Symbol.iterator]().next().done;
53678
+ var isEmptyPath = (path5) => path5 == null || typeof path5 === "object" && !!path5[Symbol.iterator]().next().done;
53805
53679
  var Collection = class extends Node.NodeBase {
53806
53680
  constructor(type, schema4) {
53807
53681
  super(type);
@@ -53831,11 +53705,11 @@ var require_Collection = __commonJS({
53831
53705
  * be a Pair instance or a `{ key, value }` object, which may not have a key
53832
53706
  * that already exists in the map.
53833
53707
  */
53834
- addIn(path4, value) {
53835
- if (isEmptyPath(path4))
53708
+ addIn(path5, value) {
53709
+ if (isEmptyPath(path5))
53836
53710
  this.add(value);
53837
53711
  else {
53838
- const [key, ...rest] = path4;
53712
+ const [key, ...rest] = path5;
53839
53713
  const node = this.get(key, true);
53840
53714
  if (identity.isCollection(node))
53841
53715
  node.addIn(rest, value);
@@ -53849,8 +53723,8 @@ var require_Collection = __commonJS({
53849
53723
  * Removes a value from the collection.
53850
53724
  * @returns `true` if the item was found and removed.
53851
53725
  */
53852
- deleteIn(path4) {
53853
- const [key, ...rest] = path4;
53726
+ deleteIn(path5) {
53727
+ const [key, ...rest] = path5;
53854
53728
  if (rest.length === 0)
53855
53729
  return this.delete(key);
53856
53730
  const node = this.get(key, true);
@@ -53864,8 +53738,8 @@ var require_Collection = __commonJS({
53864
53738
  * scalar values from their surrounding node; to disable set `keepScalar` to
53865
53739
  * `true` (collections are always returned intact).
53866
53740
  */
53867
- getIn(path4, keepScalar) {
53868
- const [key, ...rest] = path4;
53741
+ getIn(path5, keepScalar) {
53742
+ const [key, ...rest] = path5;
53869
53743
  const node = this.get(key, true);
53870
53744
  if (rest.length === 0)
53871
53745
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -53883,8 +53757,8 @@ var require_Collection = __commonJS({
53883
53757
  /**
53884
53758
  * Checks if the collection includes a value with the key `key`.
53885
53759
  */
53886
- hasIn(path4) {
53887
- const [key, ...rest] = path4;
53760
+ hasIn(path5) {
53761
+ const [key, ...rest] = path5;
53888
53762
  if (rest.length === 0)
53889
53763
  return this.has(key);
53890
53764
  const node = this.get(key, true);
@@ -53894,8 +53768,8 @@ var require_Collection = __commonJS({
53894
53768
  * Sets a value in this collection. For `!!set`, `value` needs to be a
53895
53769
  * boolean to add/remove the item from the set.
53896
53770
  */
53897
- setIn(path4, value) {
53898
- const [key, ...rest] = path4;
53771
+ setIn(path5, value) {
53772
+ const [key, ...rest] = path5;
53899
53773
  if (rest.length === 0) {
53900
53774
  this.set(key, value);
53901
53775
  } else {
@@ -55957,7 +55831,7 @@ var require_timestamp = __commonJS({
55957
55831
  const sign = str[0];
55958
55832
  const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
55959
55833
  const num = (n) => asBigInt ? BigInt(n) : Number(n);
55960
- const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
55834
+ const res = parts.replace(/_/g, "").split(":").reduce((res2, p2) => res2 * num(60) + num(p2), num(0));
55961
55835
  return sign === "-" ? num(-1) * res : res;
55962
55836
  }
55963
55837
  function stringifySexagesimal(node) {
@@ -56352,9 +56226,9 @@ var require_Document = __commonJS({
56352
56226
  this.contents.add(value);
56353
56227
  }
56354
56228
  /** Adds a value to the document. */
56355
- addIn(path4, value) {
56229
+ addIn(path5, value) {
56356
56230
  if (assertCollection(this.contents))
56357
- this.contents.addIn(path4, value);
56231
+ this.contents.addIn(path5, value);
56358
56232
  }
56359
56233
  /**
56360
56234
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -56429,14 +56303,14 @@ var require_Document = __commonJS({
56429
56303
  * Removes a value from the document.
56430
56304
  * @returns `true` if the item was found and removed.
56431
56305
  */
56432
- deleteIn(path4) {
56433
- if (Collection.isEmptyPath(path4)) {
56306
+ deleteIn(path5) {
56307
+ if (Collection.isEmptyPath(path5)) {
56434
56308
  if (this.contents == null)
56435
56309
  return false;
56436
56310
  this.contents = null;
56437
56311
  return true;
56438
56312
  }
56439
- return assertCollection(this.contents) ? this.contents.deleteIn(path4) : false;
56313
+ return assertCollection(this.contents) ? this.contents.deleteIn(path5) : false;
56440
56314
  }
56441
56315
  /**
56442
56316
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -56451,10 +56325,10 @@ var require_Document = __commonJS({
56451
56325
  * scalar values from their surrounding node; to disable set `keepScalar` to
56452
56326
  * `true` (collections are always returned intact).
56453
56327
  */
56454
- getIn(path4, keepScalar) {
56455
- if (Collection.isEmptyPath(path4))
56328
+ getIn(path5, keepScalar) {
56329
+ if (Collection.isEmptyPath(path5))
56456
56330
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
56457
- return identity.isCollection(this.contents) ? this.contents.getIn(path4, keepScalar) : void 0;
56331
+ return identity.isCollection(this.contents) ? this.contents.getIn(path5, keepScalar) : void 0;
56458
56332
  }
56459
56333
  /**
56460
56334
  * Checks if the document includes a value with the key `key`.
@@ -56465,10 +56339,10 @@ var require_Document = __commonJS({
56465
56339
  /**
56466
56340
  * Checks if the document includes a value at `path`.
56467
56341
  */
56468
- hasIn(path4) {
56469
- if (Collection.isEmptyPath(path4))
56342
+ hasIn(path5) {
56343
+ if (Collection.isEmptyPath(path5))
56470
56344
  return this.contents !== void 0;
56471
- return identity.isCollection(this.contents) ? this.contents.hasIn(path4) : false;
56345
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path5) : false;
56472
56346
  }
56473
56347
  /**
56474
56348
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -56485,13 +56359,13 @@ var require_Document = __commonJS({
56485
56359
  * Sets a value in this document. For `!!set`, `value` needs to be a
56486
56360
  * boolean to add/remove the item from the set.
56487
56361
  */
56488
- setIn(path4, value) {
56489
- if (Collection.isEmptyPath(path4)) {
56362
+ setIn(path5, value) {
56363
+ if (Collection.isEmptyPath(path5)) {
56490
56364
  this.contents = value;
56491
56365
  } else if (this.contents == null) {
56492
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path4), value);
56366
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path5), value);
56493
56367
  } else if (assertCollection(this.contents)) {
56494
- this.contents.setIn(path4, value);
56368
+ this.contents.setIn(path5, value);
56495
56369
  }
56496
56370
  }
56497
56371
  /**
@@ -58383,9 +58257,9 @@ var require_cst_visit = __commonJS({
58383
58257
  visit.BREAK = BREAK;
58384
58258
  visit.SKIP = SKIP;
58385
58259
  visit.REMOVE = REMOVE;
58386
- visit.itemAtPath = (cst, path4) => {
58260
+ visit.itemAtPath = (cst, path5) => {
58387
58261
  let item = cst;
58388
- for (const [field, index4] of path4) {
58262
+ for (const [field, index4] of path5) {
58389
58263
  const tok = item == null ? void 0 : item[field];
58390
58264
  if (tok && "items" in tok) {
58391
58265
  item = tok.items[index4];
@@ -58394,23 +58268,23 @@ var require_cst_visit = __commonJS({
58394
58268
  }
58395
58269
  return item;
58396
58270
  };
58397
- visit.parentCollection = (cst, path4) => {
58398
- const parent = visit.itemAtPath(cst, path4.slice(0, -1));
58399
- const field = path4[path4.length - 1][0];
58271
+ visit.parentCollection = (cst, path5) => {
58272
+ const parent = visit.itemAtPath(cst, path5.slice(0, -1));
58273
+ const field = path5[path5.length - 1][0];
58400
58274
  const coll = parent == null ? void 0 : parent[field];
58401
58275
  if (coll && "items" in coll)
58402
58276
  return coll;
58403
58277
  throw new Error("Parent collection not found");
58404
58278
  };
58405
- function _visit(path4, item, visitor) {
58406
- let ctrl = visitor(item, path4);
58279
+ function _visit(path5, item, visitor) {
58280
+ let ctrl = visitor(item, path5);
58407
58281
  if (typeof ctrl === "symbol")
58408
58282
  return ctrl;
58409
58283
  for (const field of ["key", "value"]) {
58410
58284
  const token = item[field];
58411
58285
  if (token && "items" in token) {
58412
58286
  for (let i = 0; i < token.items.length; ++i) {
58413
- const ci = _visit(Object.freeze(path4.concat([[field, i]])), token.items[i], visitor);
58287
+ const ci = _visit(Object.freeze(path5.concat([[field, i]])), token.items[i], visitor);
58414
58288
  if (typeof ci === "number")
58415
58289
  i = ci - 1;
58416
58290
  else if (ci === BREAK)
@@ -58421,10 +58295,10 @@ var require_cst_visit = __commonJS({
58421
58295
  }
58422
58296
  }
58423
58297
  if (typeof ctrl === "function" && field === "key")
58424
- ctrl = ctrl(item, path4);
58298
+ ctrl = ctrl(item, path5);
58425
58299
  }
58426
58300
  }
58427
- return typeof ctrl === "function" ? ctrl(item, path4) : ctrl;
58301
+ return typeof ctrl === "function" ? ctrl(item, path5) : ctrl;
58428
58302
  }
58429
58303
  exports.visit = visit;
58430
58304
  }
@@ -60211,19 +60085,19 @@ __export(studioUtils_exports, {
60211
60085
  preparePgSchema: () => preparePgSchema,
60212
60086
  prepareSQLiteSchema: () => prepareSQLiteSchema
60213
60087
  });
60214
- var import_drizzle_orm15, import_mysql_core4, import_pg_core4, import_sqlite_core5, preparePgSchema, prepareMySqlSchema, prepareSQLiteSchema, prepareModels, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleDb;
60088
+ var import_drizzle_orm15, import_mysql_core4, import_pg_core5, import_sqlite_core6, preparePgSchema, prepareMySqlSchema, prepareSQLiteSchema, prepareModels, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleDb;
60215
60089
  var init_studioUtils = __esm({
60216
60090
  "src/serializer/studioUtils.ts"() {
60217
60091
  import_drizzle_orm15 = require("drizzle-orm");
60218
60092
  import_mysql_core4 = require("drizzle-orm/mysql-core");
60219
- import_pg_core4 = require("drizzle-orm/pg-core");
60220
- import_sqlite_core5 = require("drizzle-orm/sqlite-core");
60093
+ import_pg_core5 = require("drizzle-orm/pg-core");
60094
+ import_sqlite_core6 = require("drizzle-orm/sqlite-core");
60221
60095
  init_utils();
60222
60096
  init_utils3();
60223
60097
  init_global();
60224
60098
  init_serializer();
60225
- preparePgSchema = async (path4) => {
60226
- const imports = prepareFilenames(path4);
60099
+ preparePgSchema = async (path5) => {
60100
+ const imports = prepareFilenames(path5);
60227
60101
  const pgSchema4 = {};
60228
60102
  const relations4 = {};
60229
60103
  const { unregister } = await safeRegister();
@@ -60232,8 +60106,8 @@ var init_studioUtils = __esm({
60232
60106
  const i0 = require(`${it}`);
60233
60107
  const i0values = Object.entries(i0);
60234
60108
  i0values.forEach(([k, t]) => {
60235
- if ((0, import_drizzle_orm15.is)(t, import_pg_core4.PgTable)) {
60236
- const schema4 = (0, import_pg_core4.getTableConfig)(t).schema || "public";
60109
+ if ((0, import_drizzle_orm15.is)(t, import_pg_core5.PgTable)) {
60110
+ const schema4 = (0, import_pg_core5.getTableConfig)(t).schema || "public";
60237
60111
  pgSchema4[schema4] = pgSchema4[schema4] || {};
60238
60112
  pgSchema4[schema4][k] = t;
60239
60113
  }
@@ -60245,8 +60119,8 @@ var init_studioUtils = __esm({
60245
60119
  unregister();
60246
60120
  return { schema: pgSchema4, relations: relations4 };
60247
60121
  };
60248
- prepareMySqlSchema = async (path4) => {
60249
- const imports = prepareFilenames(path4);
60122
+ prepareMySqlSchema = async (path5) => {
60123
+ const imports = prepareFilenames(path5);
60250
60124
  const mysqlSchema4 = {
60251
60125
  public: {}
60252
60126
  };
@@ -60269,8 +60143,8 @@ var init_studioUtils = __esm({
60269
60143
  unregister();
60270
60144
  return { schema: mysqlSchema4, relations: relations4 };
60271
60145
  };
60272
- prepareSQLiteSchema = async (path4) => {
60273
- const imports = prepareFilenames(path4);
60146
+ prepareSQLiteSchema = async (path5) => {
60147
+ const imports = prepareFilenames(path5);
60274
60148
  const sqliteSchema2 = {
60275
60149
  public: {}
60276
60150
  };
@@ -60281,7 +60155,7 @@ var init_studioUtils = __esm({
60281
60155
  const i0 = require(`${it}`);
60282
60156
  const i0values = Object.entries(i0);
60283
60157
  i0values.forEach(([k, t]) => {
60284
- if ((0, import_drizzle_orm15.is)(t, import_sqlite_core5.SQLiteTable)) {
60158
+ if ((0, import_drizzle_orm15.is)(t, import_sqlite_core6.SQLiteTable)) {
60285
60159
  const schema4 = "public";
60286
60160
  sqliteSchema2[schema4][k] = t;
60287
60161
  }
@@ -60293,8 +60167,8 @@ var init_studioUtils = __esm({
60293
60167
  unregister();
60294
60168
  return { schema: sqliteSchema2, relations: relations4 };
60295
60169
  };
60296
- prepareModels = async (path4) => {
60297
- const imports = prepareFilenames(path4);
60170
+ prepareModels = async (path5) => {
60171
+ const imports = prepareFilenames(path5);
60298
60172
  const sqliteSchema2 = {};
60299
60173
  const pgSchema4 = {};
60300
60174
  const mysqlSchema4 = {};
@@ -60304,13 +60178,13 @@ var init_studioUtils = __esm({
60304
60178
  const i0 = require(`${it}`);
60305
60179
  const i0values = Object.entries(i0);
60306
60180
  i0values.forEach(([k, t]) => {
60307
- if ((0, import_drizzle_orm15.is)(t, import_pg_core4.PgTable)) {
60181
+ if ((0, import_drizzle_orm15.is)(t, import_pg_core5.PgTable)) {
60308
60182
  pgSchema4[k] = t;
60309
60183
  }
60310
60184
  if ((0, import_drizzle_orm15.is)(t, import_mysql_core4.MySqlTable)) {
60311
60185
  mysqlSchema4[k] = t;
60312
60186
  }
60313
- if ((0, import_drizzle_orm15.is)(t, import_sqlite_core5.SQLiteTable)) {
60187
+ if ((0, import_drizzle_orm15.is)(t, import_sqlite_core6.SQLiteTable)) {
60314
60188
  sqliteSchema2[k] = t;
60315
60189
  }
60316
60190
  if ((0, import_drizzle_orm15.is)(t, import_drizzle_orm15.Relations)) {
@@ -60518,8 +60392,7 @@ var init_utils5 = __esm({
60518
60392
  init_pgIntrospect();
60519
60393
  init_pgPushUtils();
60520
60394
  init_sqliteIntrospect();
60521
- init_sqliteSerializer();
60522
- init_pgSerializer();
60395
+ init_schemaToDrizzle();
60523
60396
  init_studioUtils();
60524
60397
  init_pgConnect();
60525
60398
  assertV1OutFolder = (out, dialect6) => {
@@ -61322,8 +61195,8 @@ var require_package = __commonJS({
61322
61195
  var require_main = __commonJS({
61323
61196
  "node_modules/.pnpm/dotenv@16.0.3/node_modules/dotenv/lib/main.js"(exports, module2) {
61324
61197
  var fs9 = require("fs");
61325
- var path4 = require("path");
61326
- var os2 = require("os");
61198
+ var path5 = require("path");
61199
+ var os3 = require("os");
61327
61200
  var packageJson = require_package();
61328
61201
  var version = packageJson.version;
61329
61202
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
@@ -61350,10 +61223,10 @@ var require_main = __commonJS({
61350
61223
  console.log(`[dotenv@${version}][DEBUG] ${message}`);
61351
61224
  }
61352
61225
  function _resolveHome(envPath) {
61353
- return envPath[0] === "~" ? path4.join(os2.homedir(), envPath.slice(1)) : envPath;
61226
+ return envPath[0] === "~" ? path5.join(os3.homedir(), envPath.slice(1)) : envPath;
61354
61227
  }
61355
61228
  function config(options) {
61356
- let dotenvPath = path4.resolve(process.cwd(), ".env");
61229
+ let dotenvPath = path5.resolve(process.cwd(), ".env");
61357
61230
  let encoding = "utf8";
61358
61231
  const debug = Boolean(options && options.debug);
61359
61232
  const override = Boolean(options && options.override);
@@ -62160,7 +62033,7 @@ __export(cli_exports, {
62160
62033
  });
62161
62034
  module.exports = __toCommonJS(cli_exports);
62162
62035
  var import_commander = require("commander");
62163
- var import_fs12 = require("fs");
62036
+ var import_fs13 = require("fs");
62164
62037
  init_lib();
62165
62038
 
62166
62039
  // src/cli/commands/check.ts
@@ -62202,14 +62075,14 @@ var checkHandler = (out, dialect6) => {
62202
62075
 
62203
62076
  // src/cli/index.ts
62204
62077
  var import_hanji11 = __toESM(require_hanji());
62205
- var import_path7 = __toESM(require("path"));
62078
+ var import_path8 = __toESM(require("path"));
62206
62079
  init_utils3();
62207
62080
  init_source();
62208
62081
 
62209
62082
  // package.json
62210
62083
  var package_default = {
62211
62084
  name: "drizzle-kit",
62212
- version: "0.20.8",
62085
+ version: "0.20.9",
62213
62086
  repository: "https://github.com/drizzle-team/drizzle-kit-mirror",
62214
62087
  author: "Drizzle Team",
62215
62088
  license: "MIT",
@@ -62265,11 +62138,12 @@ var package_default = {
62265
62138
  ]
62266
62139
  },
62267
62140
  dependencies: {
62268
- "@drizzle-team/studio": "^0.0.35",
62141
+ "@drizzle-team/studio": "^0.0.37",
62269
62142
  "@esbuild-kit/esm-loader": "^2.5.5",
62270
62143
  camelcase: "^7.0.1",
62271
62144
  chalk: "^5.2.0",
62272
62145
  commander: "^9.4.1",
62146
+ "env-paths": "^3.0.0",
62273
62147
  esbuild: "^0.19.7",
62274
62148
  "esbuild-register": "^3.5.0",
62275
62149
  glob: "^8.1.0",
@@ -62277,7 +62151,6 @@ var package_default = {
62277
62151
  "json-diff": "0.9.0",
62278
62152
  minimatch: "^7.4.3",
62279
62153
  semver: "^7.5.4",
62280
- wrangler: "^3.7.0",
62281
62154
  zod: "^3.20.2"
62282
62155
  },
62283
62156
  devDependencies: {
@@ -62309,6 +62182,7 @@ var package_default = {
62309
62182
  tsx: "^3.12.1",
62310
62183
  typescript: "^4.9.4",
62311
62184
  uvu: "^0.5.6",
62185
+ wrangler: "^3.22.1",
62312
62186
  zx: "^7.2.2"
62313
62187
  },
62314
62188
  exports: {
@@ -62360,10 +62234,10 @@ var upSqliteHandlerV4 = (out) => {
62360
62234
  path: it,
62361
62235
  raw: report.rawMap[it]
62362
62236
  })).forEach((it) => {
62363
- const path4 = it.path;
62237
+ const path5 = it.path;
62364
62238
  const result = updateToLatestV42(it.raw);
62365
- console.log(`[${source_default.green("\u2713")}] ${path4}`);
62366
- import_fs9.default.writeFileSync(path4, JSON.stringify(result, null, 2));
62239
+ console.log(`[${source_default.green("\u2713")}] ${path5}`);
62240
+ import_fs9.default.writeFileSync(path5, JSON.stringify(result, null, 2));
62367
62241
  });
62368
62242
  console.log("Everything's fine \u{1F436}\u{1F525}");
62369
62243
  };
@@ -63000,6 +62874,97 @@ init_sqlgenerator();
63000
62874
  init_selector_ui();
63001
62875
  var import_studio = require("@drizzle-team/studio");
63002
62876
  init_global();
62877
+
62878
+ // src/utils/certs.ts
62879
+ init_build();
62880
+ var import_path7 = require("path");
62881
+
62882
+ // node_modules/.pnpm/env-paths@3.0.0/node_modules/env-paths/index.js
62883
+ var import_node_path3 = __toESM(require("node:path"), 1);
62884
+ var import_node_os2 = __toESM(require("node:os"), 1);
62885
+ var import_node_process3 = __toESM(require("node:process"), 1);
62886
+ var homedir = import_node_os2.default.homedir();
62887
+ var tmpdir = import_node_os2.default.tmpdir();
62888
+ var { env: env2 } = import_node_process3.default;
62889
+ var macos = (name) => {
62890
+ const library = import_node_path3.default.join(homedir, "Library");
62891
+ return {
62892
+ data: import_node_path3.default.join(library, "Application Support", name),
62893
+ config: import_node_path3.default.join(library, "Preferences", name),
62894
+ cache: import_node_path3.default.join(library, "Caches", name),
62895
+ log: import_node_path3.default.join(library, "Logs", name),
62896
+ temp: import_node_path3.default.join(tmpdir, name)
62897
+ };
62898
+ };
62899
+ var windows = (name) => {
62900
+ const appData = env2.APPDATA || import_node_path3.default.join(homedir, "AppData", "Roaming");
62901
+ const localAppData = env2.LOCALAPPDATA || import_node_path3.default.join(homedir, "AppData", "Local");
62902
+ return {
62903
+ // Data/config/cache/log are invented by me as Windows isn't opinionated about this
62904
+ data: import_node_path3.default.join(localAppData, name, "Data"),
62905
+ config: import_node_path3.default.join(appData, name, "Config"),
62906
+ cache: import_node_path3.default.join(localAppData, name, "Cache"),
62907
+ log: import_node_path3.default.join(localAppData, name, "Log"),
62908
+ temp: import_node_path3.default.join(tmpdir, name)
62909
+ };
62910
+ };
62911
+ var linux = (name) => {
62912
+ const username = import_node_path3.default.basename(homedir);
62913
+ return {
62914
+ data: import_node_path3.default.join(env2.XDG_DATA_HOME || import_node_path3.default.join(homedir, ".local", "share"), name),
62915
+ config: import_node_path3.default.join(env2.XDG_CONFIG_HOME || import_node_path3.default.join(homedir, ".config"), name),
62916
+ cache: import_node_path3.default.join(env2.XDG_CACHE_HOME || import_node_path3.default.join(homedir, ".cache"), name),
62917
+ // https://wiki.debian.org/XDGBaseDirectorySpecification#state
62918
+ log: import_node_path3.default.join(env2.XDG_STATE_HOME || import_node_path3.default.join(homedir, ".local", "state"), name),
62919
+ temp: import_node_path3.default.join(tmpdir, username, name)
62920
+ };
62921
+ };
62922
+ function envPaths(name, { suffix = "nodejs" } = {}) {
62923
+ if (typeof name !== "string") {
62924
+ throw new TypeError(`Expected a string, got ${typeof name}`);
62925
+ }
62926
+ if (suffix) {
62927
+ name += `-${suffix}`;
62928
+ }
62929
+ if (import_node_process3.default.platform === "darwin") {
62930
+ return macos(name);
62931
+ }
62932
+ if (import_node_process3.default.platform === "win32") {
62933
+ return windows(name);
62934
+ }
62935
+ return linux(name);
62936
+ }
62937
+
62938
+ // src/utils/certs.ts
62939
+ var import_promises = require("fs/promises");
62940
+ var import_fs12 = require("fs");
62941
+ var p = envPaths("drizzle-studio", {
62942
+ suffix: ""
62943
+ });
62944
+ $.verbose = false;
62945
+ $.cwd = p.data;
62946
+ (0, import_fs12.mkdirSync)(p.data, { recursive: true });
62947
+ var certs = async () => {
62948
+ const res = await $`mkcert --help`.nothrow();
62949
+ const keyPath = (0, import_path7.join)(p.data, "localhost-key.pem");
62950
+ const certPath = (0, import_path7.join)(p.data, "localhost.pem");
62951
+ if (res.exitCode === 0) {
62952
+ try {
62953
+ await Promise.all([(0, import_promises.access)(keyPath), (0, import_promises.access)(certPath)]);
62954
+ } catch (e) {
62955
+ await $`mkcert localhost`.nothrow();
62956
+ }
62957
+ const [key, cert] = await Promise.all([
62958
+ (0, import_promises.readFile)(keyPath, { encoding: "utf-8" }),
62959
+ (0, import_promises.readFile)(certPath, { encoding: "utf-8" })
62960
+ ]);
62961
+ return key && cert ? { key, cert } : null;
62962
+ }
62963
+ return null;
62964
+ };
62965
+ certs();
62966
+
62967
+ // src/cli/index.ts
63003
62968
  var printVersions = async () => {
63004
62969
  const v = await versions();
63005
62970
  console.log(`${source_default.gray(v)}
@@ -63531,8 +63496,8 @@ var introspectPgCommand = new import_commander.Command("introspect:pg").option("
63531
63496
  tablesFilter,
63532
63497
  schemasFilter
63533
63498
  );
63534
- const schemaFile = import_path7.default.join(validatedConfig.out, "schema.ts");
63535
- (0, import_fs12.writeFileSync)(schemaFile, ts.file);
63499
+ const schemaFile = import_path8.default.join(validatedConfig.out, "schema.ts");
63500
+ (0, import_fs13.writeFileSync)(schemaFile, ts.file);
63536
63501
  console.log();
63537
63502
  if (snapshots.length === 0) {
63538
63503
  const { sqlStatements, _meta } = await prepareSQL(
@@ -63542,15 +63507,15 @@ var introspectPgCommand = new import_commander.Command("introspect:pg").option("
63542
63507
  dryMySql,
63543
63508
  schema4
63544
63509
  );
63545
- writeResult(
63546
- schema4,
63510
+ writeResult({
63511
+ cur: schema4,
63547
63512
  sqlStatements,
63548
63513
  journal,
63549
63514
  _meta,
63550
- validatedConfig.out,
63551
- validatedConfig.breakpoints,
63552
- "introspect"
63553
- );
63515
+ outFolder: validatedConfig.out,
63516
+ breakpoints: validatedConfig.breakpoints,
63517
+ type: "introspect"
63518
+ });
63554
63519
  } else {
63555
63520
  (0, import_hanji11.render)(
63556
63521
  `[${source_default.blue(
@@ -63584,8 +63549,8 @@ var introspectMySqlCommand = new import_commander.Command("introspect:mysql").op
63584
63549
  const filterConfig = res.tablesFilter;
63585
63550
  const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
63586
63551
  const { schema: schema4, ts } = await mysqlIntrospect2(res, tablesFilter);
63587
- const schemaFile = import_path7.default.join(out, "schema.ts");
63588
- (0, import_fs12.writeFileSync)(schemaFile, ts.file);
63552
+ const schemaFile = import_path8.default.join(out, "schema.ts");
63553
+ (0, import_fs13.writeFileSync)(schemaFile, ts.file);
63589
63554
  console.log();
63590
63555
  if (snapshots.length === 0) {
63591
63556
  const { sqlStatements, _meta } = await prepareSQL(
@@ -63595,15 +63560,15 @@ var introspectMySqlCommand = new import_commander.Command("introspect:mysql").op
63595
63560
  dryMySql,
63596
63561
  schema4
63597
63562
  );
63598
- writeResult(
63599
- schema4,
63563
+ writeResult({
63564
+ cur: schema4,
63600
63565
  sqlStatements,
63601
63566
  journal,
63602
63567
  _meta,
63603
- out,
63604
- res.breakpoints ?? false,
63605
- "introspect"
63606
- );
63568
+ outFolder: out,
63569
+ breakpoints: res.breakpoints ?? false,
63570
+ type: "introspect"
63571
+ });
63607
63572
  } else {
63608
63573
  (0, import_hanji11.render)(
63609
63574
  `[${source_default.blue(
@@ -63637,8 +63602,8 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
63637
63602
  const filterConfig = res.tablesFilter;
63638
63603
  const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
63639
63604
  const { schema: schema4, ts } = await sqliteIntrospect2(res, tablesFilter);
63640
- const schemaFile = import_path7.default.join(out, "schema.ts");
63641
- (0, import_fs12.writeFileSync)(schemaFile, ts.file);
63605
+ const schemaFile = import_path8.default.join(out, "schema.ts");
63606
+ (0, import_fs13.writeFileSync)(schemaFile, ts.file);
63642
63607
  console.log();
63643
63608
  if (snapshots.length === 0) {
63644
63609
  const { sqlStatements, _meta } = await prepareSQL(
@@ -63648,15 +63613,15 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
63648
63613
  drySQLite,
63649
63614
  schema4
63650
63615
  );
63651
- writeResult(
63652
- schema4,
63616
+ writeResult({
63617
+ cur: schema4,
63653
63618
  sqlStatements,
63654
63619
  journal,
63655
63620
  _meta,
63656
- out,
63657
- res.breakpoints ?? false,
63658
- "introspect"
63659
- );
63621
+ outFolder: out,
63622
+ breakpoints: res.breakpoints ?? false,
63623
+ type: "introspect"
63624
+ });
63660
63625
  } else {
63661
63626
  (0, import_hanji11.render)(
63662
63627
  `[${source_default.blue(
@@ -63690,7 +63655,9 @@ var dropCommand = new import_commander.Command("drop").option("--out <out>", `Ou
63690
63655
  if (typeof options.driver !== "undefined") {
63691
63656
  bundle = options.driver === "expo";
63692
63657
  } else {
63693
- const drizzleConfig = await drizzleConfigFromFile(options.config);
63658
+ const drizzleConfig = await drizzleConfigFromFile(
63659
+ options.config
63660
+ );
63694
63661
  bundle = drizzleConfig.driver === "expo";
63695
63662
  }
63696
63663
  assertV1OutFolder(out, "{dialect}");
@@ -63786,9 +63753,12 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63786
63753
  )
63787
63754
  );
63788
63755
  }
63756
+ const { key, cert } = await certs() || {};
63789
63757
  server.start({
63790
63758
  host,
63791
63759
  port,
63760
+ key,
63761
+ cert,
63792
63762
  cb: (err2, address) => {
63793
63763
  if (err2) {
63794
63764
  console.error(err2);
@@ -63800,7 +63770,7 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63800
63770
  if (host !== "127.0.0.1") {
63801
63771
  queryParams.host = host;
63802
63772
  }
63803
- const queryString = Object.keys(queryParams).map((key) => `${key}=${queryParams[key]}`).join("&");
63773
+ const queryString = Object.keys(queryParams).map((key2) => `${key2}=${queryParams[key2]}`).join("&");
63804
63774
  console.log(
63805
63775
  `
63806
63776
  Drizzle Studio is up and running on ${source_default.blue(