gadfly.client.fetchone() and gadfly.client.fetchmany()
are not currently implemented. Here is a patch
implementing these functions and slightly modifying
fetchall() to use fetchmany(). This code is based on
the code in database.py.
diff -r1.1 client.py
98c98,117
< # should add fetchone fetchmany
---
> def fetchone(self):
> r = self.results
> if r is None:
> return None
> if len(r)<1:
> raise ValueError, "no more results"
> result = r[0]
> del r[0]
> return result
>
> def fetchmany(self, size=None):
> r = self.results
> if r is None:
> return None
> if size is None:
> size = len(r)
> result = r[:size]
> del r[:size]
> return result
>
100c119
< return self.results
---
> return self.fetchmany()
Logged In: YES
user_id=46639
Hmm... I think at least fetchmany and fetchall should return
an empty list if there are no results to be compatible with
the DB API 2.0.
Logged In: YES
user_id=46639
Implemented in dbapi20.py by moellenb