Re: MDB 2.x

From: Date: Wed, 20 Aug 2003 01:56:46 +0000
Subject: Re: MDB 2.x
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20117@lists.php.net to get a copy of this message
Just warming up to do real work.. - comments on MDB.php - loadClass() uses @ silencer on include_once.. - apiVersion() - seems a bit waste.. - why not just have var $apiVersion = 2 - isConnection = could use is_a() - isManip() = the string is closed at the end of the line.. ALTER will fail.. - is there some reason not to follow PEAR_Errors API? - you appear to raise errors with null messages.. - postgres driver appears to have the same ismanip bug as DB for EXPLAIN - see bugs db.. - looks like DECIMAL needs real support still :) - I would have been tempted to use temporary variables for the get decaration.. return "$name INT" . (isset($field['default']) ? ' DEFAULT ' . $field['default'] : '') . (isset($field['notnull']) ? ' NOT NULL' : ''); or $default = isset($field['default']) ? ' DEFAULT '.$field['default']:''; $notnull = isset($field['notnull']) ? ' NOT NULL' : ''; return "$name INT $default $notnull"; - just a little clearer.. - and performance is not likely to be an issue here :) ---------------------- After all that.. Its really looking like a nice API, and the code is really well laid out now.. Regards Alan Lukas Smith wrote:
Hi, just wanted to inform you all that MDB 2.x is now mostly done. Atleast what I have planned. The API has changed a lot though :-/ - A lot of methods were removed because they are now unnecessary. - A few methods have changed parameter orders or behaviour (for example the fetch* methods don't free the result set anymore) - All array keys of parameters are now lowercased with underscores as word separators - LOB support is dramatically simplified and you can now use the bulk fetching methods with LOB's - A bunch of things where moved to separate classes most notably the "extended" methods such as queryOne, queryRow, queryCol, queryAll and the get* methods and executeMultiple - You can now optionally define a class into which a result resource can be wrapped (just like DB does as default) Generally MDB 2.x should feel a lot more intuitive for DB users. The code is now also a lot cleaner and should therefore be easier for other developers to get along. I have tested everything with mysql (3.x and 4.x), postgresql and oracle on windows and linux. Please have a look at the example.php and the test suite to get a better idea of the new API. Since the last changes are still a bit fresh I will not package a preview release just yet. But I would welcome any feedback. Regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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