elements to render correctly even if they all render
identically, such as "qmark" style bind parameters.
[ticket:1574]
+
+ - The cursor associated with connection pool connections
+ (i.e. _CursorFairy) now proxies `__iter__()` to the
+ underlying cursor correctly. [ticket:1632]
- postgresql
- Added support for reflecting the DOUBLE PRECISION type,
def invalidate(self, e=None):
self.__parent.invalidate(e=e)
-
+
+ def __iter__(self):
+ return iter(self.cursor)
+
def close(self):
try:
self.cursor.close()
import threading, time, gc
from sqlalchemy import pool, interfaces
import sqlalchemy as tsa
-from sqlalchemy.test import TestBase
+from sqlalchemy.test import TestBase, testing
+from sqlalchemy.test.testing import eq_
mcid = 1
self.assert_(connection.cursor() is not None)
self.assert_(connection is not connection2)
-
+ def test_cursor_iterable(self):
+ conn = testing.db.raw_connection()
+ cursor = conn.cursor()
+ cursor.execute("select 1")
+ expected = [(1,)]
+ for row in cursor:
+ eq_(row, expected.pop(0))
+
def testthreadlocal_del(self):
self._do_testthreadlocal(useclose=False)