Re: RE: [PEAR] Re: [PEAR-DEV] RE: [PEAR] RE: [PEAR-DEV] numRows(), out of order row fetching and stuff?

From: Date: Wed, 23 Jul 2003 12:31:49 +0000
Subject: Re: RE: [PEAR] Re: [PEAR-DEV] RE: [PEAR] RE: [PEAR-DEV] numRows(), out of order row fetching and stuff?
References: 1  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-18582@lists.php.net to get a copy of this message
On Wednesday, July 23, 2003 13:38, Lukas Smith wrote: >> From: Tomas V.V.Cox [mailto:cox@idecnet.com] >> Sent: Wednesday, July 23, 2003 1:29 PM >> On Monday, July 21, 2003 20:46, Lukas Smith wrote: >> >> >> Perhaps you could re-implement numRows() to do this, and add a big >> >> warning about performance, or is the goal to cut off bloat? >> >> > Yes as a BC option what you can do is offer a numRows implementation >> > that takes a the full query as a parameter. This should make porting > a >> > bit easier. >> >> > Actually I think that is how PEAR::DB does it for oracle. However I >> > would want this to stay out side of the MDB and therefore it would >> > require passing the full query. >> >> Just build an array that associates the query launched with the result >> resource ($this->queries[(int)$res]), so you can emulate numrows >> safely (and costly btw). > This is what MDB already does in a few drivers. > Obviously this could be made optional, but I just wonder if its worth > the hassle. You know that in PEAR::DB the user must set the "portability" flag in order to use that, otherwise he'll get a PEAR_DB_NOTCAPABLE. The hassle of this is not comparable with buffering inside the class :) >> Someone talked about the AdoDB implementation, I've took a look at it >> and looks very nice. It tries the query rewrite method and if it's not >> possible runs the original query. I'll pick up your code for PEAR::Db >> with your permission John ;) > Yeah I was thinking of using this as a BC hack where you could then do > something like $mdb->>bchack->numRows($query); > instead of §mdb->>runRows($result); A BC hack that breaks BC is not so a good idea imho ;) -- Tomas V.V.Cox mailto:cox@idecnet.com

« previous php.pear.dev (#18582) next »