Rework the documentation

This commit is contained in:
François Voron
2021-09-17 15:14:36 +02:00
parent e31a0a99b5
commit fc59cf11ef
33 changed files with 486 additions and 861 deletions

View File

@@ -24,7 +24,7 @@ For the sake of this tutorial from now on, we'll use a simple SQLite databse.
Let's declare our User ORM model.
```py hl_lines="29-33"
```py hl_lines="11-15"
{!./src/db_ormar.py!}
```
@@ -35,19 +35,15 @@ there to fit to your needs!
## Create the database adapter
The database adapter of **FastAPI Users** makes the link between your
database configuration and the users logic. Create it like this.
database configuration and the users logic. It should be generated by a FastAPI dependency.
```py hl_lines="40"
```py hl_lines="22-23"
{!./src/db_ormar.py!}
```
Notice that we pass a reference to your [`UserDB` model](../model.md).
Notice that we pass a reference to your [`UserDB` model](../models.md).
!!! warning
In production, it's strongly recommended to setup a migration system to
update your SQL schemas. See
[Alembic](https://alembic.sqlalchemy.org/en/latest/).
## Next steps
We will now configure an [authentication method](../authentication/index.md).