$app->helper(pg => sub { state $pg = Mojo::Pg->new($app->config->{pg}{uri})
});
http://mojolicio.us/perldoc/Mojo/Pg#newOn Tue, Sep 1, 2015 at 5:38 PM, Neil Watson <[email protected]> wrote: > On Tue, Sep 01, 2015 at 04:07:45PM +0500, Andrey Khozov wrote: > >> >> $ script/app eval 'say app->pg->db->query("select reltuples from >> pg_class where relname = ?", "files")->arrays->[0][0]' >> 1810 >> > > How did you define $pg? > > > -- > Neil Watson > Linux/UNIX Consultant > http://watson-wilson.ca > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/mojolicious. > For more options, visit https://groups.google.com/d/optout. > -- Andrey Khozov -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
