[Dbix-class] Problem overriding connection method from Schema
module
Emmanuel Quevillon
tuco at pasteur.fr
Fri Aug 21 13:06:34 GMT 2009
Quinn Fazigu wrote:
>
>
> On Fri, Aug 21, 2009 at 4:59 AM, Emmanuel Quevillon <tuco at pasteur.fr
> <mailto:tuco at pasteur.fr>> wrote:
>
> sub connection {
>
> my ($self, @rest) = @_;
> $self->next::method(@rest);
>
> $self->driver_name($self->handler()->{Driver}->{Name});
>
> }
>
>
> Does standard DBIx::Class::Schema have a "handler" method, or is that a
> decoration added by Catalyst? You could try wrapping the driver_name
> assignment like so:
>
hanlder method is a method I've removed from the example as my
connection method is much more longer...
It is a shortcut to $self->storage()->dbh().
> if ($self->can('handler')) {
> $self->driver_name($self->handler()->{Driver}->{Name});
> }
>
> Schema::MyAppDB->connect('dib:Pg:dbname=test','test','pass');
>
>
> That "dib" there in the connect parameter is a typo for "dbi", right?
>
Typo sorry :(
>
--
-------------------------
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-------------------------
More information about the DBIx-Class
mailing list