@stablemates/workhorse-prisma 0.2.1 → 0.4.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 +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
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
|
-
|
|
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
|
|
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,
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,KAAK,
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stablemates/workhorse-prisma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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.
|
|
36
|
-
"pg": "^8.
|
|
35
|
+
"@types/pg": "^8.23.1",
|
|
36
|
+
"pg": "^8.23.0",
|
|
37
37
|
"prisma": "6.19.3",
|
|
38
|
-
"@stablemates/workhorse": "0.
|
|
38
|
+
"@stablemates/workhorse": "0.4.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@prisma/client": ">=6 <7",
|
|
42
|
-
"@stablemates/workhorse": ">=0.
|
|
42
|
+
"@stablemates/workhorse": ">=0.4.0 <0.5.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=22"
|