@8ms/helpers 2.0.8 → 2.0.9
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/.yarn/install-state.gz +0 -0
- package/package.json +1 -1
- package/prisma/PrismaNamespace.js +15 -6
- package/prisma/server.js +1 -0
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -41,19 +41,25 @@ class PrismaNamespace extends _class_1.BaseNamespace {
|
|
|
41
41
|
// Async setup to only initialise where required
|
|
42
42
|
this.ensureInit = async () => {
|
|
43
43
|
if (!this.client) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (this.config.isPlanetScale) {
|
|
44
|
+
let adapter;
|
|
45
|
+
if (this.config.isPlanetScale) {
|
|
46
|
+
try {
|
|
48
47
|
const { PrismaPlanetScale } = await Promise.resolve().then(() => __importStar(require("@prisma/adapter-planetscale")));
|
|
49
48
|
adapter = new PrismaPlanetScale({
|
|
50
49
|
url: this.config.url,
|
|
51
50
|
});
|
|
52
51
|
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
throw new Error("PlanetScale Client not installed");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const { PrismaClient } = await Promise.resolve().then(() => __importStar(require("@prisma/client")));
|
|
53
58
|
// Show the full query if debugging
|
|
54
59
|
if (this.config.isDebug) {
|
|
55
60
|
this.client = new PrismaClient({
|
|
56
61
|
adapter,
|
|
62
|
+
datasourceUrl: this.config.url,
|
|
57
63
|
log: [
|
|
58
64
|
{
|
|
59
65
|
emit: "event",
|
|
@@ -64,11 +70,14 @@ class PrismaNamespace extends _class_1.BaseNamespace {
|
|
|
64
70
|
}
|
|
65
71
|
// Standard prisma
|
|
66
72
|
else {
|
|
67
|
-
this.client = new PrismaClient({
|
|
73
|
+
this.client = new PrismaClient({
|
|
74
|
+
adapter,
|
|
75
|
+
datasourceUrl: this.config.url,
|
|
76
|
+
});
|
|
68
77
|
}
|
|
69
78
|
}
|
|
70
79
|
catch (e) {
|
|
71
|
-
throw new Error("Prisma
|
|
80
|
+
throw new Error("Prisma Client not installed");
|
|
72
81
|
}
|
|
73
82
|
}
|
|
74
83
|
};
|
package/prisma/server.js
CHANGED