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 {
88 return 'idleCount' in clientOrPool
99}
1010
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 > {
1215 let client : Client | PoolClient
1316 if ( isPool ( clientOrPool ) ) {
1417 // It's a Pool
@@ -19,7 +22,7 @@ async function transaction<T>(clientOrPool: Client | Pool, cb: (client: Client)
1922 }
2023 await client . query ( 'BEGIN' )
2124 try {
22- const result = await cb ( client as Client )
25+ const result = await cb ( client )
2326 await client . query ( 'COMMIT' )
2427 return result
2528 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments