[Dbix-class] Re: question about connect from manual

Eden Cardim edencardim at gmail.com
Thu Feb 24 14:47:40 GMT 2011


>>>>> "Jim" == Jim Green <student.northwestern at gmail.com> writes:

    Jim> lets say I have
    __PACKAGE__-> connection(connection details) in the Schema.pm
    Jim> when I want to use a certain table I still need to 


    Jim> my $schema = My::Schema->connect(); 

    Jim> in my application code. 

    Jim> I don't think it is smart enough to have to do this each time I need to
    Jim> access a table.

    Jim> I want something as simple as 
    Jim> my $rs = $schema->resultset(tablename), 

What's keeping you from doing that? As long as you hold on to the
$schema object, it'll be connected, you don't have to connect once for
every query.

-- 
Eden Cardim
Software Engineer
Shadowcat Systems Ltd.
http://www.shadowcat.co.uk
http://blog.edencardim.com



More information about the DBIx-Class mailing list