mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
Fixed bug where MYSQL_URL=root@localhost:3306/test would incorrectly be treated as postgres instead of mysql due to missing protocol detection. Now properly infers adapter from environment variable names: - MYSQL_URL → mysql adapter (even without mysql:// protocol) - POSTGRES_URL, PGURL, PG_URL → postgres adapter (even without postgres:// protocol) - Protocol detection still takes precedence when present - Maintains proper precedence order across environment variables Added comprehensive tests to verify: - MYSQL_URL without protocol correctly infers mysql - POSTGRES_URL without protocol correctly infers postgres - All existing functionality continues to work This ensures that environment variable names provide semantic hints about the intended database adapter even when URLs lack explicit protocols. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>