Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by Corion (Patriarch)
on Apr 03, 2019 at 09:27 UTC ( [id://1232070]=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

If you are content with preparing them on the first invocation, you can use either ->prepare_cached or use the state keyword:

post '/invtot' => sub { state $st = $dbh->prepare(...); $st->execute(...); };

Log In?
Username:
Password:

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

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

    No recent polls found