{ "info": { "author": "snower, mosquito", "author_email": "sujian199@gmail.com, me@mosquito.su", "bugtrack_url": null, "classifiers": [], "description": "TorMySQL\n========\n\n|Build Status|\n\nThe highest performance asynchronous MySQL driver.\n\nPyPI page: https://pypi.python.org/pypi/tormysql\n\nAbout\n=====\n\nPresents a Future-based API and greenlet for non-blocking access to\nMySQL.\n\nSupport both `tornado `__ and\n`asyncio `__.\n\nInstallation\n============\n\n::\n\n pip install TorMySQL\n\nUsed Tornado\n============\n\nexample pool\n------------\n\n::\n\n from tornado.ioloop import IOLoop\n from tornado import gen\n import tormysql\n\n pool = tormysql.ConnectionPool(\n max_connections = 20, #max open connections\n idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout\n wait_connection_timeout = 3, #wait connection timeout\n host = \"127.0.0.1\",\n user = \"root\",\n passwd = \"TEST\",\n db = \"test\",\n charset = \"utf8\"\n )\n\n @gen.coroutine\n def test():\n with (yield pool.Connection()) as conn:\n try:\n with conn.cursor() as cursor:\n yield cursor.execute(\"INSERT INTO test(id) VALUES(1)\")\n except:\n yield conn.rollback()\n else:\n yield conn.commit()\n\n with conn.cursor() as cursor:\n yield cursor.execute(\"SELECT * FROM test\")\n datas = cursor.fetchall()\n\n print datas\n\n yield pool.close()\n\n ioloop = IOLoop.instance()\n ioloop.run_sync(test)\n\nexample helpers\n---------------\n\n::\n\n from tornado.ioloop import IOLoop\n from tornado import gen\n import tormysql\n\n pool = tormysql.helpers.ConnectionPool(\n max_connections = 20, #max open connections\n idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout\n wait_connection_timeout = 3, #wait connection timeout\n host = \"127.0.0.1\",\n user = \"root\",\n passwd = \"TEST\",\n db = \"test\",\n charset = \"utf8\"\n )\n\n @gen.coroutine\n def test():\n tx = yield pool.begin()\n try:\n yield tx.execute(\"INSERT INTO test(id) VALUES(1)\")\n except:\n yield tx.rollback()\n else:\n yield tx.commit()\n\n cursor = yield pool.execute(\"SELECT * FROM test\")\n datas = cursor.fetchall()\n\n print datas\n\n yield pool.close()\n\n ioloop = IOLoop.instance()\n ioloop.run_sync(test)\n\nUsed asyncio alone\n==================\n\nexample pool\n------------\n\n::\n\n from asyncio import events\n import tormysql\n\n pool = tormysql.ConnectionPool(\n max_connections = 20, #max open connections\n idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout\n wait_connection_timeout = 3, #wait connection timeout\n host = \"127.0.0.1\",\n user = \"root\",\n passwd = \"TEST\",\n db = \"test\",\n charset = \"utf8\"\n )\n\n async def test():\n async with await pool.Connection() as conn:\n try:\n async with conn.cursor() as cursor:\n await cursor.execute(\"INSERT INTO test(id) VALUES(1)\")\n except:\n await conn.rollback()\n else:\n await conn.commit()\n\n async with conn.cursor() as cursor:\n await cursor.execute(\"SELECT * FROM test\")\n datas = cursor.fetchall()\n\n print(datas)\n\n await pool.close()\n\n ioloop = events.get_event_loop()\n ioloop.run_until_complete(test)\n\nexample helpers\n---------------\n\n::\n\n from asyncio import events\n import tormysql\n\n pool = tormysql.helpers.ConnectionPool(\n max_connections = 20, #max open connections\n idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout\n wait_connection_timeout = 3, #wait connection timeout\n host = \"127.0.0.1\",\n user = \"root\",\n passwd = \"TEST\",\n db = \"test\",\n charset = \"utf8\"\n )\n\n async def test():\n async with await pool.begin() as tx:\n await tx.execute(\"INSERT INTO test(id) VALUES(1)\")\n\n cursor = await pool.execute(\"SELECT * FROM test\")\n datas = cursor.fetchall()\n\n print(datas)\n\n await pool.close()\n\n ioloop = events.get_event_loop()\n ioloop.run_until_complete(test)\n\nResources\n=========\n\nYou can read `PyMySQL Documentation `__\nonline for more information.\n\nLicense\n=======\n\nTorMySQL uses the MIT license, see LICENSE file for the details.\n\n.. |Build Status| image:: https://travis-ci.org/snower/TorMySQL.svg?branch=master\n :target: https://travis-ci.org/snower/TorMySQL\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/snower/TorMySQL", "keywords": "tornado,mysql", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "anthill-tormysql", "package_url": "https://pypi.org/project/anthill-tormysql/", "platform": "", "project_url": "https://pypi.org/project/anthill-tormysql/", "project_urls": { "Homepage": "https://github.com/snower/TorMySQL" }, "release_url": "https://pypi.org/project/anthill-tormysql/0.4.0/", "requires_dist": [ "tornado (>=5.0)", "anthill-PyMySQL (>=0.9.999)", "greenlet (>=0.4.2)" ], "requires_python": "", "summary": "Tornado asynchronous MySQL Driver", "version": "0.4.0" }, "last_serial": 4796914, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "ce9f4034fa9078d666fa8ea6842d7d10", "sha256": "ea910e3a3bcb2064639d7673e149a8589026646d6b2b23bd241b890762195911" }, "downloads": -1, "filename": "anthill_tormysql-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce9f4034fa9078d666fa8ea6842d7d10", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18826, "upload_time": "2019-02-08T18:46:23", "url": "https://files.pythonhosted.org/packages/d0/33/d46bc7af16648da97aa8e56c78a8ad981695fbfc18a820e83ba942524d34/anthill_tormysql-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1937401cb1fde5e5b995c3eb0963953a", "sha256": "ddc004b1218fa6ed9ff844a8ca4c580099d53f0a06ce05c3de62e4abae983f84" }, "downloads": -1, "filename": "anthill_tormysql-0.4.0-py3.5.egg", "has_sig": false, "md5_digest": "1937401cb1fde5e5b995c3eb0963953a", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 45773, "upload_time": "2019-02-08T18:46:27", "url": "https://files.pythonhosted.org/packages/92/4a/e91be683e7d09a4b986cff2762778d9d3c3c01768b05ee31c83fba72a642/anthill_tormysql-0.4.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "cad9e96c94759a04827aafdf566b2532", "sha256": "346b5a16e83ed6bec7c82b4e6b22b51cc13c1345df497e1a49f83b4c17c8cd6f" }, "downloads": -1, "filename": "anthill-tormysql-0.4.0.tar.gz", "has_sig": false, "md5_digest": "cad9e96c94759a04827aafdf566b2532", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14743, "upload_time": "2019-02-08T18:46:25", "url": "https://files.pythonhosted.org/packages/96/00/c93034ff13941b8f3ff876dec15c780518250c51abc6012a8f44d29ccc85/anthill-tormysql-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce9f4034fa9078d666fa8ea6842d7d10", "sha256": "ea910e3a3bcb2064639d7673e149a8589026646d6b2b23bd241b890762195911" }, "downloads": -1, "filename": "anthill_tormysql-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce9f4034fa9078d666fa8ea6842d7d10", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18826, "upload_time": "2019-02-08T18:46:23", "url": "https://files.pythonhosted.org/packages/d0/33/d46bc7af16648da97aa8e56c78a8ad981695fbfc18a820e83ba942524d34/anthill_tormysql-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1937401cb1fde5e5b995c3eb0963953a", "sha256": "ddc004b1218fa6ed9ff844a8ca4c580099d53f0a06ce05c3de62e4abae983f84" }, "downloads": -1, "filename": "anthill_tormysql-0.4.0-py3.5.egg", "has_sig": false, "md5_digest": "1937401cb1fde5e5b995c3eb0963953a", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 45773, "upload_time": "2019-02-08T18:46:27", "url": "https://files.pythonhosted.org/packages/92/4a/e91be683e7d09a4b986cff2762778d9d3c3c01768b05ee31c83fba72a642/anthill_tormysql-0.4.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "cad9e96c94759a04827aafdf566b2532", "sha256": "346b5a16e83ed6bec7c82b4e6b22b51cc13c1345df497e1a49f83b4c17c8cd6f" }, "downloads": -1, "filename": "anthill-tormysql-0.4.0.tar.gz", "has_sig": false, "md5_digest": "cad9e96c94759a04827aafdf566b2532", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14743, "upload_time": "2019-02-08T18:46:25", "url": "https://files.pythonhosted.org/packages/96/00/c93034ff13941b8f3ff876dec15c780518250c51abc6012a8f44d29ccc85/anthill-tormysql-0.4.0.tar.gz" } ] }