Skip to content

fix: accept SQLAlchemy-style connection URLs with driver hints#650

Merged
datlechin merged 1 commit intomainfrom
fix/sqlalchemy-url-driver-hints
Apr 9, 2026
Merged

fix: accept SQLAlchemy-style connection URLs with driver hints#650
datlechin merged 1 commit intomainfrom
fix/sqlalchemy-url-driver-hints

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Strip driver hint suffixes (e.g., +psycopg, +asyncpg, +pymysql) from connection URL schemes before matching database type
  • postgresql+psycopg://... now parses as PostgreSQL, mysql+pymysql://... as MySQL, etc.
  • Preserves +ssh (SSH tunneling) and +srv (MongoDB SRV) behavior

Closes #642

Test plan

  • Paste postgresql+psycopg://user:pass@localhost:5432/mydb → parses as PostgreSQL
  • Paste postgresql+asyncpg://user:pass@localhost:5432/mydb → parses as PostgreSQL
  • Paste mysql+pymysql://user:pass@localhost:3306/mydb → parses as MySQL
  • Paste mongodb+srv://user:pass@cluster.example.com/mydb → still parses as MongoDB (not stripped)
  • Paste postgresql+ssh://user:pass@localhost/mydb → still enables SSH mode
  • Existing URLs without driver hints continue to work unchanged

@datlechin datlechin merged commit e336416 into main Apr 9, 2026
2 checks passed
@datlechin datlechin deleted the fix/sqlalchemy-url-driver-hints branch April 9, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Psycopg support

1 participant