@prisma/migrate 6.6.0-dev.23 → 6.6.0-dev.25
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/dist/CLI.js +3 -3
- package/dist/Migrate.js +6 -6
- package/dist/SchemaEngine.js +5 -5
- package/dist/bin.js +43 -43
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/{chunk-J4DAOTRR.js → chunk-324Z6HS7.js} +41 -43
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-3WTXX6CQ.js → chunk-5LKIRKDL.js} +60 -60
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-F62CN63F.js → chunk-B4SUSDC2.js} +30 -31
- package/dist/{chunk-ODH7XYW7.js → chunk-BURHAP6O.js} +46 -48
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-MREGRQDD.js → chunk-FBWTUBJC.js} +46 -45
- package/dist/{chunk-MATFO4ZW.js → chunk-G7PJKEOV.js} +33 -33
- package/dist/{chunk-PW3LNSDM.js → chunk-GPNGRJAR.js} +33 -35
- package/dist/{chunk-NAXFX7K7.js → chunk-HJFSTAJX.js} +30 -32
- package/dist/{chunk-4ZFVT4RS.js → chunk-IINN7QUV.js} +165 -190
- package/dist/{chunk-IR55GBON.js → chunk-IWC5MH4R.js} +5 -5
- package/dist/{chunk-ZOEKRXDP.js → chunk-K43RXWQY.js} +21 -18
- package/dist/{chunk-3OQIC7NW.js → chunk-KMHFSDY6.js} +43 -45
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-MKK3GSDF.js → chunk-MKS2ZJJ5.js} +5 -5
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-IY67YUOD.js → chunk-NJYZPNB4.js} +54 -56
- package/dist/{chunk-7X4MPZIO.js → chunk-NYVWWESL.js} +322 -336
- package/dist/{chunk-EGPJABTW.js → chunk-TGV6QGEF.js} +69 -69
- package/dist/{chunk-3VFKYWQZ.js → chunk-URKH6SE2.js} +73 -80
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-N5UBDQRA.js → chunk-VVP3QZ7Q.js} +21 -21
- package/dist/{chunk-DAYMMAJB.js → chunk-YBNDKPPO.js} +36 -38
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/{chunk-ZYT5KWQF.js → chunk-YHLTCM34.js} +323 -337
- package/dist/{chunk-A6PMXMMT.js → chunk-ZB5NPOJW.js} +13 -13
- package/dist/{chunk-V5TUSOJX.js → chunk-ZGR2WQ62.js} +38 -40
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +3 -3
- package/dist/commands/DbExecute.js +7 -7
- package/dist/commands/DbPull.js +9 -9
- package/dist/commands/DbPush.js +7 -7
- package/dist/commands/DbSeed.js +4 -4
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +9 -9
- package/dist/commands/MigrateDev.js +11 -11
- package/dist/commands/MigrateDiff.js +10 -10
- package/dist/commands/MigrateReset.js +10 -10
- package/dist/commands/MigrateResolve.js +7 -7
- package/dist/commands/MigrateStatus.js +7 -7
- package/dist/index.js +46 -46
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +5 -5
- package/dist/utils/getSchemaPathAndPrint.js +1 -1
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +5 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -4
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +759 -675
- package/dist/utils/setupMongo.js +552 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -4
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +6 -6
- package/dist/chunk-YYPMC5FN.js +0 -1407
|
@@ -26,13 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_IINN7QUV_exports = {};
|
|
30
|
+
__export(chunk_IINN7QUV_exports, {
|
|
31
31
|
createSpinner: () => createSpinner
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
35
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_IINN7QUV_exports);
|
|
34
|
+
var import_chunk_URKH6SE2 = require("./chunk-URKH6SE2.js");
|
|
35
|
+
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
36
36
|
var import_node_process = __toESM(require("node:process"));
|
|
37
37
|
var import_node_process2 = __toESM(require("node:process"));
|
|
38
38
|
var import_node_os = __toESM(require("node:os"));
|
|
@@ -40,7 +40,7 @@ var import_node_tty = __toESM(require("node:tty"));
|
|
|
40
40
|
var import_node_process3 = __toESM(require("node:process"));
|
|
41
41
|
var import_node_process4 = __toESM(require("node:process"));
|
|
42
42
|
var import_node_process5 = __toESM(require("node:process"));
|
|
43
|
-
var require_spinners = (0,
|
|
43
|
+
var require_spinners = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
44
44
|
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(exports, module2) {
|
|
45
45
|
module2.exports = {
|
|
46
46
|
dots: {
|
|
@@ -1666,7 +1666,7 @@ var require_spinners = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
1666
1666
|
};
|
|
1667
1667
|
}
|
|
1668
1668
|
});
|
|
1669
|
-
var require_cli_spinners = (0,
|
|
1669
|
+
var require_cli_spinners = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
1670
1670
|
"../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js"(exports, module2) {
|
|
1671
1671
|
"use strict";
|
|
1672
1672
|
var spinners = Object.assign({}, require_spinners());
|
|
@@ -2159,7 +2159,7 @@ Object.defineProperties(createChalk.prototype, styles2);
|
|
|
2159
2159
|
var chalk = createChalk();
|
|
2160
2160
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2161
2161
|
var source_default = chalk;
|
|
2162
|
-
var import_cli_spinners = (0,
|
|
2162
|
+
var import_cli_spinners = (0, import_chunk_2ESYSVXG.__toESM)(require_cli_spinners(), 1);
|
|
2163
2163
|
function isUnicodeSupported() {
|
|
2164
2164
|
if (import_node_process3.default.platform !== "win32") {
|
|
2165
2165
|
return import_node_process3.default.env.TERM !== "linux";
|
|
@@ -2194,249 +2194,269 @@ function isUnicodeSupported2() {
|
|
|
2194
2194
|
return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2195
2195
|
}
|
|
2196
2196
|
var ASCII_ETX_CODE = 3;
|
|
2197
|
-
var _activeCount, _StdinDiscarder_instances, realStart_fn, realStop_fn, handleInput_fn;
|
|
2198
2197
|
var StdinDiscarder = class {
|
|
2199
|
-
|
|
2200
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _StdinDiscarder_instances);
|
|
2201
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _activeCount, 0);
|
|
2202
|
-
}
|
|
2198
|
+
#activeCount = 0;
|
|
2203
2199
|
start() {
|
|
2204
|
-
|
|
2205
|
-
if (
|
|
2206
|
-
|
|
2200
|
+
this.#activeCount++;
|
|
2201
|
+
if (this.#activeCount === 1) {
|
|
2202
|
+
this.#realStart();
|
|
2207
2203
|
}
|
|
2208
2204
|
}
|
|
2209
2205
|
stop() {
|
|
2210
|
-
if (
|
|
2206
|
+
if (this.#activeCount <= 0) {
|
|
2211
2207
|
throw new Error("`stop` called more times than `start`");
|
|
2212
2208
|
}
|
|
2213
|
-
|
|
2214
|
-
if (
|
|
2215
|
-
|
|
2209
|
+
this.#activeCount--;
|
|
2210
|
+
if (this.#activeCount === 0) {
|
|
2211
|
+
this.#realStop();
|
|
2216
2212
|
}
|
|
2217
2213
|
}
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
import_node_process5.default.stdin.setRawMode(true);
|
|
2226
|
-
import_node_process5.default.stdin.on("data", (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _StdinDiscarder_instances, handleInput_fn));
|
|
2227
|
-
import_node_process5.default.stdin.resume();
|
|
2228
|
-
};
|
|
2229
|
-
realStop_fn = function() {
|
|
2230
|
-
if (!import_node_process5.default.stdin.isTTY) {
|
|
2231
|
-
return;
|
|
2214
|
+
#realStart() {
|
|
2215
|
+
if (import_node_process5.default.platform === "win32" || !import_node_process5.default.stdin.isTTY) {
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
import_node_process5.default.stdin.setRawMode(true);
|
|
2219
|
+
import_node_process5.default.stdin.on("data", this.#handleInput);
|
|
2220
|
+
import_node_process5.default.stdin.resume();
|
|
2232
2221
|
}
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
import_node_process5.default.
|
|
2222
|
+
#realStop() {
|
|
2223
|
+
if (!import_node_process5.default.stdin.isTTY) {
|
|
2224
|
+
return;
|
|
2225
|
+
}
|
|
2226
|
+
import_node_process5.default.stdin.off("data", this.#handleInput);
|
|
2227
|
+
import_node_process5.default.stdin.pause();
|
|
2228
|
+
import_node_process5.default.stdin.setRawMode(false);
|
|
2229
|
+
}
|
|
2230
|
+
#handleInput(chunk) {
|
|
2231
|
+
if (chunk[0] === ASCII_ETX_CODE) {
|
|
2232
|
+
import_node_process5.default.emit("SIGINT");
|
|
2233
|
+
}
|
|
2240
2234
|
}
|
|
2241
2235
|
};
|
|
2242
2236
|
var stdinDiscarder = new StdinDiscarder();
|
|
2243
2237
|
var stdin_discarder_default = stdinDiscarder;
|
|
2244
|
-
var import_cli_spinners2 = (0,
|
|
2245
|
-
var _linesToClear, _isDiscardingStdin, _lineCount, _frameIndex, _lastSpinnerFrameTime, _options, _spinner, _stream, _id, _initialInterval, _isEnabled, _isSilent, _indent, _text, _prefixText, _suffixText, _Ora_instances, getFullPrefixText_fn, getFullSuffixText_fn, updateLineCount_fn;
|
|
2238
|
+
var import_cli_spinners2 = (0, import_chunk_2ESYSVXG.__toESM)(require_cli_spinners(), 1);
|
|
2246
2239
|
var Ora = class {
|
|
2240
|
+
#linesToClear = 0;
|
|
2241
|
+
#isDiscardingStdin = false;
|
|
2242
|
+
#lineCount = 0;
|
|
2243
|
+
#frameIndex = -1;
|
|
2244
|
+
#lastSpinnerFrameTime = 0;
|
|
2245
|
+
#options;
|
|
2246
|
+
#spinner;
|
|
2247
|
+
#stream;
|
|
2248
|
+
#id;
|
|
2249
|
+
#initialInterval;
|
|
2250
|
+
#isEnabled;
|
|
2251
|
+
#isSilent;
|
|
2252
|
+
#indent;
|
|
2253
|
+
#text;
|
|
2254
|
+
#prefixText;
|
|
2255
|
+
#suffixText;
|
|
2256
|
+
color;
|
|
2247
2257
|
constructor(options) {
|
|
2248
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _Ora_instances);
|
|
2249
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _linesToClear, 0);
|
|
2250
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _isDiscardingStdin, false);
|
|
2251
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _lineCount, 0);
|
|
2252
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _frameIndex, -1);
|
|
2253
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _lastSpinnerFrameTime, 0);
|
|
2254
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _options);
|
|
2255
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _spinner);
|
|
2256
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _stream);
|
|
2257
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _id);
|
|
2258
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _initialInterval);
|
|
2259
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _isEnabled);
|
|
2260
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _isSilent);
|
|
2261
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _indent);
|
|
2262
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _text);
|
|
2263
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _prefixText);
|
|
2264
|
-
(0, import_chunk_WWAWV7DQ.__privateAdd)(this, _suffixText);
|
|
2265
|
-
(0, import_chunk_WWAWV7DQ.__publicField)(this, "color");
|
|
2266
2258
|
if (typeof options === "string") {
|
|
2267
2259
|
options = {
|
|
2268
2260
|
text: options
|
|
2269
2261
|
};
|
|
2270
2262
|
}
|
|
2271
|
-
|
|
2263
|
+
this.#options = {
|
|
2272
2264
|
color: "cyan",
|
|
2273
2265
|
stream: import_node_process.default.stderr,
|
|
2274
2266
|
discardStdin: true,
|
|
2275
2267
|
hideCursor: true,
|
|
2276
2268
|
...options
|
|
2277
|
-
}
|
|
2278
|
-
this.color =
|
|
2279
|
-
this.spinner =
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
this.text =
|
|
2285
|
-
this.prefixText =
|
|
2286
|
-
this.suffixText =
|
|
2287
|
-
this.indent =
|
|
2269
|
+
};
|
|
2270
|
+
this.color = this.#options.color;
|
|
2271
|
+
this.spinner = this.#options.spinner;
|
|
2272
|
+
this.#initialInterval = this.#options.interval;
|
|
2273
|
+
this.#stream = this.#options.stream;
|
|
2274
|
+
this.#isEnabled = typeof this.#options.isEnabled === "boolean" ? this.#options.isEnabled : isInteractive({ stream: this.#stream });
|
|
2275
|
+
this.#isSilent = typeof this.#options.isSilent === "boolean" ? this.#options.isSilent : false;
|
|
2276
|
+
this.text = this.#options.text;
|
|
2277
|
+
this.prefixText = this.#options.prefixText;
|
|
2278
|
+
this.suffixText = this.#options.suffixText;
|
|
2279
|
+
this.indent = this.#options.indent;
|
|
2288
2280
|
if (import_node_process.default.env.NODE_ENV === "test") {
|
|
2289
|
-
this._stream =
|
|
2290
|
-
this._isEnabled =
|
|
2281
|
+
this._stream = this.#stream;
|
|
2282
|
+
this._isEnabled = this.#isEnabled;
|
|
2291
2283
|
Object.defineProperty(this, "_linesToClear", {
|
|
2292
2284
|
get() {
|
|
2293
|
-
return
|
|
2285
|
+
return this.#linesToClear;
|
|
2294
2286
|
},
|
|
2295
2287
|
set(newValue) {
|
|
2296
|
-
|
|
2288
|
+
this.#linesToClear = newValue;
|
|
2297
2289
|
}
|
|
2298
2290
|
});
|
|
2299
2291
|
Object.defineProperty(this, "_frameIndex", {
|
|
2300
2292
|
get() {
|
|
2301
|
-
return
|
|
2293
|
+
return this.#frameIndex;
|
|
2302
2294
|
}
|
|
2303
2295
|
});
|
|
2304
2296
|
Object.defineProperty(this, "_lineCount", {
|
|
2305
2297
|
get() {
|
|
2306
|
-
return
|
|
2298
|
+
return this.#lineCount;
|
|
2307
2299
|
}
|
|
2308
2300
|
});
|
|
2309
2301
|
}
|
|
2310
2302
|
}
|
|
2311
2303
|
get indent() {
|
|
2312
|
-
return
|
|
2304
|
+
return this.#indent;
|
|
2313
2305
|
}
|
|
2314
2306
|
set indent(indent = 0) {
|
|
2315
2307
|
if (!(indent >= 0 && Number.isInteger(indent))) {
|
|
2316
2308
|
throw new Error("The `indent` option must be an integer from 0 and up");
|
|
2317
2309
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2310
|
+
this.#indent = indent;
|
|
2311
|
+
this.#updateLineCount();
|
|
2320
2312
|
}
|
|
2321
2313
|
get interval() {
|
|
2322
|
-
return
|
|
2314
|
+
return this.#initialInterval ?? this.#spinner.interval ?? 100;
|
|
2323
2315
|
}
|
|
2324
2316
|
get spinner() {
|
|
2325
|
-
return
|
|
2317
|
+
return this.#spinner;
|
|
2326
2318
|
}
|
|
2327
2319
|
set spinner(spinner) {
|
|
2328
|
-
|
|
2329
|
-
|
|
2320
|
+
this.#frameIndex = -1;
|
|
2321
|
+
this.#initialInterval = void 0;
|
|
2330
2322
|
if (typeof spinner === "object") {
|
|
2331
2323
|
if (spinner.frames === void 0) {
|
|
2332
2324
|
throw new Error("The given spinner must have a `frames` property");
|
|
2333
2325
|
}
|
|
2334
|
-
|
|
2326
|
+
this.#spinner = spinner;
|
|
2335
2327
|
} else if (!isUnicodeSupported2()) {
|
|
2336
|
-
|
|
2328
|
+
this.#spinner = import_cli_spinners.default.line;
|
|
2337
2329
|
} else if (spinner === void 0) {
|
|
2338
|
-
|
|
2330
|
+
this.#spinner = import_cli_spinners.default.dots;
|
|
2339
2331
|
} else if (spinner !== "default" && import_cli_spinners.default[spinner]) {
|
|
2340
|
-
|
|
2332
|
+
this.#spinner = import_cli_spinners.default[spinner];
|
|
2341
2333
|
} else {
|
|
2342
2334
|
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
|
|
2343
2335
|
}
|
|
2344
2336
|
}
|
|
2345
2337
|
get text() {
|
|
2346
|
-
return
|
|
2338
|
+
return this.#text;
|
|
2347
2339
|
}
|
|
2348
2340
|
set text(value = "") {
|
|
2349
|
-
|
|
2350
|
-
|
|
2341
|
+
this.#text = value;
|
|
2342
|
+
this.#updateLineCount();
|
|
2351
2343
|
}
|
|
2352
2344
|
get prefixText() {
|
|
2353
|
-
return
|
|
2345
|
+
return this.#prefixText;
|
|
2354
2346
|
}
|
|
2355
2347
|
set prefixText(value = "") {
|
|
2356
|
-
|
|
2357
|
-
|
|
2348
|
+
this.#prefixText = value;
|
|
2349
|
+
this.#updateLineCount();
|
|
2358
2350
|
}
|
|
2359
2351
|
get suffixText() {
|
|
2360
|
-
return
|
|
2352
|
+
return this.#suffixText;
|
|
2361
2353
|
}
|
|
2362
2354
|
set suffixText(value = "") {
|
|
2363
|
-
|
|
2364
|
-
|
|
2355
|
+
this.#suffixText = value;
|
|
2356
|
+
this.#updateLineCount();
|
|
2365
2357
|
}
|
|
2366
2358
|
get isSpinning() {
|
|
2367
|
-
return
|
|
2359
|
+
return this.#id !== void 0;
|
|
2360
|
+
}
|
|
2361
|
+
#getFullPrefixText(prefixText = this.#prefixText, postfix = " ") {
|
|
2362
|
+
if (typeof prefixText === "string" && prefixText !== "") {
|
|
2363
|
+
return prefixText + postfix;
|
|
2364
|
+
}
|
|
2365
|
+
if (typeof prefixText === "function") {
|
|
2366
|
+
return prefixText() + postfix;
|
|
2367
|
+
}
|
|
2368
|
+
return "";
|
|
2369
|
+
}
|
|
2370
|
+
#getFullSuffixText(suffixText = this.#suffixText, prefix = " ") {
|
|
2371
|
+
if (typeof suffixText === "string" && suffixText !== "") {
|
|
2372
|
+
return prefix + suffixText;
|
|
2373
|
+
}
|
|
2374
|
+
if (typeof suffixText === "function") {
|
|
2375
|
+
return prefix + suffixText();
|
|
2376
|
+
}
|
|
2377
|
+
return "";
|
|
2378
|
+
}
|
|
2379
|
+
#updateLineCount() {
|
|
2380
|
+
const columns = this.#stream.columns ?? 80;
|
|
2381
|
+
const fullPrefixText = this.#getFullPrefixText(this.#prefixText, "-");
|
|
2382
|
+
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, "-");
|
|
2383
|
+
const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
|
|
2384
|
+
this.#lineCount = 0;
|
|
2385
|
+
for (const line of (0, import_chunk_URKH6SE2.stripAnsi)(fullText).split("\n")) {
|
|
2386
|
+
this.#lineCount += Math.max(1, Math.ceil((0, import_chunk_URKH6SE2.stringWidth)(line, { countAnsiEscapeCodes: true }) / columns));
|
|
2387
|
+
}
|
|
2368
2388
|
}
|
|
2369
2389
|
get isEnabled() {
|
|
2370
|
-
return
|
|
2390
|
+
return this.#isEnabled && !this.#isSilent;
|
|
2371
2391
|
}
|
|
2372
2392
|
set isEnabled(value) {
|
|
2373
2393
|
if (typeof value !== "boolean") {
|
|
2374
2394
|
throw new TypeError("The `isEnabled` option must be a boolean");
|
|
2375
2395
|
}
|
|
2376
|
-
|
|
2396
|
+
this.#isEnabled = value;
|
|
2377
2397
|
}
|
|
2378
2398
|
get isSilent() {
|
|
2379
|
-
return
|
|
2399
|
+
return this.#isSilent;
|
|
2380
2400
|
}
|
|
2381
2401
|
set isSilent(value) {
|
|
2382
2402
|
if (typeof value !== "boolean") {
|
|
2383
2403
|
throw new TypeError("The `isSilent` option must be a boolean");
|
|
2384
2404
|
}
|
|
2385
|
-
|
|
2405
|
+
this.#isSilent = value;
|
|
2386
2406
|
}
|
|
2387
2407
|
frame() {
|
|
2388
2408
|
const now = Date.now();
|
|
2389
|
-
if (
|
|
2390
|
-
|
|
2391
|
-
|
|
2409
|
+
if (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {
|
|
2410
|
+
this.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;
|
|
2411
|
+
this.#lastSpinnerFrameTime = now;
|
|
2392
2412
|
}
|
|
2393
|
-
const { frames } =
|
|
2394
|
-
let frame = frames[
|
|
2413
|
+
const { frames } = this.#spinner;
|
|
2414
|
+
let frame = frames[this.#frameIndex];
|
|
2395
2415
|
if (this.color) {
|
|
2396
2416
|
frame = source_default[this.color](frame);
|
|
2397
2417
|
}
|
|
2398
|
-
const fullPrefixText = typeof
|
|
2418
|
+
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
2399
2419
|
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
2400
|
-
const fullSuffixText = typeof
|
|
2420
|
+
const fullSuffixText = typeof this.#suffixText === "string" && this.#suffixText !== "" ? " " + this.#suffixText : "";
|
|
2401
2421
|
return fullPrefixText + frame + fullText + fullSuffixText;
|
|
2402
2422
|
}
|
|
2403
2423
|
clear() {
|
|
2404
|
-
if (!
|
|
2424
|
+
if (!this.#isEnabled || !this.#stream.isTTY) {
|
|
2405
2425
|
return this;
|
|
2406
2426
|
}
|
|
2407
|
-
|
|
2408
|
-
for (let index = 0; index <
|
|
2427
|
+
this.#stream.cursorTo(0);
|
|
2428
|
+
for (let index = 0; index < this.#linesToClear; index++) {
|
|
2409
2429
|
if (index > 0) {
|
|
2410
|
-
|
|
2430
|
+
this.#stream.moveCursor(0, -1);
|
|
2411
2431
|
}
|
|
2412
|
-
|
|
2432
|
+
this.#stream.clearLine(1);
|
|
2413
2433
|
}
|
|
2414
|
-
if (
|
|
2415
|
-
|
|
2434
|
+
if (this.#indent || this.lastIndent !== this.#indent) {
|
|
2435
|
+
this.#stream.cursorTo(this.#indent);
|
|
2416
2436
|
}
|
|
2417
|
-
this.lastIndent =
|
|
2418
|
-
|
|
2437
|
+
this.lastIndent = this.#indent;
|
|
2438
|
+
this.#linesToClear = 0;
|
|
2419
2439
|
return this;
|
|
2420
2440
|
}
|
|
2421
2441
|
render() {
|
|
2422
|
-
if (
|
|
2442
|
+
if (this.#isSilent) {
|
|
2423
2443
|
return this;
|
|
2424
2444
|
}
|
|
2425
2445
|
this.clear();
|
|
2426
|
-
|
|
2427
|
-
|
|
2446
|
+
this.#stream.write(this.frame());
|
|
2447
|
+
this.#linesToClear = this.#lineCount;
|
|
2428
2448
|
return this;
|
|
2429
2449
|
}
|
|
2430
2450
|
start(text) {
|
|
2431
2451
|
if (text) {
|
|
2432
2452
|
this.text = text;
|
|
2433
2453
|
}
|
|
2434
|
-
if (
|
|
2454
|
+
if (this.#isSilent) {
|
|
2435
2455
|
return this;
|
|
2436
2456
|
}
|
|
2437
|
-
if (!
|
|
2457
|
+
if (!this.#isEnabled) {
|
|
2438
2458
|
if (this.text) {
|
|
2439
|
-
|
|
2459
|
+
this.#stream.write(`- ${this.text}
|
|
2440
2460
|
`);
|
|
2441
2461
|
}
|
|
2442
2462
|
return this;
|
|
@@ -2444,31 +2464,31 @@ var Ora = class {
|
|
|
2444
2464
|
if (this.isSpinning) {
|
|
2445
2465
|
return this;
|
|
2446
2466
|
}
|
|
2447
|
-
if (
|
|
2448
|
-
|
|
2467
|
+
if (this.#options.hideCursor) {
|
|
2468
|
+
import_chunk_URKH6SE2.cli_cursor_default.hide(this.#stream);
|
|
2449
2469
|
}
|
|
2450
|
-
if (
|
|
2451
|
-
|
|
2470
|
+
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY) {
|
|
2471
|
+
this.#isDiscardingStdin = true;
|
|
2452
2472
|
stdin_discarder_default.start();
|
|
2453
2473
|
}
|
|
2454
2474
|
this.render();
|
|
2455
|
-
|
|
2475
|
+
this.#id = setInterval(this.render.bind(this), this.interval);
|
|
2456
2476
|
return this;
|
|
2457
2477
|
}
|
|
2458
2478
|
stop() {
|
|
2459
|
-
if (!
|
|
2479
|
+
if (!this.#isEnabled) {
|
|
2460
2480
|
return this;
|
|
2461
2481
|
}
|
|
2462
|
-
clearInterval(
|
|
2463
|
-
|
|
2464
|
-
|
|
2482
|
+
clearInterval(this.#id);
|
|
2483
|
+
this.#id = void 0;
|
|
2484
|
+
this.#frameIndex = 0;
|
|
2465
2485
|
this.clear();
|
|
2466
|
-
if (
|
|
2467
|
-
|
|
2486
|
+
if (this.#options.hideCursor) {
|
|
2487
|
+
import_chunk_URKH6SE2.cli_cursor_default.show(this.#stream);
|
|
2468
2488
|
}
|
|
2469
|
-
if (
|
|
2489
|
+
if (this.#options.discardStdin && import_node_process.default.stdin.isTTY && this.#isDiscardingStdin) {
|
|
2470
2490
|
stdin_discarder_default.stop();
|
|
2471
|
-
|
|
2491
|
+
this.#isDiscardingStdin = false;
|
|
2472
2492
|
}
|
|
2473
2493
|
return this;
|
|
2474
2494
|
}
|
|
@@ -2485,68 +2505,23 @@ var Ora = class {
|
|
|
2485
2505
|
return this.stopAndPersist({ symbol: log_symbols_default.info, text });
|
|
2486
2506
|
}
|
|
2487
2507
|
stopAndPersist(options = {}) {
|
|
2488
|
-
if (
|
|
2508
|
+
if (this.#isSilent) {
|
|
2489
2509
|
return this;
|
|
2490
2510
|
}
|
|
2491
|
-
const prefixText = options.prefixText ??
|
|
2492
|
-
const fullPrefixText =
|
|
2511
|
+
const prefixText = options.prefixText ?? this.#prefixText;
|
|
2512
|
+
const fullPrefixText = this.#getFullPrefixText(prefixText, " ");
|
|
2493
2513
|
const symbolText = options.symbol ?? " ";
|
|
2494
2514
|
const text = options.text ?? this.text;
|
|
2495
2515
|
const separatorText = symbolText ? " " : "";
|
|
2496
2516
|
const fullText = typeof text === "string" ? separatorText + text : "";
|
|
2497
|
-
const suffixText = options.suffixText ??
|
|
2498
|
-
const fullSuffixText =
|
|
2517
|
+
const suffixText = options.suffixText ?? this.#suffixText;
|
|
2518
|
+
const fullSuffixText = this.#getFullSuffixText(suffixText, " ");
|
|
2499
2519
|
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + "\n";
|
|
2500
2520
|
this.stop();
|
|
2501
|
-
|
|
2521
|
+
this.#stream.write(textToWrite);
|
|
2502
2522
|
return this;
|
|
2503
2523
|
}
|
|
2504
2524
|
};
|
|
2505
|
-
_linesToClear = /* @__PURE__ */ new WeakMap();
|
|
2506
|
-
_isDiscardingStdin = /* @__PURE__ */ new WeakMap();
|
|
2507
|
-
_lineCount = /* @__PURE__ */ new WeakMap();
|
|
2508
|
-
_frameIndex = /* @__PURE__ */ new WeakMap();
|
|
2509
|
-
_lastSpinnerFrameTime = /* @__PURE__ */ new WeakMap();
|
|
2510
|
-
_options = /* @__PURE__ */ new WeakMap();
|
|
2511
|
-
_spinner = /* @__PURE__ */ new WeakMap();
|
|
2512
|
-
_stream = /* @__PURE__ */ new WeakMap();
|
|
2513
|
-
_id = /* @__PURE__ */ new WeakMap();
|
|
2514
|
-
_initialInterval = /* @__PURE__ */ new WeakMap();
|
|
2515
|
-
_isEnabled = /* @__PURE__ */ new WeakMap();
|
|
2516
|
-
_isSilent = /* @__PURE__ */ new WeakMap();
|
|
2517
|
-
_indent = /* @__PURE__ */ new WeakMap();
|
|
2518
|
-
_text = /* @__PURE__ */ new WeakMap();
|
|
2519
|
-
_prefixText = /* @__PURE__ */ new WeakMap();
|
|
2520
|
-
_suffixText = /* @__PURE__ */ new WeakMap();
|
|
2521
|
-
_Ora_instances = /* @__PURE__ */ new WeakSet();
|
|
2522
|
-
getFullPrefixText_fn = function(prefixText = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prefixText), postfix = " ") {
|
|
2523
|
-
if (typeof prefixText === "string" && prefixText !== "") {
|
|
2524
|
-
return prefixText + postfix;
|
|
2525
|
-
}
|
|
2526
|
-
if (typeof prefixText === "function") {
|
|
2527
|
-
return prefixText() + postfix;
|
|
2528
|
-
}
|
|
2529
|
-
return "";
|
|
2530
|
-
};
|
|
2531
|
-
getFullSuffixText_fn = function(suffixText = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _suffixText), prefix = " ") {
|
|
2532
|
-
if (typeof suffixText === "string" && suffixText !== "") {
|
|
2533
|
-
return prefix + suffixText;
|
|
2534
|
-
}
|
|
2535
|
-
if (typeof suffixText === "function") {
|
|
2536
|
-
return prefix + suffixText();
|
|
2537
|
-
}
|
|
2538
|
-
return "";
|
|
2539
|
-
};
|
|
2540
|
-
updateLineCount_fn = function() {
|
|
2541
|
-
const columns = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _stream).columns ?? 80;
|
|
2542
|
-
const fullPrefixText = (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _Ora_instances, getFullPrefixText_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prefixText), "-");
|
|
2543
|
-
const fullSuffixText = (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _Ora_instances, getFullSuffixText_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _suffixText), "-");
|
|
2544
|
-
const fullText = " ".repeat((0, import_chunk_WWAWV7DQ.__privateGet)(this, _indent)) + fullPrefixText + "--" + (0, import_chunk_WWAWV7DQ.__privateGet)(this, _text) + "--" + fullSuffixText;
|
|
2545
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _lineCount, 0);
|
|
2546
|
-
for (const line of (0, import_chunk_3VFKYWQZ.stripAnsi)(fullText).split("\n")) {
|
|
2547
|
-
(0, import_chunk_WWAWV7DQ.__privateSet)(this, _lineCount, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _lineCount) + Math.max(1, Math.ceil((0, import_chunk_3VFKYWQZ.stringWidth)(line, { countAnsiEscapeCodes: true }) / columns)));
|
|
2548
|
-
}
|
|
2549
|
-
};
|
|
2550
2525
|
function ora(options) {
|
|
2551
2526
|
return new Ora(options);
|
|
2552
2527
|
}
|
|
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_IWC5MH4R_exports = {};
|
|
20
|
+
__export(chunk_IWC5MH4R_exports, {
|
|
21
21
|
introspectSql: () => introspectSql
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_IWC5MH4R_exports);
|
|
24
|
+
var import_chunk_K43RXWQY = require("./chunk-K43RXWQY.js");
|
|
25
25
|
var import_internals = require("@prisma/internals");
|
|
26
26
|
var supportedProviders = ["postgresql", "cockroachdb", "mysql", "sqlite"];
|
|
27
27
|
async function introspectSql(schemaPath, queries) {
|
|
@@ -41,7 +41,7 @@ async function introspectSql(schemaPath, queries) {
|
|
|
41
41
|
if (!url) {
|
|
42
42
|
throw new Error(`Could not get url from datasource ${firstDatasource.name} in ${schema.schemaPath}`);
|
|
43
43
|
}
|
|
44
|
-
const schemaEngine = new
|
|
44
|
+
const schemaEngine = new import_chunk_K43RXWQY.SchemaEngine({ schemaPath: schema.schemaPath });
|
|
45
45
|
const results = [];
|
|
46
46
|
const errors = [];
|
|
47
47
|
try {
|