mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
Added comprehensive tests and validation for adapter-protocol compatibility: **New Test Coverage:** - ✅ Explicit adapter with URL without protocol (should work) - ✅ Explicit adapter with matching protocol (should work) - ✅ Adapter conflicts with protocol (should throw error) - ✅ Unix socket protocol with explicit adapter (should work) - ✅ SQLite protocol with sqlite adapter (should work) **Error Cases Added:** - `mysql` adapter + `postgres://` → throws "Protocol 'postgres' is not compatible with adapter 'mysql'" - `postgres` adapter + `mysql://` → throws "Protocol 'mysql' is not compatible with adapter 'postgres'" - `sqlite` adapter + `mysql://` → throws "Protocol 'mysql' is not compatible with adapter 'sqlite'" - `mysql` adapter + `postgres://` → throws "Protocol 'postgres' is not compatible with adapter 'mysql'" **Implementation Fix:** - Moved adapter-protocol validation earlier in parsing process (Step 2.5) - Now validates all adapters including SQLite before early return - Prevents SQLite adapter bypass of validation logic - Special handling for SQLite URL parsing in validation **Test Results:** - 8 new adapter-protocol validation tests - all pass - 31 total adapter precedence tests - all pass - 218 SQLite tests - all pass (no regressions) This ensures users get clear error messages when mixing incompatible adapters and protocols, improving the developer experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>