@@ -132,7 +132,7 @@ def __init__(self, connection, statement, parameters):
132
132
self ._keys = None
133
133
self ._connection = connection
134
134
self ._current = None
135
- self ._next = deque ()
135
+ self ._record_buffer = deque ()
136
136
self ._position = - 1
137
137
self ._summary = None
138
138
self ._consumed = False
@@ -154,15 +154,15 @@ def next(self):
154
154
""" Advance to the next record, if available, and return a boolean
155
155
to indicate whether or not the cursor has moved.
156
156
"""
157
- if self ._next :
158
- values = self ._next .popleft ()
157
+ if self ._record_buffer :
158
+ values = self ._record_buffer .popleft ()
159
159
self ._current = Record (self .keys (), tuple (map (hydrated , values )))
160
160
self ._position += 1
161
161
return True
162
162
elif self ._consumed :
163
163
return False
164
164
else :
165
- self ._connection .fetch_next ()
165
+ self ._connection .fetch ()
166
166
return self .next ()
167
167
168
168
def record (self ):
@@ -179,12 +179,12 @@ def at_end(self):
179
179
""" Return ``True`` if at the end of the record stream, ``False``
180
180
otherwise.
181
181
"""
182
- if self ._next :
182
+ if self ._record_buffer :
183
183
return False
184
184
elif self ._consumed :
185
185
return True
186
186
else :
187
- self ._connection .fetch_next ()
187
+ self ._connection .fetch ()
188
188
return self .at_end ()
189
189
190
190
def stream (self ):
@@ -204,7 +204,7 @@ def keys(self):
204
204
"""
205
205
# Fetch messages until we have the header or a failure
206
206
while self ._keys is None and not self ._consumed :
207
- self ._connection .fetch_next ()
207
+ self ._connection .fetch ()
208
208
return self ._keys
209
209
210
210
def get (self , item , default = None ):
@@ -226,17 +226,17 @@ def summarize(self):
226
226
227
227
def _consume (self ):
228
228
# Consume the remainder of this result, triggering all appropriate callback functions.
229
- fetch_next = self ._connection .fetch_next
229
+ fetch = self ._connection .fetch
230
230
while not self ._consumed :
231
- fetch_next ()
231
+ fetch ()
232
232
233
233
def _on_header (self , metadata ):
234
234
# Called on receipt of the result header.
235
235
self ._keys = metadata ["fields" ]
236
236
237
237
def _on_record (self , values ):
238
238
# Called on receipt of each result record.
239
- self ._next .append (values )
239
+ self ._record_buffer .append (values )
240
240
241
241
def _on_footer (self , metadata ):
242
242
# Called on receipt of the result footer.
0 commit comments