From: Yves M. <yme...@li...> - 2004-10-29 12:39:00
|
> Hey, > > Now me being quite ignorant about C stuff, but aren't there really any > libraries or whatever that we could use to make this database thing mor= e > abstract? I'm perl programmer and I know there's plethora of different > sql abstraction layers made in perl, which make is easy to use same cod= e > for different databases (my latest and favourite finding is Class::DBI)= . > > Maybe it would be nice to get rid (I mean not to make at all) those > different db storage modules and have one general module, which uses > some smart lib to talk to SQL with whichever server. The main problem is speed. Will the generic db storage module be fast eno= ugh ? You need to code it to see by yourself. I have no idea. :) About db storage modules, we only have one : mysql :) All other storage modules are different, and besides sql, there will prob= ably be file, socket, xml, rrd. Our modules are already an abstraction layer :) > > I found this: http://libdbi.sourceforge.net/ Somebody has already talked about libdbi. That was for Oracle. But perfpa= rse uses too many specificities of mysql. So he did not start. That was before the mod= ules implementation. Moreover, libdbi does not seem to be very active, and not very used. > and this: http://siag.nu/libsdb/ http://freshmeat.net/projects/libsdb/?branch_id=3D15175 Looks that the author worked on it recently (6 months ago). It is used in siag office, but is siag office still alive ? What about th= e other projects ? The more important, if you make a module that use such a library, is to b= e sure that if you find a bug, it will be fixed soon and a new release will follow. Now, such a library can be used, and one day, stop being maintained. That= day, you have to recode your software without it. That's why I like modules. If one day= some lib is not supported any more, just work on the module, not on all the project c= ode ! > And ODBC?? Just do it :) Well, you want to code a module, not to reimplement anything in perfparse= . So just do it, and then we see how it works. 1 month ago, it would have been very di= fferent because if working on perfparse to support another database had failed, we would = have been forced to go back to 0.100.7. Today, whatever the version of perfparse is, when your module is ready, w= e try it and if it works, we include it to perfparse. And any change in perfparse has no = impact on your module. So just do it :) Now, an answer to Ben about some ideas about the CGIs. I think that the code to produce graphs and statistics should be in a lib= rary, using some modules too. Modules because with them, you can read the data from e= verywhere : just plug the right module ! Who would use such libraries ? - the CGIs of course - some command-line tools. I would like some tool that get some data from= the base and compute some file that my boss could read without any SQL knowledge. - some Perl or PHP modules (or other languages if any) I'm also asking myself if C is the best language to get data from the dat= abase and generate documents with statistics. Aren't there other tools that you can= give them the numbers and they tell you the statistics you need ? For the graphs, however, I consider that C is good because you always do = the same : get data between 2 dates, optionnaly compute the scale and limits, and draw. = Result is a file, or some CGI compatible output. Well, I know my needs : get the data and generate graphs. What are your n= eeds ? Yves --=20 - Homepage - http://ymettier.free.fr - http://www.logicacmg.com - - GPG key - http://ymettier.free.fr/gpg.txt - - Maitretarot - http://www.nongnu.org/maitretarot/ - - Perfparse - http://perfparse.sf.net/ - |