John Siracusa writes:
 > On 8/7/07 5:12 PM, George Hartzell wrote:
 > > If I change Rose::DB::SQLite::validate_datetime_keyword so that it'll
 > > accept 'current_timestamp'
 > 
 > Yeah, I should do that...
 > 
 > > then the value gets inserted literally into the table.
 > 
 > it probably also needs to be inlined (i.e., unquoted)
 > 
 > > I'd like to be able to specify the default behaviour in the schema,
 > > it'll be more robust if/when it's used outside of rdbo.
 > 
 > A default value of "now" should work in all supported databases, IIRC.
 > 

The default value of "now" does work when used in the RDBO perl
module.  The problem is that since I'm using RDBO::Loader, the only
way to get that value in there is to use it in the SQL, where it
doesn't do what is intended.  Eventually I may stop generating the
perl classes on the fly, but in the meantime I'd like it to do the
right thing.

Can you give me a hint on setting up the inlining?  It looks like I'll
need to change
Rose::DB::Object::Metadata::Column::Timestamp::should_inline_value so
that it checks (off the top of my head)

  ($_[1]->driver eq 'sqlite' && $_[2] =~ /current_datetime/i) 

or something close to that.  I'll have to figure out how to work it
into the existing ternary test.

Thanks,

g.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to