{ "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": "zoomcatalog", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "zoom-tormysql", "package_url": "https://pypi.org/project/zoom-tormysql/", "platform": "", "project_url": "https://pypi.org/project/zoom-tormysql/", "project_urls": { "Homepage": "https://github.com/snower/TorMySQL" }, "release_url": "https://pypi.org/project/zoom-tormysql/0.4.2/", "requires_dist": [ "tornado (>=5)", "PyMySQL (>=0.7.10)", "greenlet (>=0.4.2)" ], "requires_python": "", "summary": "Tornado asynchronous MySQL Driver", "version": "0.4.2" }, "last_serial": 5131742, "releases": { "0.4.1": [ { "comment_text": "", "digests": { "md5": "1a7b0400c760fec30449473f27fb30b6", "sha256": "e936c7825b9e4f07b8db241a47e26a5c2b696649b23af05197a13a17fab1ec96" }, "downloads": -1, "filename": "zoom_tormysql-0.4.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1a7b0400c760fec30449473f27fb30b6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18753, "upload_time": "2019-03-21T23:12:39", "url": "https://files.pythonhosted.org/packages/33/3f/f971e9e07493383a060b39bd893cf7c02979a9058972640d65a8919d67f8/zoom_tormysql-0.4.1-py2.py3-none-any.whl" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "0b59e0962b1515fa201418523934bc27", "sha256": "8211f2c94c6a50b64b9a40b7710c508ccb1849a485ea788b785d95c805709552" }, "downloads": -1, "filename": "zoom_tormysql-0.4.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0b59e0962b1515fa201418523934bc27", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18849, "upload_time": "2019-04-12T02:08:02", "url": "https://files.pythonhosted.org/packages/aa/cf/e9d6a892d5a9491053e9b0e5bac25f14f749d266bd286576a38806b8bca8/zoom_tormysql-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ac3305b9f6a317efc84a9fe53314fae", "sha256": "6125aa52227fab2ea918ef5607dd655d1fddaaafbba191a17b81b9c7f81e9702" }, "downloads": -1, "filename": "zoom-tormysql-0.4.2.tar.gz", "has_sig": false, "md5_digest": "8ac3305b9f6a317efc84a9fe53314fae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14879, "upload_time": "2019-04-12T02:08:03", "url": "https://files.pythonhosted.org/packages/f8/0f/f3aeb300c2465fdde054259a6ec7684fa12b3793e6c9f2db3331f3a2fed6/zoom-tormysql-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0b59e0962b1515fa201418523934bc27", "sha256": "8211f2c94c6a50b64b9a40b7710c508ccb1849a485ea788b785d95c805709552" }, "downloads": -1, "filename": "zoom_tormysql-0.4.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0b59e0962b1515fa201418523934bc27", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 18849, "upload_time": "2019-04-12T02:08:02", "url": "https://files.pythonhosted.org/packages/aa/cf/e9d6a892d5a9491053e9b0e5bac25f14f749d266bd286576a38806b8bca8/zoom_tormysql-0.4.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ac3305b9f6a317efc84a9fe53314fae", "sha256": "6125aa52227fab2ea918ef5607dd655d1fddaaafbba191a17b81b9c7f81e9702" }, "downloads": -1, "filename": "zoom-tormysql-0.4.2.tar.gz", "has_sig": false, "md5_digest": "8ac3305b9f6a317efc84a9fe53314fae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14879, "upload_time": "2019-04-12T02:08:03", "url": "https://files.pythonhosted.org/packages/f8/0f/f3aeb300c2465fdde054259a6ec7684fa12b3793e6c9f2db3331f3a2fed6/zoom-tormysql-0.4.2.tar.gz" } ] }