in reply to Set-Theoretical Database Interface

You might want to look at Tie::DBI (by Lincoln Stein) or AnyData (by me). AnyData is a tied-hash interface to DBI (it underlies DBD::AnyData but has a separate user interface). Here's some sample AnyData code:
# create a table # $table = adTie( 'CSV','my_db.csv','o', {col_names=>'name,country,sex'} ); # insert a row # $table->{Sue} = {country=>'de',sex=>'f'}; # delete a single row # delete $table->{Tom}; # select a single value # $str = $table->{Sue}->{country}; # loop through table # while ( my $row = each %$table ) { print $row->{name} if $row->{sex} eq 'f'; } # select multiple rows # $rows = $table->{{age=>'> 25'}} # update multiple rows # $table->{{country=>'Nz'}}={country=>'nz'};
I really recommend that you write to dbi-dev@perl.org to get ideas from Tim and other DBI/DBD authors.

Replies are listed 'Best First'.
Re: Re: Set-Theoretical Database Interface
by awwaiid (Friar) on Feb 19, 2004 at 18:09 UTC

    Thanks for the example, AnyData is super-cool. Looks like you have similar ideas and your module can do similar things as mine. I think I'll take your advice and get on to dbi-dev to see if I can get even more ideas and pre-existing solutions.

    Though I will look at AnyData in detail later, does AnyData have an idea of joins? As TheOrb pointed out, right now my code is all joins and very little filtering -- but my next round of improvements will be addressing that issue. Looks like you have filtering worked out already.