Merge pull request #42 from solgenomics/topic/duplicate_image_warning
[cxgn-corelibs.git] / lib / CXGN / DB / Sandbox.pm
blob2f541c6b1c34edc7e4a88d319212b2552985eda3
1 =head1 NAME
3 CXGN::DB::Sandbox
5 =head1 WHY?
7 I want something simple for standalone scripts that may make weird calls
8 and lock or mess up the database. I don't want to change my environmental
9 variables every time, so I think it's easier to just call this, and it
10 helps set the "tone" of the particular script. All this does is provide
11 standard arguments to CXGN::DB::Connection for a Sandbox connection,
12 public schema. You can provide further arguments, or replace the standard
13 ones that I've made, the same as you do with the standard Connection module.
15 =head1 AUTHOR
17 Christopher Carpita <csc32@cornell.edu>
19 =cut
21 package CXGN::DB::Sandbox;
22 use strict;
23 use base qw/CXGN::DB::Connection/;
24 sub new {
25 my $class = shift;
26 my $custom_args = shift;
27 my $db_args = {
28 dbname => "sandbox",
29 dbhost => "scopolamine",
30 dbschema => "public",
31 dbbranch => "production",
32 dbargs => { RaiseError=>0, AutoCommit=>1, PrintError=>0 }
34 while(my($key, $value) = each %$custom_args){
35 $db_args->{$key} = $value;
37 my $self = $class->SUPER::new($db_args);
38 return $self;