@prisma/cli-init 0.0.0-dev.202506210326 → 0.0.0-dev.202506212242
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.
|
@@ -344,7 +344,7 @@ import internals5 from "@prisma/internals";
|
|
|
344
344
|
import * as Checkpoint from "checkpoint-client";
|
|
345
345
|
|
|
346
346
|
// package.json
|
|
347
|
-
var version = "0.0.0-dev.
|
|
347
|
+
var version = "0.0.0-dev.202506212242";
|
|
348
348
|
|
|
349
349
|
// src/platform/_lib/userAgent.ts
|
|
350
350
|
var debug = Debug("prisma:cli:platform:_lib:userAgent");
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
printPpgInitOutput,
|
|
29
29
|
requestOrThrow,
|
|
30
30
|
successMessage
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-4FOWRGCN.js";
|
|
32
32
|
import {
|
|
33
33
|
__commonJS,
|
|
34
34
|
__require,
|
|
@@ -1485,13 +1485,13 @@ var require_lockfile = __commonJS({
|
|
|
1485
1485
|
if (lock3.released) {
|
|
1486
1486
|
return releasedCallback && releasedCallback(Object.assign(new Error("Lock is already released"), { code: "ERELEASED" }));
|
|
1487
1487
|
}
|
|
1488
|
-
|
|
1488
|
+
unlock2(file2, { ...options, realpath: false }, releasedCallback);
|
|
1489
1489
|
});
|
|
1490
1490
|
});
|
|
1491
1491
|
});
|
|
1492
1492
|
});
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function unlock2(file, options, callback) {
|
|
1495
1495
|
options = {
|
|
1496
1496
|
fs: fs3,
|
|
1497
1497
|
realpath: true,
|
|
@@ -1544,7 +1544,7 @@ var require_lockfile = __commonJS({
|
|
|
1544
1544
|
}
|
|
1545
1545
|
});
|
|
1546
1546
|
module.exports.lock = lock2;
|
|
1547
|
-
module.exports.unlock =
|
|
1547
|
+
module.exports.unlock = unlock2;
|
|
1548
1548
|
module.exports.check = check2;
|
|
1549
1549
|
module.exports.getLocks = getLocks;
|
|
1550
1550
|
}
|
|
@@ -1629,7 +1629,7 @@ var require_proper_lockfile = __commonJS({
|
|
|
1629
1629
|
const release = toSync(lockfile.lock)(file, toSyncOptions(options));
|
|
1630
1630
|
return toSync(release);
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1632
|
+
function unlock2(file, options) {
|
|
1633
1633
|
return toPromise(lockfile.unlock)(file, options);
|
|
1634
1634
|
}
|
|
1635
1635
|
function unlockSync(file, options) {
|
|
@@ -1643,7 +1643,7 @@ var require_proper_lockfile = __commonJS({
|
|
|
1643
1643
|
}
|
|
1644
1644
|
module.exports = lock2;
|
|
1645
1645
|
module.exports.lock = lock2;
|
|
1646
|
-
module.exports.unlock =
|
|
1646
|
+
module.exports.unlock = unlock2;
|
|
1647
1647
|
module.exports.lockSync = lockSync;
|
|
1648
1648
|
module.exports.unlockSync = unlockSync;
|
|
1649
1649
|
module.exports.check = check2;
|
|
@@ -2834,14 +2834,17 @@ var StatelessServerState = class extends ServerState {
|
|
|
2834
2834
|
var StatefulServerState = class _StatefulServerState extends ServerState {
|
|
2835
2835
|
#databaseDumpPath;
|
|
2836
2836
|
#dataDirPath;
|
|
2837
|
+
#lockfilePath;
|
|
2837
2838
|
#pglitePath;
|
|
2838
2839
|
#serverDumpPath;
|
|
2840
|
+
#closed;
|
|
2839
2841
|
#serverDump;
|
|
2840
|
-
#unlock = null;
|
|
2841
2842
|
constructor(options) {
|
|
2842
2843
|
super({ ...options, persistenceMode: "stateful" });
|
|
2844
|
+
this.#closed = false;
|
|
2843
2845
|
this.#dataDirPath = getDataDirPath(this.name);
|
|
2844
2846
|
this.#databaseDumpPath = join(this.#dataDirPath, "db_dump.bak");
|
|
2847
|
+
this.#lockfilePath = join(this.#dataDirPath, ".lock");
|
|
2845
2848
|
this.#pglitePath = join(this.#dataDirPath, ".pglite");
|
|
2846
2849
|
this.#serverDump = options?.serverDump ?? null;
|
|
2847
2850
|
this.#serverDumpPath = _StatefulServerState.getServerDumpPath(this.#dataDirPath);
|
|
@@ -2864,7 +2867,7 @@ var StatefulServerState = class _StatefulServerState extends ServerState {
|
|
|
2864
2867
|
console.debug(`[State] using data directory: ${this.#dataDirPath}`);
|
|
2865
2868
|
}
|
|
2866
2869
|
try {
|
|
2867
|
-
|
|
2870
|
+
await (0, import_proper_lockfile.lock)(this.#dataDirPath, { lockfilePath: this.#lockfilePath });
|
|
2868
2871
|
if (this.debug) {
|
|
2869
2872
|
console.debug(`[State] obtained lock on: ${this.#dataDirPath}`);
|
|
2870
2873
|
}
|
|
@@ -2891,27 +2894,22 @@ var StatefulServerState = class _StatefulServerState extends ServerState {
|
|
|
2891
2894
|
}
|
|
2892
2895
|
}
|
|
2893
2896
|
async close() {
|
|
2894
|
-
if (this.#
|
|
2897
|
+
if (this.#closed) {
|
|
2895
2898
|
return;
|
|
2896
2899
|
}
|
|
2897
2900
|
try {
|
|
2898
|
-
await this.#
|
|
2899
|
-
this.#
|
|
2901
|
+
await (0, import_proper_lockfile.unlock)(this.#dataDirPath, { lockfilePath: this.#lockfilePath });
|
|
2902
|
+
this.#closed = true;
|
|
2900
2903
|
if (this.debug) {
|
|
2901
2904
|
console.debug(`[State] released lock on: ${this.#dataDirPath}`);
|
|
2902
2905
|
}
|
|
2903
2906
|
} catch (error) {
|
|
2904
|
-
|
|
2907
|
+
if (this.debug) {
|
|
2908
|
+
console.error(`[State] failed to release lock on: ${this.#dataDirPath}`, error);
|
|
2909
|
+
}
|
|
2905
2910
|
throw error;
|
|
2906
2911
|
}
|
|
2907
2912
|
}
|
|
2908
|
-
async killProcess() {
|
|
2909
|
-
const { pid, status } = await getServerStatus(this, { debug: this.debug });
|
|
2910
|
-
if (pid == null || status !== "running" && status !== "starting_up") {
|
|
2911
|
-
return false;
|
|
2912
|
-
}
|
|
2913
|
-
return y.kill?.(pid, "SIGTERM") || false;
|
|
2914
|
-
}
|
|
2915
2913
|
async writeServerDump(exports) {
|
|
2916
2914
|
this.#serverDump = {
|
|
2917
2915
|
name: this.name,
|
|
@@ -3408,7 +3406,7 @@ var Init = class _Init {
|
|
|
3408
3406
|
let generatedSchema;
|
|
3409
3407
|
let generatedName;
|
|
3410
3408
|
if (isPpgCommand) {
|
|
3411
|
-
const PlatformCommands = await import("./_-
|
|
3409
|
+
const PlatformCommands = await import("./_-PR4ZNYAW.js");
|
|
3412
3410
|
const credentials = await credentialsFile.load();
|
|
3413
3411
|
if (internals.isError(credentials))
|
|
3414
3412
|
throw credentials;
|