Skip to content

Commit 98fe9e6

Browse files
Add reference projects for testing Prisma 5.x and 6.6+ compatibility
Co-Authored-By: Eric Allam <[email protected]>
1 parent 72f015d commit 98fe9e6

File tree

8 files changed

+173
-0
lines changed

8 files changed

+173
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Prisma 6.6+ Compatibility Test
2+
3+
This reference project tests the compatibility of the Trigger.dev build system with Prisma 6.6+.
4+
5+
## Structure
6+
7+
- Uses Prisma 6.6.0
8+
- Schema folder structure (`prisma/schema/schema.prisma`)
9+
- Custom output path specified (`output = "../generated/client"`)
10+
11+
## Testing
12+
13+
1. Install dependencies:
14+
```
15+
npm install
16+
```
17+
18+
2. Generate Prisma client:
19+
```
20+
npm run generate:prisma
21+
```
22+
23+
3. Run the test:
24+
```
25+
npm test
26+
```
27+
28+
This test verifies that the `--schema` flag works correctly with Prisma 6.6+ when using schema folders and custom output paths.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { PrismaClient } = require("@prisma/client");
2+
3+
async function main() {
4+
try {
5+
const prisma = new PrismaClient();
6+
console.log("Connected to Prisma 6.6.0");
7+
8+
const user = await prisma.user.create({
9+
data: {
10+
11+
name: "Test User"
12+
}
13+
});
14+
15+
console.log("Created user:", user);
16+
17+
await prisma.$disconnect();
18+
console.log("Test completed successfully");
19+
} catch (error) {
20+
console.error("Test failed:", error);
21+
process.exit(1);
22+
}
23+
}
24+
25+
main();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "prisma-test-new",
3+
"version": "1.0.0",
4+
"description": "Test project for Prisma 6.6+ compatibility",
5+
"main": "index.js",
6+
"scripts": {
7+
"generate:prisma": "prisma generate",
8+
"test": "node index.js"
9+
},
10+
"keywords": ["prisma", "test", "compatibility"],
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@prisma/client": "^6.6.0"
15+
},
16+
"devDependencies": {
17+
"prisma": "^6.6.0"
18+
}
19+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
generator client {
2+
provider = "prisma-client-js"
3+
output = "../generated/client"
4+
}
5+
6+
datasource db {
7+
provider = "sqlite"
8+
url = "file:./dev.db"
9+
}
10+
11+
model User {
12+
id Int @id @default(autoincrement())
13+
email String @unique
14+
name String?
15+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Prisma 5.x Compatibility Test
2+
3+
This reference project tests the compatibility of the Trigger.dev build system with Prisma 5.x.
4+
5+
## Structure
6+
7+
- Uses Prisma 5.0.0
8+
- Schema folder structure (`prisma/schema/schema.prisma`)
9+
- No output path specified (uses default node_modules location)
10+
11+
## Testing
12+
13+
1. Install dependencies:
14+
```
15+
npm install
16+
```
17+
18+
2. Generate Prisma client:
19+
```
20+
npm run generate:prisma
21+
```
22+
23+
3. Run the test:
24+
```
25+
npm test
26+
```
27+
28+
This test verifies that the `--schema` flag works correctly with Prisma 5.x when using schema folders.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { PrismaClient } = require("@prisma/client");
2+
3+
async function main() {
4+
try {
5+
const prisma = new PrismaClient();
6+
console.log("Connected to Prisma 5.0.0");
7+
8+
const user = await prisma.user.create({
9+
data: {
10+
11+
name: "Test User"
12+
}
13+
});
14+
15+
console.log("Created user:", user);
16+
17+
await prisma.$disconnect();
18+
console.log("Test completed successfully");
19+
} catch (error) {
20+
console.error("Test failed:", error);
21+
process.exit(1);
22+
}
23+
}
24+
25+
main();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "prisma-test-old",
3+
"version": "1.0.0",
4+
"description": "Test project for Prisma 5.x compatibility",
5+
"main": "index.js",
6+
"scripts": {
7+
"generate:prisma": "prisma generate",
8+
"test": "node index.js"
9+
},
10+
"keywords": ["prisma", "test", "compatibility"],
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@prisma/client": "^5.0.0"
15+
},
16+
"devDependencies": {
17+
"prisma": "^5.0.0"
18+
}
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
generator client {
2+
provider = "prisma-client-js"
3+
}
4+
5+
datasource db {
6+
provider = "sqlite"
7+
url = "file:./dev.db"
8+
}
9+
10+
model User {
11+
id Int @id @default(autoincrement())
12+
email String @unique
13+
name String?
14+
}

0 commit comments

Comments
 (0)