UNPKG

pgnode

Version:

PostgresSQL client to Nodejs servers

9 lines (8 loc) 372 B
import { Pool, PoolClient } from 'pg'; /** * @param pg node postgres pool * @param callback callback that will use provided transaction client * @param forceRollback force rollback even without errors - useful for tests * @returns */ export default function tx<T>(pg: Pool | PoolClient, callback: (db: PoolClient) => Promise<T>, forceRollback?: boolean): Promise<T>;