The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bio::DB::BioDB - class creating the adaptor factory for a particular database

SYNOPSIS

    $dbadp = Bio::DB::BioDB->new(
                                    -database => 'biosql',
                        -user     => 'root',
                        -dbname   => 'pog',
                        -host     => 'caldy',
                                       -port     => 3306,    # optional
                        -driver   => 'mysql'
            );

DESCRIPTION

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

CONTACT

    Hilmar Lapp, hlapp at gmx.net

APPENDIX

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

new

 Title   : new
 Usage   : $db = Bio::DB::BioDB->new(-database => 'biosql');
 Function: Load and instantiate the encapsulating adaptor for the given
           database.

           This module acts as a factory, similar in spirit to
           Bio::SeqIO, but instead of a sequence stream it returns the
           adaptor object for the specified database.

 Example :
 Returns : a Bio::DB::DBAdaptorI implementing object
 Args    : Named parameters. Currently recognized are

             -database    the name of the database for which the
                          encapsulating adaptor is sought (biosql|markerdb)

             -dbcontext   a Bio::DB::DBContextI implementing object

             -initrc      a scalar denoting a file which when
                          evaluated by perl results in a hash
                          reference or an array reference (to an array
                          with an even number of elements)
                          representing the arguments for this method
                          and for creating an instance of
                          Bio::DB::SimpleDBContext. The special value
                          DEFAULT means to use the file .bioperldb in
                          either the current directory or the home
                          directory, in this order.

             -printerror  whether or not the database and statement
                          handles to be created when necessary should
                          print all errors (the adaptor modules will
                          handle errors themselves, too)

           Instead of -dbcontext, you can also pass all parameters
           accepted by Bio::DB::SimpleDBContext::new(), and this
           module will create the context for you and set the
           dbadaptor property to the returned value. Note that if you
           do pass in your own DBContextI object, as a side effect the
           dbadaptor() property will be changed by this method to
           reflect the created adaptor.

           Note also that if using the -initrc argument any separately
           supplied arguments will override and supplement the
           arguments defined in that file.

_load_dbadaptor

 Title   : _load_dbadaptor
 Usage   : $self->_load_dbadaptor("Bio::DB::BioSQL::");
 Function: Loads up (like use) the DBAdaptorI implementing module for a
           database at run time on demand.
 Example : 
 Returns : TRUE on success
 Args    : The prefix of the database implementing modules.

add_db_mapping

 Title   : add_db_mapping
 Usage   : $self->add_db_mapping(key, value)
 Function: Adds another package path mapping to the static private hash %db_map.
 Example :  add_db_mapping("FastBioSQL", "Bio::Das::BioSQL::");
 Returns : None
 Args    : key - arbitrary identifier, value - Perl package path ending in "::"