[Dbix-class] Left join on multiple columns

Guillermo Roditi groditi at gmail.com
Fri May 18 18:16:17 GMT 2007


Correction, you want to add it to the ResultSet class, not the result class!
and yes there's a way.

http://search.cpan.org/~blblack/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.p=
od#Predefined_searches

http://search.cpan.org/~jrobinson/DBIx-Class-0.07999_02/lib/DBIx/Class/Stor=
age/DBI.pm

$self->result_source->schema->storage

On 5/18/07, John Goulah <jgoulah at gmail.com> wrote:
>
> On 5/18/07, Ronald J Kimball <rkimball+dbixclass at pangeamedia.com> wrote:
> >
> > John Goulah wrote:
> > > This leads to the question of whether you can write straight SQL in
> > > times like these.  I suppose it breaks the design, but sometimes its
> > > just easier to write SQL... Is it possible?
> >
> > Yes, you can.  That's actually what I have in my code right now.  Like
> > so:
> >
> > my $dbh =3D $schema->storage->dbh;
> >
> > my $sth =3D $dbh->prepare(<<"EndOfSQL");
> >    ...
> > EndOfSQL
> >
> > $sth->execute();
>
>
>
>
> So, that does seem to work, and I can even put a method in the
> Model/myDB.pm file and call that via $c->model.   But what I'd rather do =
is
> add these methods into the table model classes under lib/myDB/*.pm.   Is
> there a way to access the storage->dbh handle from there?
>
>
> Thanks,
> John
>
>
>
>
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070518/7d5=
49e94/attachment.htm


More information about the Dbix-class mailing list