tortoise / tortoise/tortoise-orm

doesn't identify anything when used multiple connections in config dict, also Model.save(using_db=) parameter not working

Open
#1,091 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.6k
Forks
516
Avg merge
2d 21h
Merged PRs (30d)
9

Description

Describe the bug
In advance I should mention that I want to multi tenant app (same models for multiple databases) with tortoise. So in testing this actually work or not I created test project
I wrote multiple connection params in config dict, wrote models, showed them in modules, in order to test I wrote insert data

To Reproduce
I placed the code here https://dpaste.org/PMRx

Expected behavior
It should save Model with, different databases BaseDBAsyncClient. and then get them get them with, but shows error : tortoise.exceptions.OperationalError: permission denied for table tournament

Additional context
I saw NotImplemented areas inside tortoise-orm's source code. so what is the cause of error? how it can be solved? Is it even possible to create such app with tortoise?

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 with the reproduction linked at https://dpaste.org/PMRx and trace the configuration dict, BaseDBAsyncClient selection, and Model.save(using_db=) path described in the issue. Determine whether saving and retrieving the model across multiple databases is supported, and use the reported permission-denied error to define the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.