doesn't identify anything when used multiple connections in config dict, also Model.save(using_db=) parameter not working
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?
Check the permissions
Check the permissions
I created databases with postgres user, via createdb name;, as tortoise did not created schemas except default connection, I backuped the first tortoise made db and uploaded them to new db's with pg_dump, although all users are granted with all privileges respectively. Now I am trying to create only one user and many databases, and permit this to do anything to all databases
I created databases with postgres user, via
createdb name;, as tortoise did not created schemas except default connection, I backuped the first tortoise made db and uploaded them to new db's with pg_dump, although all users are granted with all privileges respectively. Now I am trying to create only one user and many databases, and permit this to do anything to all databases
when created one user and multiple databases, and granting all privileges over these databases it is working. but now there appeared another problem: how to use using_db=BaseDBAsyncClient in filtering data?
now i trying to pk = await Model.save(using_db) after that I put these lines: added = await Model.filter(pk=pk, using_db=BaseDBAsyncClient it is not working, because filter doesn't take using_db parameter. so i need your help again. how can I get data from multiple databases?
See https://tortoise.github.io/router.html