The idea behind this project is to have sqlalchemy specific handlers that deal with session closing and run behind ThreadPoolExecutor, not blocking ioloop along the way.
Initialize sessionmaker and take a look at tqueries.mixins.SqlalchemyRESTMixin and You're good to go :)
engine = engine_from_config(settings, prefix=u'sqlalchemy.', echo=True)
sqla.initialize_sessionmaker(engine=engine)
Base.metadata.bind = engine
Base.metadata.create_all(engine)
- Run project:
$ python examples/sqla.py
- Create couple of models
$ curl -X POST http://localhost:8888
- Retrieve (it sleeps for 2 seconds on purpose)
Create couple of models
$ curl -X GET http://localhost:8888