Tornado asynchronous MySQL Driver [fork of TorMySQL]
Project description
mytor
Tornado asynchronous MySQL Driver
About
mytor - presents a Tornado Future-based API and greenlet for non-blocking access to MySQL.
Installation
pip install TorMySQL
Examples
from tornado.ioloop import IOLoop from tornado.get import coroutine import mytor pool = mytor.ConnectionPool( max_connections = 20, #max open connections idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout host = "127.0.0.1", user = "root", passwd = "TEST", db = "test", charset = "utf8" ) @coroutine def test(): with (yield pool.Connection()) as conn: with conn.cursor() as cursor: yield cursor.execute("SELECT * FROM test") datas = cursor.fetchall() print datas yield pool.close() ioloop = IOLoop.instance() ioloop.run_sync(test)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mytor-0.2.3.tar.gz
(6.6 kB
view hashes)
Built Distributions
mytor-0.2.3-py3.4.egg
(8.1 kB
view hashes)
mytor-0.2.3-py2.7.egg
(19.9 kB
view hashes)
Close
Hashes for mytor-0.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58e30e325f88821849f74ac4b568c63b7f415bf3a483570cbeb673fe4c98b9c |
|
MD5 | 2dbfb14dc572537d0beb58a3baef65b3 |
|
BLAKE2b-256 | bae3fffad6bfa5ac39a340441ca0a2d7c2a59e8cebc129983dce5ded0e3483ec |