File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Mailing List
3535https://groups.google.com/forum/#!forum/aio-libs
3636
3737
38- Basic Example
38+ Basic
3939-------------
4040
4141**aiomysql ** based on PyMySQL _ , and provides same api, you just need
@@ -46,28 +46,6 @@ Properties are unchanged, so ``conn.prop`` is correct as well as
4646``conn.prop = val ``.
4747
4848
49- .. code :: python
50-
51- import asyncio
52- from aiomysql import create_pool
53-
54-
55- loop = asyncio.get_event_loop()
56-
57- async def go ():
58- async with create_pool(host = ' 127.0.0.1' , port = 3306 ,
59- user = ' root' , password = ' ' ,
60- db = ' mysql' , loop = loop) as pool:
61- async with pool.get() as conn:
62- async with conn.cursor() as cur:
63- await cur.execute(" SELECT 42;" )
64- value = await cur.fetchone()
65- print (value)
66-
67-
68- loop.run_until_complete(go())
69-
70-
7149Connection Pool
7250---------------
7351Connection pooling ported from aiopg _ :
You can’t perform that action at this time.
0 commit comments