[Dbix-class] Share data between DBIx::Class::Core and MyLib

2013-01-18 Thread Arthur Rance
Hello, What's the right way to design this library ? my $lib = new MyLib; $lib->init_cd_burner; my $schema = $lib->get_schema; my $rs = $schema->resultset('CD')->search( $search_params ); while( my $cd = $rs->next ) {   $cd->set_cd_burner( $lib->get_cd_burner );   $cd->burn_this_cd; } or else :

[Dbix-class] help needed in forming a 'and' and 'or' select query using DBIx::Class

2013-01-18 Thread Rajeev Prasad
Hello,   I am trying to build a query based on two column values as folows:   columnA = x  (one char, any char - not null) columnB = zz _or_ x,xx,yyy,mm  (comma seperated values or just one value)     I am looking for rows where: (columnB contains either zz or mm...)   columnA = x AND ( columnB = z

[Dbix-class] Prefetch and join on different tables

2013-01-18 Thread mpm
Hello, I am performing a join between a table 'mdata', that has a 'has many' relationship with 'mc' and 'mt'. $where contains conditions over mc and mt, and I want all columns of mc and mdata in the result. So I prefetch mc: push @{ $attr->{join} }, 'mt'; push @{ $attr->{join} }, 'mc'; my $rs1 =

Re: [Dbix-class] Prefetch and join on different tables

2013-01-18 Thread Patrick Meidl
On Fri, Jan 18 2013, mpm wrote: > push @{ $attr->{join} }, 'mt'; > push @{ $attr->{join} }, 'mc'; > my $rs1 = $c->model('weight::Mdata')->search( $where, $attr,{prefetch => > 'mc'}); I think your curly braces are misplaced. this should do what you want: my $rs1 = $c->model('weight::Mdata')->sea