Skip to content

2024

#239: Asynchronous Tests With Pytest

After finishing the dashboard, I hoped to quickly switch my datastore implementation to use the asynchronous methods for SQLAlchemy. Unfortunately, that was not the case. Everything needs to change, and that change must be done all at once. That includes pytest, that we need to run our tests.

To make the change more understandable, we start in this post with pytest and do the necessary work to test asynchronous methods. With that out of our way, we can next week focus on SQLAlchemy.

#235: DB Migrations With Alembic and FastAPI

Our current way to create the tables in the database when we run the application works fine until we need to extend an existing table. Then SQLAlchemy will not do that for us, and we must make the change manually. With Alembic we have a solution for that problem that works great with SQLAlchemy. Let us add it to our to-do application.

#233: SQLAlchemy and FastAPI

Until now we kept our data in a variable. While that worked with an example application, the data vanishes as soon as we restart our API. To get a more realistic application, we need to persist data for a longer time. Let us explore how we can integrate SQLAlchemy with FastAPI.

#232: Update SQLAlchemy to Version 2.x

Before we can move ahead and add a database to our to-do API, we take a little detour and update SQLAlchemy to version 2. Much changed since I wrote about SQLAlchemy three years ago, but thanks to the early published guidelines, the largest part of the examples I used in my post can stay the same. Nevertheless, there are changes we need to know about, and we must update minor details to run the examples with the current version of SQLAlchemy.

#230: Fix the PydanticJsonSchemaWarning in FastAPI

While I was preparing the next post, I run into an annoying warning that I wanted to fix before I add one additional feature to the minimalistic to-do application. Let us explore what I had to do to find the reason for the warning and how I could fix the problem.