Create models, which are effectively columns in the database (see the SQLModel docs for details; consider sqlmodel (sqlalchemy) cascade in Relationship
).
Then, connect to the database and write from JSON records format.
If writing from a pandas dataframe, make sure the NaN
values are of the correct type. This can be forced with df = df.astype({"quotes": "string"})
.
These can be used with FastAPI (with tests).