File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ Mailing List
35
35
https://groups.google.com/forum/#!forum/aio-libs
36
36
37
37
38
- Basic Example
38
+ Basic
39
39
-------------
40
40
41
41
**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
46
46
``conn.prop = val ``.
47
47
48
48
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
-
71
49
Connection Pool
72
50
---------------
73
51
Connection pooling ported from aiopg _ :
You can’t perform that action at this time.
0 commit comments