[Cdash] database support in cdash
Markus Grabner
grabner at icg.tugraz.at
Mon Jun 30 18:29:30 UTC 2008
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
--
Markus Grabner - Computer Graphics and Vision
Graz University of Technology, Inffeldgasse 16a/II, 8010 Graz, Austria
Phone: +43/316/873-5041, Fax: +43/316/873-5050
WWW: http://www.icg.tugraz.at/Members/grabner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdo.php
Type: application/x-php
Size: 4081 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cdash/attachments/20080630/84c96f82/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQL-Translator-psql-index.patch
Type: text/x-diff
Size: 738 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cdash/attachments/20080630/84c96f82/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform.sh
Type: application/x-shellscript
Size: 995 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cdash/attachments/20080630/84c96f82/attachment-0005.bin>
More information about the CDash
mailing list