(url: string)
| 64 | * run in session mode on 6543. |
| 65 | */ |
| 66 | export 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 |
no outgoing calls
no test coverage detected