[Dbix-class] Removing rows older than a given number of minutes ...

Rob Kinyon rob.kinyon at gmail.com
Tue Jan 26 21:24:09 GMT 2010


On Tue, Jan 26, 2010 at 16:16, Kiffin Gish <kiffin.gish at planet.nl> wrote:
> Very true, but there must be better ways to do this than the reactions
> so far.

What's wrong with:

$rs->search({
  state => $state,
  last_modified => [ "< TIMEDIFF( NOW(), ? SECONDS", $seconds ],
})->delete_all;

Standard SQL::Abstract stuff, described in both the DBIC cookbook and
the SQL::Abstract docs.

Remember - date/time manipulation is NOT standardized.

Rob



More information about the DBIx-Class mailing list