drizzle-kit 0.17.1-6d783c6 → 0.17.1-d0991a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +273 -323
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -619,7 +619,7 @@ var require_command = __commonJS({
|
|
|
619
619
|
var EventEmitter = require("events").EventEmitter;
|
|
620
620
|
var childProcess = require("child_process");
|
|
621
621
|
var path3 = require("path");
|
|
622
|
-
var
|
|
622
|
+
var fs6 = require("fs");
|
|
623
623
|
var process3 = require("process");
|
|
624
624
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
625
625
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -1059,11 +1059,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1059
1059
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1060
1060
|
function findFile(baseDir, baseName) {
|
|
1061
1061
|
const localBin = path3.resolve(baseDir, baseName);
|
|
1062
|
-
if (
|
|
1062
|
+
if (fs6.existsSync(localBin))
|
|
1063
1063
|
return localBin;
|
|
1064
1064
|
if (sourceExt.includes(path3.extname(baseName)))
|
|
1065
1065
|
return void 0;
|
|
1066
|
-
const foundExt = sourceExt.find((ext2) =>
|
|
1066
|
+
const foundExt = sourceExt.find((ext2) => fs6.existsSync(`${localBin}${ext2}`));
|
|
1067
1067
|
if (foundExt)
|
|
1068
1068
|
return `${localBin}${foundExt}`;
|
|
1069
1069
|
return void 0;
|
|
@@ -1075,7 +1075,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1075
1075
|
if (this._scriptPath) {
|
|
1076
1076
|
let resolvedScriptPath;
|
|
1077
1077
|
try {
|
|
1078
|
-
resolvedScriptPath =
|
|
1078
|
+
resolvedScriptPath = fs6.realpathSync(this._scriptPath);
|
|
1079
1079
|
} catch (err2) {
|
|
1080
1080
|
resolvedScriptPath = this._scriptPath;
|
|
1081
1081
|
}
|
|
@@ -5756,11 +5756,11 @@ var require_hanji = __commonJS({
|
|
|
5756
5756
|
"use strict";
|
|
5757
5757
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
5758
5758
|
function adopt(value) {
|
|
5759
|
-
return value instanceof P ? value : new P(function(
|
|
5760
|
-
|
|
5759
|
+
return value instanceof P ? value : new P(function(resolve2) {
|
|
5760
|
+
resolve2(value);
|
|
5761
5761
|
});
|
|
5762
5762
|
}
|
|
5763
|
-
return new (P || (P = Promise))(function(
|
|
5763
|
+
return new (P || (P = Promise))(function(resolve2, reject) {
|
|
5764
5764
|
function fulfilled(value) {
|
|
5765
5765
|
try {
|
|
5766
5766
|
step(generator.next(value));
|
|
@@ -5776,7 +5776,7 @@ var require_hanji = __commonJS({
|
|
|
5776
5776
|
}
|
|
5777
5777
|
}
|
|
5778
5778
|
function step(result) {
|
|
5779
|
-
result.done ?
|
|
5779
|
+
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
5780
5780
|
}
|
|
5781
5781
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5782
5782
|
});
|
|
@@ -5850,14 +5850,14 @@ var require_hanji = __commonJS({
|
|
|
5850
5850
|
};
|
|
5851
5851
|
exports.SelectState = SelectState2;
|
|
5852
5852
|
var deferred = () => {
|
|
5853
|
-
let
|
|
5853
|
+
let resolve2;
|
|
5854
5854
|
let reject;
|
|
5855
5855
|
const promise = new Promise((res, rej) => {
|
|
5856
|
-
|
|
5856
|
+
resolve2 = res;
|
|
5857
5857
|
reject = rej;
|
|
5858
5858
|
});
|
|
5859
5859
|
return {
|
|
5860
|
-
resolve,
|
|
5860
|
+
resolve: resolve2,
|
|
5861
5861
|
reject,
|
|
5862
5862
|
promise
|
|
5863
5863
|
};
|
|
@@ -5907,8 +5907,8 @@ var require_hanji = __commonJS({
|
|
|
5907
5907
|
};
|
|
5908
5908
|
this.stdin.on("keypress", keypress);
|
|
5909
5909
|
this.view.attach(this);
|
|
5910
|
-
const { resolve, promise } = (0, exports.deferred)();
|
|
5911
|
-
this.resolve =
|
|
5910
|
+
const { resolve: resolve2, promise } = (0, exports.deferred)();
|
|
5911
|
+
this.resolve = resolve2;
|
|
5912
5912
|
this.promise = promise;
|
|
5913
5913
|
this.renderFunc = (0, lodash_throttle_1.default)((str) => {
|
|
5914
5914
|
this.stdout.write(str);
|
|
@@ -9579,15 +9579,15 @@ var require_resolve_resolve = __commonJS({
|
|
|
9579
9579
|
var slice = Array.prototype.slice;
|
|
9580
9580
|
var resolveArgs;
|
|
9581
9581
|
resolveArgs = function(args) {
|
|
9582
|
-
return this.map(function(
|
|
9583
|
-
return
|
|
9582
|
+
return this.map(function(resolve2, i) {
|
|
9583
|
+
return resolve2 ? resolve2(args[i]) : args[i];
|
|
9584
9584
|
}).concat(slice.call(args, this.length));
|
|
9585
9585
|
};
|
|
9586
9586
|
module2.exports = function(resolvers) {
|
|
9587
9587
|
resolvers = toArray(resolvers);
|
|
9588
|
-
resolvers.forEach(function(
|
|
9589
|
-
if (isValue(
|
|
9590
|
-
callable(
|
|
9588
|
+
resolvers.forEach(function(resolve2) {
|
|
9589
|
+
if (isValue(resolve2))
|
|
9590
|
+
callable(resolve2);
|
|
9591
9591
|
});
|
|
9592
9592
|
return resolveArgs.bind(resolvers);
|
|
9593
9593
|
};
|
|
@@ -9635,7 +9635,7 @@ var require_configure_map = __commonJS({
|
|
|
9635
9635
|
var on = ee.on;
|
|
9636
9636
|
var emit = ee.emit;
|
|
9637
9637
|
module2.exports = function(original, length, options) {
|
|
9638
|
-
var cache = create(null), conf, memLength, get, set, del, clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized,
|
|
9638
|
+
var cache = create(null), conf, memLength, get, set, del, clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized, resolve2;
|
|
9639
9639
|
if (length !== false)
|
|
9640
9640
|
memLength = length;
|
|
9641
9641
|
else if (isNaN(original.length))
|
|
@@ -9650,12 +9650,12 @@ var require_configure_map = __commonJS({
|
|
|
9650
9650
|
clear = normalizer.clear;
|
|
9651
9651
|
}
|
|
9652
9652
|
if (options.resolvers != null)
|
|
9653
|
-
|
|
9653
|
+
resolve2 = resolveResolve(options.resolvers);
|
|
9654
9654
|
if (get) {
|
|
9655
9655
|
memoized = defineLength(function(arg) {
|
|
9656
9656
|
var id, result, args = arguments;
|
|
9657
|
-
if (
|
|
9658
|
-
args =
|
|
9657
|
+
if (resolve2)
|
|
9658
|
+
args = resolve2(args);
|
|
9659
9659
|
id = get(args);
|
|
9660
9660
|
if (id !== null) {
|
|
9661
9661
|
if (hasOwnProperty.call(cache, id)) {
|
|
@@ -9704,8 +9704,8 @@ var require_configure_map = __commonJS({
|
|
|
9704
9704
|
} else {
|
|
9705
9705
|
memoized = function(arg) {
|
|
9706
9706
|
var result, args = arguments, id;
|
|
9707
|
-
if (
|
|
9708
|
-
args =
|
|
9707
|
+
if (resolve2)
|
|
9708
|
+
args = resolve2(arguments);
|
|
9709
9709
|
id = String(args[0]);
|
|
9710
9710
|
if (hasOwnProperty.call(cache, id)) {
|
|
9711
9711
|
if (getListeners)
|
|
@@ -9730,8 +9730,8 @@ var require_configure_map = __commonJS({
|
|
|
9730
9730
|
memoized,
|
|
9731
9731
|
profileName: options.profileName,
|
|
9732
9732
|
get: function(args) {
|
|
9733
|
-
if (
|
|
9734
|
-
args =
|
|
9733
|
+
if (resolve2)
|
|
9734
|
+
args = resolve2(args);
|
|
9735
9735
|
if (get)
|
|
9736
9736
|
return get(args);
|
|
9737
9737
|
return String(args[0]);
|
|
@@ -9774,8 +9774,8 @@ var require_configure_map = __commonJS({
|
|
|
9774
9774
|
if (get) {
|
|
9775
9775
|
extDel = defineLength(function(arg) {
|
|
9776
9776
|
var id, args = arguments;
|
|
9777
|
-
if (
|
|
9778
|
-
args =
|
|
9777
|
+
if (resolve2)
|
|
9778
|
+
args = resolve2(args);
|
|
9779
9779
|
id = get(args);
|
|
9780
9780
|
if (id === null)
|
|
9781
9781
|
return;
|
|
@@ -9787,8 +9787,8 @@ var require_configure_map = __commonJS({
|
|
|
9787
9787
|
};
|
|
9788
9788
|
} else {
|
|
9789
9789
|
extDel = function(arg) {
|
|
9790
|
-
if (
|
|
9791
|
-
arg =
|
|
9790
|
+
if (resolve2)
|
|
9791
|
+
arg = resolve2(arguments)[0];
|
|
9792
9792
|
return conf.delete(arg);
|
|
9793
9793
|
};
|
|
9794
9794
|
}
|
|
@@ -9796,8 +9796,8 @@ var require_configure_map = __commonJS({
|
|
|
9796
9796
|
var id, args = arguments;
|
|
9797
9797
|
if (length === 0)
|
|
9798
9798
|
return cache.data;
|
|
9799
|
-
if (
|
|
9800
|
-
args =
|
|
9799
|
+
if (resolve2)
|
|
9800
|
+
args = resolve2(args);
|
|
9801
9801
|
if (get)
|
|
9802
9802
|
id = get(args);
|
|
9803
9803
|
else
|
|
@@ -9808,8 +9808,8 @@ var require_configure_map = __commonJS({
|
|
|
9808
9808
|
var id, args = arguments;
|
|
9809
9809
|
if (length === 0)
|
|
9810
9810
|
return conf.has("data");
|
|
9811
|
-
if (
|
|
9812
|
-
args =
|
|
9811
|
+
if (resolve2)
|
|
9812
|
+
args = resolve2(args);
|
|
9813
9813
|
if (get)
|
|
9814
9814
|
id = get(args);
|
|
9815
9815
|
else
|
|
@@ -11719,7 +11719,7 @@ var require_bare = __commonJS({
|
|
|
11719
11719
|
var sgr = require_sgr();
|
|
11720
11720
|
var supportsColor2 = require_supports_color();
|
|
11721
11721
|
var mods = sgr.mods;
|
|
11722
|
-
var
|
|
11722
|
+
var join6 = Array.prototype.join;
|
|
11723
11723
|
var defineProperty = Object.defineProperty;
|
|
11724
11724
|
var max = Math.max;
|
|
11725
11725
|
var min = Math.min;
|
|
@@ -11773,7 +11773,7 @@ var require_bare = __commonJS({
|
|
|
11773
11773
|
getFn = function() {
|
|
11774
11774
|
return setPrototypeOf(
|
|
11775
11775
|
function self2() {
|
|
11776
|
-
var start = "", end = "", msg =
|
|
11776
|
+
var start = "", end = "", msg = join6.call(arguments, " "), conf = self2._cliColorData, hasAnsi = sgr.hasCSI(msg);
|
|
11777
11777
|
forEach(
|
|
11778
11778
|
conf,
|
|
11779
11779
|
function(mod, key) {
|
|
@@ -20902,7 +20902,7 @@ var require_node2 = __commonJS({
|
|
|
20902
20902
|
function _interopRequireDefault(obj) {
|
|
20903
20903
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
20904
20904
|
}
|
|
20905
|
-
function asyncGeneratorStep(gen,
|
|
20905
|
+
function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
|
|
20906
20906
|
try {
|
|
20907
20907
|
var info2 = gen[key](arg);
|
|
20908
20908
|
var value = info2.value;
|
|
@@ -20911,7 +20911,7 @@ var require_node2 = __commonJS({
|
|
|
20911
20911
|
return;
|
|
20912
20912
|
}
|
|
20913
20913
|
if (info2.done) {
|
|
20914
|
-
|
|
20914
|
+
resolve2(value);
|
|
20915
20915
|
} else {
|
|
20916
20916
|
Promise.resolve(value).then(_next, _throw);
|
|
20917
20917
|
}
|
|
@@ -20919,31 +20919,31 @@ var require_node2 = __commonJS({
|
|
|
20919
20919
|
function _asyncToGenerator(fn) {
|
|
20920
20920
|
return function() {
|
|
20921
20921
|
var self2 = this, args = arguments;
|
|
20922
|
-
return new Promise(function(
|
|
20922
|
+
return new Promise(function(resolve2, reject) {
|
|
20923
20923
|
var gen = fn.apply(self2, args);
|
|
20924
20924
|
function _next(value) {
|
|
20925
|
-
asyncGeneratorStep(gen,
|
|
20925
|
+
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
|
|
20926
20926
|
}
|
|
20927
20927
|
function _throw(err2) {
|
|
20928
|
-
asyncGeneratorStep(gen,
|
|
20928
|
+
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err2);
|
|
20929
20929
|
}
|
|
20930
20930
|
_next(void 0);
|
|
20931
20931
|
});
|
|
20932
20932
|
};
|
|
20933
20933
|
}
|
|
20934
|
-
var readFile = (fp) => new Promise((
|
|
20934
|
+
var readFile = (fp) => new Promise((resolve2, reject) => {
|
|
20935
20935
|
_fs.default.readFile(fp, "utf8", (err2, data) => {
|
|
20936
20936
|
if (err2)
|
|
20937
20937
|
return reject(err2);
|
|
20938
|
-
|
|
20938
|
+
resolve2(data);
|
|
20939
20939
|
});
|
|
20940
20940
|
});
|
|
20941
20941
|
var readFileSync4 = (fp) => {
|
|
20942
20942
|
return _fs.default.readFileSync(fp, "utf8");
|
|
20943
20943
|
};
|
|
20944
|
-
var pathExists = (fp) => new Promise((
|
|
20944
|
+
var pathExists = (fp) => new Promise((resolve2) => {
|
|
20945
20945
|
_fs.default.access(fp, (err2) => {
|
|
20946
|
-
|
|
20946
|
+
resolve2(!err2);
|
|
20947
20947
|
});
|
|
20948
20948
|
});
|
|
20949
20949
|
var pathExistsSync = _fs.default.existsSync;
|
|
@@ -23466,7 +23466,7 @@ var require_old = __commonJS({
|
|
|
23466
23466
|
"node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports) {
|
|
23467
23467
|
var pathModule = require("path");
|
|
23468
23468
|
var isWindows = process.platform === "win32";
|
|
23469
|
-
var
|
|
23469
|
+
var fs6 = require("fs");
|
|
23470
23470
|
var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
|
23471
23471
|
function rethrow() {
|
|
23472
23472
|
var callback;
|
|
@@ -23531,7 +23531,7 @@ var require_old = __commonJS({
|
|
|
23531
23531
|
base = m[0];
|
|
23532
23532
|
previous = "";
|
|
23533
23533
|
if (isWindows && !knownHard[base]) {
|
|
23534
|
-
|
|
23534
|
+
fs6.lstatSync(base);
|
|
23535
23535
|
knownHard[base] = true;
|
|
23536
23536
|
}
|
|
23537
23537
|
}
|
|
@@ -23549,7 +23549,7 @@ var require_old = __commonJS({
|
|
|
23549
23549
|
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
23550
23550
|
resolvedLink = cache[base];
|
|
23551
23551
|
} else {
|
|
23552
|
-
var stat =
|
|
23552
|
+
var stat = fs6.lstatSync(base);
|
|
23553
23553
|
if (!stat.isSymbolicLink()) {
|
|
23554
23554
|
knownHard[base] = true;
|
|
23555
23555
|
if (cache)
|
|
@@ -23564,8 +23564,8 @@ var require_old = __commonJS({
|
|
|
23564
23564
|
}
|
|
23565
23565
|
}
|
|
23566
23566
|
if (linkTarget === null) {
|
|
23567
|
-
|
|
23568
|
-
linkTarget =
|
|
23567
|
+
fs6.statSync(base);
|
|
23568
|
+
linkTarget = fs6.readlinkSync(base);
|
|
23569
23569
|
}
|
|
23570
23570
|
resolvedLink = pathModule.resolve(previous, linkTarget);
|
|
23571
23571
|
if (cache)
|
|
@@ -23602,7 +23602,7 @@ var require_old = __commonJS({
|
|
|
23602
23602
|
base = m[0];
|
|
23603
23603
|
previous = "";
|
|
23604
23604
|
if (isWindows && !knownHard[base]) {
|
|
23605
|
-
|
|
23605
|
+
fs6.lstat(base, function(err2) {
|
|
23606
23606
|
if (err2)
|
|
23607
23607
|
return cb(err2);
|
|
23608
23608
|
knownHard[base] = true;
|
|
@@ -23630,7 +23630,7 @@ var require_old = __commonJS({
|
|
|
23630
23630
|
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
23631
23631
|
return gotResolvedLink(cache[base]);
|
|
23632
23632
|
}
|
|
23633
|
-
return
|
|
23633
|
+
return fs6.lstat(base, gotStat);
|
|
23634
23634
|
}
|
|
23635
23635
|
function gotStat(err2, stat) {
|
|
23636
23636
|
if (err2)
|
|
@@ -23647,10 +23647,10 @@ var require_old = __commonJS({
|
|
|
23647
23647
|
return gotTarget(null, seenLinks[id], base);
|
|
23648
23648
|
}
|
|
23649
23649
|
}
|
|
23650
|
-
|
|
23650
|
+
fs6.stat(base, function(err3) {
|
|
23651
23651
|
if (err3)
|
|
23652
23652
|
return cb(err3);
|
|
23653
|
-
|
|
23653
|
+
fs6.readlink(base, function(err4, target) {
|
|
23654
23654
|
if (!isWindows)
|
|
23655
23655
|
seenLinks[id] = target;
|
|
23656
23656
|
gotTarget(err4, target);
|
|
@@ -23682,9 +23682,9 @@ var require_fs = __commonJS({
|
|
|
23682
23682
|
realpath.realpathSync = realpathSync;
|
|
23683
23683
|
realpath.monkeypatch = monkeypatch;
|
|
23684
23684
|
realpath.unmonkeypatch = unmonkeypatch;
|
|
23685
|
-
var
|
|
23686
|
-
var origRealpath =
|
|
23687
|
-
var origRealpathSync =
|
|
23685
|
+
var fs6 = require("fs");
|
|
23686
|
+
var origRealpath = fs6.realpath;
|
|
23687
|
+
var origRealpathSync = fs6.realpathSync;
|
|
23688
23688
|
var version = process.version;
|
|
23689
23689
|
var ok = /^v[0-5]\./.test(version);
|
|
23690
23690
|
var old = require_old();
|
|
@@ -23722,12 +23722,12 @@ var require_fs = __commonJS({
|
|
|
23722
23722
|
}
|
|
23723
23723
|
}
|
|
23724
23724
|
function monkeypatch() {
|
|
23725
|
-
|
|
23726
|
-
|
|
23725
|
+
fs6.realpath = realpath;
|
|
23726
|
+
fs6.realpathSync = realpathSync;
|
|
23727
23727
|
}
|
|
23728
23728
|
function unmonkeypatch() {
|
|
23729
|
-
|
|
23730
|
-
|
|
23729
|
+
fs6.realpath = origRealpath;
|
|
23730
|
+
fs6.realpathSync = origRealpathSync;
|
|
23731
23731
|
}
|
|
23732
23732
|
}
|
|
23733
23733
|
});
|
|
@@ -24577,7 +24577,7 @@ var require_common2 = __commonJS({
|
|
|
24577
24577
|
function ownProp(obj, field) {
|
|
24578
24578
|
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
24579
24579
|
}
|
|
24580
|
-
var
|
|
24580
|
+
var fs6 = require("fs");
|
|
24581
24581
|
var path3 = require("path");
|
|
24582
24582
|
var minimatch2 = require_minimatch();
|
|
24583
24583
|
var isAbsolute = require("path").isAbsolute;
|
|
@@ -24636,7 +24636,7 @@ var require_common2 = __commonJS({
|
|
|
24636
24636
|
self2.stat = !!options.stat;
|
|
24637
24637
|
self2.noprocess = !!options.noprocess;
|
|
24638
24638
|
self2.absolute = !!options.absolute;
|
|
24639
|
-
self2.fs = options.fs ||
|
|
24639
|
+
self2.fs = options.fs || fs6;
|
|
24640
24640
|
self2.maxLength = options.maxLength || Infinity;
|
|
24641
24641
|
self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
|
|
24642
24642
|
self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
|
|
@@ -42014,7 +42014,7 @@ var require_named_placeholders = __commonJS({
|
|
|
42014
42014
|
}
|
|
42015
42015
|
return s;
|
|
42016
42016
|
}
|
|
42017
|
-
function
|
|
42017
|
+
function join6(tree) {
|
|
42018
42018
|
if (tree.length == 1) {
|
|
42019
42019
|
return tree;
|
|
42020
42020
|
}
|
|
@@ -42040,7 +42040,7 @@ var require_named_placeholders = __commonJS({
|
|
|
42040
42040
|
if (cache && (tree = cache.get(query))) {
|
|
42041
42041
|
return toArrayParams(tree, paramsObj);
|
|
42042
42042
|
}
|
|
42043
|
-
tree =
|
|
42043
|
+
tree = join6(parse(query));
|
|
42044
42044
|
if (cache) {
|
|
42045
42045
|
cache.set(query, tree);
|
|
42046
42046
|
}
|
|
@@ -43460,7 +43460,7 @@ var require_promise2 = __commonJS({
|
|
|
43460
43460
|
"use strict";
|
|
43461
43461
|
var core = require_mysql2();
|
|
43462
43462
|
var EventEmitter = require("events").EventEmitter;
|
|
43463
|
-
function makeDoneCb(
|
|
43463
|
+
function makeDoneCb(resolve2, reject, localErr) {
|
|
43464
43464
|
return function(err2, rows, fields) {
|
|
43465
43465
|
if (err2) {
|
|
43466
43466
|
localErr.message = err2.message;
|
|
@@ -43471,7 +43471,7 @@ var require_promise2 = __commonJS({
|
|
|
43471
43471
|
localErr.sqlMessage = err2.sqlMessage;
|
|
43472
43472
|
reject(localErr);
|
|
43473
43473
|
} else {
|
|
43474
|
-
|
|
43474
|
+
resolve2([rows, fields]);
|
|
43475
43475
|
}
|
|
43476
43476
|
};
|
|
43477
43477
|
}
|
|
@@ -43503,8 +43503,8 @@ var require_promise2 = __commonJS({
|
|
|
43503
43503
|
execute(parameters) {
|
|
43504
43504
|
const s = this.statement;
|
|
43505
43505
|
const localErr = new Error();
|
|
43506
|
-
return new this.Promise((
|
|
43507
|
-
const done = makeDoneCb(
|
|
43506
|
+
return new this.Promise((resolve2, reject) => {
|
|
43507
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43508
43508
|
if (parameters) {
|
|
43509
43509
|
s.execute(parameters, done);
|
|
43510
43510
|
} else {
|
|
@@ -43513,9 +43513,9 @@ var require_promise2 = __commonJS({
|
|
|
43513
43513
|
});
|
|
43514
43514
|
}
|
|
43515
43515
|
close() {
|
|
43516
|
-
return new this.Promise((
|
|
43516
|
+
return new this.Promise((resolve2) => {
|
|
43517
43517
|
this.statement.close();
|
|
43518
|
-
|
|
43518
|
+
resolve2();
|
|
43519
43519
|
});
|
|
43520
43520
|
}
|
|
43521
43521
|
};
|
|
@@ -43543,8 +43543,8 @@ var require_promise2 = __commonJS({
|
|
|
43543
43543
|
"Callback function is not available with promise clients."
|
|
43544
43544
|
);
|
|
43545
43545
|
}
|
|
43546
|
-
return new this.Promise((
|
|
43547
|
-
const done = makeDoneCb(
|
|
43546
|
+
return new this.Promise((resolve2, reject) => {
|
|
43547
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43548
43548
|
if (params !== void 0) {
|
|
43549
43549
|
c.query(query, params, done);
|
|
43550
43550
|
} else {
|
|
@@ -43560,8 +43560,8 @@ var require_promise2 = __commonJS({
|
|
|
43560
43560
|
"Callback function is not available with promise clients."
|
|
43561
43561
|
);
|
|
43562
43562
|
}
|
|
43563
|
-
return new this.Promise((
|
|
43564
|
-
const done = makeDoneCb(
|
|
43563
|
+
return new this.Promise((resolve2, reject) => {
|
|
43564
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43565
43565
|
if (params !== void 0) {
|
|
43566
43566
|
c.execute(query, params, done);
|
|
43567
43567
|
} else {
|
|
@@ -43570,46 +43570,46 @@ var require_promise2 = __commonJS({
|
|
|
43570
43570
|
});
|
|
43571
43571
|
}
|
|
43572
43572
|
end() {
|
|
43573
|
-
return new this.Promise((
|
|
43574
|
-
this.connection.end(
|
|
43573
|
+
return new this.Promise((resolve2) => {
|
|
43574
|
+
this.connection.end(resolve2);
|
|
43575
43575
|
});
|
|
43576
43576
|
}
|
|
43577
43577
|
beginTransaction() {
|
|
43578
43578
|
const c = this.connection;
|
|
43579
43579
|
const localErr = new Error();
|
|
43580
|
-
return new this.Promise((
|
|
43581
|
-
const done = makeDoneCb(
|
|
43580
|
+
return new this.Promise((resolve2, reject) => {
|
|
43581
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43582
43582
|
c.beginTransaction(done);
|
|
43583
43583
|
});
|
|
43584
43584
|
}
|
|
43585
43585
|
commit() {
|
|
43586
43586
|
const c = this.connection;
|
|
43587
43587
|
const localErr = new Error();
|
|
43588
|
-
return new this.Promise((
|
|
43589
|
-
const done = makeDoneCb(
|
|
43588
|
+
return new this.Promise((resolve2, reject) => {
|
|
43589
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43590
43590
|
c.commit(done);
|
|
43591
43591
|
});
|
|
43592
43592
|
}
|
|
43593
43593
|
rollback() {
|
|
43594
43594
|
const c = this.connection;
|
|
43595
43595
|
const localErr = new Error();
|
|
43596
|
-
return new this.Promise((
|
|
43597
|
-
const done = makeDoneCb(
|
|
43596
|
+
return new this.Promise((resolve2, reject) => {
|
|
43597
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43598
43598
|
c.rollback(done);
|
|
43599
43599
|
});
|
|
43600
43600
|
}
|
|
43601
43601
|
ping() {
|
|
43602
43602
|
const c = this.connection;
|
|
43603
43603
|
const localErr = new Error();
|
|
43604
|
-
return new this.Promise((
|
|
43605
|
-
const done = makeDoneCb(
|
|
43604
|
+
return new this.Promise((resolve2, reject) => {
|
|
43605
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43606
43606
|
c.ping(done);
|
|
43607
43607
|
});
|
|
43608
43608
|
}
|
|
43609
43609
|
connect() {
|
|
43610
43610
|
const c = this.connection;
|
|
43611
43611
|
const localErr = new Error();
|
|
43612
|
-
return new this.Promise((
|
|
43612
|
+
return new this.Promise((resolve2, reject) => {
|
|
43613
43613
|
c.connect((err2, param) => {
|
|
43614
43614
|
if (err2) {
|
|
43615
43615
|
localErr.message = err2.message;
|
|
@@ -43619,7 +43619,7 @@ var require_promise2 = __commonJS({
|
|
|
43619
43619
|
localErr.sqlMessage = err2.sqlMessage;
|
|
43620
43620
|
reject(localErr);
|
|
43621
43621
|
} else {
|
|
43622
|
-
|
|
43622
|
+
resolve2(param);
|
|
43623
43623
|
}
|
|
43624
43624
|
});
|
|
43625
43625
|
});
|
|
@@ -43628,7 +43628,7 @@ var require_promise2 = __commonJS({
|
|
|
43628
43628
|
const c = this.connection;
|
|
43629
43629
|
const promiseImpl = this.Promise;
|
|
43630
43630
|
const localErr = new Error();
|
|
43631
|
-
return new this.Promise((
|
|
43631
|
+
return new this.Promise((resolve2, reject) => {
|
|
43632
43632
|
c.prepare(options, (err2, statement) => {
|
|
43633
43633
|
if (err2) {
|
|
43634
43634
|
localErr.message = err2.message;
|
|
@@ -43642,7 +43642,7 @@ var require_promise2 = __commonJS({
|
|
|
43642
43642
|
statement,
|
|
43643
43643
|
promiseImpl
|
|
43644
43644
|
);
|
|
43645
|
-
|
|
43645
|
+
resolve2(wrappedStatement);
|
|
43646
43646
|
}
|
|
43647
43647
|
});
|
|
43648
43648
|
});
|
|
@@ -43650,7 +43650,7 @@ var require_promise2 = __commonJS({
|
|
|
43650
43650
|
changeUser(options) {
|
|
43651
43651
|
const c = this.connection;
|
|
43652
43652
|
const localErr = new Error();
|
|
43653
|
-
return new this.Promise((
|
|
43653
|
+
return new this.Promise((resolve2, reject) => {
|
|
43654
43654
|
c.changeUser(options, (err2) => {
|
|
43655
43655
|
if (err2) {
|
|
43656
43656
|
localErr.message = err2.message;
|
|
@@ -43660,7 +43660,7 @@ var require_promise2 = __commonJS({
|
|
|
43660
43660
|
localErr.sqlMessage = err2.sqlMessage;
|
|
43661
43661
|
reject(localErr);
|
|
43662
43662
|
} else {
|
|
43663
|
-
|
|
43663
|
+
resolve2();
|
|
43664
43664
|
}
|
|
43665
43665
|
});
|
|
43666
43666
|
});
|
|
@@ -43681,9 +43681,9 @@ var require_promise2 = __commonJS({
|
|
|
43681
43681
|
"no Promise implementation available.Use promise-enabled node version or pass userland Promise implementation as parameter, for example: { Promise: require('bluebird') }"
|
|
43682
43682
|
);
|
|
43683
43683
|
}
|
|
43684
|
-
return new thePromise((
|
|
43684
|
+
return new thePromise((resolve2, reject) => {
|
|
43685
43685
|
coreConnection.once("connect", () => {
|
|
43686
|
-
|
|
43686
|
+
resolve2(new PromiseConnection(coreConnection, thePromise));
|
|
43687
43687
|
});
|
|
43688
43688
|
coreConnection.once("error", (err2) => {
|
|
43689
43689
|
createConnectionErr.message = err2.message;
|
|
@@ -43740,12 +43740,12 @@ var require_promise2 = __commonJS({
|
|
|
43740
43740
|
}
|
|
43741
43741
|
getConnection() {
|
|
43742
43742
|
const corePool = this.pool;
|
|
43743
|
-
return new this.Promise((
|
|
43743
|
+
return new this.Promise((resolve2, reject) => {
|
|
43744
43744
|
corePool.getConnection((err2, coreConnection) => {
|
|
43745
43745
|
if (err2) {
|
|
43746
43746
|
reject(err2);
|
|
43747
43747
|
} else {
|
|
43748
|
-
|
|
43748
|
+
resolve2(new PromisePoolConnection(coreConnection, this.Promise));
|
|
43749
43749
|
}
|
|
43750
43750
|
});
|
|
43751
43751
|
});
|
|
@@ -43758,8 +43758,8 @@ var require_promise2 = __commonJS({
|
|
|
43758
43758
|
"Callback function is not available with promise clients."
|
|
43759
43759
|
);
|
|
43760
43760
|
}
|
|
43761
|
-
return new this.Promise((
|
|
43762
|
-
const done = makeDoneCb(
|
|
43761
|
+
return new this.Promise((resolve2, reject) => {
|
|
43762
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43763
43763
|
if (args !== void 0) {
|
|
43764
43764
|
corePool.query(sql, args, done);
|
|
43765
43765
|
} else {
|
|
@@ -43775,8 +43775,8 @@ var require_promise2 = __commonJS({
|
|
|
43775
43775
|
"Callback function is not available with promise clients."
|
|
43776
43776
|
);
|
|
43777
43777
|
}
|
|
43778
|
-
return new this.Promise((
|
|
43779
|
-
const done = makeDoneCb(
|
|
43778
|
+
return new this.Promise((resolve2, reject) => {
|
|
43779
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43780
43780
|
if (args) {
|
|
43781
43781
|
corePool.execute(sql, args, done);
|
|
43782
43782
|
} else {
|
|
@@ -43787,7 +43787,7 @@ var require_promise2 = __commonJS({
|
|
|
43787
43787
|
end() {
|
|
43788
43788
|
const corePool = this.pool;
|
|
43789
43789
|
const localErr = new Error();
|
|
43790
|
-
return new this.Promise((
|
|
43790
|
+
return new this.Promise((resolve2, reject) => {
|
|
43791
43791
|
corePool.end((err2) => {
|
|
43792
43792
|
if (err2) {
|
|
43793
43793
|
localErr.message = err2.message;
|
|
@@ -43797,7 +43797,7 @@ var require_promise2 = __commonJS({
|
|
|
43797
43797
|
localErr.sqlMessage = err2.sqlMessage;
|
|
43798
43798
|
reject(localErr);
|
|
43799
43799
|
} else {
|
|
43800
|
-
|
|
43800
|
+
resolve2();
|
|
43801
43801
|
}
|
|
43802
43802
|
});
|
|
43803
43803
|
});
|
|
@@ -43838,12 +43838,12 @@ var require_promise2 = __commonJS({
|
|
|
43838
43838
|
}
|
|
43839
43839
|
getConnection() {
|
|
43840
43840
|
const corePoolCluster = this.poolCluster;
|
|
43841
|
-
return new this.Promise((
|
|
43841
|
+
return new this.Promise((resolve2, reject) => {
|
|
43842
43842
|
corePoolCluster.getConnection((err2, coreConnection) => {
|
|
43843
43843
|
if (err2) {
|
|
43844
43844
|
reject(err2);
|
|
43845
43845
|
} else {
|
|
43846
|
-
|
|
43846
|
+
resolve2(new PromisePoolConnection(coreConnection, this.Promise));
|
|
43847
43847
|
}
|
|
43848
43848
|
});
|
|
43849
43849
|
});
|
|
@@ -43856,8 +43856,8 @@ var require_promise2 = __commonJS({
|
|
|
43856
43856
|
"Callback function is not available with promise clients."
|
|
43857
43857
|
);
|
|
43858
43858
|
}
|
|
43859
|
-
return new this.Promise((
|
|
43860
|
-
const done = makeDoneCb(
|
|
43859
|
+
return new this.Promise((resolve2, reject) => {
|
|
43860
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43861
43861
|
corePoolCluster.query(sql, args, done);
|
|
43862
43862
|
});
|
|
43863
43863
|
}
|
|
@@ -43869,8 +43869,8 @@ var require_promise2 = __commonJS({
|
|
|
43869
43869
|
"Callback function is not available with promise clients."
|
|
43870
43870
|
);
|
|
43871
43871
|
}
|
|
43872
|
-
return new this.Promise((
|
|
43873
|
-
const done = makeDoneCb(
|
|
43872
|
+
return new this.Promise((resolve2, reject) => {
|
|
43873
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
43874
43874
|
corePoolCluster.execute(sql, args, done);
|
|
43875
43875
|
});
|
|
43876
43876
|
}
|
|
@@ -43883,7 +43883,7 @@ var require_promise2 = __commonJS({
|
|
|
43883
43883
|
end() {
|
|
43884
43884
|
const corePoolCluster = this.poolCluster;
|
|
43885
43885
|
const localErr = new Error();
|
|
43886
|
-
return new this.Promise((
|
|
43886
|
+
return new this.Promise((resolve2, reject) => {
|
|
43887
43887
|
corePoolCluster.end((err2) => {
|
|
43888
43888
|
if (err2) {
|
|
43889
43889
|
localErr.message = err2.message;
|
|
@@ -43893,7 +43893,7 @@ var require_promise2 = __commonJS({
|
|
|
43893
43893
|
localErr.sqlMessage = err2.sqlMessage;
|
|
43894
43894
|
reject(localErr);
|
|
43895
43895
|
} else {
|
|
43896
|
-
|
|
43896
|
+
resolve2();
|
|
43897
43897
|
}
|
|
43898
43898
|
});
|
|
43899
43899
|
});
|
|
@@ -45435,80 +45435,36 @@ var init_mjs = __esm({
|
|
|
45435
45435
|
// src/cli/commands/mysqlIntrospect.ts
|
|
45436
45436
|
var mysqlIntrospect_exports = {};
|
|
45437
45437
|
__export(mysqlIntrospect_exports, {
|
|
45438
|
-
MySQLConfig1: () => MySQLConfig1,
|
|
45439
|
-
MySQLConfig2: () => MySQLConfig2,
|
|
45440
|
-
configIntrospectSchema: () => configIntrospectSchema,
|
|
45441
|
-
configPushSchema: () => configPushSchema,
|
|
45442
45438
|
connectToMySQL: () => connectToMySQL,
|
|
45443
45439
|
mysqlIntrospect: () => mysqlIntrospect,
|
|
45444
45440
|
mysqlPushIntrospect: () => mysqlPushIntrospect
|
|
45445
45441
|
});
|
|
45446
|
-
var import_hanji4, import_promise,
|
|
45442
|
+
var import_hanji4, import_promise, connectToMySQL, mysqlIntrospect, mysqlPushIntrospect;
|
|
45447
45443
|
var init_mysqlIntrospect = __esm({
|
|
45448
45444
|
"src/cli/commands/mysqlIntrospect.ts"() {
|
|
45449
45445
|
import_hanji4 = __toESM(require_hanji());
|
|
45450
|
-
init_lib();
|
|
45451
45446
|
init_views();
|
|
45452
45447
|
import_promise = __toESM(require_promise2());
|
|
45453
45448
|
init_mysqlSerializer();
|
|
45454
45449
|
init_mysql_introspect();
|
|
45455
45450
|
init_global();
|
|
45456
45451
|
init_mjs();
|
|
45457
|
-
MySQLConfig1 = objectType({
|
|
45458
|
-
host: stringType(),
|
|
45459
|
-
port: coerce.number().optional(),
|
|
45460
|
-
user: stringType().default("mysql"),
|
|
45461
|
-
password: stringType().optional(),
|
|
45462
|
-
database: stringType()
|
|
45463
|
-
}).strict();
|
|
45464
|
-
MySQLConfig2 = objectType({
|
|
45465
|
-
connectionString: stringType()
|
|
45466
|
-
}).strict();
|
|
45467
|
-
Conf = unionType([MySQLConfig1, MySQLConfig2]);
|
|
45468
|
-
configPushSchema = unionType([
|
|
45469
|
-
objectType({
|
|
45470
|
-
host: stringType(),
|
|
45471
|
-
port: coerce.number().optional(),
|
|
45472
|
-
user: stringType().default("mysql"),
|
|
45473
|
-
password: stringType().optional(),
|
|
45474
|
-
database: stringType(),
|
|
45475
|
-
schema: unionType([stringType(), stringType().array()]),
|
|
45476
|
-
tablesFilter: unionType([stringType(), stringType().array()]).optional()
|
|
45477
|
-
}),
|
|
45478
|
-
objectType({
|
|
45479
|
-
connectionString: stringType(),
|
|
45480
|
-
schema: unionType([stringType(), stringType().array()]),
|
|
45481
|
-
tablesFilter: unionType([stringType(), stringType().array()]).optional()
|
|
45482
|
-
})
|
|
45483
|
-
]);
|
|
45484
|
-
configIntrospectSchema = unionType([
|
|
45485
|
-
objectType({
|
|
45486
|
-
host: stringType(),
|
|
45487
|
-
port: coerce.number().optional(),
|
|
45488
|
-
user: stringType().default("mysql"),
|
|
45489
|
-
password: stringType().optional(),
|
|
45490
|
-
database: stringType(),
|
|
45491
|
-
out: stringType(),
|
|
45492
|
-
breakpoints: booleanType().optional().default(false)
|
|
45493
|
-
}),
|
|
45494
|
-
objectType({
|
|
45495
|
-
connectionString: stringType(),
|
|
45496
|
-
out: stringType(),
|
|
45497
|
-
breakpoints: booleanType().optional().default(false)
|
|
45498
|
-
})
|
|
45499
|
-
]);
|
|
45500
45452
|
connectToMySQL = async (config) => {
|
|
45501
45453
|
let client;
|
|
45502
45454
|
let databaseName;
|
|
45503
|
-
if (
|
|
45455
|
+
if ("connectionString" in config) {
|
|
45504
45456
|
const connection = config.connectionString;
|
|
45505
45457
|
client = await (0, import_promise.createConnection)(connection);
|
|
45506
45458
|
const connectionUrl = new URL(connection);
|
|
45507
45459
|
const pathname = connectionUrl.pathname;
|
|
45508
45460
|
databaseName = pathname.split("/")[pathname.split("/").length - 1];
|
|
45509
|
-
} else {
|
|
45461
|
+
} else if ("host" in config) {
|
|
45510
45462
|
client = await (0, import_promise.createConnection)(config);
|
|
45511
45463
|
databaseName = config.database;
|
|
45464
|
+
} else {
|
|
45465
|
+
throw Error(
|
|
45466
|
+
"Either `connectionString` of `host, port, etc.` params be provided in config file"
|
|
45467
|
+
);
|
|
45512
45468
|
}
|
|
45513
45469
|
await client.connect();
|
|
45514
45470
|
return { client, databaseName };
|
|
@@ -47106,15 +47062,15 @@ var require_lib3 = __commonJS({
|
|
|
47106
47062
|
"node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
|
|
47107
47063
|
"use strict";
|
|
47108
47064
|
var path3 = require("path");
|
|
47109
|
-
var
|
|
47065
|
+
var fs6 = require("fs");
|
|
47110
47066
|
var helper = require_helper();
|
|
47111
47067
|
module2.exports = function(connInfo, cb) {
|
|
47112
47068
|
var file = helper.getFileName();
|
|
47113
|
-
|
|
47069
|
+
fs6.stat(file, function(err2, stat) {
|
|
47114
47070
|
if (err2 || !helper.usePgPass(stat, file)) {
|
|
47115
47071
|
return cb(void 0);
|
|
47116
47072
|
}
|
|
47117
|
-
var st =
|
|
47073
|
+
var st = fs6.createReadStream(file);
|
|
47118
47074
|
helper.getPassword(connInfo, st, cb);
|
|
47119
47075
|
});
|
|
47120
47076
|
};
|
|
@@ -47162,7 +47118,7 @@ var require_pg_connection_string = __commonJS({
|
|
|
47162
47118
|
"node_modules/.pnpm/pg-connection-string@2.5.0/node_modules/pg-connection-string/index.js"(exports, module2) {
|
|
47163
47119
|
"use strict";
|
|
47164
47120
|
var url = require("url");
|
|
47165
|
-
var
|
|
47121
|
+
var fs6 = require("fs");
|
|
47166
47122
|
function parse(str) {
|
|
47167
47123
|
if (str.charAt(0) === "/") {
|
|
47168
47124
|
var config = str.split(" ");
|
|
@@ -47211,13 +47167,13 @@ var require_pg_connection_string = __commonJS({
|
|
|
47211
47167
|
config.ssl = {};
|
|
47212
47168
|
}
|
|
47213
47169
|
if (config.sslcert) {
|
|
47214
|
-
config.ssl.cert =
|
|
47170
|
+
config.ssl.cert = fs6.readFileSync(config.sslcert).toString();
|
|
47215
47171
|
}
|
|
47216
47172
|
if (config.sslkey) {
|
|
47217
|
-
config.ssl.key =
|
|
47173
|
+
config.ssl.key = fs6.readFileSync(config.sslkey).toString();
|
|
47218
47174
|
}
|
|
47219
47175
|
if (config.sslrootcert) {
|
|
47220
|
-
config.ssl.ca =
|
|
47176
|
+
config.ssl.ca = fs6.readFileSync(config.sslrootcert).toString();
|
|
47221
47177
|
}
|
|
47222
47178
|
switch (config.sslmode) {
|
|
47223
47179
|
case "disable": {
|
|
@@ -48428,7 +48384,7 @@ var require_dist = __commonJS({
|
|
|
48428
48384
|
function parse(stream, callback) {
|
|
48429
48385
|
const parser = new parser_1.Parser();
|
|
48430
48386
|
stream.on("data", (buffer) => parser.parse(buffer, callback));
|
|
48431
|
-
return new Promise((
|
|
48387
|
+
return new Promise((resolve2) => stream.on("end", () => resolve2()));
|
|
48432
48388
|
}
|
|
48433
48389
|
exports.parse = parse;
|
|
48434
48390
|
}
|
|
@@ -48746,12 +48702,12 @@ var require_client2 = __commonJS({
|
|
|
48746
48702
|
this._connect(callback);
|
|
48747
48703
|
return;
|
|
48748
48704
|
}
|
|
48749
|
-
return new this._Promise((
|
|
48705
|
+
return new this._Promise((resolve2, reject) => {
|
|
48750
48706
|
this._connect((error2) => {
|
|
48751
48707
|
if (error2) {
|
|
48752
48708
|
reject(error2);
|
|
48753
48709
|
} else {
|
|
48754
|
-
|
|
48710
|
+
resolve2();
|
|
48755
48711
|
}
|
|
48756
48712
|
});
|
|
48757
48713
|
});
|
|
@@ -49037,8 +48993,8 @@ var require_client2 = __commonJS({
|
|
|
49037
48993
|
readTimeout = this.connectionParameters.query_timeout;
|
|
49038
48994
|
query = new Query(config, values, callback);
|
|
49039
48995
|
if (!query.callback) {
|
|
49040
|
-
result = new this._Promise((
|
|
49041
|
-
query.callback = (err2, res) => err2 ? reject(err2) :
|
|
48996
|
+
result = new this._Promise((resolve2, reject) => {
|
|
48997
|
+
query.callback = (err2, res) => err2 ? reject(err2) : resolve2(res);
|
|
49042
48998
|
});
|
|
49043
48999
|
}
|
|
49044
49000
|
}
|
|
@@ -49108,8 +49064,8 @@ var require_client2 = __commonJS({
|
|
|
49108
49064
|
if (cb) {
|
|
49109
49065
|
this.connection.once("end", cb);
|
|
49110
49066
|
} else {
|
|
49111
|
-
return new this._Promise((
|
|
49112
|
-
this.connection.once("end",
|
|
49067
|
+
return new this._Promise((resolve2) => {
|
|
49068
|
+
this.connection.once("end", resolve2);
|
|
49113
49069
|
});
|
|
49114
49070
|
}
|
|
49115
49071
|
}
|
|
@@ -49154,8 +49110,8 @@ var require_pg_pool = __commonJS({
|
|
|
49154
49110
|
const cb = function(err2, client) {
|
|
49155
49111
|
err2 ? rej(err2) : res(client);
|
|
49156
49112
|
};
|
|
49157
|
-
const result = new Promise2(function(
|
|
49158
|
-
res =
|
|
49113
|
+
const result = new Promise2(function(resolve2, reject) {
|
|
49114
|
+
res = resolve2;
|
|
49159
49115
|
rej = reject;
|
|
49160
49116
|
});
|
|
49161
49117
|
return { callback: cb, result };
|
|
@@ -49559,8 +49515,8 @@ var require_query4 = __commonJS({
|
|
|
49559
49515
|
if (this._promise)
|
|
49560
49516
|
return this._promise;
|
|
49561
49517
|
this._promise = new Promise(
|
|
49562
|
-
function(
|
|
49563
|
-
this._once("end",
|
|
49518
|
+
function(resolve2, reject) {
|
|
49519
|
+
this._once("end", resolve2);
|
|
49564
49520
|
this._once("error", reject);
|
|
49565
49521
|
}.bind(this)
|
|
49566
49522
|
);
|
|
@@ -49725,12 +49681,12 @@ var require_client3 = __commonJS({
|
|
|
49725
49681
|
this._connect(callback);
|
|
49726
49682
|
return;
|
|
49727
49683
|
}
|
|
49728
|
-
return new this._Promise((
|
|
49684
|
+
return new this._Promise((resolve2, reject) => {
|
|
49729
49685
|
this._connect((error2) => {
|
|
49730
49686
|
if (error2) {
|
|
49731
49687
|
reject(error2);
|
|
49732
49688
|
} else {
|
|
49733
|
-
|
|
49689
|
+
resolve2();
|
|
49734
49690
|
}
|
|
49735
49691
|
});
|
|
49736
49692
|
});
|
|
@@ -49754,8 +49710,8 @@ var require_client3 = __commonJS({
|
|
|
49754
49710
|
query = new NativeQuery(config, values, callback);
|
|
49755
49711
|
if (!query.callback) {
|
|
49756
49712
|
let resolveOut, rejectOut;
|
|
49757
|
-
result = new this._Promise((
|
|
49758
|
-
resolveOut =
|
|
49713
|
+
result = new this._Promise((resolve2, reject) => {
|
|
49714
|
+
resolveOut = resolve2;
|
|
49759
49715
|
rejectOut = reject;
|
|
49760
49716
|
});
|
|
49761
49717
|
query.callback = (err2, res) => err2 ? rejectOut(err2) : resolveOut(res);
|
|
@@ -49808,8 +49764,8 @@ var require_client3 = __commonJS({
|
|
|
49808
49764
|
}
|
|
49809
49765
|
var result;
|
|
49810
49766
|
if (!cb) {
|
|
49811
|
-
result = new this._Promise(function(
|
|
49812
|
-
cb = (err2) => err2 ? reject(err2) :
|
|
49767
|
+
result = new this._Promise(function(resolve2, reject) {
|
|
49768
|
+
cb = (err2) => err2 ? reject(err2) : resolve2();
|
|
49813
49769
|
});
|
|
49814
49770
|
}
|
|
49815
49771
|
this.native.end(function() {
|
|
@@ -50428,7 +50384,7 @@ __export(pgIntrospect_exports, {
|
|
|
50428
50384
|
PgConfig2: () => PgConfig2,
|
|
50429
50385
|
pgIntrospect: () => pgIntrospect
|
|
50430
50386
|
});
|
|
50431
|
-
var import_hanji5, import_pg, PgConfig1, PgConfig2,
|
|
50387
|
+
var import_hanji5, import_pg, PgConfig1, PgConfig2, Conf, pgIntrospect;
|
|
50432
50388
|
var init_pgIntrospect = __esm({
|
|
50433
50389
|
"src/cli/commands/pgIntrospect.ts"() {
|
|
50434
50390
|
import_hanji5 = __toESM(require_hanji());
|
|
@@ -50449,7 +50405,7 @@ var init_pgIntrospect = __esm({
|
|
|
50449
50405
|
PgConfig2 = objectType({
|
|
50450
50406
|
connectionString: stringType()
|
|
50451
50407
|
}).strict();
|
|
50452
|
-
|
|
50408
|
+
Conf = unionType([PgConfig1, PgConfig2]);
|
|
50453
50409
|
pgIntrospect = async (config) => {
|
|
50454
50410
|
const pool = new import_pg.Pool(config);
|
|
50455
50411
|
const progress = new IntrospectProgress();
|
|
@@ -50469,8 +50425,7 @@ var init_pgIntrospect = __esm({
|
|
|
50469
50425
|
// src/cli/index.ts
|
|
50470
50426
|
var cli_exports = {};
|
|
50471
50427
|
__export(cli_exports, {
|
|
50472
|
-
checkSchema: () => checkSchema
|
|
50473
|
-
configSchema: () => configSchema
|
|
50428
|
+
checkSchema: () => checkSchema
|
|
50474
50429
|
});
|
|
50475
50430
|
module.exports = __toCommonJS(cli_exports);
|
|
50476
50431
|
|
|
@@ -50491,7 +50446,7 @@ var {
|
|
|
50491
50446
|
} = import_index.default;
|
|
50492
50447
|
|
|
50493
50448
|
// src/cli/index.ts
|
|
50494
|
-
var
|
|
50449
|
+
var import_fs11 = require("fs");
|
|
50495
50450
|
init_lib();
|
|
50496
50451
|
|
|
50497
50452
|
// src/cli/commands/check.ts
|
|
@@ -50533,8 +50488,7 @@ var checkHandler = (out, dialect6) => {
|
|
|
50533
50488
|
|
|
50534
50489
|
// src/cli/index.ts
|
|
50535
50490
|
var import_hanji6 = __toESM(require_hanji());
|
|
50536
|
-
|
|
50537
|
-
var import_path6 = __toESM(require("path"));
|
|
50491
|
+
var import_path7 = __toESM(require("path"));
|
|
50538
50492
|
|
|
50539
50493
|
// src/cli/utils.ts
|
|
50540
50494
|
init_views();
|
|
@@ -50652,7 +50606,7 @@ var package_default = {
|
|
|
50652
50606
|
dockerode: "^3.3.4",
|
|
50653
50607
|
dotenv: "^16.0.3",
|
|
50654
50608
|
"drizzle-kit": "^0.16.8",
|
|
50655
|
-
"drizzle-orm": "0.23.2
|
|
50609
|
+
"drizzle-orm": "0.23.2",
|
|
50656
50610
|
esbuild: "^0.15.7",
|
|
50657
50611
|
"esbuild-register": "^3.3.3",
|
|
50658
50612
|
eslint: "^8.29.0",
|
|
@@ -50751,24 +50705,107 @@ var dropMigration = async (out) => {
|
|
|
50751
50705
|
console.log(`[${source_default.green("\u2713")}] ${source_default.bold(result.data.tag)} migration successfully dropped`);
|
|
50752
50706
|
};
|
|
50753
50707
|
|
|
50708
|
+
// src/cli/commands/utils.ts
|
|
50709
|
+
init_serializer();
|
|
50710
|
+
init_lib();
|
|
50711
|
+
var import_path6 = require("path");
|
|
50712
|
+
init_source();
|
|
50713
|
+
var import_fs10 = require("fs");
|
|
50714
|
+
init_views();
|
|
50715
|
+
var prepareGenerateConfig = (options) => {
|
|
50716
|
+
var _a;
|
|
50717
|
+
const { schema: schema4, out, config, breakpoints, custom } = options;
|
|
50718
|
+
if (!(schema4 || out)) {
|
|
50719
|
+
const drizzleConfig = drizzleConfigFromFile(config);
|
|
50720
|
+
if (!drizzleConfig.out) {
|
|
50721
|
+
console.log("You must specify 'out' param in config file");
|
|
50722
|
+
process.exit(1);
|
|
50723
|
+
}
|
|
50724
|
+
return {
|
|
50725
|
+
custom,
|
|
50726
|
+
breakpoints: (_a = drizzleConfig.breakpoints) != null ? _a : false,
|
|
50727
|
+
schema: drizzleConfig.schema,
|
|
50728
|
+
out: drizzleConfig.out
|
|
50729
|
+
};
|
|
50730
|
+
}
|
|
50731
|
+
if (!schema4) {
|
|
50732
|
+
console.error(`'schema' param must be set`);
|
|
50733
|
+
process.exit(1);
|
|
50734
|
+
}
|
|
50735
|
+
if (!out) {
|
|
50736
|
+
console.error(`'out' param must be set`);
|
|
50737
|
+
process.exit(1);
|
|
50738
|
+
}
|
|
50739
|
+
return { schema: schema4, out, breakpoints, custom };
|
|
50740
|
+
};
|
|
50741
|
+
var assertOutFolder = (it) => {
|
|
50742
|
+
if ("out" in it)
|
|
50743
|
+
return it.out;
|
|
50744
|
+
const cliConfig = drizzleConfigFromFile(it.config);
|
|
50745
|
+
if (!cliConfig.out) {
|
|
50746
|
+
console.log(
|
|
50747
|
+
error(
|
|
50748
|
+
`'out' folder param must be set through '--out' param or in config file`
|
|
50749
|
+
)
|
|
50750
|
+
);
|
|
50751
|
+
process.exit(0);
|
|
50752
|
+
}
|
|
50753
|
+
return cliConfig.out;
|
|
50754
|
+
};
|
|
50755
|
+
var configCommonSchema = objectType({
|
|
50756
|
+
schema: unionType([stringType(), stringType().array()]),
|
|
50757
|
+
out: stringType().optional(),
|
|
50758
|
+
breakpoints: booleanType().optional(),
|
|
50759
|
+
tablesFilter: unionType([stringType(), stringType().array()]).optional()
|
|
50760
|
+
});
|
|
50761
|
+
var mysqlConnectionSchema = unionType([
|
|
50762
|
+
objectType({
|
|
50763
|
+
host: stringType(),
|
|
50764
|
+
port: coerce.number().optional(),
|
|
50765
|
+
user: stringType().default("mysql"),
|
|
50766
|
+
password: stringType().optional(),
|
|
50767
|
+
database: stringType()
|
|
50768
|
+
}),
|
|
50769
|
+
objectType({
|
|
50770
|
+
connectionString: stringType()
|
|
50771
|
+
}),
|
|
50772
|
+
objectType({})
|
|
50773
|
+
]);
|
|
50774
|
+
var mySqlCliConfigSchema = intersectionType(
|
|
50775
|
+
configCommonSchema,
|
|
50776
|
+
mysqlConnectionSchema
|
|
50777
|
+
);
|
|
50778
|
+
var drizzleConfigFromFile = (configPath) => {
|
|
50779
|
+
var _a;
|
|
50780
|
+
if (!configPath) {
|
|
50781
|
+
console.log(
|
|
50782
|
+
source_default.gray("No config path provided, using default 'drizzle.config.json'")
|
|
50783
|
+
);
|
|
50784
|
+
}
|
|
50785
|
+
const path3 = (0, import_path6.join)((0, import_path6.resolve)(configPath != null ? configPath : "drizzle.config.json"));
|
|
50786
|
+
if (!(0, import_fs10.existsSync)(path3)) {
|
|
50787
|
+
console.log(`${path3} file does not exist`);
|
|
50788
|
+
process.exit(1);
|
|
50789
|
+
}
|
|
50790
|
+
console.log(source_default.grey(`Reading config file '${path3}'`));
|
|
50791
|
+
const { unregister } = safeRegister();
|
|
50792
|
+
const required = require(path3);
|
|
50793
|
+
const content = (_a = required.default) != null ? _a : required;
|
|
50794
|
+
unregister();
|
|
50795
|
+
const res = mySqlCliConfigSchema.safeParse(content);
|
|
50796
|
+
if (!res.success) {
|
|
50797
|
+
console.error(res.error);
|
|
50798
|
+
console.log("Missing required params");
|
|
50799
|
+
process.exit(1);
|
|
50800
|
+
}
|
|
50801
|
+
return res.data;
|
|
50802
|
+
};
|
|
50803
|
+
|
|
50754
50804
|
// src/cli/index.ts
|
|
50755
50805
|
var printVersions = () => {
|
|
50756
50806
|
console.log(`${source_default.gray(versions())}
|
|
50757
50807
|
`);
|
|
50758
50808
|
};
|
|
50759
|
-
var assertEitherConfigOrOut = (config, out) => {
|
|
50760
|
-
if (out)
|
|
50761
|
-
return out;
|
|
50762
|
-
if (!(0, import_fs10.existsSync)(import_path6.default.join(import_path6.default.resolve(config)))) {
|
|
50763
|
-
console.log(`${config} file does not exist`);
|
|
50764
|
-
process.exit(1);
|
|
50765
|
-
}
|
|
50766
|
-
console.log(`Reading ${config}`);
|
|
50767
|
-
const drizzleConfig = JSON.parse(
|
|
50768
|
-
import_fs10.default.readFileSync(import_path6.default.join(import_path6.default.resolve(config))).toString()
|
|
50769
|
-
);
|
|
50770
|
-
return drizzleConfig.out;
|
|
50771
|
-
};
|
|
50772
50809
|
var versions = () => {
|
|
50773
50810
|
const { npmVersion } = ormCoreVersions();
|
|
50774
50811
|
const ormVersion = npmVersion ? `
|
|
@@ -50776,12 +50813,6 @@ drizzle-orm: v${npmVersion}` : "";
|
|
|
50776
50813
|
const versions2 = `drizzle-kit: v${package_default.version}${ormVersion}`;
|
|
50777
50814
|
return versions2;
|
|
50778
50815
|
};
|
|
50779
|
-
var configSchema = objectType({
|
|
50780
|
-
schema: unionType([stringType(), stringType().array()]),
|
|
50781
|
-
out: stringType().default("drizzle"),
|
|
50782
|
-
breakpoints: booleanType(),
|
|
50783
|
-
custom: booleanType()
|
|
50784
|
-
}).strict();
|
|
50785
50816
|
var optionsSchema = objectType({
|
|
50786
50817
|
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
50787
50818
|
out: stringType().optional(),
|
|
@@ -50789,9 +50820,6 @@ var optionsSchema = objectType({
|
|
|
50789
50820
|
breakpoints: booleanType().optional().default(false),
|
|
50790
50821
|
custom: booleanType().optional().default(false)
|
|
50791
50822
|
}).strict();
|
|
50792
|
-
var pushOptionsSchema = objectType({
|
|
50793
|
-
config: stringType().optional()
|
|
50794
|
-
}).strict();
|
|
50795
50823
|
var generatePgCommand = new Command("generate:pg").option("--schema <schema...>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option("--custom", "Prepare empty migration file for custom SQL").option(
|
|
50796
50824
|
"--config <config>",
|
|
50797
50825
|
"Path to a config.json file, drizzle.config.json by default"
|
|
@@ -50800,10 +50828,6 @@ var generatePgCommand = new Command("generate:pg").option("--schema <schema...>"
|
|
|
50800
50828
|
assertOrmCoreVersion();
|
|
50801
50829
|
const oprtionsParsed = optionsSchema.parse(options);
|
|
50802
50830
|
const result = prepareGenerateConfig(oprtionsParsed);
|
|
50803
|
-
if (result instanceof Error) {
|
|
50804
|
-
console.error(result);
|
|
50805
|
-
return;
|
|
50806
|
-
}
|
|
50807
50831
|
assertPackages("drizzle-orm");
|
|
50808
50832
|
const { prepareAndMigratePg: prepareAndMigratePg2 } = (init_migrate(), __toCommonJS(migrate_exports));
|
|
50809
50833
|
await prepareAndMigratePg2(result);
|
|
@@ -50816,10 +50840,6 @@ var generateMysqlCommand = new Command("generate:mysql").option("--schema <schem
|
|
|
50816
50840
|
assertOrmCoreVersion();
|
|
50817
50841
|
const oprtionsParsed = optionsSchema.parse(options);
|
|
50818
50842
|
const result = prepareGenerateConfig(oprtionsParsed);
|
|
50819
|
-
if (result instanceof Error) {
|
|
50820
|
-
console.error(result);
|
|
50821
|
-
return;
|
|
50822
|
-
}
|
|
50823
50843
|
assertPackages("drizzle-orm");
|
|
50824
50844
|
const { prepareAndMigrateMySql: prepareAndMigrateMySql2 } = (init_migrate(), __toCommonJS(migrate_exports));
|
|
50825
50845
|
await prepareAndMigrateMySql2(result);
|
|
@@ -50828,30 +50848,18 @@ var dbPushMysqlCommand = new Command("push:mysql").option(
|
|
|
50828
50848
|
"--config <config>",
|
|
50829
50849
|
"Path to a config.json file, drizzle.config.json by default"
|
|
50830
50850
|
).action(async (options) => {
|
|
50831
|
-
var _a;
|
|
50832
50851
|
printVersions();
|
|
50833
50852
|
assertPackages("drizzle-orm");
|
|
50834
50853
|
assertOrmCoreVersion();
|
|
50835
|
-
const { mysqlPushIntrospect: mysqlPushIntrospect2, connectToMySQL: connectToMySQL2
|
|
50836
|
-
const
|
|
50837
|
-
const
|
|
50838
|
-
|
|
50839
|
-
);
|
|
50840
|
-
const res = configPushSchema2.safeParse(drizzleConfig);
|
|
50841
|
-
if (!res.success) {
|
|
50842
|
-
console.log("Missing required params");
|
|
50843
|
-
return;
|
|
50844
|
-
}
|
|
50845
|
-
const connection = await connectToMySQL2(res.data);
|
|
50846
|
-
const filterConfig = res.data.tablesFilter;
|
|
50854
|
+
const { mysqlPushIntrospect: mysqlPushIntrospect2, connectToMySQL: connectToMySQL2 } = (init_mysqlIntrospect(), __toCommonJS(mysqlIntrospect_exports));
|
|
50855
|
+
const drizzleConfig = drizzleConfigFromFile(options.config);
|
|
50856
|
+
const connection = await connectToMySQL2(drizzleConfig);
|
|
50857
|
+
const filterConfig = drizzleConfig.tablesFilter;
|
|
50847
50858
|
const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
|
|
50848
|
-
const { schema: schema4 } = await mysqlPushIntrospect2(
|
|
50849
|
-
connection,
|
|
50850
|
-
tablesFilter
|
|
50851
|
-
);
|
|
50859
|
+
const { schema: schema4 } = await mysqlPushIntrospect2(connection, tablesFilter);
|
|
50852
50860
|
const { prepareMySQLPush: prepareMySQLPush2 } = (init_migrate(), __toCommonJS(migrate_exports));
|
|
50853
50861
|
const statements = await prepareMySQLPush2(
|
|
50854
|
-
{ schema:
|
|
50862
|
+
{ schema: drizzleConfig.schema },
|
|
50855
50863
|
schema4
|
|
50856
50864
|
);
|
|
50857
50865
|
try {
|
|
@@ -50878,41 +50886,19 @@ var generateSqliteCommand = new Command("generate:sqlite").option("--schema <sch
|
|
|
50878
50886
|
assertOrmCoreVersion();
|
|
50879
50887
|
const oprtionsParsed = optionsSchema.parse(options);
|
|
50880
50888
|
const result = prepareGenerateConfig(oprtionsParsed);
|
|
50881
|
-
if (result instanceof Error) {
|
|
50882
|
-
console.error(result);
|
|
50883
|
-
return;
|
|
50884
|
-
}
|
|
50885
50889
|
assertPackages("drizzle-orm");
|
|
50886
50890
|
const { prepareAndMigrateSqlite: prepareAndMigrateSqlite2 } = (init_migrate(), __toCommonJS(migrate_exports));
|
|
50887
50891
|
await prepareAndMigrateSqlite2(result);
|
|
50888
50892
|
});
|
|
50889
|
-
var
|
|
50890
|
-
|
|
50891
|
-
|
|
50892
|
-
|
|
50893
|
-
const drizzleConfig = JSON.parse(
|
|
50894
|
-
import_fs10.default.readFileSync(import_path6.default.join(import_path6.default.resolve(path3))).toString()
|
|
50895
|
-
);
|
|
50896
|
-
return drizzleConfig;
|
|
50897
|
-
}
|
|
50898
|
-
if (!schema4) {
|
|
50899
|
-
return new Error(`'schema' param must be set`);
|
|
50900
|
-
}
|
|
50901
|
-
return configSchema.parse({ schema: schema4, out, breakpoints, custom });
|
|
50902
|
-
};
|
|
50903
|
-
var checkSchema = objectType({
|
|
50904
|
-
out: stringType().optional(),
|
|
50905
|
-
config: stringType().default("drizzle.config.json")
|
|
50906
|
-
}).strict();
|
|
50893
|
+
var checkSchema = unionType([
|
|
50894
|
+
objectType({ out: stringType() }),
|
|
50895
|
+
objectType({ config: stringType().optional() })
|
|
50896
|
+
]);
|
|
50907
50897
|
var checkPgCommand = new Command("check:pg").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
50908
50898
|
printVersions();
|
|
50909
50899
|
assertOrmCoreVersion();
|
|
50910
50900
|
const params = checkSchema.parse(options);
|
|
50911
|
-
const out =
|
|
50912
|
-
if (!out) {
|
|
50913
|
-
console.log(error(`'out' folder param must be set`));
|
|
50914
|
-
process.exit(0);
|
|
50915
|
-
}
|
|
50901
|
+
const out = assertOutFolder(params);
|
|
50916
50902
|
checkHandler(out, "pg");
|
|
50917
50903
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
|
50918
50904
|
});
|
|
@@ -50920,11 +50906,7 @@ var checkSqliteCommand = new Command("check:sqlite").option("--out <out>", `Outp
|
|
|
50920
50906
|
printVersions();
|
|
50921
50907
|
assertOrmCoreVersion();
|
|
50922
50908
|
const params = checkSchema.parse(options);
|
|
50923
|
-
const out =
|
|
50924
|
-
if (!out) {
|
|
50925
|
-
console.log(error(`'out' folder param must be set`));
|
|
50926
|
-
process.exit(0);
|
|
50927
|
-
}
|
|
50909
|
+
const out = assertOutFolder(params);
|
|
50928
50910
|
checkHandler(out, "sqlite");
|
|
50929
50911
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
|
50930
50912
|
});
|
|
@@ -50932,15 +50914,7 @@ var upPgCommand = new Command("up:pg").option("--out <out>", `Output folder`).op
|
|
|
50932
50914
|
printVersions();
|
|
50933
50915
|
assertOrmCoreVersion();
|
|
50934
50916
|
const params = checkSchema.parse(options);
|
|
50935
|
-
const out =
|
|
50936
|
-
if (!out) {
|
|
50937
|
-
console.log(
|
|
50938
|
-
error(
|
|
50939
|
-
`'out' folder param must be set through '--out' param or in config file`
|
|
50940
|
-
)
|
|
50941
|
-
);
|
|
50942
|
-
process.exit(0);
|
|
50943
|
-
}
|
|
50917
|
+
const out = assertOutFolder(params);
|
|
50944
50918
|
assertPackages("drizzle-orm");
|
|
50945
50919
|
upPgHandlerV4(out);
|
|
50946
50920
|
upgradeFolders("pg", out);
|
|
@@ -50950,19 +50924,7 @@ var upMysqlCommand = new Command("up:mysql").option("--out <out>", `Output folde
|
|
|
50950
50924
|
printVersions();
|
|
50951
50925
|
assertOrmCoreVersion();
|
|
50952
50926
|
const params = checkSchema.parse(options);
|
|
50953
|
-
const out =
|
|
50954
|
-
if (!out) {
|
|
50955
|
-
console.log(
|
|
50956
|
-
error(
|
|
50957
|
-
`'out' folder param must be set through '--out' param or in config file`
|
|
50958
|
-
)
|
|
50959
|
-
);
|
|
50960
|
-
process.exit(0);
|
|
50961
|
-
}
|
|
50962
|
-
if (!out) {
|
|
50963
|
-
console.log(error(`'out' folder param must be set`));
|
|
50964
|
-
process.exit(0);
|
|
50965
|
-
}
|
|
50927
|
+
const out = assertOutFolder(params);
|
|
50966
50928
|
assertPackages("drizzle-orm");
|
|
50967
50929
|
upMysqlHandlerV4(out);
|
|
50968
50930
|
upgradeFolders("mysql", out);
|
|
@@ -50972,11 +50934,7 @@ var upSqliteCommand = new Command("up:sqlite").option("--out <out>", `Output fol
|
|
|
50972
50934
|
printVersions();
|
|
50973
50935
|
assertOrmCoreVersion();
|
|
50974
50936
|
const params = checkSchema.parse(options);
|
|
50975
|
-
const out =
|
|
50976
|
-
if (!out) {
|
|
50977
|
-
console.log(error(`'out' folder param must be set`));
|
|
50978
|
-
process.exit(0);
|
|
50979
|
-
}
|
|
50937
|
+
const out = assertOutFolder(params);
|
|
50980
50938
|
upSqliteHandlerV4(out);
|
|
50981
50939
|
upgradeFolders("sqlite", out);
|
|
50982
50940
|
upSqliteHandler(out);
|
|
@@ -51001,8 +50959,8 @@ var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Mi
|
|
|
51001
50959
|
}
|
|
51002
50960
|
const { snapshots, journal } = prepareOutFolder2(res.data.out, "pg");
|
|
51003
50961
|
const { schema: schema4, ts } = await pgIntrospect2(res.data);
|
|
51004
|
-
const schemaFile =
|
|
51005
|
-
(0,
|
|
50962
|
+
const schemaFile = import_path7.default.join(res.data.out, "schema.ts");
|
|
50963
|
+
(0, import_fs11.writeFileSync)(schemaFile, ts);
|
|
51006
50964
|
console.log();
|
|
51007
50965
|
if (snapshots.length === 0) {
|
|
51008
50966
|
const { sqlStatements, _meta } = await prepareSQL(
|
|
@@ -51045,20 +51003,17 @@ var introspectMySqlCommand = new Command("introspect:mysql").option(
|
|
|
51045
51003
|
printVersions();
|
|
51046
51004
|
assertPackages("drizzle-orm");
|
|
51047
51005
|
assertOrmCoreVersion();
|
|
51048
|
-
const { mysqlIntrospect: mysqlIntrospect2
|
|
51049
|
-
const
|
|
51050
|
-
|
|
51051
|
-
|
|
51052
|
-
|
|
51053
|
-
const res = configIntrospectSchema2.safeParse(drizzleConfig);
|
|
51054
|
-
if (!res.success) {
|
|
51055
|
-
console.log("Missing required params");
|
|
51056
|
-
return;
|
|
51006
|
+
const { mysqlIntrospect: mysqlIntrospect2 } = (init_mysqlIntrospect(), __toCommonJS(mysqlIntrospect_exports));
|
|
51007
|
+
const drizzleConfig = drizzleConfigFromFile(options.config);
|
|
51008
|
+
if (!drizzleConfig.out) {
|
|
51009
|
+
console.log("You must specify 'out' path in your config file");
|
|
51010
|
+
process.exit(1);
|
|
51057
51011
|
}
|
|
51058
|
-
const
|
|
51059
|
-
const {
|
|
51060
|
-
const
|
|
51061
|
-
|
|
51012
|
+
const out = drizzleConfig.out;
|
|
51013
|
+
const { snapshots, journal } = prepareOutFolder2(out, "mysql");
|
|
51014
|
+
const { schema: schema4, ts } = await mysqlIntrospect2(drizzleConfig);
|
|
51015
|
+
const schemaFile = import_path7.default.join(out, "schema.ts");
|
|
51016
|
+
(0, import_fs11.writeFileSync)(schemaFile, ts);
|
|
51062
51017
|
console.log();
|
|
51063
51018
|
if (snapshots.length === 0) {
|
|
51064
51019
|
const { sqlStatements, _meta } = await prepareSQL(
|
|
@@ -51073,8 +51028,8 @@ var introspectMySqlCommand = new Command("introspect:mysql").option(
|
|
|
51073
51028
|
sqlStatements,
|
|
51074
51029
|
journal,
|
|
51075
51030
|
_meta,
|
|
51076
|
-
|
|
51077
|
-
|
|
51031
|
+
out,
|
|
51032
|
+
(_a = drizzleConfig.breakpoints) != null ? _a : false,
|
|
51078
51033
|
"introspect"
|
|
51079
51034
|
);
|
|
51080
51035
|
} else {
|
|
@@ -51097,11 +51052,7 @@ var dropCommand = new Command("drop").option("--out <out>", `Output folder`).opt
|
|
|
51097
51052
|
printVersions();
|
|
51098
51053
|
assertOrmCoreVersion();
|
|
51099
51054
|
const params = checkSchema.parse(options);
|
|
51100
|
-
const out =
|
|
51101
|
-
if (!out) {
|
|
51102
|
-
console.log(error(`'out' folder param must be set`));
|
|
51103
|
-
process.exit(0);
|
|
51104
|
-
}
|
|
51055
|
+
const out = assertOutFolder(params);
|
|
51105
51056
|
assertV1OutFolder(out, "{dialect}");
|
|
51106
51057
|
dropMigration(out);
|
|
51107
51058
|
});
|
|
@@ -51121,6 +51072,5 @@ program.addCommand(dbPushMysqlCommand);
|
|
|
51121
51072
|
program.parse();
|
|
51122
51073
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51123
51074
|
0 && (module.exports = {
|
|
51124
|
-
checkSchema
|
|
51125
|
-
configSchema
|
|
51075
|
+
checkSchema
|
|
51126
51076
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-kit",
|
|
3
|
-
"version": "0.17.1-
|
|
3
|
+
"version": "0.17.1-d0991a3",
|
|
4
4
|
"repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
|
|
5
5
|
"author": "Drizzle Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"dockerode": "^3.3.4",
|
|
72
72
|
"dotenv": "^16.0.3",
|
|
73
73
|
"drizzle-kit": "^0.16.8",
|
|
74
|
-
"drizzle-orm": "0.23.2
|
|
74
|
+
"drizzle-orm": "0.23.2",
|
|
75
75
|
"esbuild": "^0.15.7",
|
|
76
76
|
"esbuild-register": "^3.3.3",
|
|
77
77
|
"eslint": "^8.29.0",
|