Firebird/Introspect.pm

filter: Statementstmt 74.2% 26 / 35 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod n/a totaltotal 77.2% 34 / 44 CC 1 SCAR 1.1
CC
1
Cov
74%
_build_model
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Firebird.pm ↑ Summary Firebird/Deploy.pm »
1 package DBIO::Firebird::Introspect;
2 # ABSTRACT: Introspect a Firebird database via rdb$ system tables
3  
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 our $VERSION = '0.900007';
8  
9 6 ▶use base 'DBIO::Introspect::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 6 ▶use DBIO::Firebird::Introspect::Tables;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 6 ▶use DBIO::Firebird::Introspect::Columns;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶use DBIO::Firebird::Introspect::Indexes;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 ▶use DBIO::Firebird::Introspect::Uniques;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 ▶use DBIO::Firebird::Introspect::ForeignKeys;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 0 ▶sub _build_model {
Subroutine _build_model: not called CC=1 SCAR=6.9
19 0 my ($self) = @_;
20 0 my $dbh = $self->dbh;
21  
22 # Firebird returns result-column names upper-cased; the helpers read
23 # lower-case rdb$ keys from fetchrow_hashref. Force lower-cased hash keys so
24 # the two agree (statement handles inherit this at prepare time).
25 0 local $dbh->{FetchHashKeyName} = 'NAME_lc';
26  
27 0 my $tables = DBIO::Firebird::Introspect::Tables->fetch($dbh);
28 0 my $columns = DBIO::Firebird::Introspect::Columns->fetch($dbh, $tables);
29 0 my $indexes = DBIO::Firebird::Introspect::Indexes->fetch($dbh, $tables);
30 0 my $uniques = DBIO::Firebird::Introspect::Uniques->fetch($dbh, $tables);
31 0 my $foreign_keys = DBIO::Firebird::Introspect::ForeignKeys->fetch($dbh, $tables);
32  
33 return {
34 0 tables => $tables,
35 columns => $columns,
36 indexes => $indexes,
37 unique_constraints => $uniques,
38 foreign_keys => $foreign_keys,
39 };
40 }
41  
42  
43 6 1;
44  
45 __END__
« Firebird.pm ↑ Summary Firebird/Deploy.pm »