@prisma/migrate 6.6.0-integration-mcp.3 → 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.5
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/bin.js +7 -7
- package/dist/chunk-GKDFIHM2.js +45 -0
- package/dist/{chunk-QSSFEJHM.js → chunk-L53C3AX3.js} +159 -26
- package/dist/{chunk-ZJ4IDCRR.js → chunk-QJT4H5N6.js} +4 -4
- package/dist/{chunk-QVMYNWAN.js → chunk-TGV6QGEF.js} +37 -191
- package/dist/{chunk-NXCH5SQP.js → chunk-XPDKMCDT.js} +160 -27
- package/dist/{chunk-4RKCE4QB.js → chunk-ZB5NPOJW.js} +3 -85
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/MigrateDiff.js +3 -3
- package/dist/index.js +10 -7
- package/dist/internals/src/cli/directoryConfig.d.ts +1 -1
- package/dist/internals/src/cli/getSchema.d.ts +28 -3
- package/dist/internals/src/cli/hashes.d.ts +2 -1
- package/dist/internals/src/cli/schemaContext.d.ts +3 -4
- package/dist/internals/src/index.d.ts +1 -1
- package/dist/migrate/src/index.d.ts +1 -0
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +10 -0
- package/dist/utils/getSchemaPathAndPrint.js +27 -0
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +67 -763
- package/dist/utils/setupPostgres.js +2 -2
- package/package.json +8 -8
|
@@ -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_XPDKMCDT_exports = {};
|
|
30
|
+
__export(chunk_XPDKMCDT_exports, {
|
|
31
31
|
MigrateDiff: () => MigrateDiff
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var import_chunk_4RKCE4QB = require("./chunk-4RKCE4QB.js");
|
|
33
|
+
module.exports = __toCommonJS(chunk_XPDKMCDT_exports);
|
|
35
34
|
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
35
|
+
var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
|
|
36
36
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
37
37
|
var import_chunk_PDCXVUV3 = require("./chunk-PDCXVUV3.js");
|
|
38
38
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
@@ -9335,12 +9335,93 @@ var require_lib5 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
9335
9335
|
module2.exports = GitHost;
|
|
9336
9336
|
}
|
|
9337
9337
|
});
|
|
9338
|
+
var require_implementation = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9339
|
+
"../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports, module2) {
|
|
9340
|
+
"use strict";
|
|
9341
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
9342
|
+
var toStr = Object.prototype.toString;
|
|
9343
|
+
var max = Math.max;
|
|
9344
|
+
var funcType = "[object Function]";
|
|
9345
|
+
var concatty = function concatty2(a, b) {
|
|
9346
|
+
var arr = [];
|
|
9347
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
9348
|
+
arr[i] = a[i];
|
|
9349
|
+
}
|
|
9350
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
9351
|
+
arr[j + a.length] = b[j];
|
|
9352
|
+
}
|
|
9353
|
+
return arr;
|
|
9354
|
+
};
|
|
9355
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
9356
|
+
var arr = [];
|
|
9357
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
9358
|
+
arr[j] = arrLike[i];
|
|
9359
|
+
}
|
|
9360
|
+
return arr;
|
|
9361
|
+
};
|
|
9362
|
+
var joiny = function(arr, joiner) {
|
|
9363
|
+
var str = "";
|
|
9364
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
9365
|
+
str += arr[i];
|
|
9366
|
+
if (i + 1 < arr.length) {
|
|
9367
|
+
str += joiner;
|
|
9368
|
+
}
|
|
9369
|
+
}
|
|
9370
|
+
return str;
|
|
9371
|
+
};
|
|
9372
|
+
module2.exports = function bind2(that) {
|
|
9373
|
+
var target = this;
|
|
9374
|
+
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
9375
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
9376
|
+
}
|
|
9377
|
+
var args = slicy(arguments, 1);
|
|
9378
|
+
var bound;
|
|
9379
|
+
var binder = function() {
|
|
9380
|
+
if (this instanceof bound) {
|
|
9381
|
+
var result = target.apply(
|
|
9382
|
+
this,
|
|
9383
|
+
concatty(args, arguments)
|
|
9384
|
+
);
|
|
9385
|
+
if (Object(result) === result) {
|
|
9386
|
+
return result;
|
|
9387
|
+
}
|
|
9388
|
+
return this;
|
|
9389
|
+
}
|
|
9390
|
+
return target.apply(
|
|
9391
|
+
that,
|
|
9392
|
+
concatty(args, arguments)
|
|
9393
|
+
);
|
|
9394
|
+
};
|
|
9395
|
+
var boundLength = max(0, target.length - args.length);
|
|
9396
|
+
var boundArgs = [];
|
|
9397
|
+
for (var i = 0; i < boundLength; i++) {
|
|
9398
|
+
boundArgs[i] = "$" + i;
|
|
9399
|
+
}
|
|
9400
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
9401
|
+
if (target.prototype) {
|
|
9402
|
+
var Empty = function Empty2() {
|
|
9403
|
+
};
|
|
9404
|
+
Empty.prototype = target.prototype;
|
|
9405
|
+
bound.prototype = new Empty();
|
|
9406
|
+
Empty.prototype = null;
|
|
9407
|
+
}
|
|
9408
|
+
return bound;
|
|
9409
|
+
};
|
|
9410
|
+
}
|
|
9411
|
+
});
|
|
9412
|
+
var require_function_bind = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9413
|
+
"../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports, module2) {
|
|
9414
|
+
"use strict";
|
|
9415
|
+
var implementation = require_implementation();
|
|
9416
|
+
module2.exports = Function.prototype.bind || implementation;
|
|
9417
|
+
}
|
|
9418
|
+
});
|
|
9338
9419
|
var require_hasown = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9339
9420
|
"../../node_modules/.pnpm/hasown@2.0.0/node_modules/hasown/index.js"(exports, module2) {
|
|
9340
9421
|
"use strict";
|
|
9341
9422
|
var call = Function.prototype.call;
|
|
9342
9423
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
9343
|
-
var bind2 =
|
|
9424
|
+
var bind2 = require_function_bind();
|
|
9344
9425
|
module2.exports = bind2.call(call, $hasOwn);
|
|
9345
9426
|
}
|
|
9346
9427
|
});
|
|
@@ -9624,8 +9705,8 @@ var require_typos = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
9624
9705
|
var require_fixer = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
9625
9706
|
"../../node_modules/.pnpm/normalize-package-data@6.0.0/node_modules/normalize-package-data/lib/fixer.js"(exports, module2) {
|
|
9626
9707
|
"use strict";
|
|
9627
|
-
var isValidSemver = (0,
|
|
9628
|
-
var cleanSemver = (0,
|
|
9708
|
+
var isValidSemver = (0, import_chunk_ZB5NPOJW.require_valid)();
|
|
9709
|
+
var cleanSemver = (0, import_chunk_ZB5NPOJW.require_clean)();
|
|
9629
9710
|
var validateLicense = require_validate_npm_package_license();
|
|
9630
9711
|
var hostedGitInfo = require_lib5();
|
|
9631
9712
|
var isBuiltinModule = require_is_core_module();
|
|
@@ -10171,7 +10252,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
10171
10252
|
"../internals/package.json"(exports, module2) {
|
|
10172
10253
|
module2.exports = {
|
|
10173
10254
|
name: "@prisma/internals",
|
|
10174
|
-
version: "6.6.0-integration-
|
|
10255
|
+
version: "6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.5",
|
|
10175
10256
|
description: "This package is intended for Prisma's internal use",
|
|
10176
10257
|
main: "dist/index.js",
|
|
10177
10258
|
types: "dist/index.d.ts",
|
|
@@ -10258,7 +10339,7 @@ var require_package = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
10258
10339
|
"@prisma/generator": "workspace:*",
|
|
10259
10340
|
"@prisma/generator-helper": "workspace:*",
|
|
10260
10341
|
"@prisma/get-platform": "workspace:*",
|
|
10261
|
-
"@prisma/prisma-schema-wasm": "6.6.0-
|
|
10342
|
+
"@prisma/prisma-schema-wasm": "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
|
|
10262
10343
|
"@prisma/schema-files-loader": "workspace:*",
|
|
10263
10344
|
arg: "5.0.2",
|
|
10264
10345
|
prompts: "2.4.2"
|
|
@@ -10904,16 +10985,15 @@ function renderLookupError(error) {
|
|
|
10904
10985
|
function renderDefaultLookupError(error, cwd) {
|
|
10905
10986
|
const parts = [
|
|
10906
10987
|
`Could not find Prisma Schema that is required for this command.`,
|
|
10907
|
-
`You can either provide it with ${(0, import_chunk_SKRR5WT4.green)(
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
`or put it into the default location (${(0, import_chunk_SKRR5WT4.green)("`./prisma/schema.prisma`")}, or ${(0, import_chunk_SKRR5WT4.green)("`./schema.prisma`")}.`,
|
|
10988
|
+
`You can either provide it with ${(0, import_chunk_SKRR5WT4.green)(
|
|
10989
|
+
"`--schema`"
|
|
10990
|
+
)} argument, set it as \`prisma.schema\` in your package.json or put it into the default location.`,
|
|
10911
10991
|
"Checked following paths:\n"
|
|
10912
10992
|
];
|
|
10913
10993
|
const printedPaths = /* @__PURE__ */ new Set();
|
|
10914
10994
|
for (const failure of error.failures) {
|
|
10915
|
-
const filePath = failure.path;
|
|
10916
|
-
if (!printedPaths.has(failure.path)) {
|
|
10995
|
+
const filePath = failure.rule.schemaPath.path;
|
|
10996
|
+
if (!printedPaths.has(failure.rule.schemaPath.path)) {
|
|
10917
10997
|
parts.push(`${import_path2.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
|
|
10918
10998
|
printedPaths.add(filePath);
|
|
10919
10999
|
}
|
|
@@ -10939,13 +11019,21 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
|
10939
11019
|
error: { kind: "PrismaConfigNotConfigured" }
|
|
10940
11020
|
};
|
|
10941
11021
|
}
|
|
10942
|
-
|
|
10943
|
-
if (
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10948
|
-
|
|
11022
|
+
let schemaResult;
|
|
11023
|
+
if (schemaPathFromConfig.kind === "single") {
|
|
11024
|
+
schemaResult = await readSchemaFromSingleFile(schemaPathFromConfig.filePath);
|
|
11025
|
+
if (!schemaResult.ok) {
|
|
11026
|
+
throw new Error(
|
|
11027
|
+
`Could not load schema from file \`${schemaPathFromConfig.filePath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
|
11028
|
+
);
|
|
11029
|
+
}
|
|
11030
|
+
} else {
|
|
11031
|
+
schemaResult = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
|
|
11032
|
+
if (!schemaResult.ok) {
|
|
11033
|
+
throw new Error(
|
|
11034
|
+
`Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
|
11035
|
+
);
|
|
11036
|
+
}
|
|
10949
11037
|
}
|
|
10950
11038
|
return schemaResult;
|
|
10951
11039
|
}
|
|
@@ -10980,14 +11068,51 @@ async function getSchemaFromPackageJson(cwd) {
|
|
|
10980
11068
|
return lookupResult;
|
|
10981
11069
|
}
|
|
10982
11070
|
async function getDefaultSchema(cwd, failures = []) {
|
|
10983
|
-
const
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
11071
|
+
const schemaPrisma = {
|
|
11072
|
+
schemaPath: {
|
|
11073
|
+
path: import_path2.default.join(cwd, "schema.prisma"),
|
|
11074
|
+
kind: "file"
|
|
11075
|
+
}
|
|
11076
|
+
};
|
|
11077
|
+
const prismaSchemaFile = {
|
|
11078
|
+
schemaPath: {
|
|
11079
|
+
path: import_path2.default.join(cwd, "prisma", "schema.prisma"),
|
|
11080
|
+
kind: "file"
|
|
11081
|
+
},
|
|
11082
|
+
conflictsWith: {
|
|
11083
|
+
path: import_path2.default.join(cwd, "prisma", "schema"),
|
|
11084
|
+
kind: "directory"
|
|
11085
|
+
}
|
|
11086
|
+
};
|
|
11087
|
+
const prismaSchemaFolder = {
|
|
11088
|
+
schemaPath: {
|
|
11089
|
+
path: import_path2.default.join(cwd, "prisma", "schema"),
|
|
11090
|
+
kind: "directory"
|
|
11091
|
+
},
|
|
11092
|
+
conflictsWith: {
|
|
11093
|
+
path: import_path2.default.join(cwd, "prisma", "schema.prisma"),
|
|
11094
|
+
kind: "file"
|
|
11095
|
+
}
|
|
11096
|
+
};
|
|
11097
|
+
const rules = [schemaPrisma, prismaSchemaFile, prismaSchemaFolder];
|
|
11098
|
+
for (const rule of rules) {
|
|
11099
|
+
debug2(`Checking existence of ${rule.schemaPath.path}`);
|
|
11100
|
+
const schema = await loadSchemaFromDefaultLocation(rule.schemaPath);
|
|
10987
11101
|
if (!schema.ok) {
|
|
10988
|
-
failures.push({
|
|
11102
|
+
failures.push({ rule, error: schema.error });
|
|
10989
11103
|
continue;
|
|
10990
11104
|
}
|
|
11105
|
+
if (rule.conflictsWith) {
|
|
11106
|
+
const conflictingSchema = await loadSchemaFromDefaultLocation(rule.conflictsWith);
|
|
11107
|
+
if (conflictingSchema.ok) {
|
|
11108
|
+
throw new Error(
|
|
11109
|
+
`Found Prisma Schemas at both \`${import_path2.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path2.default.relative(
|
|
11110
|
+
cwd,
|
|
11111
|
+
rule.conflictsWith.path
|
|
11112
|
+
)}\`. Please remove one.`
|
|
11113
|
+
);
|
|
11114
|
+
}
|
|
11115
|
+
}
|
|
10991
11116
|
return schema;
|
|
10992
11117
|
}
|
|
10993
11118
|
return {
|
|
@@ -10998,6 +11123,14 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
|
10998
11123
|
}
|
|
10999
11124
|
};
|
|
11000
11125
|
}
|
|
11126
|
+
async function loadSchemaFromDefaultLocation(lookupPath) {
|
|
11127
|
+
switch (lookupPath.kind) {
|
|
11128
|
+
case "file":
|
|
11129
|
+
return readSchemaFromSingleFile(lookupPath.path);
|
|
11130
|
+
case "directory":
|
|
11131
|
+
return readSchemaFromDirectory(lookupPath.path);
|
|
11132
|
+
}
|
|
11133
|
+
}
|
|
11001
11134
|
var debug3 = (0, import_debug.default)("prisma:migrate:diff");
|
|
11002
11135
|
var helpOptions = (0, import_internals.format)(
|
|
11003
11136
|
`${(0, import_chunk_SKRR5WT4.bold)("Usage")}
|
|
@@ -16,12 +16,11 @@ 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_ZB5NPOJW_exports = {};
|
|
20
|
+
__export(chunk_ZB5NPOJW_exports, {
|
|
21
21
|
require_clean: () => require_clean,
|
|
22
22
|
require_constants: () => require_constants,
|
|
23
23
|
require_debug: () => require_debug,
|
|
24
|
-
require_function_bind: () => require_function_bind,
|
|
25
24
|
require_identifiers: () => require_identifiers,
|
|
26
25
|
require_parse: () => require_parse,
|
|
27
26
|
require_parse_options: () => require_parse_options,
|
|
@@ -29,7 +28,7 @@ __export(chunk_4RKCE4QB_exports, {
|
|
|
29
28
|
require_semver: () => require_semver,
|
|
30
29
|
require_valid: () => require_valid
|
|
31
30
|
});
|
|
32
|
-
module.exports = __toCommonJS(
|
|
31
|
+
module.exports = __toCommonJS(chunk_ZB5NPOJW_exports);
|
|
33
32
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
34
33
|
var require_debug = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
35
34
|
"../../node_modules/.pnpm/semver@7.7.0/node_modules/semver/internal/debug.js"(exports, module2) {
|
|
@@ -491,84 +490,3 @@ var require_clean = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
491
490
|
module2.exports = clean;
|
|
492
491
|
}
|
|
493
492
|
});
|
|
494
|
-
var require_implementation = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
495
|
-
"../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports, module2) {
|
|
496
|
-
"use strict";
|
|
497
|
-
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
498
|
-
var toStr = Object.prototype.toString;
|
|
499
|
-
var max = Math.max;
|
|
500
|
-
var funcType = "[object Function]";
|
|
501
|
-
var concatty = function concatty2(a, b) {
|
|
502
|
-
var arr = [];
|
|
503
|
-
for (var i = 0; i < a.length; i += 1) {
|
|
504
|
-
arr[i] = a[i];
|
|
505
|
-
}
|
|
506
|
-
for (var j = 0; j < b.length; j += 1) {
|
|
507
|
-
arr[j + a.length] = b[j];
|
|
508
|
-
}
|
|
509
|
-
return arr;
|
|
510
|
-
};
|
|
511
|
-
var slicy = function slicy2(arrLike, offset) {
|
|
512
|
-
var arr = [];
|
|
513
|
-
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
514
|
-
arr[j] = arrLike[i];
|
|
515
|
-
}
|
|
516
|
-
return arr;
|
|
517
|
-
};
|
|
518
|
-
var joiny = function(arr, joiner) {
|
|
519
|
-
var str = "";
|
|
520
|
-
for (var i = 0; i < arr.length; i += 1) {
|
|
521
|
-
str += arr[i];
|
|
522
|
-
if (i + 1 < arr.length) {
|
|
523
|
-
str += joiner;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return str;
|
|
527
|
-
};
|
|
528
|
-
module2.exports = function bind(that) {
|
|
529
|
-
var target = this;
|
|
530
|
-
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
531
|
-
throw new TypeError(ERROR_MESSAGE + target);
|
|
532
|
-
}
|
|
533
|
-
var args = slicy(arguments, 1);
|
|
534
|
-
var bound;
|
|
535
|
-
var binder = function() {
|
|
536
|
-
if (this instanceof bound) {
|
|
537
|
-
var result = target.apply(
|
|
538
|
-
this,
|
|
539
|
-
concatty(args, arguments)
|
|
540
|
-
);
|
|
541
|
-
if (Object(result) === result) {
|
|
542
|
-
return result;
|
|
543
|
-
}
|
|
544
|
-
return this;
|
|
545
|
-
}
|
|
546
|
-
return target.apply(
|
|
547
|
-
that,
|
|
548
|
-
concatty(args, arguments)
|
|
549
|
-
);
|
|
550
|
-
};
|
|
551
|
-
var boundLength = max(0, target.length - args.length);
|
|
552
|
-
var boundArgs = [];
|
|
553
|
-
for (var i = 0; i < boundLength; i++) {
|
|
554
|
-
boundArgs[i] = "$" + i;
|
|
555
|
-
}
|
|
556
|
-
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
557
|
-
if (target.prototype) {
|
|
558
|
-
var Empty = function Empty2() {
|
|
559
|
-
};
|
|
560
|
-
Empty.prototype = target.prototype;
|
|
561
|
-
bound.prototype = new Empty();
|
|
562
|
-
Empty.prototype = null;
|
|
563
|
-
}
|
|
564
|
-
return bound;
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
var require_function_bind = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
569
|
-
"../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports, module2) {
|
|
570
|
-
"use strict";
|
|
571
|
-
var implementation = require_implementation();
|
|
572
|
-
module2.exports = Function.prototype.bind || implementation;
|
|
573
|
-
}
|
|
574
|
-
});
|
package/dist/commands/DbPull.js
CHANGED
|
@@ -18,16 +18,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var DbPull_exports = {};
|
|
20
20
|
__export(DbPull_exports, {
|
|
21
|
-
DbPull: () =>
|
|
21
|
+
DbPull: () => import_chunk_QJT4H5N6.DbPull
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(DbPull_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_QJT4H5N6 = require("../chunk-QJT4H5N6.js");
|
|
25
25
|
var import_chunk_IINN7QUV = require("../chunk-IINN7QUV.js");
|
|
26
|
+
var import_chunk_JZ75RIMZ = require("../chunk-JZ75RIMZ.js");
|
|
26
27
|
var import_chunk_RR6BKMNO = require("../chunk-RR6BKMNO.js");
|
|
27
28
|
var import_chunk_RTGQXNX6 = require("../chunk-RTGQXNX6.js");
|
|
28
29
|
var import_chunk_AI6DH66U = require("../chunk-AI6DH66U.js");
|
|
29
30
|
var import_chunk_AHJ2N6BJ = require("../chunk-AHJ2N6BJ.js");
|
|
30
|
-
var import_chunk_JZ75RIMZ = require("../chunk-JZ75RIMZ.js");
|
|
31
31
|
var import_chunk_JFKDSUIE = require("../chunk-JFKDSUIE.js");
|
|
32
32
|
var import_chunk_LGYRZ6CV = require("../chunk-LGYRZ6CV.js");
|
|
33
33
|
var import_chunk_2R6DII47 = require("../chunk-2R6DII47.js");
|
|
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var MigrateDiff_exports = {};
|
|
20
20
|
__export(MigrateDiff_exports, {
|
|
21
|
-
MigrateDiff: () =>
|
|
21
|
+
MigrateDiff: () => import_chunk_XPDKMCDT.MigrateDiff
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(MigrateDiff_exports);
|
|
24
|
-
var
|
|
25
|
-
var import_chunk_4RKCE4QB = require("../chunk-4RKCE4QB.js");
|
|
24
|
+
var import_chunk_XPDKMCDT = require("../chunk-XPDKMCDT.js");
|
|
26
25
|
var import_chunk_33LPBNDX = require("../chunk-33LPBNDX.js");
|
|
26
|
+
var import_chunk_ZB5NPOJW = require("../chunk-ZB5NPOJW.js");
|
|
27
27
|
var import_chunk_VAJ4VX67 = require("../chunk-VAJ4VX67.js");
|
|
28
28
|
var import_chunk_PDCXVUV3 = require("../chunk-PDCXVUV3.js");
|
|
29
29
|
var import_chunk_V6PVGSDJ = require("../chunk-V6PVGSDJ.js");
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ __export(index_exports, {
|
|
|
21
21
|
DbCommand: () => import_chunk_EJG7GKM7.DbCommand,
|
|
22
22
|
DbDrop: () => import_chunk_SQKGZVG3.DbDrop,
|
|
23
23
|
DbExecute: () => import_chunk_GAKKKF5T.DbExecute,
|
|
24
|
-
DbPull: () =>
|
|
24
|
+
DbPull: () => import_chunk_QJT4H5N6.DbPull,
|
|
25
25
|
DbPush: () => import_chunk_3PIR4R46.DbPush,
|
|
26
26
|
DbSeed: () => import_chunk_B4SUSDC2.DbSeed,
|
|
27
27
|
EngineResults: () => import_chunk_LVR7W5DD.EngineResults,
|
|
@@ -29,29 +29,32 @@ __export(index_exports, {
|
|
|
29
29
|
MigrateCommand: () => import_chunk_LLO7YF56.MigrateCommand,
|
|
30
30
|
MigrateDeploy: () => import_chunk_HHVLUI3H.MigrateDeploy,
|
|
31
31
|
MigrateDev: () => import_chunk_CKRN45WP.MigrateDev,
|
|
32
|
-
MigrateDiff: () =>
|
|
32
|
+
MigrateDiff: () => import_chunk_XPDKMCDT.MigrateDiff,
|
|
33
33
|
MigrateReset: () => import_chunk_O723A5JE.MigrateReset,
|
|
34
34
|
MigrateResolve: () => import_chunk_KN2W5IP7.MigrateResolve,
|
|
35
35
|
MigrateStatus: () => import_chunk_GKHRL6AR.MigrateStatus,
|
|
36
36
|
SchemaEngine: () => import_chunk_D2DGSPW6.SchemaEngine,
|
|
37
37
|
byline: () => import_chunk_L6KOIJJ5.byline,
|
|
38
38
|
getDatabaseVersionSafe: () => import_chunk_NIKXBMZL.getDatabaseVersionSafe,
|
|
39
|
-
|
|
39
|
+
getSchemaPathAndPrint: () => import_chunk_GKDFIHM2.getSchemaPathAndPrint,
|
|
40
|
+
introspectSql: () => import_chunk_5LTDMS3H.introspectSql,
|
|
41
|
+
printSchemaLoadedMessage: () => import_chunk_GKDFIHM2.printSchemaLoadedMessage
|
|
40
42
|
});
|
|
41
43
|
module.exports = __toCommonJS(index_exports);
|
|
44
|
+
var import_chunk_GKDFIHM2 = require("./chunk-GKDFIHM2.js");
|
|
42
45
|
var import_chunk_5LTDMS3H = require("./chunk-5LTDMS3H.js");
|
|
43
46
|
var import_chunk_NIKXBMZL = require("./chunk-NIKXBMZL.js");
|
|
44
47
|
var import_chunk_O723A5JE = require("./chunk-O723A5JE.js");
|
|
45
48
|
var import_chunk_KN2W5IP7 = require("./chunk-KN2W5IP7.js");
|
|
46
49
|
var import_chunk_GKHRL6AR = require("./chunk-GKHRL6AR.js");
|
|
47
50
|
var import_chunk_GAKKKF5T = require("./chunk-GAKKKF5T.js");
|
|
48
|
-
var
|
|
51
|
+
var import_chunk_QJT4H5N6 = require("./chunk-QJT4H5N6.js");
|
|
49
52
|
var import_chunk_IINN7QUV = require("./chunk-IINN7QUV.js");
|
|
53
|
+
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
50
54
|
var import_chunk_RR6BKMNO = require("./chunk-RR6BKMNO.js");
|
|
51
55
|
var import_chunk_RTGQXNX6 = require("./chunk-RTGQXNX6.js");
|
|
52
56
|
var import_chunk_AI6DH66U = require("./chunk-AI6DH66U.js");
|
|
53
57
|
var import_chunk_AHJ2N6BJ = require("./chunk-AHJ2N6BJ.js");
|
|
54
|
-
var import_chunk_JZ75RIMZ = require("./chunk-JZ75RIMZ.js");
|
|
55
58
|
var import_chunk_JFKDSUIE = require("./chunk-JFKDSUIE.js");
|
|
56
59
|
var import_chunk_LGYRZ6CV = require("./chunk-LGYRZ6CV.js");
|
|
57
60
|
var import_chunk_3PIR4R46 = require("./chunk-3PIR4R46.js");
|
|
@@ -65,9 +68,9 @@ var import_chunk_5LKIRKDL = require("./chunk-5LKIRKDL.js");
|
|
|
65
68
|
var import_chunk_KRQEFTDT = require("./chunk-KRQEFTDT.js");
|
|
66
69
|
var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
|
|
67
70
|
var import_chunk_2R6DII47 = require("./chunk-2R6DII47.js");
|
|
68
|
-
var
|
|
69
|
-
var import_chunk_4RKCE4QB = require("./chunk-4RKCE4QB.js");
|
|
71
|
+
var import_chunk_XPDKMCDT = require("./chunk-XPDKMCDT.js");
|
|
70
72
|
var import_chunk_33LPBNDX = require("./chunk-33LPBNDX.js");
|
|
73
|
+
var import_chunk_ZB5NPOJW = require("./chunk-ZB5NPOJW.js");
|
|
71
74
|
var import_chunk_VAJ4VX67 = require("./chunk-VAJ4VX67.js");
|
|
72
75
|
var import_chunk_PDCXVUV3 = require("./chunk-PDCXVUV3.js");
|
|
73
76
|
var import_chunk_V6PVGSDJ = require("./chunk-V6PVGSDJ.js");
|
|
@@ -4,4 +4,4 @@ export type DirectoryConfig = {
|
|
|
4
4
|
typedSqlDirPath: string;
|
|
5
5
|
migrationsDirPath: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function inferDirectoryConfig(schemaContext?: SchemaContext | null
|
|
7
|
+
export declare function inferDirectoryConfig(schemaContext?: SchemaContext | null): DirectoryConfig;
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import type { GetSchemaResult, SuccessfulLookupResult } from '@prisma/schema-files-loader';
|
|
2
|
+
import type { MultipleSchemas } from '../utils/schemaFileInput';
|
|
2
3
|
type PackageJsonLookupResult = SuccessfulLookupResult | {
|
|
3
4
|
ok: false;
|
|
4
5
|
error: {
|
|
5
6
|
kind: 'PackageJsonNotConfigured';
|
|
6
7
|
};
|
|
7
8
|
};
|
|
9
|
+
export type SchemaPathFromConfig = {
|
|
10
|
+
/**
|
|
11
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
|
12
|
+
*/
|
|
13
|
+
kind: 'single';
|
|
14
|
+
/**
|
|
15
|
+
* The path to a single `.prisma` schema file.
|
|
16
|
+
*/
|
|
17
|
+
filePath: string;
|
|
18
|
+
} | {
|
|
19
|
+
/**
|
|
20
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
21
|
+
*/
|
|
22
|
+
kind: 'multi';
|
|
23
|
+
/**
|
|
24
|
+
* The path to a folder containing multiple `.prisma` schema files.
|
|
25
|
+
* All of the files in this folder will be used.
|
|
26
|
+
*/
|
|
27
|
+
folderPath: string;
|
|
28
|
+
};
|
|
8
29
|
export type GetSchemaOptions = {
|
|
9
30
|
cwd?: string;
|
|
10
31
|
argumentName?: string;
|
|
@@ -15,7 +36,7 @@ export type GetSchemaOptions = {
|
|
|
15
36
|
* @param schemaPathFromConfig
|
|
16
37
|
* @param opts
|
|
17
38
|
*/
|
|
18
|
-
export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPathFromConfig?:
|
|
39
|
+
export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult>;
|
|
19
40
|
/**
|
|
20
41
|
* Loads the schema, returns null if it is not found
|
|
21
42
|
* Throws an error if schema is specified explicitly in
|
|
@@ -26,8 +47,7 @@ export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPat
|
|
|
26
47
|
* @param opts
|
|
27
48
|
* @returns
|
|
28
49
|
*/
|
|
29
|
-
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, schemaPathFromConfig?:
|
|
30
|
-
export declare function printSchemaLoadedMessage(schemaPath: string): void;
|
|
50
|
+
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult | null>;
|
|
31
51
|
export type PrismaConfig = {
|
|
32
52
|
schema?: string;
|
|
33
53
|
seed?: string;
|
|
@@ -37,4 +57,9 @@ export declare function getPrismaConfigFromPackageJson(cwd: string): Promise<{
|
|
|
37
57
|
packagePath: string;
|
|
38
58
|
} | null>;
|
|
39
59
|
export declare function getSchemaFromPackageJson(cwd: string): Promise<PackageJsonLookupResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Small helper that returns the directory which contains the `schema.prisma` file
|
|
62
|
+
*/
|
|
63
|
+
export declare function getSchemaDir(schemaPathFromArgs?: string): Promise<string | null>;
|
|
64
|
+
export declare function getSchema(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig): Promise<MultipleSchemas>;
|
|
40
65
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type SchemaPathFromConfig } from './getSchema';
|
|
1
2
|
/**
|
|
2
3
|
* Get a unique identifier for the project by hashing
|
|
3
4
|
* the directory with `schema.prisma`
|
|
4
5
|
*/
|
|
5
|
-
export declare function getProjectHash(schemaPathFromArgs: string | undefined, schemaPathFromConfig:
|
|
6
|
+
export declare function getProjectHash(schemaPathFromArgs: string | undefined, schemaPathFromConfig: SchemaPathFromConfig | undefined): Promise<string>;
|
|
6
7
|
/**
|
|
7
8
|
* Get a unique identifier for the CLI installation path
|
|
8
9
|
* which can be either global or local (in project's node_modules)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DataSource, GeneratorConfig } from '@prisma/generator';
|
|
2
2
|
import { GetSchemaResult, LoadedFile } from '@prisma/schema-files-loader';
|
|
3
|
+
import { SchemaPathFromConfig } from './getSchema';
|
|
3
4
|
export type SchemaContext = {
|
|
4
5
|
/**
|
|
5
6
|
* All loaded schema files and their paths.
|
|
@@ -39,21 +40,19 @@ export type SchemaContext = {
|
|
|
39
40
|
};
|
|
40
41
|
type LoadSchemaContextOptions = {
|
|
41
42
|
schemaPathFromArg?: string;
|
|
42
|
-
schemaPathFromConfig?:
|
|
43
|
+
schemaPathFromConfig?: SchemaPathFromConfig;
|
|
43
44
|
printLoadMessage?: boolean;
|
|
44
45
|
ignoreEnvVarErrors?: boolean;
|
|
45
46
|
allowNull?: boolean;
|
|
46
47
|
schemaPathArgumentName?: string;
|
|
47
|
-
cwd?: string;
|
|
48
48
|
};
|
|
49
49
|
export declare function loadSchemaContext(opts: LoadSchemaContextOptions & {
|
|
50
50
|
allowNull: true;
|
|
51
51
|
}): Promise<SchemaContext | null>;
|
|
52
52
|
export declare function loadSchemaContext(opts?: LoadSchemaContextOptions): Promise<SchemaContext>;
|
|
53
|
-
export declare function processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors,
|
|
53
|
+
export declare function processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors, }: {
|
|
54
54
|
schemaResult: GetSchemaResult;
|
|
55
55
|
printLoadMessage?: boolean;
|
|
56
56
|
ignoreEnvVarErrors?: boolean;
|
|
57
|
-
cwd?: string;
|
|
58
57
|
}): Promise<SchemaContext>;
|
|
59
58
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { checkUnsupportedDataProxy } from './cli/checkUnsupportedDataProxy';
|
|
2
2
|
export { type DirectoryConfig, inferDirectoryConfig } from './cli/directoryConfig';
|
|
3
3
|
export { getGeneratorSuccessMessage } from './cli/getGeneratorSuccessMessage';
|
|
4
|
-
export { getPrismaConfigFromPackageJson, type GetSchemaOptions, getSchemaWithPath, getSchemaWithPathOptional,
|
|
4
|
+
export { getPrismaConfigFromPackageJson, getSchema, getSchemaDir, type GetSchemaOptions, getSchemaWithPath, getSchemaWithPathOptional, type SchemaPathFromConfig, } from './cli/getSchema';
|
|
5
5
|
export { getTypescriptVersion } from './cli/getTypescriptVersion';
|
|
6
6
|
export { getCLIPathHash, getProjectHash } from './cli/hashes';
|
|
7
7
|
export { unknownCommand } from './cli/Help';
|
|
@@ -16,4 +16,5 @@ export { SchemaEngine } from './SchemaEngine';
|
|
|
16
16
|
export * from './types';
|
|
17
17
|
export { default as byline } from './utils/byline';
|
|
18
18
|
export { getDatabaseVersionSafe } from './utils/getDatabaseVersionSafe';
|
|
19
|
+
export { getSchemaPathAndPrint, printSchemaLoadedMessage } from './utils/getSchemaPathAndPrint';
|
|
19
20
|
export { introspectSql, type IntrospectSqlError, type IntrospectSqlInput, type IntrospectSqlResult, } from './utils/introspectSql';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type GetSchemaOptions, type GetSchemaResult, type SchemaPathFromConfig } from '@prisma/internals';
|
|
2
|
+
/**
|
|
3
|
+
* If a path is provided checks that it exists or error
|
|
4
|
+
* If no path provided check in default location(s) or error
|
|
5
|
+
* Schema found: print to console its relative path
|
|
6
|
+
*
|
|
7
|
+
* @returns {GetSchemaResult}
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSchemaPathAndPrint(schemaPathProvided?: string, schemaPathFromConfig?: SchemaPathFromConfig, options?: GetSchemaOptions): Promise<GetSchemaResult>;
|
|
10
|
+
export declare function printSchemaLoadedMessage(schemaPath: string): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var getSchemaPathAndPrint_exports = {};
|
|
20
|
+
__export(getSchemaPathAndPrint_exports, {
|
|
21
|
+
getSchemaPathAndPrint: () => import_chunk_GKDFIHM2.getSchemaPathAndPrint,
|
|
22
|
+
printSchemaLoadedMessage: () => import_chunk_GKDFIHM2.printSchemaLoadedMessage
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(getSchemaPathAndPrint_exports);
|
|
25
|
+
var import_chunk_GKDFIHM2 = require("../chunk-GKDFIHM2.js");
|
|
26
|
+
var import_chunk_SKRR5WT4 = require("../chunk-SKRR5WT4.js");
|
|
27
|
+
var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
|
|
@@ -32,12 +32,12 @@ __export(setupCockroach_exports, {
|
|
|
32
32
|
tearDownCockroach: () => tearDownCockroach
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(setupCockroach_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_TGV6QGEF = require("../chunk-TGV6QGEF.js");
|
|
36
36
|
var import_chunk_2ESYSVXG = require("../chunk-2ESYSVXG.js");
|
|
37
37
|
var import_internals = require("@prisma/internals");
|
|
38
38
|
var import_fs = __toESM(require("fs"));
|
|
39
39
|
var import_path = __toESM(require("path"));
|
|
40
|
-
var import_pg = (0, import_chunk_2ESYSVXG.__toESM)((0,
|
|
40
|
+
var import_pg = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_TGV6QGEF.require_lib)());
|
|
41
41
|
async function setupCockroach(options) {
|
|
42
42
|
const { connectionString } = options;
|
|
43
43
|
const { dirname } = options;
|