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

Rob Kinyon rob.kinyon at gmail.com
Sun Jan 24 16:21:57 GMT 2010


On Sun, Jan 24, 2010 at 02:44, Octavian Rasnita <octavian at fcc.ro> wrote:
> From: "Rob Kinyon" <rob.kinyon at gmail.com>
>> $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.
>
> Is the following SQL
>
> < TIMEDIFF( NOW(), ? SECONDS
>
> a standard SQL code supported by more databases?

The point I was trying to make is that the stuff in the quotes is
literal SQL. So, whatever your DBMS needs to determine a difference
between two times. I used MySQL-specific syntax, but the concept
transfers.

Rob



More information about the DBIx-Class mailing list