I am using DBIx :: Class in Catalyst. I am creating an application. It works fine, but sometimes I need to use my own db functions that I developed that are very specific to my needs. Because of this, I need dbh. However, since I already use DBIx::Class , I know that it already uses the dbh that it uses. To avoid another unnecessary database connection, I would just like to use dbh, which DBIx::Class has already been created. I know that the DBIx :: Class :: Storage :: DBI module has two methods, dbh and dbh_do , but I'm not quite sure what the difference is between the two, and if this is the best way to access dbh. Can someone tell me that the best way to get dbh from DBIx::Class would be in a Catalyst application? I would prefer a method that I could forward to save dbh in stash, as shown below:
sub dbh :Private { my ($self, $c) = @_; $c->stash->{dbh} =
Thanks!
source share