On 19 Jun 2005 at 10:57, Kern Sibbald wrote: > Hello Dan, > > On Saturday 18 June 2005 22:46, Dan Langille wrote: > > Hi folks, > > > > I pretty much have bacula-web working using PostgreSQL. You can see > > what I have at http://www.langille.org/tmp/bacula-web/ > > > > Included there are screen shots and the diff. Please compare my > > screen shots with what you see on your MySQL websites and point out > > anything that is missing. Perhaps I've not tried a link or a window > > somewhere. > > > > Most of the problems have been: > > > > - SQL specific to MySQL (e.g. functions names). That said, the SQL > > now in use is not standard either (e.g. INTERVAL is not standard > > AFAIK). > > > > - case specific columns. The column names returned by MySQL and > > PostgreSQL differ. The result is that $row['JobId'] is not the same > > as $row['jobid']. > > I've now applied Juan Luis' 1.2 updates to the gui CVS. I haven't yet had > the > time to load and try them actually running on my system, but will do that > today. I have taken a really quick look at your screen shots, and they look > good to me, but then it was a quick look, and I am not yet up to speed enough > on bacula-web to notice the finer details. In any case, you certainly have > the major part of it working. > > If you get a chance, I would appreciate it to hear what you have to say about > the differences between your PostgreSQL fixes and those of Juan Luis. I'll > try to look at it too ...
I had some thoughts about how to handle different databases. I think we should have one file per database. For example: mysql.php postgresql.php Each of these files will contains functions that returns an SQL statement. That statement is then used by the main body of code. example: function sql_CalculateBytesPeriod($Server, $StartPeriod, $EndPeriod) { $sql = " SELECT sum(JobBytes) as jobbytes FROM job WHERE endtime < '$EndPeriod' AND endtime > '$StartDate' AND name='$server'"; return $sql } To document what goes into each file, have a main 'documention' example. <?php function sql_CalculateBytesPeriod($Server, $StartPeriod, $EndPeriod) { # obtain the number of bytes backed up from a particular server # between two given dates. # # example result set: /* bacula=> select SUM(JobFiles) from Job WHERE EndTime < '2005-06-18 23:59:59' and EndTime > '2005-05-18 00:00:00' and Name='nezlok' bacula-> ; sum ------ 8817 (1 row) bacula=> */ return ''; } With this approach, the documentation is in one place. We have an example result set. -- Dan Langille : http://www.langille.org/ BSDCan - The Technical BSD Conference - http://www.bsdcan.org/ ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users