experiments with raw SQLAlchemy
change to flask extension SQLAlchemy
basic error code handling