tortoise / tortoise/tortoise-orm

Database reflection

Open
#434 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.