#10320: CursorDebugWrapper should allow using iterators/generators for
executemany().
------------------------------------------+---------------------------------
 Reporter:  MockSoul                      |       Owner:  nobody    
   Status:  new                           |   Milestone:  post-1.0  
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 executemany on cursors can have a little speedup on huge lists if
 developer sends iterators or generators as args. Thus, they will have no
 __len__. CursorDebugWrapper tries to determine length for only one reason:
 put a record about number of executed queries into connection.queries.

 It's good idea probably to determine if args have no len -- dont put info
 about amount of executed queries into connection.queries.

 Right now I can do connection.cursor().cursor.executemany(sql, iterator)
 for that purpose. I mean -- python db wrappers usually allow iterators in
 executemany's args. Another ugly way right now - catch TypeError and
 silently ignore. This is because django do len() after calling executemany
 on underlying cursor =). Non-pythonic, yeah?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10320>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to