[Dbix-class] patch for InflateColumn::DateTime

Jess Robinson castaway at desert-island.demon.co.uk
Mon Aug 7 09:48:33 CEST 2006



On Sat, 5 Aug 2006, Dan Horne wrote:

> On Behalf Of Mark Hedges
>> Sent: Saturday, 5 August 2006 10:54 a.m.
>> To: dbix-class at lists.rawmode.org
>> Subject: [Dbix-class] patch for InflateColumn::DateTime
>>
>>
>> Hi,
>>
>> 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.
>

Sounds like  a great idea to me! Ideally each Storage::DBI::Foo should be 
able to return the value it likes in a simple call, and funky magic in the 
SQL creation replaces it where appropriate..

Sort out DEFAULT vs NULL while you're at it? ;)

Jess




More information about the Dbix-class mailing list