Skip to main content

Tornado asynchronous MySQL Driver [fork of TorMySQL]

Project description

mytor

https://travis-ci.org/mosquito/mytor.svg

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.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

mytor-0.2.0-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mytor-0.2.0.tar.gz.

File metadata

  • Download URL: mytor-0.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mytor-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2c4b162d5fac9429eb2d5192aadbc72a28d4986a5db9b29a9bc0713d6aa88fc7
MD5 8ca57c4f94980fba85cf8549fb9c5914
BLAKE2b-256 3c4e8dec946dbb49dc40eafbf8c1e51830ce4312d3f67af139d60e734b1be516

See more details on using hashes here.

File details

Details for the file mytor-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mytor-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1985a96f1e94d2f30bec5850a5439d73d0df41c6a5622e349a64c0b9988cdbdb
MD5 96833b55652f9c13e1e7ea36b8299efd
BLAKE2b-256 b0d5bc68892d51c47241b2d03458ad40879c6eb939b38260844ec3e59d613408

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page