Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: The (Too-)Well Hidden Magic of "DBIx::Class"

by jasonk (Parson)
on Feb 04, 2009 at 15:29 UTC ( #741316=note: print w/replies, xml ) Need Help??

in reply to The (Too-)Well Hidden Magic of "DBIx::Class"

To answer some of your questions in kind of random order:

When declaring a relationship, if you know you want it to use an inner join, you can specify that in the relationship declaration:

__PACKAGE__->has_many( 'foos', 'MySchema::Foo', 'bar_id', { join_type => 'INNER' } );

To find out exactly what queries are being issued as a result of your code, set the environment variable DBIC_TRACE to a true value, and the generated queries will get dumped to stderr.

As for whether it's efficient or not, that depends a lot on the application, the data, and the types of queries you are doing, as well as how you define efficient. I'm sure that I could get queries that ran a little bit faster by building them by hand, but the time that it takes to do so wouldn't offset the time that DBIx::Class saves me, so while the queries themselves might be slightly less efficient, I am much more efficient with it than without.
We're not surrounded, we're in a target-rich environment!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://741316]
[Perl300]: Hi
[Perl300]: One quick question. Is DBD::ORacle still the way to go for connecting to Oracle DB from Linux box? My code is one a different linux box than the Oracle DB
[Perl300]: I see DBI and DBD::Oracle are already installed on my Linux box where I am coding but having hard time connecting to the remote Oracle DB

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2017-10-20 20:24 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (267 votes). Check out past polls.