File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,23 @@ EllarSQLModule.setup(
2828)
2929```
3030
31+ ## ** Configuring Async Databases**
32+ When configuring async databases,
33+ you need to specify the ` +asyncpg ` or ` +aiosqlite ` suffix to the database URL in case of SQLite and PostgreSQL respectively.
34+
35+ For example, to configure an async database, you can use the following configuration:
36+ ``` python
37+ from ellar_sql import EllarSQLModule
38+
39+ EllarSQLModule.setup(
40+ databases = {
41+ " default" : " postgresql+asyncpg:///main" ,
42+ " meta" : " sqlite+aiosqlite:////path/to/meta.db" ,
43+ },
44+ migration_options = {' directory' : ' migrations' }
45+ )
46+ ```
47+
3148## ** Defining Models and Tables with Different Databases**
3249
3350** EllarSQL** creates ** Metadata** and an ** Engine** for each configured database.
You can’t perform that action at this time.
0 commit comments