docs: added example of db_urls (#1033)

This commit is contained in:
Andrey
2022-07-18 17:43:54 +04:00
committed by GitHub
parent 02ca70ac75
commit 4ab3bef0a6

View File

@ -9,7 +9,12 @@ To work with your DBMS, you'll need to install the corresponding asyncio driver.
* For PostgreSQL: `pip install asyncpg`
* For SQLite: `pip install aiosqlite`
For the sake of this tutorial from now on, we'll use a simple SQLite databse.
Examples of `DB_URL`s are:
* PostgreSQL: `engine = create_engine('postgresql+asyncpg://user:password@host:port/name')`
* SQLite: `engine = create_engine('sqlite+aiosqlite:///name.db')`
For the sake of this tutorial from now on, we'll use a simple SQLite database.
## Create the User model