Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Bio::DB::SQL::AbstractQuery
Abstract Query class

Bio::DB::SQL::AbstractQuery - Abstract Query class


NAME

Bio::DB::SQL::AbstractQuery - Abstract Query class


SYNOPSIS

Don't use this class directly; use one of the subclasses (eg SqlQuery, BioQuery)


  $q = $queryclass->new;

  $q->datacollections(["table1 t1", "table2 t2"]);

  $q->selectelts(["t1.colA", "t2.colB"]);

  $q->where("or", "colA=x", "colB=y");

  $q->orderelts(["t1.colA", "t2.colB"]);


DESCRIPTION

core methods for representing some kind of query - eg a query expressed in an human type language, an SQL query, an object oriented query.

abstracted attribute names have been used; eg a query is assumed to be over some kind of collection of data. the query is performed over a subset of this data, a set of datacollections. These datacollections are equivalent to tables in SQL and object adaptors when forming an OO query.

the where clause / constraints is represented by the QueryConstraint composite object


CONTACT

Chris Mungall <cmungall@fruitfly.org>


APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

datacollections


  Usage:  $query->datacollections([$t1,$t2]);      # setting

      OR   return $query->datacollections();  # getting

array reference of strings representing datacollections (eg tables, objects)

add_datacollection


  Usage:  $query->add_datacollection($t1, $t2, $t3);

adds datacollections; removes duplicates

where


  Usage:  $query->where("and", "att1 = val1", "att2=val2"); # setting

      OR  $query->where("att1 = val1"); # setting

      OR  $query->where({att1=>$val1, att2=>$val2}); # setting

      OR  $query->where(["OR",

                              ["AND",

                                     "x=1", "y=2", "z like blah*"],

                              ["AND",

                                     "x=5", "y=7", "z like wow*"]]);

 

      OR   $qc = $query->where();  # getting

 of type Bio::DB::SQL::QueryConstraint

this method is liberal in what it accepts.

see the new() method of Bio::DB::SQL::QueryConstraint

it will turn hashes into an ANDed query constraint composite, with each component being a name=value pair. it will turn arrays into an ANDed constraint composite, breaking up each element around the = symbol. if the first element of the array is a valid composite operand (e.g. ``or'') it will combine the array elements using this.

Or you can just feed it a Bio::DB::SQL::QueryConstraint object

selectelts


  Usage:  $query->selectelts([$col1,$col2,$col3]);      # setting

      OR  $eltsref = $query->selectelts();  # getting

array reference of string represnting attributes/elements to be selected

orderelts


  Usage:  $query->orderelts(\@elts);      # setting

      OR   return $query->orderelts();  # getting

groupelts


  Usage:  $query->groupelts(\@elts);      # setting

      OR   return $query->groupelts();  # getting
Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy