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

Uploaded Source

Built Distributions

mytor-0.2.4-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2 Python 3

mytor-0.2.4-py2.7.egg (8.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for mytor-0.2.4.tar.gz
Algorithm Hash digest
SHA256 3a2da4ca98fcf568f520ac2754e8802b699bf4678408ff5349f8c8167c361525
MD5 46b293cb12b00ddd4705b1bbb51eca11
BLAKE2b-256 17cbb1afa7617d9694fe16810081499f8f95e7994a874192ca4633aef6f67335

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mytor-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c8ca7c4a12e22c5a62ade35cfeecb3f17976bfa94ae7f58bd70d96cb9ad56622
MD5 f25fea8f858fced00d62d14b3df98b05
BLAKE2b-256 6d1c6c48722ac78045170d463b254f0a4c1eb4554e024e15f6315c56e1c476ab

See more details on using hashes here.

File details

Details for the file mytor-0.2.4-py2.7.egg.

File metadata

  • Download URL: mytor-0.2.4-py2.7.egg
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mytor-0.2.4-py2.7.egg
Algorithm Hash digest
SHA256 2d2c1accea90b6b67cd8eead52186f39500cd64f7dd16b3c331176e4aad4533e
MD5 45d518f6333911fc335804fcf89ae6a7
BLAKE2b-256 41ea7d1abf3fc248873d4cc0301019c6fc4d116276f53c50215f655787691e11

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