[Dbix-class] DateTime objects passed to search() are not supported
properly
Bill Moseley
moseley at hank.org
Sun Aug 5 17:26:49 GMT 2012
Running tests saw this message:
DBIx::Class::ResultSet::search(): DateTime objects passed to search() are
not supported properly (InflateColumn::DateTime formats and settings are
not respected.) See "Formatting DateTime objects in queries" in
DBIx::Class::Manual::Cookbook.
Cookbook suggests this:
my $dtf =3D $schema->storage->datetime_parser;
my $rs =3D $schema->resultset('users')->search(
{
signup_date =3D> {
-between =3D> [
$dtf->format_datetime($dt_start),
$dtf->format_datetime($dt_end),
],
}
},
);
I'm curious. If DBIC knows it's a DateTime object and DBIC has a method to
format it correctly then why is there a warning? Why not just format it?
-- =
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120805/4eb=
be515/attachment.htm
More information about the DBIx-Class
mailing list