neondatabase / neondatabase/serverless
Pool type incompatible with kysely 0.29 PostgresDialect (Client.connect signature mismatch)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 548
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Passing Pool from @neondatabase/serverless to kysely's PostgresDialect no longer type-checks after kysely 0.29.
Reproduction
import { Pool } from '@neondatabase/serverless';
import { Kysely, PostgresDialect } from 'kysely';
new Kysely({
dialect: new PostgresDialect({
pool: new Pool({ connectionString }),
}),
});
Error
Type 'Pool' is not assignable to type 'PostgresPool | ((options?: AbortableOperationOptions) => Promise<PostgresPool>)'.
Type 'Pool' is not assignable to type 'PostgresPool'.
The types returned by '(new Client(...)).connect()' are incompatible between these types.
Type 'Promise<void>' is not assignable to type 'Promise<PostgresClient>'.
Type 'void' is not assignable to type 'PostgresClient'.
Cause
kysely 0.29 (PR #1796) tightened the structural PostgresClient.connect() return type from Promise<void> to Promise<PostgresClient> as groundwork for query cancellation. The Pool.Client exposed by @neondatabase/serverless still has connect(): Promise<void> — which matches the underlying pg API.
Context
@neondatabase/serverless: 1.1.0kysely: 0.29.2- Neon's own docs still recommend exactly this pattern, so this breaks the recommended setup.
- Kysely maintainers have stated in the past they consider Neon-Pool ↔
PostgresDialectintegration out of scope (kysely#1441).
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
Begin with the TypeScript reproduction using @neondatabase/serverless Pool and Kysely's PostgresDialect. Compare Pool.Client.connect(), Kysely 0.29's PostgresClient expectation, and the referenced Kysely PR, then check Neon's Kysely guide. Done means the recommended setup type-checks with the reported versions without weakening the stated integration contract.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, typescript
- Domain
- backend-api-design, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100