@atomist/org-visualizer
Version:
Organization Visualizer using Atomist project scanning
16 lines • 786 B
TypeScript
import { PoolClient } from "pg";
export declare type ClientFactory = () => Promise<PoolClient>;
/**
* Perform the given operations with a database client connection
*
* Connection errors result in an exception.
* Errors thrown by the passed-in function result are logged, and the
* provided defaultResult is returned (or else undefined).
*
* @param {() => } clientFactory factory for clients
* @param {(c: ) => Promise<R>} what a function to run with the client
* @param {R} defaultResult return this in case of error. If not provided, return undefined
* @return {Promise<R>}
*/
export declare function doWithClient<R>(clientFactory: ClientFactory, what: (c: PoolClient) => Promise<R>, defaultResult?: R | ((e: Error) => R)): Promise<R>;
//# sourceMappingURL=pgUtils.d.ts.map