Skip to content

Commit 0262918

Browse files
Refactor: Move Prisma config to prisma.config.ts
Co-authored-by: me <[email protected]>
1 parent b65bc5b commit 0262918

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
"validate": "./other/validate",
4949
"setup": "npm install && prisma migrate reset --force && npm run validate && npm run prime-cache:mocks && npm run test:e2e:install && npm run test:e2e:run"
5050
},
51-
"prisma": {
52-
"seed": "tsx other/runfile prisma/seed.ts"
53-
},
5451
"dependencies": {
5552
"@conform-to/react": "^1.1.3",
5653
"@conform-to/zod": "^1.1.3",

prisma.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import path from "node:path";
2+
import { PrismaBetterSQLite3 } from "@prisma/adapter-better-sqlite3";
3+
import { type PrismaConfig } from "prisma";
4+
5+
// Import environment variables
6+
import "dotenv/config";
7+
8+
export default {
9+
experimental: {
10+
adapter: true,
11+
},
12+
schema: path.join("prisma", "schema.prisma"),
13+
migrations: {
14+
path: path.join("prisma", "migrations"),
15+
seed: "tsx other/runfile prisma/seed.ts",
16+
},
17+
async adapter() {
18+
return new PrismaBetterSQLite3({
19+
url: process.env.DATABASE_URL!,
20+
});
21+
},
22+
} satisfies PrismaConfig;

0 commit comments

Comments
 (0)