how to use the CGI::Application::Plugin::DBH and DBIx::Class together

View: New views
3 Messages — Rating Filter:   Alert me  

how to use the CGI::Application::Plugin::DBH and DBIx::Class together

by Mike.G :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, every, right now, I want to use the DBIx::Class in my project.
but I had used the CGI::Application::Plugin::DBH for get the database
connection,
so  the DBIx::Class can use the exists Database Connection Ref?
like, right now, I had the $dbh.
by :
my $dbh = $this->dbh;
so can I pass this $dbh into the DBIx::Class ?

thanks

Mike.G

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################


Re: how to use the CGI::Application::Plugin::DBH and DBIx::Class together

by Mark Stosberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2008-06-17 at 17:04 +0800, Mike.G wrote:
> Hi, every, right now, I want to use the DBIx::Class in my project.
> but I had used the CGI::Application::Plugin::DBH for get the database
> connection,
> so  the DBIx::Class can use the exists Database Connection Ref?
> like, right now, I had the $dbh.
> by :
> my $dbh = $this->dbh;
> so can I pass this $dbh into the DBIx::Class ?

Mike,

If DBIx::Class can accept an existing database handle, then: Yes.  If
there is uncertainty about that, then that's a question to confirm to
the DBIx::Class list.

    Mark



#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################


Re: Re: how to use the CGI::Application::Plugin::DBH and DBIx::Class together

by Mike.G :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

seem to DBIx::Class can't  do that.
so, I didn't use CGI::Application::Plugin::DBH,
I found make a very stupid question about that.
I have a DBIx::Class,  I don't need that plugin any more.

so, I just add one method to my class, named get_model,

just return a DBIx::Class::Schema references.

it is ok.


2008/6/18 Mark Stosberg <mark@...>:

> On Tue, 2008-06-17 at 17:04 +0800, Mike.G wrote:
> > Hi, every, right now, I want to use the DBIx::Class in my project.
> > but I had used the CGI::Application::Plugin::DBH for get the database
> > connection,
> > so  the DBIx::Class can use the exists Database Connection Ref?
> > like, right now, I had the $dbh.
> > by :
> > my $dbh = $this->dbh;
> > so can I pass this $dbh into the DBIx::Class ?
>
> Mike,
>
> If DBIx::Class can accept an existing database handle, then: Yes.  If
> there is uncertainty about that, then that's a question to confirm to
> the DBIx::Class list.
>
>    Mark
>
>
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

LightInTheBox - Buy quality products at wholesale price!