create env
python -m venv venv
source ./venv/bin/activate
pip install sqlmodel psycopg2-binary
start the database
docker-compose up
run the python files
python constraint_sqlalchemy.py
python constraint_sqlmodel.py
stop the database:
docker-compose down
This was tested on 2023/11/01 with python3.11
on MacOS (ARM) and the following package
versions:
psycopg2-binary==2.9.9
pydantic==1.10.13
SQLAlchemy==1.4.50
sqlalchemy2-stubs==0.0.2a36
sqlmodel==0.0.11
typing_extensions==4.8.0