@stablemates/workhorse-prisma 0.2.1 → 0.3.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
@@ -32,7 +32,9 @@ await prisma.$transaction(async (tx) => {
32
32
 
33
33
  The adapter never disconnects a caller-owned Prisma client unless `close` is configured.
34
34
  [Workhorse core](https://workhorse.run/docs/installation) owns schema installation and changes.
35
- Pass a `pg` pool as `notificationPool` for `LISTEN/NOTIFY`; otherwise workers poll. Database errors
35
+ A process that runs workers passes a `pg` pool as `pool`. Workers take their heartbeat and
36
+ `LISTEN/NOTIFY` connections from it, and refuse to start without it unless `sharedHeartbeats` is
37
+ set. Database errors
36
38
  become `PrismaQueryError`, with the original error in `cause` and a nested PostgreSQL code copied to
37
39
  `code` when Prisma exposes one.
38
40
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { QueryError, type AdapterNotificationPool, type ProviderAdapterOptions, type Queryable, type WorkhorseAdapter } from "@stablemates/workhorse";
1
+ import { QueryError, type AdapterConnectionPoolSource, type ProviderAdapterOptions, type Queryable, type WorkhorseAdapter } from "@stablemates/workhorse";
2
2
  /** Public subset shared by PrismaClient and Prisma.TransactionClient. */
3
3
  export interface PrismaExecutor {
4
4
  $queryRawUnsafe<T = unknown>(statement: string, ...values: unknown[]): Promise<T>;
@@ -9,7 +9,7 @@ export declare class PrismaQueryError extends QueryError {
9
9
  constructor(statement: string, cause: unknown);
10
10
  }
11
11
  /** Convert a Prisma client or transaction into Workhorse's minimal database protocol. */
12
- export declare function prismaQueryable(executor: PrismaExecutor, notificationPool?: AdapterNotificationPool): Queryable;
12
+ export declare function prismaQueryable(executor: PrismaExecutor, connectionPool?: AdapterConnectionPoolSource): Queryable;
13
13
  /** Create a Workhorse adapter around a Prisma client. */
14
14
  export declare function createPrismaAdapter<TTransaction extends PrismaExecutor = PrismaExecutor>(database: PrismaExecutor, options?: PrismaAdapterOptions): WorkhorseAdapter<TTransaction>;
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,KAAK,uBAAuB,EAC5B,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,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACnF;AAED,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;CAAG;AAEvE,qBAAa,gBAAiB,SAAQ,UAAU;gBAClC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAI9C;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,cAAc,EACxB,gBAAgB,CAAC,EAAE,uBAAuB,GACzC,SAAS,CAOX;AAED,yDAAyD;AACzD,wBAAgB,mBAAmB,CAAC,YAAY,SAAS,cAAc,GAAG,cAAc,EACtF,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE,oBAAyB,GACjC,gBAAgB,CAAC,YAAY,CAAC,CAMhC"}
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,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACnF;AAED,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;CAAG;AAEvE,qBAAa,gBAAiB,SAAQ,UAAU;gBAClC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAI9C;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,cAAc,EACxB,cAAc,CAAC,EAAE,2BAA2B,GAC3C,SAAS,CAOX;AAED,yDAAyD;AACzD,wBAAgB,mBAAmB,CAAC,YAAY,SAAS,cAAc,GAAG,cAAc,EACtF,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE,oBAAyB,GACjC,gBAAgB,CAAC,YAAY,CAAC,CAMhC"}
package/dist/index.js CHANGED
@@ -6,11 +6,11 @@ export class PrismaQueryError extends QueryError {
6
6
  }
7
7
  }
8
8
  /** Convert a Prisma client or transaction into Workhorse's minimal database protocol. */
9
- export function prismaQueryable(executor, notificationPool) {
9
+ export function prismaQueryable(executor, connectionPool) {
10
10
  return createProviderQueryable({
11
11
  execute: (statement, values) => executor.$queryRawUnsafe(statement, ...values),
12
12
  wrapError: (statement, cause) => new PrismaQueryError(statement, cause),
13
- notificationPool,
13
+ connectionPool,
14
14
  });
15
15
  }
16
16
  /** Create a Workhorse adapter around a Prisma client. */
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,gBAA0C;IAE1C,OAAO,uBAAuB,CAAC;QAC7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,CAA+B;QACzD,QAAQ;QACR,WAAW,EAAE,eAAe;QAC5B,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablemates/workhorse-prisma",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Public beta Prisma ORM provider for Workhorse",
5
5
  "homepage": "https://workhorse.run",
6
6
  "bugs": {
@@ -32,14 +32,14 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@prisma/client": "6.19.3",
35
- "@types/pg": "^8.15.5",
36
- "pg": "^8.16.3",
35
+ "@types/pg": "^8.23.1",
36
+ "pg": "^8.23.0",
37
37
  "prisma": "6.19.3",
38
- "@stablemates/workhorse": "0.2.1"
38
+ "@stablemates/workhorse": "0.3.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@prisma/client": ">=6 <7",
42
- "@stablemates/workhorse": ">=0.2.0 <0.3.0"
42
+ "@stablemates/workhorse": ">=0.3.0 <0.4.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22"