معرفی شرکت ها


anthill-tormysql-0.4.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Tornado asynchronous MySQL Driver
ویژگی مقدار
سیستم عامل -
نام فایل anthill-tormysql-0.4.0
نام anthill-tormysql
نسخه کتابخانه 0.4.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده snower, mosquito
ایمیل نویسنده sujian199@gmail.com, me@mosquito.su
آدرس صفحه اصلی https://github.com/snower/TorMySQL
آدرس اینترنتی https://pypi.org/project/anthill-tormysql/
مجوز MIT
TorMySQL ======== |Build Status| The highest performance asynchronous MySQL driver. PyPI page: https://pypi.python.org/pypi/tormysql About ===== Presents a Future-based API and greenlet for non-blocking access to MySQL. Support both `tornado <https://github.com/tornadoweb/tornado>`__ and `asyncio <https://docs.python.org/3/library/asyncio.html>`__. Installation ============ :: pip install TorMySQL Used Tornado ============ example pool ------------ :: from tornado.ioloop import IOLoop from tornado import gen import tormysql pool = tormysql.ConnectionPool( max_connections = 20, #max open connections idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout wait_connection_timeout = 3, #wait connection timeout host = "127.0.0.1", user = "root", passwd = "TEST", db = "test", charset = "utf8" ) @gen.coroutine def test(): with (yield pool.Connection()) as conn: try: with conn.cursor() as cursor: yield cursor.execute("INSERT INTO test(id) VALUES(1)") except: yield conn.rollback() else: yield conn.commit() 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) example helpers --------------- :: from tornado.ioloop import IOLoop from tornado import gen import tormysql pool = tormysql.helpers.ConnectionPool( max_connections = 20, #max open connections idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout wait_connection_timeout = 3, #wait connection timeout host = "127.0.0.1", user = "root", passwd = "TEST", db = "test", charset = "utf8" ) @gen.coroutine def test(): tx = yield pool.begin() try: yield tx.execute("INSERT INTO test(id) VALUES(1)") except: yield tx.rollback() else: yield tx.commit() cursor = yield pool.execute("SELECT * FROM test") datas = cursor.fetchall() print datas yield pool.close() ioloop = IOLoop.instance() ioloop.run_sync(test) Used asyncio alone ================== example pool ------------ :: from asyncio import events import tormysql pool = tormysql.ConnectionPool( max_connections = 20, #max open connections idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout wait_connection_timeout = 3, #wait connection timeout host = "127.0.0.1", user = "root", passwd = "TEST", db = "test", charset = "utf8" ) async def test(): async with await pool.Connection() as conn: try: async with conn.cursor() as cursor: await cursor.execute("INSERT INTO test(id) VALUES(1)") except: await conn.rollback() else: await conn.commit() async with conn.cursor() as cursor: await cursor.execute("SELECT * FROM test") datas = cursor.fetchall() print(datas) await pool.close() ioloop = events.get_event_loop() ioloop.run_until_complete(test) example helpers --------------- :: from asyncio import events import tormysql pool = tormysql.helpers.ConnectionPool( max_connections = 20, #max open connections idle_seconds = 7200, #conntion idle timeout time, 0 is not timeout wait_connection_timeout = 3, #wait connection timeout host = "127.0.0.1", user = "root", passwd = "TEST", db = "test", charset = "utf8" ) async def test(): async with await pool.begin() as tx: await tx.execute("INSERT INTO test(id) VALUES(1)") cursor = await pool.execute("SELECT * FROM test") datas = cursor.fetchall() print(datas) await pool.close() ioloop = events.get_event_loop() ioloop.run_until_complete(test) Resources ========= You can read `PyMySQL Documentation <http://pymysql.readthedocs.io/>`__ online for more information. License ======= TorMySQL uses the MIT license, see LICENSE file for the details. .. |Build Status| image:: https://travis-ci.org/snower/TorMySQL.svg?branch=master :target: https://travis-ci.org/snower/TorMySQL


نیازمندی

مقدار نام
>=5.0 tornado
>=0.9.999 anthill-PyMySQL
>=0.4.2 greenlet


نحوه نصب


نصب پکیج whl anthill-tormysql-0.4.0:

    pip install anthill-tormysql-0.4.0.whl


نصب پکیج tar.gz anthill-tormysql-0.4.0:

    pip install anthill-tormysql-0.4.0.tar.gz