tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.55k stars 374 forks source link

Is there any Example about how to use multi-database in one Sanic project #291

Open sunshineinwater opened 4 years ago

sunshineinwater commented 4 years ago

Is there any Example about how to use multi-database in one Sanic project?

I need to use more than one database in one Sanic project. Is there any simple example about how to config it? (more than one database, but same database type: postgresql )

grigi commented 4 years ago

We have a generic 2DB example: https://tortoise-orm.readthedocs.io/en/latest/examples/basic.html#two-databases but nothing specific to sanic.

I also don't think expected behaviour is made clear very clear.

sunshineinwater commented 4 years ago

We have a generic 2DB example: https://tortoise-orm.readthedocs.io/en/latest/examples/basic.html#two-databases but nothing specific to sanic.

I also don't think expected behaviour is made clear very clear.

THX a lot. It's really a perfect async ORM. I decide to use it to write my new project.

long2ice commented 3 years ago

You should use https://tortoise-orm.readthedocs.io/en/latest/router.html