tortoise / tortoise/tortoise-orm
How to get a SubQuery in FROM clause?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
My native SQL statement is:
SELECT
vulnerability.*,
vulnerability__agent.*,
vulnerability__assembly.*
FROM
( SELECT
*
FROM
vulnerability
WHERE
task_id = '12345'
ORDER BY
name ASC
LIMIT 10
) vulnerability
LEFT OUTER JOIN agent vulnerability__agentONvulnerability__agent.agent_id=vulnerability.agent_id
LEFT OUTER JOIN plugin vulnerability__assemblyONvulnerability__assembly.assembly_id=vulnerability.assembly_id
Can it be supported in tortoise-orm?
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 by reviewing Tortoise ORM's query API and its support for native SQL, then compare those entry points with the supplied SQL using a subquery in the FROM clause. Done means establishing whether this query shape is supported and, if not, defining the required ORM capability or documenting the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100