tortoise / tortoise/tortoise-orm
UPDATE and DELETE synopsises also may include WITH statements
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
https://github.com/tortoise/tortoise-orm/blob/develop/tortoise/backends/asyncpg/client.py#L135
UPDATE and DELETE synopsises also may include WITH statements. So L135 is wrong i think.
may be replace it with code below?
if "UPDATE" in query or "DELETE" in query:
To Reproduce
Run execute_query with WITH statement
Expected behavior
UPDATE and DELETE queries should executed, not fetched i think
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/asyncpg/client.py at line 135 and inspect how execute_query classifies statements. Reproduce the issue with an UPDATE or DELETE query containing a WITH statement, then verify those queries execute rather than being fetched.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100