Christopher Fields > BioPerl-DB > Bio::DB::BioSQL::DBAdaptor



Annotate this POD


Open  0
View/Report Bugs


Bio::DB::BioSQL::DBAdapter - Object representing an instance of a bioperl database


    $dbcontext = Bio::DB::SimpleContext->new(
        -user   => 'root',
        -dbname => 'pog',
        -host   => 'caldy',
        -driver => 'mysql',

    $db = Bio::DB::BioSQL::DBAdaptor->new(
        -dbcontext => $dbcontext

    # You can also create db adaptor by calling Bio::DB::BioDB constructor.
    $db = Bio::DB::BioDB->new(
        -database => 'biosql',
        -user   => 'root',
        -dbname => 'pog',
        -host   => 'caldy',
        -driver => 'mysql',


This object represents a database that is implemented somehow (you shouldn't care much as long as you can get the object). From the object you can pull out other adapters, such as the BioSeqAdapter,


Describe contact details here


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


 Title   : get_object_adaptor
 Usage   : $objadp = $adaptor->get_object_adaptor("Bio::SeqI");
 Function: Obtain an PersistenceAdaptorI compliant object for the given class
           or object.
 Example :
 Returns : The appropriate object adaptor, a Bio::DB::PersistenceAdaptorI
           implementing object.
 Args    : The class (a string) or object for which the adaptor is to be
           obtained. Optionally, a DBContextI implementing object to initialize
           the adaptor with. 


 Title   : _get_object_adaptor_class
 Usage   : $objadpclass = $adaptor->_get_object_adaptor_class("Bio::SeqI");
 Function: Obtains and loads the PersistenceAdaptorI compliant class for the
           given class or object.
 Example :
 Returns : The appropriate object adaptor class, a Bio::DB::PersistenceAdaptorI
           implementing class, or an instantiation of it, if one has been
 Args    : The class (a string) for which the adaptor class is to be obtained. 


 Title   : set_object_adaptor
 Usage   : $adaptor->set_object_adaptor("Bio::SeqI", $bioseqadaptor);
 Function: Sets the PersistenceAdaptorI compliant object and/or class for the
           given class or interface.
 Example :
 Returns : none
 Args    : The class (a string) or object for which the adaptor is to be set.
           The PersistenceAdaptorI compliant class or an instance of it to
           serve as the adaptor.


 Title   : create_persistent
 Usage   : $dbadaptor->create_persistent($obj)
 Function: Creates a PersistentObjectI implementing object that adapts the
           given object to the datastore.
 Example :
 Returns : A Bio::DB::PeristentObjectI implementing object
 Args    : An object of a type that can be stored in the datastore adapted
           by this factory. Alternatively, the class name of such an object.
           All remaining arguments will be passed to the constructor of the
           class if the first argument is a class name.


 Title   : dbcontext
 Usage   : $obj->dbcontext($newval)
 Function: Get/set the DBContextI object representing the physical database.

           If this slot is not set, adaptor objects returned by
           get_adaptor() will not be initialized with a database connection,
           unless a DBContextI is passed to get_adaptor().
 Example : 
 Returns : A DBContextI implementing object
 Args    : on set, the new DBContextI implementing object


 Title   : _load_object_adaptor
 Usage   :
 Example :
 Returns : 
 Args    :
syntax highlighting: