blib/lib/SQL/Translator/Parser/Storable.pm

filter: Statementstmt 74.0% 20 / 27 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 65.0% 26 / 40 CC 3 SCAR 16.3
CC
3
Cov
64%
parse
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
« blib/lib/SQL/Translator/Parser/DBI/MySQL.pm ↑ Summary blib/lib/SQL/Translator/Role/ListAttr.pm »
1 package SQL::Translator::Parser::Storable;
2  
3 =head1 NAME
4  
5 SQL::Translator::Parser::Storable - parser for Schema objects serialized
6 with the Storable module
7  
8 =head1 SYNOPSIS
9  
10 use SQL::Translator;
11  
12 my $translator = SQL::Translator->new;
13 $translator->parser('Storable');
14  
15 =head1 DESCRIPTION
16  
17 Slurps in a Schema from a Storable file on disk. You can then turn
18 the data into a database tables or graphs.
19  
20 =cut
21  
22 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 our $VERSION = '1.66';
25  
26 2 our $DEBUG;
27 2 ▶$DEBUG = 0 unless defined $DEBUG;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $SQL::Translator::Parser::Storable::DEBUG 2 0 2
28  
29 2 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 2 ▶use SQL::Translator::Utils qw(debug normalize_name);
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 2 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
33 2 our @EXPORT_OK = qw(parse);
34  
35 0 ▶sub parse {
Subroutine parse: not called CC=3 SCAR=24.8
Pod undocumented
36 0 my ($translator, $data) = @_;
37  
38 0 ▶ if (defined($data)) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $data) { } 0 0 0
elsif (defined $translator->filename) { } 0 0 0
39 0 $translator->{'schema'} = Storable::thaw($data);
40 0 return 1;
41 } elsif (defined($translator->filename)) {
42 0 $translator->{'schema'} = Storable::retrieve($translator->filename);
43 0 return 1;
44 }
45  
46 0 return 0;
47 }
48  
49 2 1;
50  
51 =pod
52  
53 =head1 SEE ALSO
54  
55 SQL::Translator.
56  
57 =head1 AUTHOR
58  
59 Paul Harrington E<lt>harringp@deshaw.comE<gt>.
60  
61 =cut
« blib/lib/SQL/Translator/Parser/DBI/MySQL.pm ↑ Summary blib/lib/SQL/Translator/Role/ListAttr.pm »