Quantcast

Re: gmod_load_cvterms.pl - minor SQLite fix

classic Classic list List threaded Threaded
2 messages Options
| Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: gmod_load_cvterms.pl - minor SQLite fix

Naama Menda
ok, I removed the ilike operator, and changed it to  'like' with lower-casing the column value and the variable.
This way we don't need to hardcode specific driver names.

Please update your svn repository, and let me know if you encounter more issues!

Thanks for the feedback! It is very useful for maintaining this code.


-Naama




On Tue, Feb 15, 2011 at 1:34 PM, Kim Rutherford <[hidden email]> wrote:
On Tuesday 15 February 2011 at 13:32:07, Naama Menda wrote:

> hi Kim
> glad to hear the cvterm loader works for you .
> I don't see the fix in the attachment. Could you paste it in  the email
> message?

Sorry about that.  Here it is:

Index: gmod_load_cvterms.pl
===================================================================
--- gmod_load_cvterms.pl        (revision 24461)
+++ gmod_load_cvterms.pl        (working copy)
@@ -705,13 +705,16 @@ foreach my $new_ont(@onts) {

               my $predicate_term;
               my ($rel_db)= $schema->resultset('General::Db')->search( { name => 'OBO_REL' } );
+
+               my $like_operator = $driver eq 'SQLite' ? 'like' : 'ilike';
+
               ($predicate_term) = $schema->resultset('General::Dbxref')->search(
-                   { accession => { 'ilike' , "$predicate_term_name" },
+                   { accession => { $like_operator , "$predicate_term_name" },
                     db_id     => $rel_db->db_id(),
                   })->search_related('cvterm') if $rel_db;
               if (!$predicate_term) {
                   ($predicate_term) = $schema->resultset('Cv::Cvterm')->search(
-                       { name => { 'ilike' , $predicate_term_name } ,
+                       { name => { $like_operator , $predicate_term_name } ,
                         cv_id=> $cv->cv_id(),
                       }
                       );


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
| Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: gmod_load_cvterms.pl - minor SQLite fix

Kim Rutherford
On Tuesday 15 February 2011 at 15:21:44, Naama Menda wrote:

> ok, I removed the ilike operator, and changed it to  'like' with
> lower-casing the column value and the variable.
> This way we don't need to hardcode specific driver names.

Thanks, that's a much better solution than mine.


> Please update your svn repository, and let me know if you encounter more
> issues!

Thanks very much.  The loader now works fine for me on SQLite.

Kim.

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Gmod-schema mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-schema
Loading...