[Dbix-class] patch for InflateColumn::DateTime

Mark Hedges hedges at ucsd.edu
Sat Aug 5 01:30:50 CEST 2006



On Sat, 5 Aug 2006, Dan Horne wrote:
> > 
> > I could not create an object and set the date field to \q{ NOW() }.
> > 
> > deflate->() should not do anything if the value is a scalar ref,
> > but should pass it through as-is so it gets turned into raw SQL.
> > 
> 
> On a related note I wonder what people think about a db-generic version of
> "now()" which would be replaced with "now" or "sysdate" or whatever the
> db-specific implementation should be. It means that you wouldn't need to
> create a DateTime object in advance just to get the current date for your
> record.

I'm thinking 'nevermind' on this anyway.  If you create it this 
way, then the value in the object is \q{ NOW() } and bombs when 
you try to access it, unless you re-select from the database.

Sounds too complex to fix it this way.  It's a lot easier to 
create the field with DateTime->now() than with \q{ NOW() }, and 
with NTP it's probably about the same anyway.

Mark



More information about the Dbix-class mailing list