File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -9,25 +9,15 @@ interface BenchDbConfig {
99 connectionMethod : string ;
1010}
1111
12- // Cache for TCP connection pools to enable reuse across requests
13- const tcpPools = new Map < string , PgPool > ( ) ;
14-
15- export function getTcpPool ( connectionUrl : string ) : PgPool {
16- if ( ! tcpPools . has ( connectionUrl ) ) {
17- const pool = new PgPool ( { connectionString : connectionUrl } ) ;
18- attachDatabasePool ( pool ) ;
19- tcpPools . set ( connectionUrl , pool ) ;
20- }
21- return tcpPools . get ( connectionUrl ) ! ;
22- }
23-
2412export function getBenchDb ( { connectionUrl, connectionMethod } : BenchDbConfig ) {
2513 if ( ! connectionUrl ) {
2614 throw new Error ( "Connection URL is required" ) ;
2715 }
2816
2917 if ( connectionMethod === "tcp" ) {
30- return getTcpPool ( connectionUrl ) ;
18+ const pool = new PgPool ( { connectionString : connectionUrl } ) ;
19+ attachDatabasePool ( pool ) ;
20+ return pool ;
3121 }
3222
3323 if ( connectionMethod === "ws" ) {
Original file line number Diff line number Diff line change @@ -343,7 +343,9 @@ export function DatabaseSidebar({
343343 @neondatabase/serverless{ " " }
344344 { methodGroup . connectionMethod === "http"
345345 ? "http"
346- : "websocket" }
346+ : methodGroup . connectionMethod === "tcp"
347+ ? "tcp"
348+ : "websocket" }
347349 </ h4 >
348350 { methodGroup . regions . map ( ( group ) => (
349351 < div
You can’t perform that action at this time.
0 commit comments