The Cursor class represents a cursor to iterate through instances of a specified class, the result set of a find/search operation, or the result set from SQL queries. It provides the following methods:
find(cls, idx, value) Find a database object of class cls
by an indexidx
and keyvalue
(a DB API compliant call)search(cls, idx, op, value) Locate the position of a database object of class cls
in an index idx and keyvalue
using the operationop
(a DB API compliant call)checkpoint() Checkpoint the cursor; this updates the index for the any updated objects previously returned by the methods first(), last(), next(), prev()
orskip()
.close() Close the cursor getAutoId() Get the autoid
of the current objectfirst() Move cursor to the first position last() Move cursor to the last position next() Move cursor to the next position prev() Move cursor to the previous position skip() Move cursor to the next position without retrieving the element reset() Reset (rewind) the cursor current() Return the object to which the cursor is referring execute(query [,args]) Execute a SQL query
against the database substituting argumentsargs
for format specifiers in thequery
string (a DB API compliant call)execute_many(query, args) Execute a SQL query
against the database applying a set of parametersargs
(a DB API compliant call)fetchone() Return the next row of result set (a DB API compliant call) fetchmany([size=cursor.arraysize]) Fetch the next set of rows from a result set optionally specifying the size
of the resutl set (a DB API compliant call)fetchall() Fetch all (remaining) rows of a query result (a DB API compliant call) rowcount The Read-Only property that indicates the number of rows affected
- See also: Using Python with eXtremeDB