in reply to Proper way to drilldown using DBIx::Class?
Have you regenerated your schema using 'dbicdump' after making changes ?
This is the biggest operatioal change when moving from Class:DBI , where that step is not required.
FYI - here is a very similar functioning baby app I wrote when learning this stuff (which I have subsequently forgotten):
use strict; use warnings; use MusicApp::Schema; #MusicApp::Schema::Result::Band->has_many( albums => 'MusicApp::Schema +::Result::Album', 'band');#{ 'foreign.band' => 'self.name' }); my $bandname = $ARGV[0] || "The Beatles"; my $DB_NAME="musicdb.sqlite"; my $schema = MusicApp::Schema->connect("dbi:SQLite:$DB_NAME"); my $bandrs = $schema->resultset('Band')->search({ name => { -like => +"\%$bandname\%" } }) ; while (my $b = $bandrs->next){ print "BAND: ",$b->name, " Started ", $b->year,"\n"; my $albumrs = $b->albums; while (my $a = $albumrs->next){ print "\tALBUM: ",$a->year,"\t",$a->name,"\n"; my $songrs = $a->songs; while (my $s = $songrs->next){ print "\t\tSONG: ",$s->track, "\t",$s->name,"\n"; } } }
My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Proper way to drilldown using DBIx::Class?
by ChuckP (Novice) on Jul 24, 2013 at 00:53 UTC | |
by NetWallah (Canon) on Jul 24, 2013 at 03:23 UTC | |
by ChuckP (Novice) on Jul 25, 2013 at 00:57 UTC |