create-better-t-stack 3.4.2-canary.2077910a → 3.4.2-canary.281ca96d
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.4.2-canary.
|
|
3
|
+
"version": "3.4.2-canary.281ca96d",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PrismaClient } from "../prisma/generated/client";
|
|
2
|
+
|
|
2
3
|
{{#if (eq dbSetup "planetscale")}}
|
|
3
4
|
import { PrismaPlanetScale } from "@prisma/adapter-planetscale";
|
|
4
5
|
|
|
@@ -7,15 +8,18 @@ const prisma = new PrismaClient({ adapter });
|
|
|
7
8
|
{{else}}
|
|
8
9
|
import { PrismaMariaDb } from "@prisma/adapter-mariadb";
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const databaseUrl: string = process.env.DATABASE_URL!;
|
|
12
|
+
|
|
13
|
+
const url: URL = new URL(databaseUrl);
|
|
14
|
+
const connectionConfig = {
|
|
15
|
+
host: url.hostname,
|
|
16
|
+
port: parseInt(url.port || "3306"),
|
|
17
|
+
user: url.username,
|
|
18
|
+
password: url.password,
|
|
19
|
+
database: url.pathname.slice(1),
|
|
20
|
+
};
|
|
18
21
|
|
|
22
|
+
const adapter = new PrismaMariaDb(connectionConfig);
|
|
19
23
|
const prisma = new PrismaClient({ adapter });
|
|
20
24
|
{{/if}}
|
|
21
25
|
|