feat(adapter-pg): accept connection string URL in PrismaPg constructor#29287
Conversation
…uctor
When a raw connection string URL is passed to `new PrismaPg(url)` instead
of a Pool instance or config object, it was being treated as a PoolConfig
object, causing `TypeError: Cannot use 'in' operator to search for
'password' in postgresql://...` at query time.
Now accepts `string` as a valid first argument and converts it to
`{ connectionString: string }` for pg.Pool.
Fixes prisma#29151
|
|
WalkthroughPrismaPgAdapterFactory constructor now accepts a connection string (string) in addition to Changes
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I think the original issue was linked to missing Typescript typings (which has already been resolved on |
Merging this PR will degrade performance by 97.77%
Performance Changes
Comparing Footnotes
|
Thanks for the context! updated the PR title, please lmk if there's anything i am missing |
Summary
PrismaPg(e.g.,new PrismaPg(process.env.DATABASE_URL))pg.Pool | pg.PoolConfig | string, converting strings to{ connectionString: string }internallypg.PoolConfigalready supports{ connectionString: '...' }, but accepting a plain string is more ergonomicRelated: #29151
Test plan
PrismaPgAdapterFactoryaccepts a connection string URL and creates a working adapter