Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: How can I get a database handler with Mojolicious::Plugin::Database

by Veltro (Hermit)
on Apr 03, 2019 at 10:31 UTC ( [id://1232075]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How can I get a database handler with Mojolicious::Plugin::Database
in thread How can I get a database handler with Mojolicious::Plugin::Database

the database handler was found with $c->app->_dbh_db();

The underscore often implies that the developer of the module meant these as 'private' (or internal) functions (and therefor may not be documented). I believe that that is also the case here. I looked at the source and there is definitely a helper created by the name 'db'. Try to use the method from the previous link that I gave you: A Simple Mojolicious/DBI Example

  • Comment on Re^3: How can I get a database handler with Mojolicious::Plugin::Database

Replies are listed 'Best First'.
Re^4: How can I get a database handler with Mojolicious::Plugin::Database
by frazap (Monk) on Apr 03, 2019 at 11:36 UTC
    Thanks for the link

    And yes, the correct way was just $controller->db to have the database handler

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1232075]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found