@8ms/helpers 1.33.0 → 1.33.1
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/package.json +1 -1
- package/prisma/initClient.js +3 -3
package/package.json
CHANGED
package/prisma/initClient.js
CHANGED
|
@@ -4,8 +4,8 @@ global.prisma = null;
|
|
|
4
4
|
const initClient = (props = {}) => {
|
|
5
5
|
if (!global.prisma) {
|
|
6
6
|
const { PrismaClient } = require("@prisma/client");
|
|
7
|
-
let adapter;
|
|
8
|
-
if (props?.planetScale) {
|
|
7
|
+
let adapter = null;
|
|
8
|
+
if (true === props?.planetScale) {
|
|
9
9
|
const { Client } = require("@planetscale/database");
|
|
10
10
|
const client = new Client({
|
|
11
11
|
url: process.env.DATABASE_URL
|
|
@@ -14,7 +14,7 @@ const initClient = (props = {}) => {
|
|
|
14
14
|
adapter = new PrismaPlanetScale(client);
|
|
15
15
|
}
|
|
16
16
|
// Show the full query if debugging
|
|
17
|
-
if (props?.debug) {
|
|
17
|
+
if (true === props?.debug) {
|
|
18
18
|
global.prisma = new PrismaClient({
|
|
19
19
|
adapter,
|
|
20
20
|
log: [
|