neondatabase / neondatabase/serverless
Pool constructor confusing for Cloudflare Workers
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 548
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
I couldn't figure out the right way to use @neondatabase/serverless with pg.Pool on Cloudflare Workers. The docs aren't clear on whether I should pass the connection string directly or as an object.
I tried both:
// Option 1
new Pool({ connectionString: process.env.DATABASE_URL })
// Option 2
new Pool(process.env.DATABASE_URL)
Both gave me issues when I tried creating the Pool at module scope. I ended up having to create it per-request like I did with auth, but I'm not sure if that's the intended pattern or if I'm doing it wrong.
Some clarification in the docs about Cloudflare Workers usage would be really helpful.
Version: 1.0.2
Database: Neon PostgreSQL
Deployment: Cloudflare Workers
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by reviewing the Pool constructor documentation and the Cloudflare Workers usage guidance, focusing on connection-string forms and module-scope versus per-request creation. Done means the docs clearly state the supported constructor usage and intended Pool lifecycle for Neon PostgreSQL on Workers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- cloud, databases, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100