well, in product server I'm using MySQL and for test cases I'm using SQLite.
so I wonder to ask whether there is any suggestion for something like follows:

I have a Foorum::ResultSet::Comment, and in one sub I write

   my $comment = $self->create(
       {   object_type => $object_type,
           object_id   => $object_id,
           author_id   => $user_id,
           title       => $title,
           text        => $text,
           formatter   => $formatter,
post_on => \'NOW()', #' SQLite use CURRENT_TIMESTAMP
           post_ip     => $post_ip,
           reply_to    => $reply_to,
           forum_id    => $forum_id,
           upload_id   => $info->{upload_id} || 0,
       }
   );

u know SQLite need use \'CURRENT_TIMESTAMP' instead of \'NOW()'. it will fail when I call prove -l to test this sub.

How do I know $self->schema or result_source is based on SQLite or MySQL?

Any suggestion to deal with this situation?

Thanks.

--
Fayland Lam // http://www.fayland.org/ Foorum based on Catalyst // http://www.foorumbbs.com/

_______________________________________________
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/[EMAIL PROTECTED]

Reply via email to