David Saez Padros wrote:
Hi !!
It does not work for me either. First the MySQL files for MDB2 are missing in the CVS (MDB2 Error: not found). I added them to the repository.
where did yuo get it ? the package i downloaded from http://pear.php.net/package/MDB2/download has the very same files as my cvs tree ?? (well, i missed just one file that i just added)
When I download the MDB2 package (beta6) I just have the basic/common files within the MDB2 folder. Then I have to download each specific DB driver separately (http://pear.php.net/package/MDB2_Driver_mysql/)
As far as I can see, the method rcube_mdb2::query extracts all arguments and passes them to rcube_mdb2::_query but they're never used to replace the ? within the SQL statement. I think this causes the Syntax error.
fixed.
For Postgres support I think we have to replace all 'NOW()' commands to lowercased 'now()'.
that's true ? looks very strange ... anyone using postgres can confirm this ?
As far as we can trust this post: http://sourceforge.net/tracker/index.php?func=detail&aid=1320311&gro...
This is from a previous post "Have you considered MDB2?" on 15.10.2005: "As for your handling of NOW(). Currently MDB2 handles this through MDB2_Date. However there have always been plans to add a module that will generate the necessary SQL to make SQL functions portable."
We should use this abstraction function as well.
I was also thinking of replacing the rcube_mdb2 class completely and call MDB2 methods directly form the steps. Just create the MDB2 object in rcube_init() and connect to the DB directly. What do you think about this?
maybe it's not a good idea, mdb2 is still beta and does not support as many database backeds as pear does, maybe it's better to have both functional. Also having a first 'abstraction' layer at rcube_db will allow in the future to add or replace the database backend without effort.
You maybe right.... but I can live with just support for MDB2. I think MDB2 will be stable before RoundCube gets out of beta state.
To use UNIX_TIMESTAP we should fetch the raw date from the DB (simple SELECT changed_date ...) and convert it using the MDB2 method mdbstamp2Unix().
that has been solved using a different aproach, the rcube_db class has a function that returns the correct syntax for that function (this saves one query)
I saw your solution but this still requires to add a separate abstraction in our layer for each new database. If there's an abstraction functionality in the PEAR package we should use this.
I would prefer that the rcube_db class gets similar methods for data type conversion and just pass them to the PEAR object if available (as in MDB2) and implements them itself if not (as for DB).
Thomas