drizzle-kit 0.24.2-417b0fa → 0.24.2-5ccb794

Sign up to get free protection for your applications and to get access to all the features.
package/api.js CHANGED
@@ -229,8 +229,8 @@ var init_ansi_styles = __esm({
229
229
 
230
230
  // ../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
231
231
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
232
- const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
233
- const position = argv.indexOf(prefix2 + flag);
232
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
233
+ const position = argv.indexOf(prefix + flag);
234
234
  const terminatorPosition = argv.indexOf("--");
235
235
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
236
236
  }
@@ -375,12 +375,12 @@ function stringReplaceAll(string, substring, replacer) {
375
375
  returnValue += string.slice(endIndex);
376
376
  return returnValue;
377
377
  }
378
- function stringEncaseCRLFWithFirstIndex(string, prefix2, postfix, index4) {
378
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
379
379
  let endIndex = 0;
380
380
  let returnValue = "";
381
381
  do {
382
382
  const gotCR = string[index4 - 1] === "\r";
383
- returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix2 + (gotCR ? "\r\n" : "\n") + postfix;
383
+ returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
384
384
  endIndex = index4 + 1;
385
385
  index4 = string.indexOf("\n", endIndex);
386
386
  } while (index4 !== -1);
@@ -1897,40 +1897,40 @@ var require_sync = __commonJS({
1897
1897
  while (typeof pattern[n] === "string") {
1898
1898
  n++;
1899
1899
  }
1900
- var prefix2;
1900
+ var prefix;
1901
1901
  switch (n) {
1902
1902
  case pattern.length:
1903
1903
  this._processSimple(pattern.join("/"), index4);
1904
1904
  return;
1905
1905
  case 0:
1906
- prefix2 = null;
1906
+ prefix = null;
1907
1907
  break;
1908
1908
  default:
1909
- prefix2 = pattern.slice(0, n).join("/");
1909
+ prefix = pattern.slice(0, n).join("/");
1910
1910
  break;
1911
1911
  }
1912
1912
  var remain = pattern.slice(n);
1913
1913
  var read;
1914
- if (prefix2 === null)
1914
+ if (prefix === null)
1915
1915
  read = ".";
1916
- else if (isAbsolute(prefix2) || isAbsolute(pattern.map(function(p) {
1916
+ else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
1917
1917
  return typeof p === "string" ? p : "[*]";
1918
1918
  }).join("/"))) {
1919
- if (!prefix2 || !isAbsolute(prefix2))
1920
- prefix2 = "/" + prefix2;
1921
- read = prefix2;
1919
+ if (!prefix || !isAbsolute(prefix))
1920
+ prefix = "/" + prefix;
1921
+ read = prefix;
1922
1922
  } else
1923
- read = prefix2;
1923
+ read = prefix;
1924
1924
  var abs = this._makeAbs(read);
1925
1925
  if (childrenIgnored(this, read))
1926
1926
  return;
1927
1927
  var isGlobStar = remain[0] === minimatch2.GLOBSTAR;
1928
1928
  if (isGlobStar)
1929
- this._processGlobStar(prefix2, read, abs, remain, index4, inGlobStar);
1929
+ this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar);
1930
1930
  else
1931
- this._processReaddir(prefix2, read, abs, remain, index4, inGlobStar);
1931
+ this._processReaddir(prefix, read, abs, remain, index4, inGlobStar);
1932
1932
  };
1933
- GlobSync.prototype._processReaddir = function(prefix2, read, abs, remain, index4, inGlobStar) {
1933
+ GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar) {
1934
1934
  var entries = this._readdir(abs, inGlobStar);
1935
1935
  if (!entries)
1936
1936
  return;
@@ -1943,7 +1943,7 @@ var require_sync = __commonJS({
1943
1943
  var e = entries[i];
1944
1944
  if (e.charAt(0) !== "." || dotOk) {
1945
1945
  var m;
1946
- if (negate && !prefix2) {
1946
+ if (negate && !prefix) {
1947
1947
  m = !e.match(pn);
1948
1948
  } else {
1949
1949
  m = e.match(pn);
@@ -1960,11 +1960,11 @@ var require_sync = __commonJS({
1960
1960
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
1961
1961
  for (var i = 0; i < len; i++) {
1962
1962
  var e = matchedEntries[i];
1963
- if (prefix2) {
1964
- if (prefix2.slice(-1) !== "/")
1965
- e = prefix2 + "/" + e;
1963
+ if (prefix) {
1964
+ if (prefix.slice(-1) !== "/")
1965
+ e = prefix + "/" + e;
1966
1966
  else
1967
- e = prefix2 + e;
1967
+ e = prefix + e;
1968
1968
  }
1969
1969
  if (e.charAt(0) === "/" && !this.nomount) {
1970
1970
  e = path2.join(this.root, e);
@@ -1977,8 +1977,8 @@ var require_sync = __commonJS({
1977
1977
  for (var i = 0; i < len; i++) {
1978
1978
  var e = matchedEntries[i];
1979
1979
  var newPattern;
1980
- if (prefix2)
1981
- newPattern = [prefix2, e];
1980
+ if (prefix)
1981
+ newPattern = [prefix, e];
1982
1982
  else
1983
1983
  newPattern = [e];
1984
1984
  this._process(newPattern.concat(remain), index4, inGlobStar);
@@ -2085,12 +2085,12 @@ var require_sync = __commonJS({
2085
2085
  break;
2086
2086
  }
2087
2087
  };
2088
- GlobSync.prototype._processGlobStar = function(prefix2, read, abs, remain, index4, inGlobStar) {
2088
+ GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar) {
2089
2089
  var entries = this._readdir(abs, inGlobStar);
2090
2090
  if (!entries)
2091
2091
  return;
2092
2092
  var remainWithoutGlobStar = remain.slice(1);
2093
- var gspref = prefix2 ? [prefix2] : [];
2093
+ var gspref = prefix ? [prefix] : [];
2094
2094
  var noGlobStar = gspref.concat(remainWithoutGlobStar);
2095
2095
  this._process(noGlobStar, index4, false);
2096
2096
  var len = entries.length;
@@ -2107,25 +2107,25 @@ var require_sync = __commonJS({
2107
2107
  this._process(below, index4, true);
2108
2108
  }
2109
2109
  };
2110
- GlobSync.prototype._processSimple = function(prefix2, index4) {
2111
- var exists2 = this._stat(prefix2);
2110
+ GlobSync.prototype._processSimple = function(prefix, index4) {
2111
+ var exists2 = this._stat(prefix);
2112
2112
  if (!this.matches[index4])
2113
2113
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
2114
2114
  if (!exists2)
2115
2115
  return;
2116
- if (prefix2 && isAbsolute(prefix2) && !this.nomount) {
2117
- var trail = /[\/\\]$/.test(prefix2);
2118
- if (prefix2.charAt(0) === "/") {
2119
- prefix2 = path2.join(this.root, prefix2);
2116
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
2117
+ var trail = /[\/\\]$/.test(prefix);
2118
+ if (prefix.charAt(0) === "/") {
2119
+ prefix = path2.join(this.root, prefix);
2120
2120
  } else {
2121
- prefix2 = path2.resolve(this.root, prefix2);
2121
+ prefix = path2.resolve(this.root, prefix);
2122
2122
  if (trail)
2123
- prefix2 += "/";
2123
+ prefix += "/";
2124
2124
  }
2125
2125
  }
2126
2126
  if (process.platform === "win32")
2127
- prefix2 = prefix2.replace(/\\/g, "/");
2128
- this._emitMatch(index4, prefix2);
2127
+ prefix = prefix.replace(/\\/g, "/");
2128
+ this._emitMatch(index4, prefix);
2129
2129
  };
2130
2130
  GlobSync.prototype._stat = function(f) {
2131
2131
  var abs = this._makeAbs(f);
@@ -2520,46 +2520,46 @@ var require_glob = __commonJS({
2520
2520
  while (typeof pattern[n] === "string") {
2521
2521
  n++;
2522
2522
  }
2523
- var prefix2;
2523
+ var prefix;
2524
2524
  switch (n) {
2525
2525
  case pattern.length:
2526
2526
  this._processSimple(pattern.join("/"), index4, cb);
2527
2527
  return;
2528
2528
  case 0:
2529
- prefix2 = null;
2529
+ prefix = null;
2530
2530
  break;
2531
2531
  default:
2532
- prefix2 = pattern.slice(0, n).join("/");
2532
+ prefix = pattern.slice(0, n).join("/");
2533
2533
  break;
2534
2534
  }
2535
2535
  var remain = pattern.slice(n);
2536
2536
  var read;
2537
- if (prefix2 === null)
2537
+ if (prefix === null)
2538
2538
  read = ".";
2539
- else if (isAbsolute(prefix2) || isAbsolute(pattern.map(function(p) {
2539
+ else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
2540
2540
  return typeof p === "string" ? p : "[*]";
2541
2541
  }).join("/"))) {
2542
- if (!prefix2 || !isAbsolute(prefix2))
2543
- prefix2 = "/" + prefix2;
2544
- read = prefix2;
2542
+ if (!prefix || !isAbsolute(prefix))
2543
+ prefix = "/" + prefix;
2544
+ read = prefix;
2545
2545
  } else
2546
- read = prefix2;
2546
+ read = prefix;
2547
2547
  var abs = this._makeAbs(read);
2548
2548
  if (childrenIgnored(this, read))
2549
2549
  return cb();
2550
2550
  var isGlobStar = remain[0] === minimatch2.GLOBSTAR;
2551
2551
  if (isGlobStar)
2552
- this._processGlobStar(prefix2, read, abs, remain, index4, inGlobStar, cb);
2552
+ this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar, cb);
2553
2553
  else
2554
- this._processReaddir(prefix2, read, abs, remain, index4, inGlobStar, cb);
2554
+ this._processReaddir(prefix, read, abs, remain, index4, inGlobStar, cb);
2555
2555
  };
2556
- Glob.prototype._processReaddir = function(prefix2, read, abs, remain, index4, inGlobStar, cb) {
2556
+ Glob.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
2557
2557
  var self2 = this;
2558
2558
  this._readdir(abs, inGlobStar, function(er, entries) {
2559
- return self2._processReaddir2(prefix2, read, abs, remain, index4, inGlobStar, entries, cb);
2559
+ return self2._processReaddir2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
2560
2560
  });
2561
2561
  };
2562
- Glob.prototype._processReaddir2 = function(prefix2, read, abs, remain, index4, inGlobStar, entries, cb) {
2562
+ Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
2563
2563
  if (!entries)
2564
2564
  return cb();
2565
2565
  var pn = remain[0];
@@ -2571,7 +2571,7 @@ var require_glob = __commonJS({
2571
2571
  var e = entries[i];
2572
2572
  if (e.charAt(0) !== "." || dotOk) {
2573
2573
  var m;
2574
- if (negate && !prefix2) {
2574
+ if (negate && !prefix) {
2575
2575
  m = !e.match(pn);
2576
2576
  } else {
2577
2577
  m = e.match(pn);
@@ -2588,11 +2588,11 @@ var require_glob = __commonJS({
2588
2588
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
2589
2589
  for (var i = 0; i < len; i++) {
2590
2590
  var e = matchedEntries[i];
2591
- if (prefix2) {
2592
- if (prefix2 !== "/")
2593
- e = prefix2 + "/" + e;
2591
+ if (prefix) {
2592
+ if (prefix !== "/")
2593
+ e = prefix + "/" + e;
2594
2594
  else
2595
- e = prefix2 + e;
2595
+ e = prefix + e;
2596
2596
  }
2597
2597
  if (e.charAt(0) === "/" && !this.nomount) {
2598
2598
  e = path2.join(this.root, e);
@@ -2605,11 +2605,11 @@ var require_glob = __commonJS({
2605
2605
  for (var i = 0; i < len; i++) {
2606
2606
  var e = matchedEntries[i];
2607
2607
  var newPattern;
2608
- if (prefix2) {
2609
- if (prefix2 !== "/")
2610
- e = prefix2 + "/" + e;
2608
+ if (prefix) {
2609
+ if (prefix !== "/")
2610
+ e = prefix + "/" + e;
2611
2611
  else
2612
- e = prefix2 + e;
2612
+ e = prefix + e;
2613
2613
  }
2614
2614
  this._process([e].concat(remain), index4, inGlobStar, cb);
2615
2615
  }
@@ -2740,17 +2740,17 @@ var require_glob = __commonJS({
2740
2740
  }
2741
2741
  return cb();
2742
2742
  };
2743
- Glob.prototype._processGlobStar = function(prefix2, read, abs, remain, index4, inGlobStar, cb) {
2743
+ Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
2744
2744
  var self2 = this;
2745
2745
  this._readdir(abs, inGlobStar, function(er, entries) {
2746
- self2._processGlobStar2(prefix2, read, abs, remain, index4, inGlobStar, entries, cb);
2746
+ self2._processGlobStar2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
2747
2747
  });
2748
2748
  };
2749
- Glob.prototype._processGlobStar2 = function(prefix2, read, abs, remain, index4, inGlobStar, entries, cb) {
2749
+ Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
2750
2750
  if (!entries)
2751
2751
  return cb();
2752
2752
  var remainWithoutGlobStar = remain.slice(1);
2753
- var gspref = prefix2 ? [prefix2] : [];
2753
+ var gspref = prefix ? [prefix] : [];
2754
2754
  var noGlobStar = gspref.concat(remainWithoutGlobStar);
2755
2755
  this._process(noGlobStar, index4, false, cb);
2756
2756
  var isSym = this.symlinks[abs];
@@ -2768,30 +2768,30 @@ var require_glob = __commonJS({
2768
2768
  }
2769
2769
  cb();
2770
2770
  };
2771
- Glob.prototype._processSimple = function(prefix2, index4, cb) {
2771
+ Glob.prototype._processSimple = function(prefix, index4, cb) {
2772
2772
  var self2 = this;
2773
- this._stat(prefix2, function(er, exists2) {
2774
- self2._processSimple2(prefix2, index4, er, exists2, cb);
2773
+ this._stat(prefix, function(er, exists2) {
2774
+ self2._processSimple2(prefix, index4, er, exists2, cb);
2775
2775
  });
2776
2776
  };
2777
- Glob.prototype._processSimple2 = function(prefix2, index4, er, exists2, cb) {
2777
+ Glob.prototype._processSimple2 = function(prefix, index4, er, exists2, cb) {
2778
2778
  if (!this.matches[index4])
2779
2779
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
2780
2780
  if (!exists2)
2781
2781
  return cb();
2782
- if (prefix2 && isAbsolute(prefix2) && !this.nomount) {
2783
- var trail = /[\/\\]$/.test(prefix2);
2784
- if (prefix2.charAt(0) === "/") {
2785
- prefix2 = path2.join(this.root, prefix2);
2782
+ if (prefix && isAbsolute(prefix) && !this.nomount) {
2783
+ var trail = /[\/\\]$/.test(prefix);
2784
+ if (prefix.charAt(0) === "/") {
2785
+ prefix = path2.join(this.root, prefix);
2786
2786
  } else {
2787
- prefix2 = path2.resolve(this.root, prefix2);
2787
+ prefix = path2.resolve(this.root, prefix);
2788
2788
  if (trail)
2789
- prefix2 += "/";
2789
+ prefix += "/";
2790
2790
  }
2791
2791
  }
2792
2792
  if (process.platform === "win32")
2793
- prefix2 = prefix2.replace(/\\/g, "/");
2794
- this._emitMatch(index4, prefix2);
2793
+ prefix = prefix.replace(/\\/g, "/");
2794
+ this._emitMatch(index4, prefix);
2795
2795
  cb();
2796
2796
  };
2797
2797
  Glob.prototype._stat = function(f, cb) {
@@ -8419,7 +8419,7 @@ var init_views = __esm({
8419
8419
  import_hanji = __toESM(require_hanji());
8420
8420
  init_utils();
8421
8421
  warning = (msg) => {
8422
- (0, import_hanji.render)(`[${source_default.yellow("Warning")}] ${msg}`);
8422
+ (0, import_hanji.render)(`${source_default.bgYellow.bold(" Warning ")} ${msg}`);
8423
8423
  };
8424
8424
  error = (error2, greyMsg = "") => {
8425
8425
  return `${source_default.bgRed.bold(" Error ")} ${error2} ${greyMsg ? source_default.grey(greyMsg) : ""}`.trim();
@@ -9743,7 +9743,7 @@ var require_difflib = __commonJS({
9743
9743
  return `${beginning},${beginning + length - 1}`;
9744
9744
  };
9745
9745
  contextDiff = function(a, b, { fromfile, tofile, fromfiledate, tofiledate, n, lineterm } = {}) {
9746
- var _2, file1Range, file2Range, first, fromdate, group, i1, i2, j1, j2, l, last, len, len1, len2, len3, len4, line, lines, m, o, p, prefix2, q, ref, ref1, ref2, started, tag, todate;
9746
+ var _2, file1Range, file2Range, first, fromdate, group, i1, i2, j1, j2, l, last, len, len1, len2, len3, len4, line, lines, m, o, p, prefix, q, ref, ref1, ref2, started, tag, todate;
9747
9747
  if (fromfile == null) {
9748
9748
  fromfile = "";
9749
9749
  }
@@ -9762,7 +9762,7 @@ var require_difflib = __commonJS({
9762
9762
  if (lineterm == null) {
9763
9763
  lineterm = "\n";
9764
9764
  }
9765
- prefix2 = {
9765
+ prefix = {
9766
9766
  insert: "+ ",
9767
9767
  delete: "- ",
9768
9768
  replace: "! ",
@@ -9798,7 +9798,7 @@ var require_difflib = __commonJS({
9798
9798
  ref1 = a.slice(i1, i2);
9799
9799
  for (o = 0, len2 = ref1.length; o < len2; o++) {
9800
9800
  line = ref1[o];
9801
- lines.push(prefix2[tag] + line);
9801
+ lines.push(prefix[tag] + line);
9802
9802
  }
9803
9803
  }
9804
9804
  }
@@ -9820,7 +9820,7 @@ var require_difflib = __commonJS({
9820
9820
  ref2 = b.slice(j1, j2);
9821
9821
  for (q = 0, len4 = ref2.length; q < len4; q++) {
9822
9822
  line = ref2[q];
9823
- lines.push(prefix2[tag] + line);
9823
+ lines.push(prefix[tag] + line);
9824
9824
  }
9825
9825
  }
9826
9826
  }
@@ -9833,7 +9833,7 @@ var require_difflib = __commonJS({
9833
9833
  return new Differ(linejunk, charjunk).compare(a, b);
9834
9834
  };
9835
9835
  restore = function(delta, which) {
9836
- var l, len, line, lines, prefixes2, ref, tag;
9836
+ var l, len, line, lines, prefixes, ref, tag;
9837
9837
  tag = {
9838
9838
  1: "- ",
9839
9839
  2: "+ "
@@ -9841,11 +9841,11 @@ var require_difflib = __commonJS({
9841
9841
  if (!tag) {
9842
9842
  throw new Error(`unknow delta choice (must be 1 or 2): ${which}`);
9843
9843
  }
9844
- prefixes2 = [" ", tag];
9844
+ prefixes = [" ", tag];
9845
9845
  lines = [];
9846
9846
  for (l = 0, len = delta.length; l < len; l++) {
9847
9847
  line = delta[l];
9848
- if (ref = line.slice(0, 2), indexOf.call(prefixes2, ref) >= 0) {
9848
+ if (ref = line.slice(0, 2), indexOf.call(prefixes, ref) >= 0) {
9849
9849
  lines.push(line.slice(2));
9850
9850
  }
9851
9851
  }
@@ -9986,8 +9986,8 @@ var require_has_flag = __commonJS({
9986
9986
  module2.exports = function(flag, argv) {
9987
9987
  argv = argv || process.argv;
9988
9988
  var terminatorPos = argv.indexOf("--");
9989
- var prefix2 = /^-{1,2}/.test(flag) ? "" : "--";
9990
- var pos = argv.indexOf(prefix2 + flag);
9989
+ var prefix = /^-{1,2}/.test(flag) ? "" : "--";
9990
+ var pos = argv.indexOf(prefix + flag);
9991
9991
  return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
9992
9992
  };
9993
9993
  }
@@ -10596,7 +10596,7 @@ var require_colorize = __commonJS({
10596
10596
  };
10597
10597
  var subcolorizeToCallback = function(options, key, diff2, output, color2, indent) {
10598
10598
  let subvalue;
10599
- const prefix2 = key ? `${key}: ` : "";
10599
+ const prefix = key ? `${key}: ` : "";
10600
10600
  const subindent = indent + " ";
10601
10601
  const outputElisions = (n) => {
10602
10602
  const maxElisions = options.maxElisions === void 0 ? Infinity : options.maxElisions;
@@ -10614,7 +10614,7 @@ var require_colorize = __commonJS({
10614
10614
  subcolorizeToCallback(options, key, diff2.__old, output, "-", indent);
10615
10615
  return subcolorizeToCallback(options, key, diff2.__new, output, "+", indent);
10616
10616
  } else {
10617
- output(color2, `${indent}${prefix2}{`);
10617
+ output(color2, `${indent}${prefix}{`);
10618
10618
  for (const subkey of Object.keys(diff2)) {
10619
10619
  let m;
10620
10620
  subvalue = diff2[subkey];
@@ -10629,7 +10629,7 @@ var require_colorize = __commonJS({
10629
10629
  return output(color2, `${indent}}`);
10630
10630
  }
10631
10631
  case "array": {
10632
- output(color2, `${indent}${prefix2}[`);
10632
+ output(color2, `${indent}${prefix}[`);
10633
10633
  let looksLikeDiff = true;
10634
10634
  for (const item of diff2) {
10635
10635
  if (extendedTypeOf(item) !== "array" || !(item.length === 2 || item.length === 1 && item[0] === " ") || !(typeof item[0] === "string") || item[0].length !== 1 || ![" ", "-", "+", "~"].includes(item[0])) {
@@ -10668,7 +10668,7 @@ var require_colorize = __commonJS({
10668
10668
  }
10669
10669
  default:
10670
10670
  if (diff2 === 0 || diff2 === null || diff2 === false || diff2 === "" || diff2) {
10671
- return output(color2, indent + prefix2 + JSON.stringify(diff2));
10671
+ return output(color2, indent + prefix + JSON.stringify(diff2));
10672
10672
  }
10673
10673
  }
10674
10674
  };
@@ -15865,7 +15865,7 @@ var init_schemaValidator = __esm({
15865
15865
  });
15866
15866
 
15867
15867
  // src/cli/validations/common.ts
15868
- var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
15868
+ var sqliteDriversLiterals, postgresqlDriversLiterals, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
15869
15869
  var init_common = __esm({
15870
15870
  "src/cli/validations/common.ts"() {
15871
15871
  "use strict";
@@ -15881,24 +15881,12 @@ var init_common = __esm({
15881
15881
  literalType("aws-data-api"),
15882
15882
  literalType("pglite")
15883
15883
  ];
15884
- prefixes = [
15885
- "index",
15886
- "timestamp",
15887
- "supabase",
15888
- "unix",
15889
- "none"
15890
- ];
15891
- prefix = enumType(prefixes);
15892
- {
15893
- const _2 = "";
15894
- }
15895
15884
  sqliteDriver = unionType(sqliteDriversLiterals);
15896
15885
  postgresDriver = unionType(postgresqlDriversLiterals);
15897
15886
  driver = unionType([sqliteDriver, postgresDriver]);
15898
15887
  configMigrations = objectType({
15899
15888
  table: stringType().optional(),
15900
- schema: stringType().optional(),
15901
- prefix: prefix.optional().default("index")
15889
+ schema: stringType().optional()
15902
15890
  }).optional();
15903
15891
  configCommonSchema = objectType({
15904
15892
  dialect: dialect3,
@@ -25650,6 +25638,267 @@ var init_selector_ui = __esm({
25650
25638
  }
25651
25639
  });
25652
25640
 
25641
+ // src/cli/validations/cli.ts
25642
+ var pushParams, pullParams, configCheck, cliConfigCheck;
25643
+ var init_cli = __esm({
25644
+ "src/cli/validations/cli.ts"() {
25645
+ "use strict";
25646
+ init_lib();
25647
+ init_schemaValidator();
25648
+ init_common();
25649
+ pushParams = objectType({
25650
+ dialect: dialect3,
25651
+ schema: unionType([stringType(), stringType().array()]),
25652
+ tablesFilter: unionType([stringType(), stringType().array()]).optional(),
25653
+ schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
25654
+ extensionsFilters: literalType("postgis").array().optional(),
25655
+ verbose: booleanType().optional(),
25656
+ strict: booleanType().optional()
25657
+ }).passthrough();
25658
+ pullParams = objectType({
25659
+ config: stringType().optional(),
25660
+ dialect: dialect3,
25661
+ out: stringType().optional().default("drizzle"),
25662
+ tablesFilter: unionType([stringType(), stringType().array()]).optional(),
25663
+ schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
25664
+ extensionsFilters: literalType("postgis").array().optional(),
25665
+ casing,
25666
+ breakpoints: booleanType().optional().default(true)
25667
+ }).passthrough();
25668
+ configCheck = objectType({
25669
+ dialect: dialect3.optional(),
25670
+ out: stringType().optional()
25671
+ });
25672
+ cliConfigCheck = intersectionType(
25673
+ objectType({
25674
+ config: stringType().optional()
25675
+ }),
25676
+ configCheck
25677
+ );
25678
+ }
25679
+ });
25680
+
25681
+ // src/cli/validations/mysql.ts
25682
+ var mysqlCredentials;
25683
+ var init_mysql = __esm({
25684
+ "src/cli/validations/mysql.ts"() {
25685
+ "use strict";
25686
+ init_lib();
25687
+ init_views();
25688
+ init_common();
25689
+ init_outputs();
25690
+ mysqlCredentials = unionType([
25691
+ objectType({
25692
+ host: stringType().min(1),
25693
+ port: coerce.number().min(1).optional(),
25694
+ user: stringType().min(1).optional(),
25695
+ password: stringType().min(1).optional(),
25696
+ database: stringType().min(1),
25697
+ ssl: unionType([
25698
+ stringType(),
25699
+ objectType({
25700
+ pfx: stringType().optional(),
25701
+ key: stringType().optional(),
25702
+ passphrase: stringType().optional(),
25703
+ cert: stringType().optional(),
25704
+ ca: unionType([stringType(), stringType().array()]).optional(),
25705
+ crl: unionType([stringType(), stringType().array()]).optional(),
25706
+ ciphers: stringType().optional(),
25707
+ rejectUnauthorized: booleanType().optional()
25708
+ })
25709
+ ]).optional()
25710
+ }),
25711
+ objectType({
25712
+ url: stringType().min(1)
25713
+ })
25714
+ ]);
25715
+ }
25716
+ });
25717
+
25718
+ // src/cli/validations/postgres.ts
25719
+ var postgresCredentials;
25720
+ var init_postgres = __esm({
25721
+ "src/cli/validations/postgres.ts"() {
25722
+ "use strict";
25723
+ init_lib();
25724
+ init_views();
25725
+ init_common();
25726
+ postgresCredentials = unionType([
25727
+ objectType({
25728
+ driver: undefinedType(),
25729
+ host: stringType().min(1),
25730
+ port: coerce.number().min(1).optional(),
25731
+ user: stringType().min(1).optional(),
25732
+ password: stringType().min(1).optional(),
25733
+ database: stringType().min(1),
25734
+ ssl: unionType([
25735
+ literalType("require"),
25736
+ literalType("allow"),
25737
+ literalType("prefer"),
25738
+ literalType("verify-full"),
25739
+ booleanType(),
25740
+ objectType({}).passthrough()
25741
+ ]).optional()
25742
+ }).transform((o) => {
25743
+ delete o.driver;
25744
+ return o;
25745
+ }),
25746
+ objectType({
25747
+ driver: undefinedType(),
25748
+ url: stringType().min(1)
25749
+ }).transform((o) => {
25750
+ delete o.driver;
25751
+ return o;
25752
+ }),
25753
+ objectType({
25754
+ driver: literalType("aws-data-api"),
25755
+ database: stringType().min(1),
25756
+ secretArn: stringType().min(1),
25757
+ resourceArn: stringType().min(1)
25758
+ }),
25759
+ objectType({
25760
+ driver: literalType("pglite"),
25761
+ url: stringType().min(1)
25762
+ })
25763
+ ]);
25764
+ }
25765
+ });
25766
+
25767
+ // src/cli/validations/sqlite.ts
25768
+ var sqliteCredentials;
25769
+ var init_sqlite = __esm({
25770
+ "src/cli/validations/sqlite.ts"() {
25771
+ "use strict";
25772
+ init_global();
25773
+ init_lib();
25774
+ init_views();
25775
+ init_common();
25776
+ sqliteCredentials = unionType([
25777
+ objectType({
25778
+ driver: literalType("turso"),
25779
+ url: stringType().min(1),
25780
+ authToken: stringType().min(1).optional()
25781
+ }),
25782
+ objectType({
25783
+ driver: literalType("d1-http"),
25784
+ accountId: stringType().min(1),
25785
+ databaseId: stringType().min(1),
25786
+ token: stringType().min(1)
25787
+ }),
25788
+ objectType({
25789
+ driver: undefinedType(),
25790
+ url: stringType().min(1)
25791
+ }).transform((o) => {
25792
+ delete o.driver;
25793
+ return o;
25794
+ })
25795
+ ]);
25796
+ }
25797
+ });
25798
+
25799
+ // src/cli/validations/studio.ts
25800
+ var credentials, studioCliParams, studioConfig;
25801
+ var init_studio = __esm({
25802
+ "src/cli/validations/studio.ts"() {
25803
+ "use strict";
25804
+ init_lib();
25805
+ init_schemaValidator();
25806
+ init_mysql();
25807
+ init_postgres();
25808
+ init_sqlite();
25809
+ credentials = intersectionType(
25810
+ postgresCredentials,
25811
+ mysqlCredentials,
25812
+ sqliteCredentials
25813
+ );
25814
+ studioCliParams = objectType({
25815
+ port: coerce.number().optional().default(4983),
25816
+ host: stringType().optional().default("127.0.0.1"),
25817
+ config: stringType().optional()
25818
+ });
25819
+ studioConfig = objectType({
25820
+ dialect: dialect3,
25821
+ schema: unionType([stringType(), stringType().array()]).optional()
25822
+ });
25823
+ }
25824
+ });
25825
+
25826
+ // src/cli/commands/_es5.ts
25827
+ var es5_exports = {};
25828
+ __export(es5_exports, {
25829
+ default: () => es5_default
25830
+ });
25831
+ var _, es5_default;
25832
+ var init_es5 = __esm({
25833
+ "src/cli/commands/_es5.ts"() {
25834
+ "use strict";
25835
+ _ = "";
25836
+ es5_default = _;
25837
+ }
25838
+ });
25839
+
25840
+ // src/cli/commands/utils.ts
25841
+ var import_hanji6, assertES5, safeRegister, migrateConfig;
25842
+ var init_utils6 = __esm({
25843
+ "src/cli/commands/utils.ts"() {
25844
+ "use strict";
25845
+ import_hanji6 = __toESM(require_hanji());
25846
+ init_lib();
25847
+ init_global();
25848
+ init_schemaValidator();
25849
+ init_serializer();
25850
+ init_cli();
25851
+ init_common();
25852
+ init_mysql();
25853
+ init_outputs();
25854
+ init_postgres();
25855
+ init_sqlite();
25856
+ init_studio();
25857
+ init_views();
25858
+ assertES5 = async (unregister) => {
25859
+ try {
25860
+ init_es5();
25861
+ } catch (e) {
25862
+ if ("errors" in e && Array.isArray(e.errors) && e.errors.length > 0) {
25863
+ const es5Error = e.errors.filter((it) => it.text?.includes(`("es5") is not supported yet`)).length > 0;
25864
+ if (es5Error) {
25865
+ console.log(
25866
+ error(
25867
+ `Please change compilerOptions.target from 'es5' to 'es6' or above in your tsconfig.json`
25868
+ )
25869
+ );
25870
+ process.exit(1);
25871
+ }
25872
+ }
25873
+ console.error(e);
25874
+ process.exit(1);
25875
+ }
25876
+ };
25877
+ safeRegister = async () => {
25878
+ const { register } = require("esbuild-register/dist/node");
25879
+ let res;
25880
+ try {
25881
+ res = register({
25882
+ format: "cjs",
25883
+ loader: "ts"
25884
+ });
25885
+ } catch {
25886
+ res = {
25887
+ unregister: () => {
25888
+ }
25889
+ };
25890
+ }
25891
+ await assertES5(res.unregister);
25892
+ return res;
25893
+ };
25894
+ migrateConfig = objectType({
25895
+ dialect: dialect3,
25896
+ out: stringType().optional().default("drizzle"),
25897
+ migrations: configMigrations
25898
+ });
25899
+ }
25900
+ });
25901
+
25653
25902
  // ../drizzle-orm/dist/sqlite-core/alias.js
25654
25903
  var init_alias3 = __esm({
25655
25904
  "../drizzle-orm/dist/sqlite-core/alias.js"() {
@@ -28756,7 +29005,7 @@ function getTableConfig2(table4) {
28756
29005
  name: name2
28757
29006
  };
28758
29007
  }
28759
- var init_utils6 = __esm({
29008
+ var init_utils7 = __esm({
28760
29009
  "../drizzle-orm/dist/sqlite-core/utils.js"() {
28761
29010
  "use strict";
28762
29011
  init_entity();
@@ -28892,7 +29141,7 @@ var init_sqlite_core = __esm({
28892
29141
  init_subquery3();
28893
29142
  init_table3();
28894
29143
  init_unique_constraint2();
28895
- init_utils6();
29144
+ init_utils7();
28896
29145
  init_view2();
28897
29146
  }
28898
29147
  });
@@ -33313,7 +33562,7 @@ function getTableConfig3(table4) {
33313
33562
  baseName
33314
33563
  };
33315
33564
  }
33316
- var init_utils7 = __esm({
33565
+ var init_utils8 = __esm({
33317
33566
  "../drizzle-orm/dist/mysql-core/utils.js"() {
33318
33567
  "use strict";
33319
33568
  init_entity();
@@ -33345,7 +33594,7 @@ var init_mysql_core = __esm({
33345
33594
  init_subquery4();
33346
33595
  init_table4();
33347
33596
  init_unique_constraint3();
33348
- init_utils7();
33597
+ init_utils8();
33349
33598
  init_view_common4();
33350
33599
  init_view3();
33351
33600
  }
@@ -33902,280 +34151,6 @@ We have encountered a collision between the index name on columns ${source_defau
33902
34151
  }
33903
34152
  });
33904
34153
 
33905
- // src/cli/validations/cli.ts
33906
- var cliConfigGenerate, pushParams, pullParams, configCheck, cliConfigCheck;
33907
- var init_cli = __esm({
33908
- "src/cli/validations/cli.ts"() {
33909
- "use strict";
33910
- init_lib();
33911
- init_schemaValidator();
33912
- init_common();
33913
- cliConfigGenerate = objectType({
33914
- dialect: dialect3.optional(),
33915
- schema: unionType([stringType(), stringType().array()]).optional(),
33916
- out: stringType().optional().default("./drizzle"),
33917
- config: stringType().optional(),
33918
- name: stringType().optional(),
33919
- prefix: prefix.optional(),
33920
- breakpoints: booleanType().optional().default(true),
33921
- custom: booleanType().optional().default(false)
33922
- }).strict();
33923
- pushParams = objectType({
33924
- dialect: dialect3,
33925
- schema: unionType([stringType(), stringType().array()]),
33926
- tablesFilter: unionType([stringType(), stringType().array()]).optional(),
33927
- schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
33928
- extensionsFilters: literalType("postgis").array().optional(),
33929
- verbose: booleanType().optional(),
33930
- strict: booleanType().optional()
33931
- }).passthrough();
33932
- pullParams = objectType({
33933
- config: stringType().optional(),
33934
- dialect: dialect3,
33935
- out: stringType().optional().default("drizzle"),
33936
- tablesFilter: unionType([stringType(), stringType().array()]).optional(),
33937
- schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
33938
- extensionsFilters: literalType("postgis").array().optional(),
33939
- casing,
33940
- breakpoints: booleanType().optional().default(true),
33941
- migrations: objectType({
33942
- prefix: prefix.optional().default("index")
33943
- }).optional()
33944
- }).passthrough();
33945
- configCheck = objectType({
33946
- dialect: dialect3.optional(),
33947
- out: stringType().optional()
33948
- });
33949
- cliConfigCheck = intersectionType(
33950
- objectType({
33951
- config: stringType().optional()
33952
- }),
33953
- configCheck
33954
- );
33955
- }
33956
- });
33957
-
33958
- // src/cli/validations/mysql.ts
33959
- var mysqlCredentials;
33960
- var init_mysql = __esm({
33961
- "src/cli/validations/mysql.ts"() {
33962
- "use strict";
33963
- init_lib();
33964
- init_views();
33965
- init_common();
33966
- init_outputs();
33967
- mysqlCredentials = unionType([
33968
- objectType({
33969
- host: stringType().min(1),
33970
- port: coerce.number().min(1).optional(),
33971
- user: stringType().min(1).optional(),
33972
- password: stringType().min(1).optional(),
33973
- database: stringType().min(1),
33974
- ssl: unionType([
33975
- stringType(),
33976
- objectType({
33977
- pfx: stringType().optional(),
33978
- key: stringType().optional(),
33979
- passphrase: stringType().optional(),
33980
- cert: stringType().optional(),
33981
- ca: unionType([stringType(), stringType().array()]).optional(),
33982
- crl: unionType([stringType(), stringType().array()]).optional(),
33983
- ciphers: stringType().optional(),
33984
- rejectUnauthorized: booleanType().optional()
33985
- })
33986
- ]).optional()
33987
- }),
33988
- objectType({
33989
- url: stringType().min(1)
33990
- })
33991
- ]);
33992
- }
33993
- });
33994
-
33995
- // src/cli/validations/postgres.ts
33996
- var postgresCredentials;
33997
- var init_postgres = __esm({
33998
- "src/cli/validations/postgres.ts"() {
33999
- "use strict";
34000
- init_lib();
34001
- init_views();
34002
- init_common();
34003
- postgresCredentials = unionType([
34004
- objectType({
34005
- driver: undefinedType(),
34006
- host: stringType().min(1),
34007
- port: coerce.number().min(1).optional(),
34008
- user: stringType().min(1).optional(),
34009
- password: stringType().min(1).optional(),
34010
- database: stringType().min(1),
34011
- ssl: unionType([
34012
- literalType("require"),
34013
- literalType("allow"),
34014
- literalType("prefer"),
34015
- literalType("verify-full"),
34016
- booleanType(),
34017
- objectType({}).passthrough()
34018
- ]).optional()
34019
- }).transform((o) => {
34020
- delete o.driver;
34021
- return o;
34022
- }),
34023
- objectType({
34024
- driver: undefinedType(),
34025
- url: stringType().min(1)
34026
- }).transform((o) => {
34027
- delete o.driver;
34028
- return o;
34029
- }),
34030
- objectType({
34031
- driver: literalType("aws-data-api"),
34032
- database: stringType().min(1),
34033
- secretArn: stringType().min(1),
34034
- resourceArn: stringType().min(1)
34035
- }),
34036
- objectType({
34037
- driver: literalType("pglite"),
34038
- url: stringType().min(1)
34039
- })
34040
- ]);
34041
- }
34042
- });
34043
-
34044
- // src/cli/validations/sqlite.ts
34045
- var sqliteCredentials;
34046
- var init_sqlite = __esm({
34047
- "src/cli/validations/sqlite.ts"() {
34048
- "use strict";
34049
- init_global();
34050
- init_lib();
34051
- init_views();
34052
- init_common();
34053
- sqliteCredentials = unionType([
34054
- objectType({
34055
- driver: literalType("turso"),
34056
- url: stringType().min(1),
34057
- authToken: stringType().min(1).optional()
34058
- }),
34059
- objectType({
34060
- driver: literalType("d1-http"),
34061
- accountId: stringType().min(1),
34062
- databaseId: stringType().min(1),
34063
- token: stringType().min(1)
34064
- }),
34065
- objectType({
34066
- driver: undefinedType(),
34067
- url: stringType().min(1)
34068
- }).transform((o) => {
34069
- delete o.driver;
34070
- return o;
34071
- })
34072
- ]);
34073
- }
34074
- });
34075
-
34076
- // src/cli/validations/studio.ts
34077
- var credentials, studioCliParams, studioConfig;
34078
- var init_studio = __esm({
34079
- "src/cli/validations/studio.ts"() {
34080
- "use strict";
34081
- init_lib();
34082
- init_schemaValidator();
34083
- init_mysql();
34084
- init_postgres();
34085
- init_sqlite();
34086
- credentials = intersectionType(
34087
- postgresCredentials,
34088
- mysqlCredentials,
34089
- sqliteCredentials
34090
- );
34091
- studioCliParams = objectType({
34092
- port: coerce.number().optional().default(4983),
34093
- host: stringType().optional().default("127.0.0.1"),
34094
- config: stringType().optional()
34095
- });
34096
- studioConfig = objectType({
34097
- dialect: dialect3,
34098
- schema: unionType([stringType(), stringType().array()]).optional()
34099
- });
34100
- }
34101
- });
34102
-
34103
- // src/cli/commands/_es5.ts
34104
- var es5_exports = {};
34105
- __export(es5_exports, {
34106
- default: () => es5_default
34107
- });
34108
- var _, es5_default;
34109
- var init_es5 = __esm({
34110
- "src/cli/commands/_es5.ts"() {
34111
- "use strict";
34112
- _ = "";
34113
- es5_default = _;
34114
- }
34115
- });
34116
-
34117
- // src/cli/commands/utils.ts
34118
- var import_hanji7, assertES5, safeRegister, migrateConfig;
34119
- var init_utils8 = __esm({
34120
- "src/cli/commands/utils.ts"() {
34121
- "use strict";
34122
- import_hanji7 = __toESM(require_hanji());
34123
- init_lib();
34124
- init_global();
34125
- init_schemaValidator();
34126
- init_serializer();
34127
- init_cli();
34128
- init_common();
34129
- init_mysql();
34130
- init_outputs();
34131
- init_postgres();
34132
- init_sqlite();
34133
- init_studio();
34134
- init_views();
34135
- assertES5 = async (unregister) => {
34136
- try {
34137
- init_es5();
34138
- } catch (e) {
34139
- if ("errors" in e && Array.isArray(e.errors) && e.errors.length > 0) {
34140
- const es5Error = e.errors.filter((it) => it.text?.includes(`("es5") is not supported yet`)).length > 0;
34141
- if (es5Error) {
34142
- console.log(
34143
- error(
34144
- `Please change compilerOptions.target from 'es5' to 'es6' or above in your tsconfig.json`
34145
- )
34146
- );
34147
- process.exit(1);
34148
- }
34149
- }
34150
- console.error(e);
34151
- process.exit(1);
34152
- }
34153
- };
34154
- safeRegister = async () => {
34155
- const { register } = require("esbuild-register/dist/node");
34156
- let res;
34157
- try {
34158
- res = register({
34159
- format: "cjs",
34160
- loader: "ts"
34161
- });
34162
- } catch {
34163
- res = {
34164
- unregister: () => {
34165
- }
34166
- };
34167
- }
34168
- await assertES5(res.unregister);
34169
- return res;
34170
- };
34171
- migrateConfig = objectType({
34172
- dialect: dialect3,
34173
- out: stringType().optional().default("drizzle"),
34174
- migrations: configMigrations
34175
- });
34176
- }
34177
- });
34178
-
34179
34154
  // src/serializer/pgImports.ts
34180
34155
  var prepareFromExports;
34181
34156
  var init_pgImports = __esm({
@@ -34183,7 +34158,7 @@ var init_pgImports = __esm({
34183
34158
  "use strict";
34184
34159
  init_dist();
34185
34160
  init_pg_core();
34186
- init_utils8();
34161
+ init_utils6();
34187
34162
  prepareFromExports = (exports2) => {
34188
34163
  const tables = [];
34189
34164
  const enums = [];
@@ -34222,7 +34197,7 @@ var init_sqliteImports = __esm({
34222
34197
  "use strict";
34223
34198
  init_dist();
34224
34199
  init_sqlite_core();
34225
- init_utils8();
34200
+ init_utils6();
34226
34201
  prepareFromExports2 = (exports2) => {
34227
34202
  const tables = [];
34228
34203
  const i0values = Object.values(exports2);
@@ -34260,7 +34235,7 @@ var init_mysqlImports = __esm({
34260
34235
  "use strict";
34261
34236
  init_dist();
34262
34237
  init_mysql_core();
34263
- init_utils8();
34238
+ init_utils6();
34264
34239
  prepareFromExports3 = (exports2) => {
34265
34240
  const tables = [];
34266
34241
  const i0values = Object.values(exports2);
@@ -34890,6 +34865,7 @@ var pgSuggestions = async (db, statements) => {
34890
34865
  // src/cli/commands/pgUp.ts
34891
34866
  init_pgSchema();
34892
34867
  init_utils();
34868
+ init_utils6();
34893
34869
  var updateUpToV6 = (json) => {
34894
34870
  const schema4 = pgSchemaV5.parse(json);
34895
34871
  const tables = Object.fromEntries(
@@ -34953,7 +34929,7 @@ var updateUpToV7 = (json) => {
34953
34929
  };
34954
34930
 
34955
34931
  // src/cli/commands/sqliteIntrospect.ts
34956
- var import_hanji6 = __toESM(require_hanji());
34932
+ var import_hanji7 = __toESM(require_hanji());
34957
34933
  init_mjs();
34958
34934
  init_global();
34959
34935
 
@@ -35092,7 +35068,7 @@ var sqlitePushIntrospect = async (db, filters) => {
35092
35068
  "Pulling schema from database...",
35093
35069
  "Pulling schema from database..."
35094
35070
  );
35095
- const res = await (0, import_hanji6.renderWithTask)(progress, fromDatabase2(db, filter2));
35071
+ const res = await (0, import_hanji7.renderWithTask)(progress, fromDatabase2(db, filter2));
35096
35072
  const schema4 = { id: originUUID, prevId: "", ...res };
35097
35073
  return { schema: schema4 };
35098
35074
  };