@stablemates/workhorse-prisma 0.10.0 → 0.12.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.
package/README.md CHANGED
@@ -13,6 +13,9 @@ 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
+ Install the Workhorse schema with [Workhorse core](https://workhorse.run/docs/installation) before
17
+ the first enqueue. If the schema is missing, the queue refuses the enqueue.
18
+
16
19
  The adapter supports Prisma Client 6 and 7. Prisma 7 requires a driver adapter, such as
17
20
  `@prisma/adapter-pg`, in the `PrismaClient` constructor.
18
21
 
@@ -36,9 +39,9 @@ await prisma.$transaction(async (tx) => {
36
39
 
37
40
  The adapter never disconnects a caller-owned Prisma client unless `close` is configured.
38
41
  [Workhorse core](https://workhorse.run/docs/installation) owns schema installation and changes.
39
- A process that runs workers passes a `pg` pool as `pool`. Workers take their heartbeat and
40
- `LISTEN/NOTIFY` connections from it, and refuse to start without it unless `sharedHeartbeats` is
41
- set. Database errors
42
+ A process that runs workers passes a `pg` pool with a maximum size (`max`) of at least 3 as `pool`.
43
+ Workers take their heartbeat and `LISTEN/NOTIFY` connections from it. Without that pool,
44
+ `createWorker()` throws an error that names the step. Database errors
42
45
  become `PrismaQueryError`, with the original error in `cause` and a nested PostgreSQL code copied to
43
46
  `code` when Prisma exposes one. On Prisma 7, the code comes from the error that the driver adapter
44
47
  reported.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,SAAS,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xB,OAAO,GAAE,oBAAyB,GACjC,gBAAgB,CAAC,YAAY,CAAC,CAOhC"}
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ export function createPrismaAdapter(database, options = {}) {
19
19
  database,
20
20
  toQueryable: prismaQueryable,
21
21
  ...options,
22
+ provider: "Prisma",
22
23
  });
23
24
  }
24
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,GAKX,MAAM,wBAAwB,CAAC;AAUhC,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAC9C,YAAY,SAAiB,EAAE,KAAc;QAC3C,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAC7B,QAAwB,EACxB,cAA4C;IAE5C,OAAO,uBAAuB,CAAC;QAC7B,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAC7B,QAAQ,CAAC,eAAe,CAAmB,SAAS,EAAE,GAAG,MAAM,CAAC;QAClE,SAAS,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC;QACvE,cAAc;KACf,CAAC,CAAC;AACL,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,mBAAmB,CACjC,QAAwB,EACxB,UAAgC,EAAE;IAElC,OAAO,qBAAqB,CAA+B;QACzD,QAAQ;QACR,WAAW,EAAE,eAAe;QAC5B,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,GAKX,MAAM,wBAAwB,CAAC;AAUhC,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAC9C,YAAY,SAAiB,EAAE,KAAc;QAC3C,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAC7B,QAAwB,EACxB,cAA4C;IAE5C,OAAO,uBAAuB,CAAC;QAC7B,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAC7B,QAAQ,CAAC,eAAe,CAAmB,SAAS,EAAE,GAAG,MAAM,CAAC;QAClE,SAAS,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC;QACvE,cAAc;KACf,CAAC,CAAC;AACL,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,mBAAmB,CACjC,QAAwB,EACxB,UAAgC,EAAE;IAElC,OAAO,qBAAqB,CAA+B;QACzD,QAAQ;QACR,WAAW,EAAE,eAAe;QAC5B,GAAG,OAAO;QACV,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablemates/workhorse-prisma",
3
- "version": "0.10.0",
3
+ "version": "0.12.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.10.0"
38
+ "@stablemates/workhorse": "0.12.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@prisma/client": ">=6 <8",
42
- "@stablemates/workhorse": ">=0.10.0 <0.11.0"
42
+ "@stablemates/workhorse": ">=0.12.0 <0.13.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22"