Home | Trees | Indices | Help |
|
---|
|
This is the base class for all results. A result is a collection of one kind of dbobjects that have been retrieved from the database. This class will emulate a sequence but also has a next() method like a generator (so I don't have to change all that code that assumes a result to be a generator). The result class also has two methods to determine the result's length by querying the database. If you need to traverse over a result more than once, you must cast it into a list (and by that copying all dbobjects to the client's memory).
The result class needs to deal with datasources that have an attribute called no_fetchone set, that makes this class use the cursor.fetchall() method (most notable for the gadfly adapter).
|
|||
| __init__(self, ds, dbclass, select) | ||
| __iter__(self) | ||
| next(self) | ||
| fetchone(self) | ||
|
count(self) This is a helper function that will perform a query as SELECT COUNT(*) ... |
||
|
count_all(self) This is a helper function that will perform a query as SELECT COUNT(*) ... |
|
|
|
|
|
This is a helper function that will perform a query as SELECT COUNT(*) ... appropriate to determine the number of rows in this result. This will remove all clauses of the original select except the WHERE clause. This can't be called __len__(), because then it is used by list() and yields a superflous SELECT query. |
This is a helper function that will perform a query as SELECT COUNT(*) ... appropriate to determine the number of rows in this result. This will remove all clauses of the original select except the WHERE clause. This can't be called __len__(), because then it is used by list() and yields a superflous SELECT query. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Wed Feb 20 18:17:26 2008 | http://epydoc.sourceforge.net |