tortoise / tortoise/tortoise-orm
Cyclic references support
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
If we try to have cyclic referencing foreign keys, the schemas won't generate
Describe the solution you'd like
Support cyclic references (can be extended to multiple references in general, with a support for reverse key chooses, like this )
Describe alternatives you've considered
- Adding the constraint by hand in the code (not supported)
- Not generating schemas and adding the constraint by hand in the database
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 reproducing schema generation for two entities with cyclic foreign-key references, then read the linked relationships documentation for the multiple-relationship cases. Trace the schema-generation path and existing relationship tests; done means cyclic references generate successfully without manual database constraints, including the relevant regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100