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

Peter Rabbitson rabbit+dbic at rabbit.us
Tue Jan 26 22:42:04 GMT 2010


Drew Taylor wrote:
> I'm not a DBIC expert, but I don't think so. The [...] construct creates
> an arrayref, so the leading '\' would just create a reference to a
> reference which is probably NOT what you want. :-) Perhaps you're
> thinking about passing a scalar ref to put raw SQL into the query, ie.
> \"some sql"?

This is exactly what you want. Please refer to the fine docs of SQL::Abstract.
In short:

to supply a string of raw sql:

\$sql

to supply a string of raw sql bundled with bind values for placeholders:

\[ $sql, @list_of_bindvals ]

note that in the 2nd case @list_of_bindvals should be of the form:
( [ col1 => val1 ], [ col2 => val2 ]... )

Cheers



More information about the DBIx-Class mailing list