[Cdash] database support in cdash

Julien Jomier julien.jomier at kitware.com
Mon Jun 30 18:44:51 UTC 2008


Markus,

Thanks a lot. I'm going to implement your modifications this week or 
maybe next week.

Could you send me the translated .sql files for PostGres? I want to test 
  the installation process.

What do you want to check into the CDash repository? I think the best is 
probably to upload on the Wiki and put a description.

Julien

Markus Grabner wrote:
> Am Dienstag, 20. Mai 2008 schrieb Julien Jomier:
>> Markus,
>>
>> This is great! Thanks a lot.
>>
>> I have actually started a little bit on the postGreSQL support but it's
>> tricky because the field types are different between MySQL and PostgreSQL.
> I just tried the SQL-Translator at http://sqlfairy.sourceforge.net to 
> automatically transform MySQL data definition code into PostgreSQL code (and 
> actually for a couple of other databases), and it works pretty well. To 
> demonstrate this, the following files are attached:
> 
> *) transform.sh: transformation script to
> -) translate SQL code using SQL-Translator
> -) replace PHP MySQL functions by their PDO equivalents (as discussed earlier)
> 
> *) pdo.php: MySQL->PDO wrapper functions
> 
> *) SQL-Translator-psql-index.patch: patch for SQL-Translator to avoid invalid 
> attempts to create duplictate indices
> 
> The SQL-Translator requires some perl modules which are not included in 
> openSUSE (don't know about other distributions). The patched SQL-Translator 
> and all perl modules not included in openSUSE are available here:
> 
> http://rpm.icg.tugraz.at/suse/11.0/repodata/repoview
> 
> The script creates valid PostgreSQL code. I didn't yet check whether cdash 
> runs with a PostgreSQL database, but wanted to share this piece of code right 
> now.
> 
> May I ask for write access to the cdash repository? Then I can check in my 
> code, and it will be easier for others to evaluate.
> 
> 	Thanks & kind regards,
> 		Markus
> 
> 
>> Markus Grabner wrote:
>>> Am Dienstag, 22. April 2008 17:39 schrieben Sie:
>>>> Markus Grabner wrote:
>>>>> Am Dienstag, 22. April 2008 17:25 schrieb Julien Jomier:
>>>>>> Markus Grabner wrote:
>>>>>>> Am Dienstag, 22. April 2008 17:11 schrieb Julien Jomier:
>>>>>>>>>> I'm going to
>>>>>>>>>> give it a try when I get a chance. If it works well, it might be
>>>>>>>>>> available soon.
>>>>>>>>> Ok, please let me know when you proceed with that. I'm also willing
>>>>>>>>> to help if I can. So far, however, I only used the mysql_ functions
>>>>>>>>> and the Pear DB classes, but PDO should not be too different I
>>>>>>>>> guess.
>>>>>>>> The plan is to tag and release CDash 1.0 early next week. Then it
>>>>>>>> will be my first priority.
>>>>>>> Ok, great! So the trunk will then become the "inofficial version 1.1"
>>>>>>> until version 1.2 is finished, or will there be a separate branch for
>>>>>>> the PDO stuff?
>>>>>> It would be the "unofficial version 1.1" so you would be able to test
>>>>>> it from SVN. We just create branches for releases.
>>>>> Ok, then I will stay tuned and see how it evolves (and if I can maybe
>>>>> contribute somewhere).
>>>> Thanks a lot Markus. I'll definitely keep you in the loop.
>>> I just did a quick hack to add an additional layer between the CDash code
>>> and the database. It works as follows:
>>>
>>> *) There is a file "pdo.php" which contains "pdo_*()" counterparts of
>>> all "mysql_*()" functions used by CDash.
>>>
>>> *) If "$CDASH_DB_TYPE" is defined, calls to "pdo_*()" are routed to the
>>> corresponding PDO member functions.
>>>
>>> *) If "$CDASH_DB_TYPE" is undefined, calls to "pdo_*()" are routed
>>> directly back to their "mysql_*()" counterparts. This is for backward
>>> compatibility, should PDO not be available.
>>>
>>> *) The script "transform.sh" replaces all occurences of "mysql_" in the
>>> PHP code by "pdo_" and modifies "config.php" accordingly. *NOTE*: it does
>>> a recursive "svn revert" before, so any uncommited changes will be
>>> undone. Please commit before trying it!
>>>
>>> I set up a "toy project" and was able to browse the CDash pages using the
>>> PDO_MYSQL driver. It is far from complete and requires some extra work to
>>> support other databases (replace MySQL-specific code), but I think it's a
>>> useful proof of concept and doesn't require dramatic changes to the code
>>> base right now (a clean solution would certainly be to "inline" all the
>>> "pdo_*()" function calls, but that's a different - and much more tedious
>>> - story).
>>>
>>> What do you think about it?
>>>
>>> 	Kind regards,
>>> 		Markus
> 



More information about the CDash mailing list