Skip to content

Commit 4518c65

Browse files
committed
docs correction
1 parent cea555a commit 4518c65

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/multiple/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)