View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Todd Harris > Audio-DB-0.01 > Audio::DB::Query



Annotate this POD

View/Report Bugs


Audio::DB::Query - query methods of a Audio::DB database


Audio::DB::Query objects are used internally by Audio::DB::Reports and Audio::DB::Web. You will not normally interact with Audio::DB::Query objects. The documentation contained here is listed for completeness as well as for those looking to extend the functionality of Audio::DB.



Provided with a table name, fetch_class returns an array reference of appropriate objects. For example, passing the -class=>'artists' option results in an array reference of Audio::DB::DataTypes::Artist objects.


Some classes accept additional parameters.

 Class: albums

   By default, album objects will not be populated with songs. To retreive populated Album objects, try using ...

   If provided, Album objects will be populated with Song
   objects. These can be accessed by calling the songs() method on
   each album object.

   @albums = $music->fetch_class(-class=>'artist');
   foreach my $album_obj (@albums) {
     print $album_obj->album,"\n";
     print join("\n",map {$_->title} $album_obj->songs);

   If not provided, summaries that require touching each song (ie to
   see if it is a compilation album) will still be created, but the
   individual songs will not be returned.  This can be useful ina
   situation requiring greater speed and less memory consumption.

count() ^

 Usage: count('type');

     Where type is one of artists, albums, songs, genres
 Status: internal

Generate a simple count of the number of $type entries in the database

syntax highlighting: