drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Ability to explicitly specify the database driver on PostgreSQL when multiple drivers coexist

Open
#5,798 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Feature hasn't been suggested before.

- [x] I have verified this feature I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

Currently, I use both `@neondatabase/serverless` and `bun-sql` in my project, switching between them depending on the environment (e.g., production vs. local). However, when running `drizzle-kit push`, there is no way to explicitly tell drizzle-kit which driver to use.

When I try to interact with my local PostgreSQL using bun-sql, drizzle-kit automatically prioritizes `@neondatabase/serverless` just because the package is present in the project. As a result, it attempts to establish a WebSocket connection to my local database, causing it to fail due to incompatibility.

## Workaround:
As a temporary workaround, if I uninstall `@neondatabase/serverless` from the project and run it with Bun as the runtime (`bun --bun drizzle-kit push`), it successfully recognizes bun driver and works perfectly. This confirms that the automatic driver detection logic is what's causing the conflict.

## Proposal:
It would be great if we could explicitly specify and lock the driver choice in `drizzle.config.ts` (for example, via a driver property or similar) so that drizzle-kit respects our intended setup when multiple driver packages are installed.

## Environment:
`bun@1.3.13`, `drizzle-orm@1.0.0-rc.3`, `drizzle-kit@1.0.0-rc.3`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `drizzle-kit push` with both `@neondatabase/serverless` and `bun-sql` installed, using the `drizzle.config.ts` setup described in the issue. Trace how drizzle-kit selects a PostgreSQL driver; done means the configuration can explicitly select bun-sql for a local database instead of attempting a WebSocket connection through the Neon driver.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, postgresql, typescript
Domain
cli, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.