in reply to Perl Entity Bean
I don't really understand what exactly you want, but maybe Class::DBI::Loader does what you want? It magically constructs your (Class::DBI-based) classes out of the database according to what the database tells it the columns are:
# assume a table "person" package MyDB; use strict; use FindBin; use File::Spec; use Class::DBI::Loader; use base 'Class::DBI'; my $dbfile = File::Spec->catfile( $FindBin::Bin, 'mydb.sqlite' ); Class::DBI::Loader->new( dsn => "dbi:SQLite:dbname=$dbfile", relationships => 1, namespace => '', ); my $person = Person->retrieve(1); # get first person
|
|---|