[MOBY-guts] biomoby commit
Dennis Wang
dwang at pub.open-bio.org
Wed Jul 27 21:25:28 UTC 2005
dwang
Wed Jul 27 17:25:28 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi
In directory pub.open-bio.org:/tmp/cvs-serv30865/Perl/MOBY/Adaptor/moby/queryapi
Modified Files:
mysql.pm
Log Message:
added comment about quoting the keys in hashes if querying two or more tables (eg. 'authority.authority_uri' => $value)
in order to avoid conflict with perl special operator '.'
moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.55,1.56
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/07/27 17:33:58 1.55
+++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/07/27 21:25:28 1.56
@@ -647,6 +647,7 @@
}
# selects all the columns from service_instance table
# PAY ATTENTION to what this returns. Not auth_id but auth_uri!!
+# IMPORTANT: must use quotes for the keys of the hash (eg. 'authority.authority_uri' => $value )
sub query_service_instance {
my ($self, %args) = @_;
my $dbh = $self->dbh;
@@ -654,6 +655,7 @@
my @args;
while (my ($k, $v) = each %args){
push @args, ({$k => $v}, "and"); # format for the_add_condition subroutine
+ # but too bad won't be scalable for "or"
}
if (keys(%args)){ pop @args;} # remove final "and"
More information about the MOBY-guts
mailing list