use transactions to avoid isolation issues
publicId -> public_id
allow db-import to continue when getting errors
restructure to get a new connection from engine for each query

should use sqlalchemy's pool then