pws () { plackup -MPlack::App::File -e ' package PWS; use parent "Plack::App::File"; sub locate_file { $_[1]->{PATH_INFO} .= "index.html" if $_[1]->{PATH_INFO} =~ m{/$}; $_[0]->SUPER::locate_file($_[1]); } PWS->new->to_app; ' }
Pretty damned simple!
]]>prove
to run the tests. Instead you'd have to find all the tests yourself and run the manually with the output going to a file, something like:
for tfile in `find t -name '*.t'`; do perl -Ilib $tfile > $tfile.tap 2>&1 done
And then you'd tell the TAP plugin to look for t/*.tap
. This is rather annoying. Maybe I'm mistaken?
—Theory
]]>—Theory
]]>CREATE VIEW sales_per_salesperson
SELECT sum(oi.value) AS total, s.name AS name, c.name AS city
FROM order_items oi, orders o, cities c, salespeople s
WHERE o.item_id = oi.id
AND o.city_id = c.id
AND c.salesperson_id = s.id
GROUP BY name
Then I would create a new ORM class that uses this view as its source. Then you can query it with something like:
my $rows = $schema->resultset(
'Report:SalesPerSalesPerson'
)->search({
city => 'London',
});
So, create views for your reports, then create reporting ORM classes that use them.
—Theory
]]>What do you want them for?
—Theory
]]>do()
does not.
—Theory
]]>psql
to run migration scripts. Perl does nothing, no parsing required.
Nice that DBD::Pg's do()
allows multiple statements to be passed. Not all DBDs allow this, though (I'm looking at you, DBD::SQLite!).
—David
]]>—Theory
]]>“Yes darling, but did it see you?”
]]>