Tornado asynchronous MySQL Driver
Project description
TorMySQL
========
Tornado asynchronous MySQL Driver
About
=====
TorMySQL presents a Tornado Future-based API and greenlet for non-blocking access
to MySQL.
Installation
============
```
git clone https://github.com/snower/TorMySQL.git
python setup.py install
```
Examples
========
```
from tornado.ioloop import IOLoop
from tornado import gen
import tormysql
pool = tormysql.ConnectionPool(
max_connections = 20,
host = "127.0.0.1",
user = "root",
passwd = "TEST",
db = "test",
charset = "utf8"
)
@gen.coroutine
def connect():
conn = yield pool.Connection()
cursor = conn.cursor()
yield cursor.execute("SELECT * FROM test")
datas = cursor.fetchall()
yield cursor.close()
conn.close()
print datas
def start():
connect()
ioloop = IOLoop.instance()
ioloop.add_callback(start)
ioloop.start()
```
========
Tornado asynchronous MySQL Driver
About
=====
TorMySQL presents a Tornado Future-based API and greenlet for non-blocking access
to MySQL.
Installation
============
```
git clone https://github.com/snower/TorMySQL.git
python setup.py install
```
Examples
========
```
from tornado.ioloop import IOLoop
from tornado import gen
import tormysql
pool = tormysql.ConnectionPool(
max_connections = 20,
host = "127.0.0.1",
user = "root",
passwd = "TEST",
db = "test",
charset = "utf8"
)
@gen.coroutine
def connect():
conn = yield pool.Connection()
cursor = conn.cursor()
yield cursor.execute("SELECT * FROM test")
datas = cursor.fetchall()
yield cursor.close()
conn.close()
print datas
def start():
connect()
ioloop = IOLoop.instance()
ioloop.add_callback(start)
ioloop.start()
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
TorMySQL-0.0.4.tar.gz
(5.4 kB
view hashes)