@@ -53,13 +53,21 @@ async def aiopg_connect(args):
5353 port = args .pgport )
5454 return conn
5555
56-
5756async def aiopg_execute (conn , query , args ):
5857 cur = await conn .cursor (cursor_factory = psycopg2 .extras .DictCursor )
5958 await cur .execute (query , args )
6059 return len (await cur .fetchall ())
6160
6261
62+ aiopg_tuples_connect = aiopg_connect
63+
64+
65+ async def aiopg_tuples_execute (conn , query , args ):
66+ cur = await conn .cursor ()
67+ await cur .execute (query , args )
68+ return len (await cur .fetchall ())
69+
70+
6371async def asyncpg_connect (args ):
6472 conn = await asyncpg .connect (user = args .pguser , host = args .pghost ,
6573 port = args .pgport )
@@ -252,7 +260,7 @@ def die(msg):
252260 help = 'PostgreSQL server user' )
253261 parser .add_argument (
254262 'driver' , help = 'driver implementation to use' ,
255- choices = ['aiopg' , 'asyncpg' , 'psycopg' , 'postgresql' ])
263+ choices = ['aiopg' , 'aiopg-tuples' , ' asyncpg' , 'psycopg' , 'postgresql' ])
256264 parser .add_argument (
257265 'queryfile' , help = 'file to read benchmark query information from' )
258266
@@ -283,6 +291,10 @@ def die(msg):
283291 connector , executor = aiopg_connect , aiopg_execute
284292 is_async = True
285293 arg_format = 'python'
294+ if args .driver == 'aiopg-tuples' :
295+ connector , executor = aiopg_tuples_connect , aiopg_tuples_execute
296+ is_async = True
297+ arg_format = 'python'
286298 elif args .driver == 'asyncpg' :
287299 connector , executor = asyncpg_connect , asyncpg_execute
288300 is_async = True
0 commit comments