Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
c8fcd6c2
Commit
c8fcd6c2
authored
Jul 30, 2004
by
Ian Longden
Browse files
DBAdaptor method db renamed dbc to stop confusion so all references to this have been changed
parent
8aaaba21
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
50 additions
and
39 deletions
+50
-39
modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
+17
-6
modules/Bio/EnsEMBL/DBSQL/PredictionExonAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/PredictionExonAdaptor.pm
+1
-1
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+2
-2
modules/Bio/EnsEMBL/Storable.pm
modules/Bio/EnsEMBL/Storable.pm
+1
-1
modules/t/MultiTestDB.t
modules/t/MultiTestDB.t
+3
-3
modules/t/attributeAdaptor.t
modules/t/attributeAdaptor.t
+8
-8
modules/t/compressedSequenceAdaptor.t
modules/t/compressedSequenceAdaptor.t
+1
-1
modules/t/coordSystemAdaptor.t
modules/t/coordSystemAdaptor.t
+1
-1
modules/t/dbConnection.t
modules/t/dbConnection.t
+6
-6
modules/t/dbEntries.t
modules/t/dbEntries.t
+1
-1
modules/t/gene.t
modules/t/gene.t
+1
-1
modules/t/markerFeatureAdaptor.t
modules/t/markerFeatureAdaptor.t
+1
-1
modules/t/miscSetAdaptor.t
modules/t/miscSetAdaptor.t
+2
-2
modules/t/sliceAdaptor.t
modules/t/sliceAdaptor.t
+1
-1
No files found.
modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -529,7 +529,7 @@ sub remove_from_MiscFeature {
throw
("
MiscFeature is not stored in this database.
");
}
my
$sth
=
$db
->
db
->
prepare
("
DELETE FROM misc_attrib
"
.
my
$sth
=
$db
->
db
c
->
prepare
("
DELETE FROM misc_attrib
"
.
"
WHERE misc_feature_id = ?
");
$sth
->
execute
(
$mf
->
dbID
());
...
...
modules/Bio/EnsEMBL/DBSQL/BaseAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -126,7 +126,7 @@ sub new {
if
(
ref
(
$dbobj
)
=~
/DBAdaptor$/
){
$self
->
db
(
$dbobj
);
$self
->
dbc
(
$dbobj
->
db
);
$self
->
dbc
(
$dbobj
->
db
c
);
}
else
{
throw
("
Don't have a DBAdaptor [
$dbobj
] for new adaptor
");
...
...
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -170,7 +170,7 @@ sub generic_fetch {
#append additional clauses which may have been defined
$sql
.=
"
\n
$final_clause
";
my
$sth
=
$db
->
db
->
prepare
(
$sql
);
my
$sth
=
$db
->
db
c
->
prepare
(
$sql
);
$sth
->
execute
;
my
$res
=
$self
->
_objs_from_sth
(
$sth
,
$mapper
,
$slice
);
...
...
modules/Bio/EnsEMBL/DBSQL/CoordSystemAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -802,7 +802,7 @@ sub store {
# store the coordinate system in the database
#
my
$sth
=
$db
->
db
->
prepare
('
INSERT INTO coord_system
'
.
my
$sth
=
$db
->
db
c
->
prepare
('
INSERT INTO coord_system
'
.
'
SET name = ?,
'
.
'
version = ?,
'
.
'
attrib = ?,
'
.
...
...
modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -203,7 +203,7 @@ sub new_fast{
$con
->
isa
('
Bio::EnsEMBL::DBSQL::DBConnection
'))
{
throw
("
$con
passed is not of type Bio::EnsEMBL::DBSQL::DBConnection
");
}
$self
->
db
(
$con
);
$self
->
db
c
(
$con
);
$self
->
species
(
$con
->
species
());
$self
->
group
(
$con
->
group
());
...
...
@@ -225,11 +225,11 @@ sub new_merged{
=head2 db
=head2 db
c
Arg[1] : (optional) Bio::EnsEMBL::DBSQL::DBConnection
Exmaple : $dbc = $dba->db();
Exmaple : $dbc = $dba->db
c
();
Description: Getter/Setter for DBConnection.
Returntype : Bio::EnsEMBL::DBSQL::DBConnection
Exceptions : none
...
...
@@ -237,11 +237,22 @@ sub new_merged{
=cut
sub
db
{
sub
db
c
{
my
(
$self
,
$arg
)
=
@_
;
(
defined
$arg
)
&&
(
$self
->
{
_db
}
=
$arg
);
$self
->
{
_db
};
(
$self
->
{
_dbc
}
=
$arg
);
$self
->
{
_dbc
};
}
=head2 db
=cut
sub
db
{
my
(
$self
,
$arg
)
=
@_
;
deprecate
("
db Should no longer be called from the DBAdaptor. DBConnection should now be used OR preferably the object adaptor itself
\n
");
return
$self
->
dbc
(
$arg
);
}
...
...
modules/Bio/EnsEMBL/DBSQL/PredictionExonAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -191,7 +191,7 @@ sub store {
my
$seq_region_id
;
(
$pexon
,
$seq_region_id
)
=
$self
->
_pre_store
(
$pexon
);
my
$sth
=
$db
->
db
->
prepare
my
$sth
=
$db
->
db
c
->
prepare
("
INSERT into prediction_exon (prediction_transcript_id, exon_rank,
"
.
"
seq_region_id, seq_region_start, seq_region_end,
"
.
"
seq_region_strand, start_phase, score, p_value)
"
.
...
...
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
View file @
c8fcd6c2
...
...
@@ -1224,7 +1224,7 @@ sub store {
#store the seq_region
my
$sth
=
$db
->
db
->
prepare
("
INSERT INTO seq_region
"
.
my
$sth
=
$db
->
db
c
->
prepare
("
INSERT INTO seq_region
"
.
"
SET name = ?,
"
.
"
length = ?,
"
.
"
coord_system_id = ?
"
);
...
...
@@ -1267,7 +1267,7 @@ sub prepare {
my
$self
=
shift
;
my
$sql
=
shift
;
return
$self
->
db
()
->
dnadb
()
->
db
->
prepare
(
$sql
);
return
$self
->
db
()
->
dnadb
()
->
db
c
->
prepare
(
$sql
);
}
sub
_build_exception_cache
{
...
...
modules/Bio/EnsEMBL/Storable.pm
View file @
c8fcd6c2
...
...
@@ -130,7 +130,7 @@ sub is_stored {
my
$db
=
shift
;
if
(
$db
and
$db
->
isa
('
Bio::EnsEMBL::DBSQL::DBAdaptor
'))
{
$db
=
$db
->
db
();
$db
=
$db
->
db
c
();
}
if
(
!
$db
||
!
ref
(
$db
)
||
!
$db
->
isa
('
Bio::EnsEMBL::DBSQL::DBConnection
'))
{
throw
('
db argument must be a Bio::EnsEMBL::DBSQL::DBConnection
');
...
...
modules/t/MultiTestDB.t
View file @
c8fcd6c2
...
...
@@ -17,7 +17,7 @@ my $dba = $ens_test->get_DBAdaptor("core");
ok
(
$dba
);
my
$sth
=
$dba
->
db
->
prepare
("
select * from gene
");
my
$sth
=
$dba
->
db
c
->
prepare
("
select * from gene
");
$sth
->
execute
;
ok
(
scalar
(
$sth
->
rows
)
==
20
);
...
...
@@ -42,10 +42,10 @@ ok(scalar($sth->rows) == 20);
# delete 9 genes from the db
$sth
=
$dba
->
db
->
prepare
("
delete from gene where gene_id >= 18266
");
$sth
=
$dba
->
db
c
->
prepare
("
delete from gene where gene_id >= 18266
");
$sth
->
execute
;
$sth
=
$dba
->
db
->
prepare
("
select * from gene
");
$sth
=
$dba
->
db
c
->
prepare
("
select * from gene
");
$sth
->
execute
;
ok
(
scalar
(
$sth
->
rows
)
==
10
);
...
...
modules/t/attributeAdaptor.t
View file @
c8fcd6c2
...
...
@@ -50,7 +50,7 @@ $aa->store_on_MiscFeature($mf, [$attrib]);
#
# make sure the misc_attrib table was updated
#
my
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
my
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM misc_attrib
"
.
"
WHERE misc_feature_id = 1
")
->
[
0
]
->
[
0
];
...
...
@@ -59,7 +59,7 @@ ok($count == 1);
#
# make sure the attrib_type table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM attrib_type
"
.
"
WHERE code = 'test_code'
")
->
[
0
]
->
[
0
];
ok
(
$count
==
1
);
...
...
@@ -87,7 +87,7 @@ $aa->remove_from_MiscFeature($mf);
#
# make sure the misc_attrib table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM misc_attrib
"
.
"
WHERE misc_feature_id = 1
")
->
[
0
]
->
[
0
];
...
...
@@ -119,7 +119,7 @@ $aa->store_on_Slice($slice, [$attrib]);
#
# make sure the seq_region_attrib table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM seq_region_attrib
"
.
"
WHERE seq_region_id =
"
.
$slice
->
get_seq_region_id
())
->
[
0
]
->
[
0
];
...
...
@@ -128,7 +128,7 @@ ok($count == 1);
#
# make sure the attrib_type table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM attrib_type
"
.
"
WHERE code = 'test_code2'
")
->
[
0
]
->
[
0
];
ok
(
$count
==
1
);
...
...
@@ -156,7 +156,7 @@ $aa->remove_from_Slice($slice);
#
# make sure the seq_region_attrib table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM seq_region_attrib
"
.
"
WHERE seq_region_id =
"
.
$slice
->
get_seq_region_id
())
->
[
0
]
->
[
0
];
...
...
@@ -178,7 +178,7 @@ $aa->store_on_Slice($slice, [$attrib]);
#
# make sure the seq_region_attrib table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM seq_region_attrib
"
.
"
WHERE seq_region_id =
"
.
$slice
->
get_seq_region_id
())
->
[
0
]
->
[
0
];
...
...
@@ -187,7 +187,7 @@ ok($count == 1);
#
# make sure the attrib_type table was updated
#
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT count(*) FROM attrib_type
"
.
"
WHERE code = 'test_code2'
")
->
[
0
]
->
[
0
];
ok
(
$count
==
1
);
...
...
modules/t/compressedSequenceAdaptor.t
View file @
c8fcd6c2
...
...
@@ -36,7 +36,7 @@ $multi_db->save('core', 'dnac', 'seq_region');
#we can get weird padding at the end due to the last byte being not
#fully packed but still labelled as non-gap
my
$sth
=
$db
->
db
->
prepare
('
INSERT INTO seq_region (name, length, coord_system_id)
'
.
$db
->
db
c
->
prepare
('
INSERT INTO seq_region (name, length, coord_system_id)
'
.
'
VALUES (?,?,?)
');
$sth
->
execute
('
testfrag
',
$len
,
$contig_cs
->
dbID
);
...
...
modules/t/coordSystemAdaptor.t
View file @
c8fcd6c2
...
...
@@ -155,7 +155,7 @@ ok(!$cs->is_sequence_level);
ok
(
!
$cs
->
is_top_level
);
ok
(
$cs
->
rank
()
==
10
);
my
$sth
=
$db
->
db
->
prepare
('
SELECT attrib FROM coord_system
'
.
my
$sth
=
$db
->
db
c
->
prepare
('
SELECT attrib FROM coord_system
'
.
'
WHERE name = ? and version = ?
');
$sth
->
execute
('
newsystem
',
'
NCBI35
');
...
...
modules/t/dbConnection.t
View file @
c8fcd6c2
...
...
@@ -30,12 +30,12 @@ my $db = $multi->get_DBAdaptor('core');
#
my
$dbc
;
{
my
$db_name
=
$db
->
db
->
dbname
;
my
$port
=
$db
->
db
->
port
;
my
$user
=
$db
->
db
->
username
;
my
$pass
=
$db
->
db
->
password
;
my
$host
=
$db
->
db
->
host
;
my
$driver
=
$db
->
db
->
driver
;
my
$db_name
=
$db
->
db
c
->
dbname
;
my
$port
=
$db
->
db
c
->
port
;
my
$user
=
$db
->
db
c
->
username
;
my
$pass
=
$db
->
db
c
->
password
;
my
$host
=
$db
->
db
c
->
host
;
my
$driver
=
$db
->
db
c
->
driver
;
$dbc
=
Bio::EnsEMBL::DBSQL::
DBConnection
->
new
(
-
dbname
=>
$db_name
,
-
user
=>
$user
,
...
...
modules/t/dbEntries.t
View file @
c8fcd6c2
...
...
@@ -37,7 +37,7 @@ ok( $db );
my
$dbEntryAdaptor
=
$db
->
get_DBEntryAdaptor
();
my
$sth
=
$db
->
db
->
prepare
(
'
select count(*) from object_xref where ensembl_object_type = "Translation"
'
);
my
$sth
=
$db
->
db
c
->
prepare
(
'
select count(*) from object_xref where ensembl_object_type = "Translation"
'
);
$sth
->
execute
();
my
(
$xref_count
)
=
$sth
->
fetchrow_array
();
...
...
modules/t/gene.t
View file @
c8fcd6c2
...
...
@@ -603,7 +603,7 @@ debug( "Storing gene" );
$gene_ad
->
store
(
$gene
);
my
$dbe_id
=
$db
->
db
->
db_handle
->
selectall_arrayref
("
SELECT display_xref_id FROM gene
")
->
[
0
]
->
[
0
];
my
$dbe_id
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT display_xref_id FROM gene
")
->
[
0
]
->
[
0
];
ok
(
$dbe_id
&&
$dbe_id
==
$dbe
->
dbID
());
...
...
modules/t/markerFeatureAdaptor.t
View file @
c8fcd6c2
...
...
@@ -109,7 +109,7 @@ ok($marker_feature->dbID &&
$marker_feature
->
adaptor
==
$mfa
);
my
$sth
=
$db
->
db
->
prepare
('
SELECT count(*) from marker_feature
');
my
$sth
=
$db
->
db
c
->
prepare
('
SELECT count(*) from marker_feature
');
$sth
->
execute
;
my
(
$count
)
=
$sth
->
fetchrow_array
;
$sth
->
finish
();
...
...
modules/t/miscSetAdaptor.t
View file @
c8fcd6c2
...
...
@@ -73,7 +73,7 @@ $msa->store($misc_set);
ok
(
$misc_set
->
dbID
());
ok
(
$misc_set
->
adaptor
()
==
$msa
);
my
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
my
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT COUNT(*) FROM misc_set WHERE code = 'code'
")
->
[
0
]
->
[
0
];
ok
(
$count
==
1
);
...
...
@@ -99,7 +99,7 @@ $msa->store($misc_set);
ok
(
$misc_set
->
dbID
&&
$misc_set
->
adaptor
);
$count
=
$db
->
db
->
db_handle
->
selectall_arrayref
$count
=
$db
->
db
c
->
db_handle
->
selectall_arrayref
("
SELECT COUNT(*) FROM misc_set WHERE code = 'code'
")
->
[
0
]
->
[
0
];
ok
(
$count
==
1
);
...
...
modules/t/sliceAdaptor.t
View file @
c8fcd6c2
...
...
@@ -406,7 +406,7 @@ ok($slice->seq_region_name =~ /$clone_name\.\d+/);
# highest (lowest-numbered) ranked comes out first
$multi
->
hide
('
core
',
'
seq_region
');
my
$sth
=
$db
->
db
->
prepare
(
qq{INSERT INTO seq_region (coord_system_id, name,
my
$sth
=
$db
->
db
c
->
prepare
(
qq{INSERT INTO seq_region (coord_system_id, name,
length)
SELECT cs.coord_system_id, 'TESTREGION', 1000000
FROM coord_system cs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment