Skip to content

Commit 685279f

Browse files
committed
Rename CursorFactory to CursorInterface
1 parent 78066f0 commit 685279f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

asyncpg/connection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ async def _get_statement(self, query, timeout):
100100

101101
return state
102102

103-
def cursor(self, query, *args, prefetch=None, timeout=None):
104-
return cursor.CursorFactory(self, query, None, args, prefetch, timeout)
103+
def cursor(self, query, *args, prefetch=50, timeout=None):
104+
return cursor.CursorInterface(self, query, None, args,
105+
prefetch, timeout)
105106

106107
async def prepare(self, query, *, timeout=None):
107108
"""Create a *prepared statement* for the specified query.

asyncpg/cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from . import exceptions
1212

1313

14-
class CursorFactory:
14+
class CursorInterface:
1515

1616
__slots__ = ('_state', '_connection', '_args', '_prefetch',
1717
'_query', '_timeout')

asyncpg/prepared_stmt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def get_attributes(self):
4242

4343
def cursor(self, *args, prefetch=None, timeout=None):
4444
self.__check_open()
45-
return cursor.CursorFactory(self._connection, self._query,
46-
self._state, args, prefetch,
47-
timeout)
45+
return cursor.CursorInterface(self._connection, self._query,
46+
self._state, args, prefetch,
47+
timeout)
4848

4949
async def explain(self, *args, analyze=False):
5050
query = 'EXPLAIN (FORMAT JSON, VERBOSE'

0 commit comments

Comments
 (0)