line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Xtract::Table; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Object that represents a single table in the destination database. |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
70
|
use 5.008005; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
178
|
|
6
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
111
|
|
7
|
4
|
|
|
4
|
|
27
|
use Params::Util (); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
64
|
|
8
|
4
|
|
|
4
|
|
20
|
use Xtract::Column (); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1197
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.16'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
###################################################################### |
17
|
|
|
|
|
|
|
# Constructor and Accessors |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
4
|
|
|
4
|
0
|
12
|
my $class = shift; |
21
|
4
|
|
|
|
|
24
|
my $self = bless { @_ }, $class; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Check params |
24
|
4
|
50
|
|
|
|
17
|
unless ( Params::Util::_IDENTIFIER($self->name) ) { |
25
|
0
|
|
|
|
|
0
|
my $name = $self->name; |
26
|
0
|
|
|
|
|
0
|
Carp::croak("Missing or invalid name '$name'"); |
27
|
|
|
|
|
|
|
} |
28
|
4
|
50
|
|
|
|
58
|
unless ( $self->name eq lc $self->name ) { |
29
|
0
|
|
|
|
|
0
|
$self->{name} = lc $self->name; |
30
|
|
|
|
|
|
|
} |
31
|
4
|
50
|
|
|
|
19
|
unless ( Params::Util::_INSTANCE($self->scan, 'Xtract::Scan') ) { |
32
|
0
|
|
|
|
|
0
|
Carp::croak("Param 'scan' is not a 'Xtract::Scan' object"); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Capture column information |
36
|
4
|
|
|
|
|
16
|
my @columns = $self->columns; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
4
|
|
|
|
|
30
|
return $self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub name { |
43
|
20
|
|
|
20
|
0
|
241
|
$_[0]->{name}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub scan { |
47
|
4
|
|
|
4
|
0
|
68
|
$_[0]->{scan}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
###################################################################### |
55
|
|
|
|
|
|
|
# Introspection Methods |
56
|
|
|
|
|
|
|
|
57
|
4
|
|
|
4
|
0
|
10
|
sub columns { |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
###################################################################### |
66
|
|
|
|
|
|
|
# SQL Generation |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
0
|
|
sub create { |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |