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

Uploaded Source

Built Distribution

mytor-0.2.1-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for mytor-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f1115f1df5efaea32b3b793994219e7e351f55d23d7ffb946979fe35990e918f
MD5 c745b6a84767d3ddfe2f5103b8695b03
BLAKE2b-256 29ea92229f042051179f1ebd4a8d9c2b0bff8140572199b9f9f41a6d1b70cdf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mytor-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e2c4bf57ed3755dbb5575b57ad227fd787bfd4235130effa61b344cc235cac71
MD5 21662f36a605ab52d72216f597d28154
BLAKE2b-256 4a69a077c2d35a905651345857299a53ee9ab4a4bede832c28e7850b6b5db536

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