• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    Python
  • Created over 10 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

async mysql client for tornado

AsyncTorndb(inactive)

Async mysql client for tornado base on PyMySQL.

Documentation

AsyncTorndb behavior is almost like torndb behavior, but async. Refer to torndb and have a try.

Requirements

Demo

Here is a simple "Hello, world" example web app for AsyncTorndb::

import tornado.ioloop
import tornado.web
import tornado.gen
import asynctorndb

class MainHandler(tornado.web.RequestHandler):
    @tornado.gen.coroutine
    def get(self):
        conn = asynctorndb.Connect(user='demo', passwd='demo', database='demo')
        yield conn.connect()
        result = yield conn.query('select * from user')
        # do something with result
        self.write("Hello, world")

application = tornado.web.Application([
    (r"/", MainHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()

License

AsyncTorndb is released under the MIT License. See LICENSE for more information.