DBIx-Class-Helpers
view release on metacpan or search on metacpan
lib/DBIx/Class/Helper/ResultSet/DateMethods1/Announcement.pod view on Meta::CPAN
starts with a C<.>. You can pass any of a value, a column (via C<-ident>), a
subquery, literal sql, or a C<DateTime> object to either parameter slots of
these methods.
Second, how do I really leverage this module to do stuff with dates in my
database?
Here's a query I originally wrote with date ops. Basically it groups some
columns by some "date parts" like year, month, day, etc. You can use it to make
nice reports of things like how many things have been done per month, or maybe
find out if the system is more busy in the summer:
$rs->search(undef, {
columns => {
count => '*',
year => $rs->dt_SQL_pluck({ -ident => '.start' }, 'year'),
month => $rs->dt_SQL_pluck({ -ident => '.start' }, 'month'),
},
group_by => [
$rs->dt_SQL_pluck({ -ident => '.start' }, 'year'),
$rs->dt_SQL_pluck({ -ident => '.start' }, 'month'),
( run in 0.245 second using v1.01-cache-2.11-cpan-87723dcf8b7 )