Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gajus/slonik
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v33.1.1
Choose a base ref
...
head repository: gajus/slonik
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v33.1.2
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 20, 2023

  1. Copy the full SHA
    df915da View commit details
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/factories/createPool.ts
19 changes: 11 additions & 8 deletions src/factories/createPool.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import {
Client as PgClient,
Pool as PgPool,
} from 'pg';
import type pgTypes from 'pg-types';
import {
serializeError,
} from 'serialize-error';
@@ -68,14 +69,16 @@ export const createPool = async (
user: poolConfiguration.user,
});

await setupClient.connect();

const getTypeParser = await createTypeOverrides(
setupClient,
clientConfiguration.typeParsers,
);

await setupClient.end();
let getTypeParser: typeof pgTypes.getTypeParser;
try {
await setupClient.connect();
getTypeParser = await createTypeOverrides(
setupClient,
clientConfiguration.typeParsers,
);
} finally {
await setupClient.end();
}

const pool: PgPool = new Pool({
...poolConfiguration,