Re: RE: [PEAR-CVS] cvs: pear /DB/DB common.php

From: Date: Mon, 10 Feb 2003 20:30:05 +0000
Subject: Re: RE: [PEAR-CVS] cvs: pear /DB/DB common.php
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13091@lists.php.net to get a copy of this message
On Sat, 8 Feb 2003, Lukas Smith wrote: > > -----Original Message----- > > From: Stig Bakken [mailto:ssb@fast.no] > > Sent: Saturday, February 08, 2003 8:14 AM > > > ssb Sat Feb 8 02:14:21 2003 EDT > > > > Modified files: > > /pear/DB/DB common.php > > Log: > > * add support for params in limitQuery(), thanks to > aangenieux@clever- > > age.com > > Puh, now I am a little unsure about all of this. > MDB's query() does not support params, since MDB has the prepareQuery() > method for that. Nor do I understand this heavy use of prepared queries > in PEAR DB. Correct me of I am wrong but the point of prepared queries > is to speed up querying when the same query is used multiple times just > with different data, if the database supports this feature. That, not having to think about quoting, and general cleanlyness and ease of use. > It seems PEAR DB uses it mostly to make it possible to pass the data in > an array. Isn't that a job that would better be handled by a query > builder? A query builder is an entirely different thing, with yet another level of overhead. Params are just a way of doing portable binds/placeholders. > I guess my main question is if I should bother to add these features to > the core of MDB or keep it in the pear wrapper. > > FYI: Another thing to note is that MDB has the setSelectedRowRange() > method which will set the limit for the next query(). Regardless what > querying method is used. Ease of use was one of the primary goals in the design of DB's API. Things that can be done nicely as one-liners, should be available as one-liners. IMHO this type of functionality should also be in the core of MDB. The more stuff that goes in the wrapper, the more work DB 2.0 will be. - Stig

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