tortoise / tortoise/tortoise-orm
Query params ignored
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Describe the bug
When passing credentials over query parameters they are just ignored on tortoise
To Reproduce
Use a connection string like:
postgres://host:port/database?user=user&password=password&ssl=require
Expected behavior
Pass to asyncpg the connection credentials
Additional context
The problem seems to be on the tortoise/backends/base/config_generator.py on the expand_db_url method.
All query params are captured and then replace by None or the URL configuration which does not contain the username since it is on the query parameters
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in tortoise/backends/base/config_generator.py at the expand_db_url method and reproduce the issue with the PostgreSQL connection string shown. Trace how query parameters are merged into the URL configuration; done means username, password, and ssl query parameters are passed to asyncpg instead of being discarded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100