tortoise / tortoise/tortoise-orm
MSSQLSchemaGenerator does not support creating tables in non-default (dbo) database schemas
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.
I would like to use Tortoise to integrate with an existing application who's data is stored in MSSQL Server. However it makes use of multiple schemas (eg. control.table, sales.table) but tortoise can only map to dbo.*
Describe the solution you'd like
ideally there should be a META parameter db_schema that could be mapped into the templates something like this:
TABLE_CREATE_TEMPLATE = "CREATE TABLE [{db_schema}].[{table_name}] ({fields}){extra};"
Describe alternatives you've considered
Additional context
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 with MSSQLSchemaGenerator and its TABLE_CREATE_TEMPLATE, then trace how model META values are mapped into the template. Add support for a db_schema value so tables can target schemas such as control or sales instead of only dbo, and verify the generated CREATE TABLE statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100