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

filter: Statementstmt 80.0% 20 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 76.4% 26 / 34 CC 1 SCAR 1.5
CC
1
Cov
78%
produce
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/SQL/Translator/Parser.pm ↑ Summary blib/lib/SQL/Translator/Producer/Diagram.pm »
1 package SQL::Translator::Producer::Storable;
2  
3 =head1 NAME
4  
5 SQL::Translator::Producer::Storable - serializes the SQL::Translator::Schema
6 object via the Storable module
7  
8 =head1 SYNOPSIS
9  
10 use SQL::Translator;
11  
12 my $translator = SQL::Translator->new;
13 $translator->producer('Storable');
14  
15 =head1 DESCRIPTION
16  
17 This module uses Storable to serialize a schema to a string so that it
18 can be saved to disk. Serializing a schema and then calling producers
19 on the stored can realize significant performance gains when parsing
20 takes a long time.
21  
22 =cut
23  
24 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 our ($DEBUG, @EXPORT_OK);
27 2 ▶$DEBUG = 0 unless defined $DEBUG;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $SQL::Translator::Producer::Storable::DEBUG 2 0 2
28 2 our $VERSION = '1.66';
29  
30 2 ▶use Storable;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 2 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 2 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 2 @EXPORT_OK = qw(produce);
35  
36 0 ▶sub produce {
Subroutine produce: not called CC=1 SCAR=6.9
Pod undocumented
37 0 my $t = shift;
38 0 my $args = $t->producer_args;
39 0 my $schema = $t->schema;
40 0 my $serialized = Storable::nfreeze($schema);
41  
42 0 return $serialized;
43 }
44  
45 2 1;
46  
47 =pod
48  
49 =head1 AUTHOR
50  
51 Paul Harrington E<lt>harringp@deshaw.comE<gt>.
52  
53 =head1 SEE ALSO
54  
55 SQL::Translator, SQL::Translator::Schema, Storable.
56  
57 =cut
« blib/lib/SQL/Translator/Parser.pm ↑ Summary blib/lib/SQL/Translator/Producer/Diagram.pm »