Skip to content

Commit b2856fc

Browse files
committed
compatible for asyncpg 0.30.0 version
1 parent 6218b90 commit b2856fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gino/dialects/asyncpg.py

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44
import warnings
55

6+
from pip._internal.utils import packaging
67
from sqlalchemy import util, exc, sql
78
from sqlalchemy.dialects.postgresql import ( # noqa: F401
89
ARRAY,
@@ -175,6 +176,8 @@ async def async_execute(self, query, timeout, args, limit=0, many=False):
175176

176177
def executor(state, timeout_):
177178
if many:
179+
if packaging.version.parse(asyncpg.__version__) >= packaging.version.parse('0.30.0'):
180+
return _protocol.bind_execute_many(state, args, "", timeout_, return_rows=True)
178181
return _protocol.bind_execute_many(state, args, "", timeout_)
179182
else:
180183
return _protocol.bind_execute(state, args, "", limit, True, timeout_)

0 commit comments

Comments
 (0)