line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Class::DBI::Lite::ColumnInfo; |
3
|
|
|
|
|
|
|
|
4
|
16
|
|
|
16
|
|
89
|
use strict; |
|
16
|
|
|
|
|
31
|
|
|
16
|
|
|
|
|
405
|
|
5
|
16
|
|
|
16
|
|
73
|
use warnings 'all'; |
|
16
|
|
|
|
|
26
|
|
|
16
|
|
|
|
|
3872
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#============================================================================== |
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
24
|
|
|
24
|
0
|
86
|
my ($class, %args) = @_; |
12
|
|
|
|
|
|
|
|
13
|
24
|
|
|
|
|
63
|
my @required = qw( |
14
|
|
|
|
|
|
|
name |
15
|
|
|
|
|
|
|
type |
16
|
|
|
|
|
|
|
length |
17
|
|
|
|
|
|
|
is_nullable |
18
|
|
|
|
|
|
|
default_value |
19
|
|
|
|
|
|
|
is_pk |
20
|
|
|
|
|
|
|
key |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
24
|
|
|
|
|
41
|
foreach( @required ) |
24
|
|
|
|
|
|
|
{ |
25
|
|
|
|
|
|
|
die "Required parameter '$_' was not provided" |
26
|
168
|
50
|
|
|
|
366
|
unless exists($args{$_}); |
27
|
|
|
|
|
|
|
}# end foreach() |
28
|
|
|
|
|
|
|
|
29
|
24
|
|
|
|
|
487
|
return bless \%args, $class; |
30
|
|
|
|
|
|
|
}# end new() |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
2
|
0
|
8
|
sub null { $_[0]->{is_nullable} } |
33
|
1
|
|
|
1
|
0
|
6
|
sub default { $_[0]->{default_value} } |
34
|
0
|
|
|
0
|
1
|
0
|
sub enum_values { shift->{enum_values} } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
#============================================================================== |
38
|
|
|
|
|
|
|
sub AUTOLOAD |
39
|
|
|
|
|
|
|
{ |
40
|
1
|
|
|
1
|
|
4
|
my $s = shift; |
41
|
1
|
|
|
|
|
3
|
our $AUTOLOAD; |
42
|
1
|
|
|
|
|
11
|
my ($key) = $AUTOLOAD =~ m/([^:]+)$/; |
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
10
|
return exists($s->{$key}) ? $s->{$key} : die "Invalid field '$key'"; |
45
|
|
|
|
|
|
|
}# end AUTOLOAD() |
46
|
|
|
|
0
|
|
|
sub DESTROY {} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1;# return true: |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |