Files
bun.sh/test/js/sql
Claude Bot d55260233c refactor: Simplify adapter inference to prioritize environment variable names over protocols
Fixed logic where PGURL="mysql://" would incorrectly return mysql adapter instead of postgres.

Environment variable names now take semantic precedence over URL protocols:
- MYSQL_URL=postgres://host → mysql adapter (name wins)
- PGURL=mysql://host → postgres adapter (name wins)
- DATABASE_URL=mysql://host → mysql adapter (protocol detection as fallback)

This is more intuitive and matches user expectations - if you set PGURL, you clearly
intend PostgreSQL regardless of what protocol might be in the URL value.

Simplified logic:
1. Explicit adapter (highest priority)
2. Environment variable name (semantic intent)
3. Protocol detection (fallback for DATABASE_URL only)
4. Default to postgres

Added comprehensive tests to verify environment variable names override protocols
in all scenarios. All 236 existing tests continue to pass.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-30 12:07:23 -07:00
..
2025-08-19 23:15:53 -07:00
2025-05-08 18:51:32 -07:00
2025-05-08 18:51:32 -07:00
2025-08-01 22:41:05 -07:00
2025-08-19 23:15:53 -07:00