[Dbix-class] how to search by date?
Tobias Kremer
list at funkreich.de
Mon Jan 14 23:23:23 GMT 2008
Am 15.01.2008 um 00:13 schrieb Michael Higgins:
> Shouldn't this datetime cast/conversion thing be automagical?
>
> eval { $rs = $schema->resultset('DB::DATA')->search(
> {Name => {'like', $name_like},
> "the date" => \"= cast ('01/4/2008' as datetime)"
> })};
>
> I just can't figure out, I'm sure, where the syntax is documented for
> searching by datetime-type of column data via DBIx::Class.
Use DateTime and the following DBIC component for automatic inflating/
deflating to/from your database:
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/InflateColumn/DateTime.pm
--Tobias
More information about the DBIx-Class
mailing list