Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Feb 21, 2024
1 parent ccd8a1a commit 43a9768
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export const getTestPostgresDatabaseFactory = <
connectionDetailsFromWorker: ConnectionDetailsFromWorker
): ConnectionDetails => {
const pool = new Pool({
connectionString: connectionDetailsFromWorker.connectionString,
connectionString:
connectionDetailsFromWorker.pgbouncerConnectionString ??
connectionDetailsFromWorker.connectionString,
})

t.teardown(async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface GetTestPostgresDatabaseFactoryOptions<
pgbouncer?: {
enabled: boolean
version?: string
poolMode?: "session" | "transaction"
poolMode?: "session" | "transaction" | "statement"
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/tests/pgbouncer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ test("pgbouncer", async (t) => {
const postgres13 = await getPostgres13(t)

t.truthy(postgres13.pgbouncerConnectionString)
await postgres13.pool.query("SELECT 1")
})
1 change: 1 addition & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ export class Worker {
POOL_MODE:
this.initialData.pgbouncerOptions?.poolMode ?? "transaction",
LISTEN_PORT: "6432",
AUTH_TYPE: "trust",
})
.withStartupTimeout(120_000)
.withNetwork(network)
Expand Down

0 comments on commit 43a9768

Please sign in to comment.