Bio::EnsEMBL::Pipeline AnaSubmission
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
Globals (from "use vars" definitions)
@EXPORT_OK
Privates (from "my" definitions)
($user , $dbname , $host, $port);
Included modules
Carp
DBI
Exporter
Hum::Submission qw { get_user }
Hum::SubmissionConf
Time::Local qw ( timelocal )
Inherit
Exporter
Synopsis
No synopsis!
Description
No description!
Methods
get_db
No description
Code
prepare_statement
No description
Code
set_db_args
No description
Code
sub_db
No description
Code
Methods description
None available.
Methods code
get_dbdescriptionprevnextTop
sub get_db {
        if ($db){
            return $db;
        }else{
            warn "Not returning a db;";
            return;
        }
        
            
     }

}



1;

__END__
}
prepare_statementdescriptionprevnextTop
sub prepare_statement {
        my( $text ) = @_;
        
        my $sth = sub_db()->prepare($text);
        push(@active_statement_handles, $sth);
        return $sth;
}
set_db_argsdescriptionprevnextTop
sub set_db_args {
        ## take in user name password port etc, and use them to connect to the db
my %args_hash = @_; $user = $args_hash{user} ; $dbname = $args_hash{db_name}; $host = $args_hash{host}; $port = $args_hash{port};
}
sub_dbdescriptionprevnextTop
sub sub_db {
        unless ($db) {
            
            # go to default values unless given already
unless ($user) { $user= get_user();}; unless ($dbname) { $dbname = 'submissions'} ; unless (defined $host && defined $port){ ($host, $port)=Hum::SubmissionConf::localisation(); } if (my $test = $ENV{'SUBMISSION_TEST_DB'}) { # Legal formats:
#
# submissions_test
# submissions_test:3306
# submissions_test@ecs2b
# submissions_test@ecs2b:3306
if ($test =~ /^([\w_\$]+)(?:\@([\w\-\.]+))?(?::(\d+))?$/) { $dbname = $1; $host = $2 if $2; $port = $3 if $3; } else { confess "Can't parse SUBMISSION_TEST_DB environment variable '$test'"; } } # warn "DBI:mysql:host=$host;port=$port;database=$dbname:", $user;
# Make the database connection
$db = DBI->connect("DBI:mysql:host=$host;port=$port;database=$dbname", $user, undef, {RaiseError => 1, PrintError => 0}) or die "Can't connect to submissions database as '$user' ", DBI::errstr(); } return $db; } my( @active_statement_handles );
}
General documentation
ref_from_query( SQL )Top
Returns a reference to an array of anonymous
arrays containing the results from running the
SQL query on the database.
NAME - SubmissionTop
AUTHORTop
James Gilbert email jgrg@sanger.ac.uk