[Dbix-class] Re: DateTime objects passed to search() are not supported properly

Bill Moseley moseley at hank.org
Wed Aug 15 16:24:31 GMT 2012


Pinging on this.   Is this new behavior?   I don't remember seeing these
warnings before -- and I am curious why the calling code needs to do this
instead of DBIC.   Sorry if I'm missing something here.

On Sun, Aug 5, 2012 at 10:26 AM, Bill Moseley <moseley at hank.org> wrote:

> 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
>



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120815/428=
15f29/attachment-0001.htm


More information about the DBIx-Class mailing list