MCPcopy Create free account
hub / github.com/garrytan/gstack / isTransactionModePooler

Function isTransactionModePooler

lib/gbrain-exec.ts:66–75  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

64 * run in session mode on 6543.
65 */
66export function isTransactionModePooler(url: string): boolean {
67 try {
68 // DATABASE_URLs use postgresql:// scheme which URL() doesn't natively
69 // parse host/port from, so swap to http:// for reliable parsing.
70 const parsed = new URL(url.replace(/^postgres(ql)?:\/\//, "http://"));
71 return parsed.port === "6543";
72 } catch {
73 return false;
74 }
75}
76
77/**
78 * Build an env dict with DATABASE_URL seeded from

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected