tortoise / tortoise/tortoise-orm
Database reflection
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.
Reflection is a rather nice thing to have if you're building an application and you want to warn the user if the running database is not up to date with the ORM models, for example. There are other applications as well, and I think it would be a nice thing to have in Tortoise.
Describe the solution you'd like
It would be nice if Model exposed some methods similar to the already existing describe methods but for the live database tables.
Describe alternatives you've considered
Atm I'm doing some ugly things with raw SQL using a connection from get_connection which is always a possibility, though a nice interface would better fit an ORM.
Additional context
A little convo on Gitter. Nickolas told me to open this issue as reminder :)
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 reading Model's existing describe methods and the get_connection usage mentioned in the issue. The request does not name files, tests, or a defined reflection API, so clarify the supported databases, returned schema details, and completion criteria before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100