line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
2
|
|
2315
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
60
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
131
|
|
24
|
|
|
|
|
|
|
our $VERSION = '1.62'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our $DEBUG; |
27
|
|
|
|
|
|
|
$DEBUG = 0 unless defined $DEBUG; |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
2
|
|
1325
|
use Storable; |
|
2
|
|
|
|
|
6528
|
|
|
2
|
|
|
|
|
123
|
|
30
|
2
|
|
|
2
|
|
518
|
use SQL::Translator::Utils qw(debug normalize_name); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
127
|
|
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
2
|
|
14
|
use base qw(Exporter); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
425
|
|
33
|
|
|
|
|
|
|
our @EXPORT_OK = qw(parse); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub parse { |
36
|
0
|
|
|
0
|
0
|
|
my ($translator, $data) = @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
if (defined($data)) { |
|
|
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
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SEE ALSO |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
SQL::Translator. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Paul Harrington Eharringp@deshaw.comE. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |