Re: some MDB2 questions

From: Date: Fri, 11 Feb 2005 00:00:19 +0000
Subject: Re: some MDB2 questions
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36141@lists.php.net to get a copy of this message
Lukas Smith wrote:
$stmt->bindParam(':foo', $bar);
As for the bindParam(). Look here: http://de.php.net/manual/en/function.pdostatement-bindparam.php Thanks but I meant ':'...
So I don't have to mess with SQL here, and I can use this code easily for updates too. I don't have to care for quoting...
Sure. I can see how its useful. However it seems to me like then you might as well use a "true" OO interface to your data.
For me object-relations mapping is very difficult and "expensive" with complex data. I don't think it is worth it in my case...
I will add something (atleast for PHP5) that will get around this using __call() so that you dont have to type that extra "->extended" and you dont even explicitly need to load the extended module.
Wonderful, I thought about it too, that would be really great!
How mature is the MySQL reverse-engeneering script today? What happends to MySQLs "sequence emulation tables"?
Quite mature. I think it screws up with multi column unique indexes. Aside form that it works very reliable. There is a little helper script in the package in the MDB2/Tools dir. The trick is of course that its not always possible to know exactly the type. For example CHAR(1) could be text or boolean etc. In that case MDB2 picks the more likely one and raises a warning for all the other possibilities.
Thank you very much for you answers! At the moment I am not sure whether to go with ADOdb or MDB2 ;-) I do not need so much SQL-abstraction, I allways try to write portable/simple SQL, I avoid using DB-specific functions. The features I need most are "LIMIT-abstraction", transactions, sequences, autoExecute ;-), but the main reason why I want to switch away from PEAR::DB is to be able to convert my database (>100 tables) between different Database-Servers. MDB2 and ADOdb both can do this for me. ADOdb has the advantages of many, well tested drivers and a large community (a lot of active discussions), but I don't like some implementations there, particularly thinks I have to use because of my old PEAR::DB code (switching to ADOdb made my application noticeably _slower_ - eAccelerator enabled!). Do you know which drivers of MDB2 are used in production by now? I like that MDB2 API will be in sync with PDO. In which parts of the MDB2 API do you expect changes before stable release? In future I would like to use PDO and only a very, very thin SQL-abstraction layer above. As I can see for now, I only need numRows(), LIMIT-abstraction, sequences and autoExecute() in such a layer, everything(!) else is provided by PDO! numRows() seems to be the most difficult one, because I cannot use the native functions since they are not provided bei PDO. Perhaps it must be done the way you suggested above, using query(). Also if I would implement all the functions provided by MDB2 (not Metadata/DDL... this I would like to use as an extra package, which is in sync), isn't MDB2 itself to heavy for use with PDO? Because mdb2.php itself implements a lot of things which are implemented by PDO, too! Perhaps one could create such a thin abstraction based on MDB2 (also same API) which uses PDO and PHP5 as efficient as possible as PEAR::DB2, and the metadata-part of MDB2 as PEAR::DB2_Manager... Only some thoughts... I think I'd like to work on something like that... ;-) best regards, Andreas

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