It looks like pysqlite2 doesn't support passing the size argument to
fetchmany() as a keyword argument, so this fails:

from sqlalchemy import *
md = DynamicMetaData()
md.connect('sqlite://')
stuff = Table('stuff', md, Column('thing', String(40),
primary_key=True)
)
md.create_all()
stuff.insert(thing='hello')
stuff.insert().execute(thing='hello')
stuff.insert().execute(thing='goodbye')
r = stuff.select().execute()
r.fetchmany(2)

raises:

TypeError: fetchmany() takes no keyword arguments

It seems to be possible to work around this by setting
r.cursor.cursor.arraysize to the desired size, but it might be better
just switch fetchmany() to pass the size to cursor.fetchmany() as a
positional arg. The other database I have access to try (postgres)
works with both positional and keyword size args. I don't know about
any of the others. The dbapi doc isn't clear (to me) about whether
size should be a positional or keyword arg.

If changing to a positional arg seems like a good solution, I can file
a ticket with a patch that also adds a basic fetchmany test to the
test suite.

JP


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to