seconded. I tried to do what you did a bunch of times and dealt with a ton of headaches and finally decided that date_field => DateTime->now was not that much more to type than \q{ NOW() }

On 8/4/06, Mark Hedges <[EMAIL PROTECTED]> wrote:


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

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to