File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/pg-transaction/src Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ function isPool(clientOrPool: Client | Pool): clientOrPool is Pool {
8
8
return 'idleCount' in clientOrPool
9
9
}
10
10
11
- async function transaction < T > ( clientOrPool : Client | Pool , cb : ( client : Client ) => Promise < T > ) : Promise < T > {
11
+ async function transaction < T > (
12
+ clientOrPool : Client | Pool ,
13
+ cb : ( client : Client | PoolClient ) => Promise < T >
14
+ ) : Promise < T > {
12
15
let client : Client | PoolClient
13
16
if ( isPool ( clientOrPool ) ) {
14
17
// It's a Pool
@@ -19,7 +22,7 @@ async function transaction<T>(clientOrPool: Client | Pool, cb: (client: Client)
19
22
}
20
23
await client . query ( 'BEGIN' )
21
24
try {
22
- const result = await cb ( client as Client )
25
+ const result = await cb ( client )
23
26
await client . query ( 'COMMIT' )
24
27
return result
25
28
} catch ( error ) {
You can’t perform that action at this time.
0 commit comments