Preparing for database connectivity
Let us consider some application-related concerns before we start discussing database connectivity in FastAPI:
- First, all the application prototypes from this chapter onward will be using PostgreSQL as the sole relational DBMS. We can download its installer from https://www.enterprisedb.com/downloads/postgres-postgresql-downloads.
- Second, the fitness club management system prototype has an existing database called
fcms
with six tables, namelysignup
,login
,profile_members
,profile_trainers
,attendance_member
, andgym_class
. All these tables, along with their metadata and relationships, can be seen in the following diagram:
Figure 5.1 – The fcms tables
The project folder contains a script called fcms_postgres.sql
that installs all these schemas.
Now that we’ve installed the latest version of PostgreSQL and run the fcms
script file, let us learn about SQLAlchemy, the most widely used ORM library...