@stablemates/workhorse-prisma 0.8.0 → 0.10.0

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.
Files changed (2) hide show
  1. package/README.md +6 -1
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -13,12 +13,16 @@ The Prisma ORM provider for enqueuing Workhorse tasks through Prisma transaction
13
13
  npm install @stablemates/workhorse @stablemates/workhorse-prisma @prisma/client
14
14
  ```
15
15
 
16
+ The adapter supports Prisma Client 6 and 7. Prisma 7 requires a driver adapter, such as
17
+ `@prisma/adapter-pg`, in the `PrismaClient` constructor.
18
+
16
19
  ## Enqueue in a transaction
17
20
 
18
21
  ```ts
19
22
  import { PrismaClient } from "@prisma/client";
20
23
  import { createPrismaAdapter } from "@stablemates/workhorse-prisma";
21
24
 
25
+ // On Prisma 7: new PrismaClient({ adapter: new PrismaPg({ connectionString }) })
22
26
  const prisma = new PrismaClient();
23
27
  const workhorse = createPrismaAdapter(prisma, { close: () => prisma.$disconnect() });
24
28
 
@@ -36,7 +40,8 @@ A process that runs workers passes a `pg` pool as `pool`. Workers take their hea
36
40
  `LISTEN/NOTIFY` connections from it, and refuse to start without it unless `sharedHeartbeats` is
37
41
  set. Database errors
38
42
  become `PrismaQueryError`, with the original error in `cause` and a nested PostgreSQL code copied to
39
- `code` when Prisma exposes one.
43
+ `code` when Prisma exposes one. On Prisma 7, the code comes from the error that the driver adapter
44
+ reported.
40
45
 
41
46
  ## Next
42
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablemates/workhorse-prisma",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "Public beta Prisma ORM provider for Workhorse",
5
5
  "homepage": "https://workhorse.run",
6
6
  "bugs": {
@@ -35,11 +35,11 @@
35
35
  "@types/pg": "^8.23.1",
36
36
  "pg": "^8.23.1",
37
37
  "prisma": "6.19.3",
38
- "@stablemates/workhorse": "0.8.0"
38
+ "@stablemates/workhorse": "0.10.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "@prisma/client": ">=6 <7",
42
- "@stablemates/workhorse": ">=0.8.0 <0.9.0"
41
+ "@prisma/client": ">=6 <8",
42
+ "@stablemates/workhorse": ">=0.10.0 <0.11.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22"