Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 43075
Status: stalled
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: BOLDRA [...] boldra.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.08010
Fixed in: (no value)



Subject: InflateColumn::DateTime deflates differently in select and insert
An insert using a datetime creates a value like '2009-02-07 09:00:00'. A select over a datetime searches for a value like '2009-02-07T09:00:00'. Test code attached. Sorry I didn't figure out how to put the schema/resultsource definitions/test code all in one file. using perl5.10, cygwin, DBIx::Class version 0.08010 (InflateColumn::DateTime does not define $VERSION)
Subject: test.tgz
Download test.tgz
application/x-zip-compressed 1006b

Message body not shown because it is not plain text.

This is a known lapse (not really a bug), which can not be solved with tools currently available. The problem comes from the fact that insert/update pass their values via DBIC (which knows about proper inflation/deflation procedures), but arguments to search() go straight to SQL::Abstract (which at this point is oblivious to anything DBIC related). There are plans for the upcoming SQLA 2.0 to allow better integration with the calling library (DBIC in this case), but what you described is normal and expected as far as current codebase goes. What you need to do is convert the DT objects to proper SQL Time/Datetime, before you feed them to search(). We would welcome documentation patches against http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/trunk
I'm not about to patch the DBIC doc any time soon, so why not leave this open as a bug? At least then there will be something available for other users to find. If there's already a ticket for the "upcoming SQLA 2.0", you could also link the tickets. On Sun Feb 22 05:07:40 2009, RIBASUSHI wrote: Show quoted text
> This is a known lapse (not really a bug), which can not be solved with > tools currently available. The problem comes from the fact that > insert/update pass their values via DBIC (which knows about proper > inflation/deflation procedures), but arguments to search() go straight > to SQL::Abstract (which at this point is oblivious to anything DBIC > related). There are plans for the upcoming SQLA 2.0 to allow better > integration with the calling library (DBIC in this case), but what you > described is normal and expected as far as current codebase goes. > > What you need to do is convert the DT objects to proper SQL > Time/Datetime, before you feed them to search(). We would welcome > documentation patches against > http://dev.catalyst.perl.org/repos/bast/DBIx-Class/0.08/trunk >
As you wish, but don't get your hopes high - this feature is pretty far at this point.