On Thu, Apr 30, 2009 at 03:53:52PM -0400, Ryan Cone wrote: > Can anyone provide some insight into why timestamps are treated as > datetimes in DBIx::Class::InflateColumn::DateTime? > > Line 63: $type = 'datetime' if ($type =~ /^timestamp/); > > > I am using DBIC with Oracle and I am trying to distinguish between > columns that are Date and Date Time accurate. In the database and the > models, I am using Date and Timestamp to represent the two types. But > a bit of unlucky coincidence prevents me from loading > InflateColumn::DateTime as a component... > > 1. InflateColumn makes the timestamp a datetime. > 2. DateTime::Format::Oracle makes the datetime a date (rightly so I > think since dates and datetimes are synonymous in Oracle). > > For now, I am adding custom Inflates using DateTime::Format::Oracle's > parse_date and parse_timestamp and those work as expected. But > eventually it would be nice to have something that can be loaded.
How about patching InflateColumn::DateTime so that if there -are- parse_timestamp and format_timestamp methods it uses those, and then it falls back to the _datetime methods if not? Looks to me like we simply didn't realise that there were DateTime::Format:: modules that had separate timestamp support - in fact more accurately *I* didn't realise that at the time. Do the other Oracle users on here want to weigh in on this please? -- Matt S Trout Catalyst and DBIx::Class consultancy with a clue Technical Director and a commit bit: http://shadowcat.co.uk/catalyst/ Shadowcat Systems Limited mst (@) shadowcat.co.uk http://shadowcat.co.uk/blog/matt-s-trout/ _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk