@8ms/helpers 2.0.27 → 2.0.28
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
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -42,11 +42,11 @@ class PrismaNamespace extends _class_1.BaseNamespace {
|
|
|
42
42
|
// Async setup to only initialise where required
|
|
43
43
|
this.ensureInit = async () => {
|
|
44
44
|
if (!this.client) {
|
|
45
|
-
let
|
|
45
|
+
let planetScaleAdapter = null;
|
|
46
46
|
if (this.config.isPlanetScale) {
|
|
47
47
|
try {
|
|
48
48
|
const { PrismaPlanetScale } = await Promise.resolve().then(() => __importStar(require("@prisma/adapter-planetscale")));
|
|
49
|
-
|
|
49
|
+
planetScaleAdapter = new PrismaPlanetScale({
|
|
50
50
|
url: this.config.url,
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -59,8 +59,8 @@ class PrismaNamespace extends _class_1.BaseNamespace {
|
|
|
59
59
|
// Show the full query if debugging
|
|
60
60
|
if (this.config.isDebug) {
|
|
61
61
|
this.client = new PrismaClient({
|
|
62
|
-
adapter,
|
|
63
|
-
datasourceUrl: this.config.url,
|
|
62
|
+
adapter: planetScaleAdapter,
|
|
63
|
+
datasourceUrl: planetScaleAdapter ? undefined : this.config.url,
|
|
64
64
|
log: [
|
|
65
65
|
{
|
|
66
66
|
emit: "event",
|
|
@@ -72,8 +72,8 @@ class PrismaNamespace extends _class_1.BaseNamespace {
|
|
|
72
72
|
// Standard prisma
|
|
73
73
|
else {
|
|
74
74
|
this.client = new PrismaClient({
|
|
75
|
-
adapter,
|
|
76
|
-
datasourceUrl: this.config.url,
|
|
75
|
+
adapter: planetScaleAdapter,
|
|
76
|
+
datasourceUrl: planetScaleAdapter ? undefined : this.config.url,
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
}
|