Re: Support for optional scroll method.
"Billy G. Allie" <ballie4114-EnPF47/[email protected]>
| Newsgroups | gmane.comp.python.db.pypgsql.user |
|---|---|
| Message-ID | <[email protected]> |
Benjamin Scherrey wrote:
>The DB-API 2.0 PEP specifies an optional mechanism for handling cursors and providing forward
>and backward iteration via the cursor.scroll() method. I was curious as to whether or not this was
>something coming for PyPgSQL and, until then, what would be a good workaround for going
>backwards in a cursor.
>
> many thanx,
>
> Ben Scherrey
>
Yes they will be added to pyPgSQL (If you want to supply a patch, I
won't object :-) ).
The cursor object has a rewind method, which will rewind the cursor back
to the beginning.
Your can also execute a query in the form:
cursor.execute('MOVE BACKWARD XXX IN "%s"' % cursor.name) or
cursor.execute('MOVE FORWARD XXX IN "%s"' % cursor.name)
[If you would like to supply a patch to implement .scroll(), you can use
.rewind() as a model]
I hope this helps.
>
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf