attempt to implement sqlalchemy