2 package CXGN
::DB
::Schemas
;
7 use Bio
::Chado
::Schema
;
8 use CXGN
::Phenome
::Schema
;
10 use CXGN
::Metadata
::Schema
;
17 has
'bcs_schema' => (isa
=> 'Bio::Chado::Schema',
21 has
'phenome_schema' => (isa
=> 'CXGN::Phenome::Schema',
25 has
'sgn_schema' => (isa
=> 'SGN::Schema',
29 has
'metadata_schema' => (isa
=> 'CXGN::Metadata::Schema',
33 has
'username' => (isa
=> 'Str',
37 has
'password' => (isa
=> 'Str',
41 has
'dbname' => (isa
=> 'Str',
45 has
'dbhost' => (isa
=> 'Str',
49 has
'dbuser' => (isa
=> 'Str',
53 has
'dbpass' => (isa
=> 'Str',
60 my $dsn = 'dbi:Pg:database='.$self->dbname().";host=".$self->dbhost().";port=5432";
63 if (!$self->dbuser() && !$self->dbpass()) {
64 die "Need dbuser and dbpass";
66 $self->dbh(DBI
->connect($dsn, $self->dbuser(), $self->dbpass()));
69 print STDERR
"Setting the search path...\n";
70 $self->dbh()->do("SET search_path TO phenome, metadata, sgn_people, public, sgn");
72 print STDERR
"Connecting to the schemas...\n";
73 $self->bcs_schema(Bio
::Chado
::Schema
->connect( sub { $self->dbh(); }));
75 $self->phenome_schema(CXGN
::Phenome
::Schema
->connect( sub { $self->dbh() }));
78 $self->sgn_schema(SGN
::Schema
->connect( sub { $self->dbh(); }));
80 $self->metadata_schema(CXGN
::Metadata
::Schema
->connect( sub { $self->dbh(); }));