I have written a library of functions which wrap around the the DBI
library This library I have named DBIv.pm:
$dbh = &OpenDBConnection($server, $database, $uid, $password) ;
&CloseDBConnection($dbh) ;
$rh_results = &SelectQuery($dbh, $query) ;
$rows_inserted = &InsertQuery($dbh, $query) ;
$rows_affected = &UpdateQuery($dbh, $query) ;
$rows_affected = &DeleteQuery($dbh, $query) ;
I need to add one more level of abstraction so that depending on the type
of database that I'm connected to db specific code will be run. I know
that DBIx:AnyDBD will enable this. The problem is that I don't understand
how to put everything all together.
What I'm trying to do is to modify my DBIv.pm module to use DBIx::AnyDBD so
that my DBIv.pm module no longer references DBI directly.
Should I place the above type functions in AnyDBD.pm? Default.pm?
I'm pretty sure that db independent code needs to be placed in Sybase.pm,
Oracle.pm, etc.
I'm new to the idea of OO programming in perl, but I do understand the
concepts and I'm really struggling with the syntax.
I know, I know you're all going to point me to "perldoc perltoot", the
panther book, and the documentation for DBIx::AnyDBD, but I have not been
able to make much sense out of them in regards to what I'm trying to do.
What I really would like is to hear that someone else has done something
like this, and maybe just point me in the right direction. An example
framework of what goes where would really help tremendously.
Jeff