Switch database to sqlalchemy