drizzle-kit 0.24.2-5ccb794 → 0.24.2-6fbcf46

Sign up to get free protection for your applications and to get access to all the features.
package/api.mjs CHANGED
@@ -237,8 +237,8 @@ import process2 from "process";
237
237
  import os from "os";
238
238
  import tty from "tty";
239
239
  function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
240
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
241
- const position = argv.indexOf(prefix + flag);
240
+ const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
241
+ const position = argv.indexOf(prefix2 + flag);
242
242
  const terminatorPosition = argv.indexOf("--");
243
243
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
244
244
  }
@@ -380,12 +380,12 @@ function stringReplaceAll(string, substring, replacer) {
380
380
  returnValue += string.slice(endIndex);
381
381
  return returnValue;
382
382
  }
383
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
383
+ function stringEncaseCRLFWithFirstIndex(string, prefix2, postfix, index4) {
384
384
  let endIndex = 0;
385
385
  let returnValue = "";
386
386
  do {
387
387
  const gotCR = string[index4 - 1] === "\r";
388
- returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
388
+ returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix2 + (gotCR ? "\r\n" : "\n") + postfix;
389
389
  endIndex = index4 + 1;
390
390
  index4 = string.indexOf("\n", endIndex);
391
391
  } while (index4 !== -1);
@@ -1902,40 +1902,40 @@ var require_sync = __commonJS({
1902
1902
  while (typeof pattern[n] === "string") {
1903
1903
  n++;
1904
1904
  }
1905
- var prefix;
1905
+ var prefix2;
1906
1906
  switch (n) {
1907
1907
  case pattern.length:
1908
1908
  this._processSimple(pattern.join("/"), index4);
1909
1909
  return;
1910
1910
  case 0:
1911
- prefix = null;
1911
+ prefix2 = null;
1912
1912
  break;
1913
1913
  default:
1914
- prefix = pattern.slice(0, n).join("/");
1914
+ prefix2 = pattern.slice(0, n).join("/");
1915
1915
  break;
1916
1916
  }
1917
1917
  var remain = pattern.slice(n);
1918
1918
  var read;
1919
- if (prefix === null)
1919
+ if (prefix2 === null)
1920
1920
  read = ".";
1921
- else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
1921
+ else if (isAbsolute(prefix2) || isAbsolute(pattern.map(function(p) {
1922
1922
  return typeof p === "string" ? p : "[*]";
1923
1923
  }).join("/"))) {
1924
- if (!prefix || !isAbsolute(prefix))
1925
- prefix = "/" + prefix;
1926
- read = prefix;
1924
+ if (!prefix2 || !isAbsolute(prefix2))
1925
+ prefix2 = "/" + prefix2;
1926
+ read = prefix2;
1927
1927
  } else
1928
- read = prefix;
1928
+ read = prefix2;
1929
1929
  var abs = this._makeAbs(read);
1930
1930
  if (childrenIgnored(this, read))
1931
1931
  return;
1932
1932
  var isGlobStar = remain[0] === minimatch2.GLOBSTAR;
1933
1933
  if (isGlobStar)
1934
- this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar);
1934
+ this._processGlobStar(prefix2, read, abs, remain, index4, inGlobStar);
1935
1935
  else
1936
- this._processReaddir(prefix, read, abs, remain, index4, inGlobStar);
1936
+ this._processReaddir(prefix2, read, abs, remain, index4, inGlobStar);
1937
1937
  };
1938
- GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar) {
1938
+ GlobSync.prototype._processReaddir = function(prefix2, read, abs, remain, index4, inGlobStar) {
1939
1939
  var entries = this._readdir(abs, inGlobStar);
1940
1940
  if (!entries)
1941
1941
  return;
@@ -1948,7 +1948,7 @@ var require_sync = __commonJS({
1948
1948
  var e = entries[i];
1949
1949
  if (e.charAt(0) !== "." || dotOk) {
1950
1950
  var m;
1951
- if (negate && !prefix) {
1951
+ if (negate && !prefix2) {
1952
1952
  m = !e.match(pn);
1953
1953
  } else {
1954
1954
  m = e.match(pn);
@@ -1965,11 +1965,11 @@ var require_sync = __commonJS({
1965
1965
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
1966
1966
  for (var i = 0; i < len; i++) {
1967
1967
  var e = matchedEntries[i];
1968
- if (prefix) {
1969
- if (prefix.slice(-1) !== "/")
1970
- e = prefix + "/" + e;
1968
+ if (prefix2) {
1969
+ if (prefix2.slice(-1) !== "/")
1970
+ e = prefix2 + "/" + e;
1971
1971
  else
1972
- e = prefix + e;
1972
+ e = prefix2 + e;
1973
1973
  }
1974
1974
  if (e.charAt(0) === "/" && !this.nomount) {
1975
1975
  e = path2.join(this.root, e);
@@ -1982,8 +1982,8 @@ var require_sync = __commonJS({
1982
1982
  for (var i = 0; i < len; i++) {
1983
1983
  var e = matchedEntries[i];
1984
1984
  var newPattern;
1985
- if (prefix)
1986
- newPattern = [prefix, e];
1985
+ if (prefix2)
1986
+ newPattern = [prefix2, e];
1987
1987
  else
1988
1988
  newPattern = [e];
1989
1989
  this._process(newPattern.concat(remain), index4, inGlobStar);
@@ -2090,12 +2090,12 @@ var require_sync = __commonJS({
2090
2090
  break;
2091
2091
  }
2092
2092
  };
2093
- GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar) {
2093
+ GlobSync.prototype._processGlobStar = function(prefix2, read, abs, remain, index4, inGlobStar) {
2094
2094
  var entries = this._readdir(abs, inGlobStar);
2095
2095
  if (!entries)
2096
2096
  return;
2097
2097
  var remainWithoutGlobStar = remain.slice(1);
2098
- var gspref = prefix ? [prefix] : [];
2098
+ var gspref = prefix2 ? [prefix2] : [];
2099
2099
  var noGlobStar = gspref.concat(remainWithoutGlobStar);
2100
2100
  this._process(noGlobStar, index4, false);
2101
2101
  var len = entries.length;
@@ -2112,25 +2112,25 @@ var require_sync = __commonJS({
2112
2112
  this._process(below, index4, true);
2113
2113
  }
2114
2114
  };
2115
- GlobSync.prototype._processSimple = function(prefix, index4) {
2116
- var exists2 = this._stat(prefix);
2115
+ GlobSync.prototype._processSimple = function(prefix2, index4) {
2116
+ var exists2 = this._stat(prefix2);
2117
2117
  if (!this.matches[index4])
2118
2118
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
2119
2119
  if (!exists2)
2120
2120
  return;
2121
- if (prefix && isAbsolute(prefix) && !this.nomount) {
2122
- var trail = /[\/\\]$/.test(prefix);
2123
- if (prefix.charAt(0) === "/") {
2124
- prefix = path2.join(this.root, prefix);
2121
+ if (prefix2 && isAbsolute(prefix2) && !this.nomount) {
2122
+ var trail = /[\/\\]$/.test(prefix2);
2123
+ if (prefix2.charAt(0) === "/") {
2124
+ prefix2 = path2.join(this.root, prefix2);
2125
2125
  } else {
2126
- prefix = path2.resolve(this.root, prefix);
2126
+ prefix2 = path2.resolve(this.root, prefix2);
2127
2127
  if (trail)
2128
- prefix += "/";
2128
+ prefix2 += "/";
2129
2129
  }
2130
2130
  }
2131
2131
  if (process.platform === "win32")
2132
- prefix = prefix.replace(/\\/g, "/");
2133
- this._emitMatch(index4, prefix);
2132
+ prefix2 = prefix2.replace(/\\/g, "/");
2133
+ this._emitMatch(index4, prefix2);
2134
2134
  };
2135
2135
  GlobSync.prototype._stat = function(f) {
2136
2136
  var abs = this._makeAbs(f);
@@ -2525,46 +2525,46 @@ var require_glob = __commonJS({
2525
2525
  while (typeof pattern[n] === "string") {
2526
2526
  n++;
2527
2527
  }
2528
- var prefix;
2528
+ var prefix2;
2529
2529
  switch (n) {
2530
2530
  case pattern.length:
2531
2531
  this._processSimple(pattern.join("/"), index4, cb);
2532
2532
  return;
2533
2533
  case 0:
2534
- prefix = null;
2534
+ prefix2 = null;
2535
2535
  break;
2536
2536
  default:
2537
- prefix = pattern.slice(0, n).join("/");
2537
+ prefix2 = pattern.slice(0, n).join("/");
2538
2538
  break;
2539
2539
  }
2540
2540
  var remain = pattern.slice(n);
2541
2541
  var read;
2542
- if (prefix === null)
2542
+ if (prefix2 === null)
2543
2543
  read = ".";
2544
- else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
2544
+ else if (isAbsolute(prefix2) || isAbsolute(pattern.map(function(p) {
2545
2545
  return typeof p === "string" ? p : "[*]";
2546
2546
  }).join("/"))) {
2547
- if (!prefix || !isAbsolute(prefix))
2548
- prefix = "/" + prefix;
2549
- read = prefix;
2547
+ if (!prefix2 || !isAbsolute(prefix2))
2548
+ prefix2 = "/" + prefix2;
2549
+ read = prefix2;
2550
2550
  } else
2551
- read = prefix;
2551
+ read = prefix2;
2552
2552
  var abs = this._makeAbs(read);
2553
2553
  if (childrenIgnored(this, read))
2554
2554
  return cb();
2555
2555
  var isGlobStar = remain[0] === minimatch2.GLOBSTAR;
2556
2556
  if (isGlobStar)
2557
- this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar, cb);
2557
+ this._processGlobStar(prefix2, read, abs, remain, index4, inGlobStar, cb);
2558
2558
  else
2559
- this._processReaddir(prefix, read, abs, remain, index4, inGlobStar, cb);
2559
+ this._processReaddir(prefix2, read, abs, remain, index4, inGlobStar, cb);
2560
2560
  };
2561
- Glob.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
2561
+ Glob.prototype._processReaddir = function(prefix2, read, abs, remain, index4, inGlobStar, cb) {
2562
2562
  var self2 = this;
2563
2563
  this._readdir(abs, inGlobStar, function(er, entries) {
2564
- return self2._processReaddir2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
2564
+ return self2._processReaddir2(prefix2, read, abs, remain, index4, inGlobStar, entries, cb);
2565
2565
  });
2566
2566
  };
2567
- Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
2567
+ Glob.prototype._processReaddir2 = function(prefix2, read, abs, remain, index4, inGlobStar, entries, cb) {
2568
2568
  if (!entries)
2569
2569
  return cb();
2570
2570
  var pn = remain[0];
@@ -2576,7 +2576,7 @@ var require_glob = __commonJS({
2576
2576
  var e = entries[i];
2577
2577
  if (e.charAt(0) !== "." || dotOk) {
2578
2578
  var m;
2579
- if (negate && !prefix) {
2579
+ if (negate && !prefix2) {
2580
2580
  m = !e.match(pn);
2581
2581
  } else {
2582
2582
  m = e.match(pn);
@@ -2593,11 +2593,11 @@ var require_glob = __commonJS({
2593
2593
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
2594
2594
  for (var i = 0; i < len; i++) {
2595
2595
  var e = matchedEntries[i];
2596
- if (prefix) {
2597
- if (prefix !== "/")
2598
- e = prefix + "/" + e;
2596
+ if (prefix2) {
2597
+ if (prefix2 !== "/")
2598
+ e = prefix2 + "/" + e;
2599
2599
  else
2600
- e = prefix + e;
2600
+ e = prefix2 + e;
2601
2601
  }
2602
2602
  if (e.charAt(0) === "/" && !this.nomount) {
2603
2603
  e = path2.join(this.root, e);
@@ -2610,11 +2610,11 @@ var require_glob = __commonJS({
2610
2610
  for (var i = 0; i < len; i++) {
2611
2611
  var e = matchedEntries[i];
2612
2612
  var newPattern;
2613
- if (prefix) {
2614
- if (prefix !== "/")
2615
- e = prefix + "/" + e;
2613
+ if (prefix2) {
2614
+ if (prefix2 !== "/")
2615
+ e = prefix2 + "/" + e;
2616
2616
  else
2617
- e = prefix + e;
2617
+ e = prefix2 + e;
2618
2618
  }
2619
2619
  this._process([e].concat(remain), index4, inGlobStar, cb);
2620
2620
  }
@@ -2745,17 +2745,17 @@ var require_glob = __commonJS({
2745
2745
  }
2746
2746
  return cb();
2747
2747
  };
2748
- Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
2748
+ Glob.prototype._processGlobStar = function(prefix2, read, abs, remain, index4, inGlobStar, cb) {
2749
2749
  var self2 = this;
2750
2750
  this._readdir(abs, inGlobStar, function(er, entries) {
2751
- self2._processGlobStar2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
2751
+ self2._processGlobStar2(prefix2, read, abs, remain, index4, inGlobStar, entries, cb);
2752
2752
  });
2753
2753
  };
2754
- Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
2754
+ Glob.prototype._processGlobStar2 = function(prefix2, read, abs, remain, index4, inGlobStar, entries, cb) {
2755
2755
  if (!entries)
2756
2756
  return cb();
2757
2757
  var remainWithoutGlobStar = remain.slice(1);
2758
- var gspref = prefix ? [prefix] : [];
2758
+ var gspref = prefix2 ? [prefix2] : [];
2759
2759
  var noGlobStar = gspref.concat(remainWithoutGlobStar);
2760
2760
  this._process(noGlobStar, index4, false, cb);
2761
2761
  var isSym = this.symlinks[abs];
@@ -2773,30 +2773,30 @@ var require_glob = __commonJS({
2773
2773
  }
2774
2774
  cb();
2775
2775
  };
2776
- Glob.prototype._processSimple = function(prefix, index4, cb) {
2776
+ Glob.prototype._processSimple = function(prefix2, index4, cb) {
2777
2777
  var self2 = this;
2778
- this._stat(prefix, function(er, exists2) {
2779
- self2._processSimple2(prefix, index4, er, exists2, cb);
2778
+ this._stat(prefix2, function(er, exists2) {
2779
+ self2._processSimple2(prefix2, index4, er, exists2, cb);
2780
2780
  });
2781
2781
  };
2782
- Glob.prototype._processSimple2 = function(prefix, index4, er, exists2, cb) {
2782
+ Glob.prototype._processSimple2 = function(prefix2, index4, er, exists2, cb) {
2783
2783
  if (!this.matches[index4])
2784
2784
  this.matches[index4] = /* @__PURE__ */ Object.create(null);
2785
2785
  if (!exists2)
2786
2786
  return cb();
2787
- if (prefix && isAbsolute(prefix) && !this.nomount) {
2788
- var trail = /[\/\\]$/.test(prefix);
2789
- if (prefix.charAt(0) === "/") {
2790
- prefix = path2.join(this.root, prefix);
2787
+ if (prefix2 && isAbsolute(prefix2) && !this.nomount) {
2788
+ var trail = /[\/\\]$/.test(prefix2);
2789
+ if (prefix2.charAt(0) === "/") {
2790
+ prefix2 = path2.join(this.root, prefix2);
2791
2791
  } else {
2792
- prefix = path2.resolve(this.root, prefix);
2792
+ prefix2 = path2.resolve(this.root, prefix2);
2793
2793
  if (trail)
2794
- prefix += "/";
2794
+ prefix2 += "/";
2795
2795
  }
2796
2796
  }
2797
2797
  if (process.platform === "win32")
2798
- prefix = prefix.replace(/\\/g, "/");
2799
- this._emitMatch(index4, prefix);
2798
+ prefix2 = prefix2.replace(/\\/g, "/");
2799
+ this._emitMatch(index4, prefix2);
2800
2800
  cb();
2801
2801
  };
2802
2802
  Glob.prototype._stat = function(f, cb) {
@@ -8424,7 +8424,7 @@ var init_views = __esm({
8424
8424
  import_hanji = __toESM(require_hanji());
8425
8425
  init_utils();
8426
8426
  warning = (msg) => {
8427
- (0, import_hanji.render)(`${source_default.bgYellow.bold(" Warning ")} ${msg}`);
8427
+ (0, import_hanji.render)(`[${source_default.yellow("Warning")}] ${msg}`);
8428
8428
  };
8429
8429
  error = (error2, greyMsg = "") => {
8430
8430
  return `${source_default.bgRed.bold(" Error ")} ${error2} ${greyMsg ? source_default.grey(greyMsg) : ""}`.trim();
@@ -9748,7 +9748,7 @@ var require_difflib = __commonJS({
9748
9748
  return `${beginning},${beginning + length - 1}`;
9749
9749
  };
9750
9750
  contextDiff = function(a, b, { fromfile, tofile, fromfiledate, tofiledate, n, lineterm } = {}) {
9751
- 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;
9751
+ 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;
9752
9752
  if (fromfile == null) {
9753
9753
  fromfile = "";
9754
9754
  }
@@ -9767,7 +9767,7 @@ var require_difflib = __commonJS({
9767
9767
  if (lineterm == null) {
9768
9768
  lineterm = "\n";
9769
9769
  }
9770
- prefix = {
9770
+ prefix2 = {
9771
9771
  insert: "+ ",
9772
9772
  delete: "- ",
9773
9773
  replace: "! ",
@@ -9803,7 +9803,7 @@ var require_difflib = __commonJS({
9803
9803
  ref1 = a.slice(i1, i2);
9804
9804
  for (o = 0, len2 = ref1.length; o < len2; o++) {
9805
9805
  line = ref1[o];
9806
- lines.push(prefix[tag] + line);
9806
+ lines.push(prefix2[tag] + line);
9807
9807
  }
9808
9808
  }
9809
9809
  }
@@ -9825,7 +9825,7 @@ var require_difflib = __commonJS({
9825
9825
  ref2 = b.slice(j1, j2);
9826
9826
  for (q = 0, len4 = ref2.length; q < len4; q++) {
9827
9827
  line = ref2[q];
9828
- lines.push(prefix[tag] + line);
9828
+ lines.push(prefix2[tag] + line);
9829
9829
  }
9830
9830
  }
9831
9831
  }
@@ -9838,7 +9838,7 @@ var require_difflib = __commonJS({
9838
9838
  return new Differ(linejunk, charjunk).compare(a, b);
9839
9839
  };
9840
9840
  restore = function(delta, which) {
9841
- var l, len, line, lines, prefixes, ref, tag;
9841
+ var l, len, line, lines, prefixes2, ref, tag;
9842
9842
  tag = {
9843
9843
  1: "- ",
9844
9844
  2: "+ "
@@ -9846,11 +9846,11 @@ var require_difflib = __commonJS({
9846
9846
  if (!tag) {
9847
9847
  throw new Error(`unknow delta choice (must be 1 or 2): ${which}`);
9848
9848
  }
9849
- prefixes = [" ", tag];
9849
+ prefixes2 = [" ", tag];
9850
9850
  lines = [];
9851
9851
  for (l = 0, len = delta.length; l < len; l++) {
9852
9852
  line = delta[l];
9853
- if (ref = line.slice(0, 2), indexOf.call(prefixes, ref) >= 0) {
9853
+ if (ref = line.slice(0, 2), indexOf.call(prefixes2, ref) >= 0) {
9854
9854
  lines.push(line.slice(2));
9855
9855
  }
9856
9856
  }
@@ -9991,8 +9991,8 @@ var require_has_flag = __commonJS({
9991
9991
  module.exports = function(flag, argv) {
9992
9992
  argv = argv || process.argv;
9993
9993
  var terminatorPos = argv.indexOf("--");
9994
- var prefix = /^-{1,2}/.test(flag) ? "" : "--";
9995
- var pos = argv.indexOf(prefix + flag);
9994
+ var prefix2 = /^-{1,2}/.test(flag) ? "" : "--";
9995
+ var pos = argv.indexOf(prefix2 + flag);
9996
9996
  return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
9997
9997
  };
9998
9998
  }
@@ -10601,7 +10601,7 @@ var require_colorize = __commonJS({
10601
10601
  };
10602
10602
  var subcolorizeToCallback = function(options, key, diff2, output, color2, indent) {
10603
10603
  let subvalue;
10604
- const prefix = key ? `${key}: ` : "";
10604
+ const prefix2 = key ? `${key}: ` : "";
10605
10605
  const subindent = indent + " ";
10606
10606
  const outputElisions = (n) => {
10607
10607
  const maxElisions = options.maxElisions === void 0 ? Infinity : options.maxElisions;
@@ -10619,7 +10619,7 @@ var require_colorize = __commonJS({
10619
10619
  subcolorizeToCallback(options, key, diff2.__old, output, "-", indent);
10620
10620
  return subcolorizeToCallback(options, key, diff2.__new, output, "+", indent);
10621
10621
  } else {
10622
- output(color2, `${indent}${prefix}{`);
10622
+ output(color2, `${indent}${prefix2}{`);
10623
10623
  for (const subkey of Object.keys(diff2)) {
10624
10624
  let m;
10625
10625
  subvalue = diff2[subkey];
@@ -10634,7 +10634,7 @@ var require_colorize = __commonJS({
10634
10634
  return output(color2, `${indent}}`);
10635
10635
  }
10636
10636
  case "array": {
10637
- output(color2, `${indent}${prefix}[`);
10637
+ output(color2, `${indent}${prefix2}[`);
10638
10638
  let looksLikeDiff = true;
10639
10639
  for (const item of diff2) {
10640
10640
  if (extendedTypeOf(item) !== "array" || !(item.length === 2 || item.length === 1 && item[0] === " ") || !(typeof item[0] === "string") || item[0].length !== 1 || ![" ", "-", "+", "~"].includes(item[0])) {
@@ -10673,7 +10673,7 @@ var require_colorize = __commonJS({
10673
10673
  }
10674
10674
  default:
10675
10675
  if (diff2 === 0 || diff2 === null || diff2 === false || diff2 === "" || diff2) {
10676
- return output(color2, indent + prefix + JSON.stringify(diff2));
10676
+ return output(color2, indent + prefix2 + JSON.stringify(diff2));
10677
10677
  }
10678
10678
  }
10679
10679
  };
@@ -15870,7 +15870,7 @@ var init_schemaValidator = __esm({
15870
15870
  });
15871
15871
 
15872
15872
  // src/cli/validations/common.ts
15873
- var sqliteDriversLiterals, postgresqlDriversLiterals, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
15873
+ var sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
15874
15874
  var init_common = __esm({
15875
15875
  "src/cli/validations/common.ts"() {
15876
15876
  "use strict";
@@ -15886,12 +15886,24 @@ var init_common = __esm({
15886
15886
  literalType("aws-data-api"),
15887
15887
  literalType("pglite")
15888
15888
  ];
15889
+ prefixes = [
15890
+ "index",
15891
+ "timestamp",
15892
+ "supabase",
15893
+ "unix",
15894
+ "none"
15895
+ ];
15896
+ prefix = enumType(prefixes);
15897
+ {
15898
+ const _2 = "";
15899
+ }
15889
15900
  sqliteDriver = unionType(sqliteDriversLiterals);
15890
15901
  postgresDriver = unionType(postgresqlDriversLiterals);
15891
15902
  driver = unionType([sqliteDriver, postgresDriver]);
15892
15903
  configMigrations = objectType({
15893
15904
  table: stringType().optional(),
15894
- schema: stringType().optional()
15905
+ schema: stringType().optional(),
15906
+ prefix: prefix.optional().default("index")
15895
15907
  }).optional();
15896
15908
  configCommonSchema = objectType({
15897
15909
  dialect: dialect3,
@@ -25643,267 +25655,6 @@ var init_selector_ui = __esm({
25643
25655
  }
25644
25656
  });
25645
25657
 
25646
- // src/cli/validations/cli.ts
25647
- var pushParams, pullParams, configCheck, cliConfigCheck;
25648
- var init_cli = __esm({
25649
- "src/cli/validations/cli.ts"() {
25650
- "use strict";
25651
- init_lib();
25652
- init_schemaValidator();
25653
- init_common();
25654
- pushParams = objectType({
25655
- dialect: dialect3,
25656
- schema: unionType([stringType(), stringType().array()]),
25657
- tablesFilter: unionType([stringType(), stringType().array()]).optional(),
25658
- schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
25659
- extensionsFilters: literalType("postgis").array().optional(),
25660
- verbose: booleanType().optional(),
25661
- strict: booleanType().optional()
25662
- }).passthrough();
25663
- pullParams = objectType({
25664
- config: stringType().optional(),
25665
- dialect: dialect3,
25666
- out: stringType().optional().default("drizzle"),
25667
- tablesFilter: unionType([stringType(), stringType().array()]).optional(),
25668
- schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
25669
- extensionsFilters: literalType("postgis").array().optional(),
25670
- casing,
25671
- breakpoints: booleanType().optional().default(true)
25672
- }).passthrough();
25673
- configCheck = objectType({
25674
- dialect: dialect3.optional(),
25675
- out: stringType().optional()
25676
- });
25677
- cliConfigCheck = intersectionType(
25678
- objectType({
25679
- config: stringType().optional()
25680
- }),
25681
- configCheck
25682
- );
25683
- }
25684
- });
25685
-
25686
- // src/cli/validations/mysql.ts
25687
- var mysqlCredentials;
25688
- var init_mysql = __esm({
25689
- "src/cli/validations/mysql.ts"() {
25690
- "use strict";
25691
- init_lib();
25692
- init_views();
25693
- init_common();
25694
- init_outputs();
25695
- mysqlCredentials = unionType([
25696
- objectType({
25697
- host: stringType().min(1),
25698
- port: coerce.number().min(1).optional(),
25699
- user: stringType().min(1).optional(),
25700
- password: stringType().min(1).optional(),
25701
- database: stringType().min(1),
25702
- ssl: unionType([
25703
- stringType(),
25704
- objectType({
25705
- pfx: stringType().optional(),
25706
- key: stringType().optional(),
25707
- passphrase: stringType().optional(),
25708
- cert: stringType().optional(),
25709
- ca: unionType([stringType(), stringType().array()]).optional(),
25710
- crl: unionType([stringType(), stringType().array()]).optional(),
25711
- ciphers: stringType().optional(),
25712
- rejectUnauthorized: booleanType().optional()
25713
- })
25714
- ]).optional()
25715
- }),
25716
- objectType({
25717
- url: stringType().min(1)
25718
- })
25719
- ]);
25720
- }
25721
- });
25722
-
25723
- // src/cli/validations/postgres.ts
25724
- var postgresCredentials;
25725
- var init_postgres = __esm({
25726
- "src/cli/validations/postgres.ts"() {
25727
- "use strict";
25728
- init_lib();
25729
- init_views();
25730
- init_common();
25731
- postgresCredentials = unionType([
25732
- objectType({
25733
- driver: undefinedType(),
25734
- host: stringType().min(1),
25735
- port: coerce.number().min(1).optional(),
25736
- user: stringType().min(1).optional(),
25737
- password: stringType().min(1).optional(),
25738
- database: stringType().min(1),
25739
- ssl: unionType([
25740
- literalType("require"),
25741
- literalType("allow"),
25742
- literalType("prefer"),
25743
- literalType("verify-full"),
25744
- booleanType(),
25745
- objectType({}).passthrough()
25746
- ]).optional()
25747
- }).transform((o) => {
25748
- delete o.driver;
25749
- return o;
25750
- }),
25751
- objectType({
25752
- driver: undefinedType(),
25753
- url: stringType().min(1)
25754
- }).transform((o) => {
25755
- delete o.driver;
25756
- return o;
25757
- }),
25758
- objectType({
25759
- driver: literalType("aws-data-api"),
25760
- database: stringType().min(1),
25761
- secretArn: stringType().min(1),
25762
- resourceArn: stringType().min(1)
25763
- }),
25764
- objectType({
25765
- driver: literalType("pglite"),
25766
- url: stringType().min(1)
25767
- })
25768
- ]);
25769
- }
25770
- });
25771
-
25772
- // src/cli/validations/sqlite.ts
25773
- var sqliteCredentials;
25774
- var init_sqlite = __esm({
25775
- "src/cli/validations/sqlite.ts"() {
25776
- "use strict";
25777
- init_global();
25778
- init_lib();
25779
- init_views();
25780
- init_common();
25781
- sqliteCredentials = unionType([
25782
- objectType({
25783
- driver: literalType("turso"),
25784
- url: stringType().min(1),
25785
- authToken: stringType().min(1).optional()
25786
- }),
25787
- objectType({
25788
- driver: literalType("d1-http"),
25789
- accountId: stringType().min(1),
25790
- databaseId: stringType().min(1),
25791
- token: stringType().min(1)
25792
- }),
25793
- objectType({
25794
- driver: undefinedType(),
25795
- url: stringType().min(1)
25796
- }).transform((o) => {
25797
- delete o.driver;
25798
- return o;
25799
- })
25800
- ]);
25801
- }
25802
- });
25803
-
25804
- // src/cli/validations/studio.ts
25805
- var credentials, studioCliParams, studioConfig;
25806
- var init_studio = __esm({
25807
- "src/cli/validations/studio.ts"() {
25808
- "use strict";
25809
- init_lib();
25810
- init_schemaValidator();
25811
- init_mysql();
25812
- init_postgres();
25813
- init_sqlite();
25814
- credentials = intersectionType(
25815
- postgresCredentials,
25816
- mysqlCredentials,
25817
- sqliteCredentials
25818
- );
25819
- studioCliParams = objectType({
25820
- port: coerce.number().optional().default(4983),
25821
- host: stringType().optional().default("127.0.0.1"),
25822
- config: stringType().optional()
25823
- });
25824
- studioConfig = objectType({
25825
- dialect: dialect3,
25826
- schema: unionType([stringType(), stringType().array()]).optional()
25827
- });
25828
- }
25829
- });
25830
-
25831
- // src/cli/commands/_es5.ts
25832
- var es5_exports = {};
25833
- __export(es5_exports, {
25834
- default: () => es5_default
25835
- });
25836
- var _, es5_default;
25837
- var init_es5 = __esm({
25838
- "src/cli/commands/_es5.ts"() {
25839
- "use strict";
25840
- _ = "";
25841
- es5_default = _;
25842
- }
25843
- });
25844
-
25845
- // src/cli/commands/utils.ts
25846
- var import_hanji6, assertES5, safeRegister, migrateConfig;
25847
- var init_utils6 = __esm({
25848
- "src/cli/commands/utils.ts"() {
25849
- "use strict";
25850
- import_hanji6 = __toESM(require_hanji());
25851
- init_lib();
25852
- init_global();
25853
- init_schemaValidator();
25854
- init_serializer();
25855
- init_cli();
25856
- init_common();
25857
- init_mysql();
25858
- init_outputs();
25859
- init_postgres();
25860
- init_sqlite();
25861
- init_studio();
25862
- init_views();
25863
- assertES5 = async (unregister) => {
25864
- try {
25865
- init_es5();
25866
- } catch (e) {
25867
- if ("errors" in e && Array.isArray(e.errors) && e.errors.length > 0) {
25868
- const es5Error = e.errors.filter((it) => it.text?.includes(`("es5") is not supported yet`)).length > 0;
25869
- if (es5Error) {
25870
- console.log(
25871
- error(
25872
- `Please change compilerOptions.target from 'es5' to 'es6' or above in your tsconfig.json`
25873
- )
25874
- );
25875
- process.exit(1);
25876
- }
25877
- }
25878
- console.error(e);
25879
- process.exit(1);
25880
- }
25881
- };
25882
- safeRegister = async () => {
25883
- const { register } = await import("esbuild-register/dist/node");
25884
- let res;
25885
- try {
25886
- res = register({
25887
- format: "cjs",
25888
- loader: "ts"
25889
- });
25890
- } catch {
25891
- res = {
25892
- unregister: () => {
25893
- }
25894
- };
25895
- }
25896
- await assertES5(res.unregister);
25897
- return res;
25898
- };
25899
- migrateConfig = objectType({
25900
- dialect: dialect3,
25901
- out: stringType().optional().default("drizzle"),
25902
- migrations: configMigrations
25903
- });
25904
- }
25905
- });
25906
-
25907
25658
  // ../drizzle-orm/dist/sqlite-core/alias.js
25908
25659
  var init_alias3 = __esm({
25909
25660
  "../drizzle-orm/dist/sqlite-core/alias.js"() {
@@ -29010,7 +28761,7 @@ function getTableConfig2(table4) {
29010
28761
  name: name2
29011
28762
  };
29012
28763
  }
29013
- var init_utils7 = __esm({
28764
+ var init_utils6 = __esm({
29014
28765
  "../drizzle-orm/dist/sqlite-core/utils.js"() {
29015
28766
  "use strict";
29016
28767
  init_entity();
@@ -29146,7 +28897,7 @@ var init_sqlite_core = __esm({
29146
28897
  init_subquery3();
29147
28898
  init_table3();
29148
28899
  init_unique_constraint2();
29149
- init_utils7();
28900
+ init_utils6();
29150
28901
  init_view2();
29151
28902
  }
29152
28903
  });
@@ -33567,7 +33318,7 @@ function getTableConfig3(table4) {
33567
33318
  baseName
33568
33319
  };
33569
33320
  }
33570
- var init_utils8 = __esm({
33321
+ var init_utils7 = __esm({
33571
33322
  "../drizzle-orm/dist/mysql-core/utils.js"() {
33572
33323
  "use strict";
33573
33324
  init_entity();
@@ -33599,7 +33350,7 @@ var init_mysql_core = __esm({
33599
33350
  init_subquery4();
33600
33351
  init_table4();
33601
33352
  init_unique_constraint3();
33602
- init_utils8();
33353
+ init_utils7();
33603
33354
  init_view_common4();
33604
33355
  init_view3();
33605
33356
  }
@@ -34156,6 +33907,280 @@ We have encountered a collision between the index name on columns ${source_defau
34156
33907
  }
34157
33908
  });
34158
33909
 
33910
+ // src/cli/validations/cli.ts
33911
+ var cliConfigGenerate, pushParams, pullParams, configCheck, cliConfigCheck;
33912
+ var init_cli = __esm({
33913
+ "src/cli/validations/cli.ts"() {
33914
+ "use strict";
33915
+ init_lib();
33916
+ init_schemaValidator();
33917
+ init_common();
33918
+ cliConfigGenerate = objectType({
33919
+ dialect: dialect3.optional(),
33920
+ schema: unionType([stringType(), stringType().array()]).optional(),
33921
+ out: stringType().optional().default("./drizzle"),
33922
+ config: stringType().optional(),
33923
+ name: stringType().optional(),
33924
+ prefix: prefix.optional(),
33925
+ breakpoints: booleanType().optional().default(true),
33926
+ custom: booleanType().optional().default(false)
33927
+ }).strict();
33928
+ pushParams = objectType({
33929
+ dialect: dialect3,
33930
+ schema: unionType([stringType(), stringType().array()]),
33931
+ tablesFilter: unionType([stringType(), stringType().array()]).optional(),
33932
+ schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
33933
+ extensionsFilters: literalType("postgis").array().optional(),
33934
+ verbose: booleanType().optional(),
33935
+ strict: booleanType().optional()
33936
+ }).passthrough();
33937
+ pullParams = objectType({
33938
+ config: stringType().optional(),
33939
+ dialect: dialect3,
33940
+ out: stringType().optional().default("drizzle"),
33941
+ tablesFilter: unionType([stringType(), stringType().array()]).optional(),
33942
+ schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
33943
+ extensionsFilters: literalType("postgis").array().optional(),
33944
+ casing,
33945
+ breakpoints: booleanType().optional().default(true),
33946
+ migrations: objectType({
33947
+ prefix: prefix.optional().default("index")
33948
+ }).optional()
33949
+ }).passthrough();
33950
+ configCheck = objectType({
33951
+ dialect: dialect3.optional(),
33952
+ out: stringType().optional()
33953
+ });
33954
+ cliConfigCheck = intersectionType(
33955
+ objectType({
33956
+ config: stringType().optional()
33957
+ }),
33958
+ configCheck
33959
+ );
33960
+ }
33961
+ });
33962
+
33963
+ // src/cli/validations/mysql.ts
33964
+ var mysqlCredentials;
33965
+ var init_mysql = __esm({
33966
+ "src/cli/validations/mysql.ts"() {
33967
+ "use strict";
33968
+ init_lib();
33969
+ init_views();
33970
+ init_common();
33971
+ init_outputs();
33972
+ mysqlCredentials = unionType([
33973
+ objectType({
33974
+ host: stringType().min(1),
33975
+ port: coerce.number().min(1).optional(),
33976
+ user: stringType().min(1).optional(),
33977
+ password: stringType().min(1).optional(),
33978
+ database: stringType().min(1),
33979
+ ssl: unionType([
33980
+ stringType(),
33981
+ objectType({
33982
+ pfx: stringType().optional(),
33983
+ key: stringType().optional(),
33984
+ passphrase: stringType().optional(),
33985
+ cert: stringType().optional(),
33986
+ ca: unionType([stringType(), stringType().array()]).optional(),
33987
+ crl: unionType([stringType(), stringType().array()]).optional(),
33988
+ ciphers: stringType().optional(),
33989
+ rejectUnauthorized: booleanType().optional()
33990
+ })
33991
+ ]).optional()
33992
+ }),
33993
+ objectType({
33994
+ url: stringType().min(1)
33995
+ })
33996
+ ]);
33997
+ }
33998
+ });
33999
+
34000
+ // src/cli/validations/postgres.ts
34001
+ var postgresCredentials;
34002
+ var init_postgres = __esm({
34003
+ "src/cli/validations/postgres.ts"() {
34004
+ "use strict";
34005
+ init_lib();
34006
+ init_views();
34007
+ init_common();
34008
+ postgresCredentials = unionType([
34009
+ objectType({
34010
+ driver: undefinedType(),
34011
+ host: stringType().min(1),
34012
+ port: coerce.number().min(1).optional(),
34013
+ user: stringType().min(1).optional(),
34014
+ password: stringType().min(1).optional(),
34015
+ database: stringType().min(1),
34016
+ ssl: unionType([
34017
+ literalType("require"),
34018
+ literalType("allow"),
34019
+ literalType("prefer"),
34020
+ literalType("verify-full"),
34021
+ booleanType(),
34022
+ objectType({}).passthrough()
34023
+ ]).optional()
34024
+ }).transform((o) => {
34025
+ delete o.driver;
34026
+ return o;
34027
+ }),
34028
+ objectType({
34029
+ driver: undefinedType(),
34030
+ url: stringType().min(1)
34031
+ }).transform((o) => {
34032
+ delete o.driver;
34033
+ return o;
34034
+ }),
34035
+ objectType({
34036
+ driver: literalType("aws-data-api"),
34037
+ database: stringType().min(1),
34038
+ secretArn: stringType().min(1),
34039
+ resourceArn: stringType().min(1)
34040
+ }),
34041
+ objectType({
34042
+ driver: literalType("pglite"),
34043
+ url: stringType().min(1)
34044
+ })
34045
+ ]);
34046
+ }
34047
+ });
34048
+
34049
+ // src/cli/validations/sqlite.ts
34050
+ var sqliteCredentials;
34051
+ var init_sqlite = __esm({
34052
+ "src/cli/validations/sqlite.ts"() {
34053
+ "use strict";
34054
+ init_global();
34055
+ init_lib();
34056
+ init_views();
34057
+ init_common();
34058
+ sqliteCredentials = unionType([
34059
+ objectType({
34060
+ driver: literalType("turso"),
34061
+ url: stringType().min(1),
34062
+ authToken: stringType().min(1).optional()
34063
+ }),
34064
+ objectType({
34065
+ driver: literalType("d1-http"),
34066
+ accountId: stringType().min(1),
34067
+ databaseId: stringType().min(1),
34068
+ token: stringType().min(1)
34069
+ }),
34070
+ objectType({
34071
+ driver: undefinedType(),
34072
+ url: stringType().min(1)
34073
+ }).transform((o) => {
34074
+ delete o.driver;
34075
+ return o;
34076
+ })
34077
+ ]);
34078
+ }
34079
+ });
34080
+
34081
+ // src/cli/validations/studio.ts
34082
+ var credentials, studioCliParams, studioConfig;
34083
+ var init_studio = __esm({
34084
+ "src/cli/validations/studio.ts"() {
34085
+ "use strict";
34086
+ init_lib();
34087
+ init_schemaValidator();
34088
+ init_mysql();
34089
+ init_postgres();
34090
+ init_sqlite();
34091
+ credentials = intersectionType(
34092
+ postgresCredentials,
34093
+ mysqlCredentials,
34094
+ sqliteCredentials
34095
+ );
34096
+ studioCliParams = objectType({
34097
+ port: coerce.number().optional().default(4983),
34098
+ host: stringType().optional().default("127.0.0.1"),
34099
+ config: stringType().optional()
34100
+ });
34101
+ studioConfig = objectType({
34102
+ dialect: dialect3,
34103
+ schema: unionType([stringType(), stringType().array()]).optional()
34104
+ });
34105
+ }
34106
+ });
34107
+
34108
+ // src/cli/commands/_es5.ts
34109
+ var es5_exports = {};
34110
+ __export(es5_exports, {
34111
+ default: () => es5_default
34112
+ });
34113
+ var _, es5_default;
34114
+ var init_es5 = __esm({
34115
+ "src/cli/commands/_es5.ts"() {
34116
+ "use strict";
34117
+ _ = "";
34118
+ es5_default = _;
34119
+ }
34120
+ });
34121
+
34122
+ // src/cli/commands/utils.ts
34123
+ var import_hanji7, assertES5, safeRegister, migrateConfig;
34124
+ var init_utils8 = __esm({
34125
+ "src/cli/commands/utils.ts"() {
34126
+ "use strict";
34127
+ import_hanji7 = __toESM(require_hanji());
34128
+ init_lib();
34129
+ init_global();
34130
+ init_schemaValidator();
34131
+ init_serializer();
34132
+ init_cli();
34133
+ init_common();
34134
+ init_mysql();
34135
+ init_outputs();
34136
+ init_postgres();
34137
+ init_sqlite();
34138
+ init_studio();
34139
+ init_views();
34140
+ assertES5 = async (unregister) => {
34141
+ try {
34142
+ init_es5();
34143
+ } catch (e) {
34144
+ if ("errors" in e && Array.isArray(e.errors) && e.errors.length > 0) {
34145
+ const es5Error = e.errors.filter((it) => it.text?.includes(`("es5") is not supported yet`)).length > 0;
34146
+ if (es5Error) {
34147
+ console.log(
34148
+ error(
34149
+ `Please change compilerOptions.target from 'es5' to 'es6' or above in your tsconfig.json`
34150
+ )
34151
+ );
34152
+ process.exit(1);
34153
+ }
34154
+ }
34155
+ console.error(e);
34156
+ process.exit(1);
34157
+ }
34158
+ };
34159
+ safeRegister = async () => {
34160
+ const { register } = await import("esbuild-register/dist/node");
34161
+ let res;
34162
+ try {
34163
+ res = register({
34164
+ format: "cjs",
34165
+ loader: "ts"
34166
+ });
34167
+ } catch {
34168
+ res = {
34169
+ unregister: () => {
34170
+ }
34171
+ };
34172
+ }
34173
+ await assertES5(res.unregister);
34174
+ return res;
34175
+ };
34176
+ migrateConfig = objectType({
34177
+ dialect: dialect3,
34178
+ out: stringType().optional().default("drizzle"),
34179
+ migrations: configMigrations
34180
+ });
34181
+ }
34182
+ });
34183
+
34159
34184
  // src/serializer/pgImports.ts
34160
34185
  var prepareFromExports;
34161
34186
  var init_pgImports = __esm({
@@ -34163,7 +34188,7 @@ var init_pgImports = __esm({
34163
34188
  "use strict";
34164
34189
  init_dist();
34165
34190
  init_pg_core();
34166
- init_utils6();
34191
+ init_utils8();
34167
34192
  prepareFromExports = (exports) => {
34168
34193
  const tables = [];
34169
34194
  const enums = [];
@@ -34202,7 +34227,7 @@ var init_sqliteImports = __esm({
34202
34227
  "use strict";
34203
34228
  init_dist();
34204
34229
  init_sqlite_core();
34205
- init_utils6();
34230
+ init_utils8();
34206
34231
  prepareFromExports2 = (exports) => {
34207
34232
  const tables = [];
34208
34233
  const i0values = Object.values(exports);
@@ -34240,7 +34265,7 @@ var init_mysqlImports = __esm({
34240
34265
  "use strict";
34241
34266
  init_dist();
34242
34267
  init_mysql_core();
34243
- init_utils6();
34268
+ init_utils8();
34244
34269
  prepareFromExports3 = (exports) => {
34245
34270
  const tables = [];
34246
34271
  const i0values = Object.values(exports);
@@ -34856,7 +34881,6 @@ var pgSuggestions = async (db, statements) => {
34856
34881
  // src/cli/commands/pgUp.ts
34857
34882
  init_pgSchema();
34858
34883
  init_utils();
34859
- init_utils6();
34860
34884
  var updateUpToV6 = (json) => {
34861
34885
  const schema4 = pgSchemaV5.parse(json);
34862
34886
  const tables = Object.fromEntries(
@@ -34920,7 +34944,7 @@ var updateUpToV7 = (json) => {
34920
34944
  };
34921
34945
 
34922
34946
  // src/cli/commands/sqliteIntrospect.ts
34923
- var import_hanji7 = __toESM(require_hanji());
34947
+ var import_hanji6 = __toESM(require_hanji());
34924
34948
  init_mjs();
34925
34949
  init_global();
34926
34950
 
@@ -35059,7 +35083,7 @@ var sqlitePushIntrospect = async (db, filters) => {
35059
35083
  "Pulling schema from database...",
35060
35084
  "Pulling schema from database..."
35061
35085
  );
35062
- const res = await (0, import_hanji7.renderWithTask)(progress, fromDatabase2(db, filter2));
35086
+ const res = await (0, import_hanji6.renderWithTask)(progress, fromDatabase2(db, filter2));
35063
35087
  const schema4 = { id: originUUID, prevId: "", ...res };
35064
35088
  return { schema: schema4 };
35065
35089
  };