siddhantgoel / tornado-sqlalchemy

SQLAlchemy support for Tornado
https://tornado-sqlalchemy.readthedocs.io/en/latest/
MIT License
125 stars 21 forks source link

async session.commit error #92

Closed boeyeb closed 4 years ago

boeyeb commented 4 years ago

I am getting an error "NoneType can't be used in 'await' expression" for commit call.

with self.make_session() as session: session.add(User(self._access_id, \ self._username) await session.commit()

If I remove await, the problem disappears but performance hits badly & because of sync call. Any idea? Thanks Rajeev

boeyeb commented 4 years ago

I had cut & paste error in my code. Sorry about that. Following worked

await as_future(session.commit)