line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package SQL::Admin::Catalog::Table::Column; |
3
|
2
|
|
|
2
|
|
1145
|
use base qw( SQL::Admin::Catalog::Table::Object ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
964
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
44
|
|
6
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
767
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = v0.5.0; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
###################################################################### |
11
|
|
|
|
|
|
|
###################################################################### |
12
|
|
|
|
|
|
|
sub add { # ; |
13
|
0
|
|
|
0
|
0
|
0
|
my ($self, $what, @params) = @_; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
0
|
my $obj = $self->catalog->add ($what, column => $self, @params); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
################################################################## |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
0
|
return $self->not_null ($obj) if $what eq 'not_null'; |
20
|
0
|
0
|
|
|
|
0
|
return $self->default ($obj) if $what eq 'default'; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
###################################################################### |
25
|
|
|
|
|
|
|
###################################################################### |
26
|
|
|
|
|
|
|
sub type { # ; |
27
|
8
|
|
|
8
|
0
|
4574
|
my $self = shift; |
28
|
8
|
100
|
|
|
|
26
|
$self->{type} = shift if @_; |
29
|
8
|
|
|
|
|
36
|
$self->{type}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
###################################################################### |
34
|
|
|
|
|
|
|
###################################################################### |
35
|
|
|
|
|
|
|
sub fullname { # ; |
36
|
13
|
|
|
13
|
0
|
25
|
my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
13
|
|
|
|
|
158
|
$self->table->fullname . '.' . $self->name; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
###################################################################### |
43
|
|
|
|
|
|
|
###################################################################### |
44
|
|
|
|
|
|
|
sub not_null { # ; |
45
|
7
|
|
|
7
|
0
|
13
|
my $self = shift; |
46
|
7
|
100
|
|
|
|
27
|
$self->{not_null} = shift if @_; |
47
|
7
|
|
|
|
|
51
|
$self->{not_null}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
###################################################################### |
52
|
|
|
|
|
|
|
###################################################################### |
53
|
|
|
|
|
|
|
sub default { # ; |
54
|
5
|
|
|
5
|
0
|
20
|
my $self = shift; |
55
|
5
|
100
|
|
|
|
19
|
$self->{default} = shift if @_; |
56
|
5
|
|
|
|
|
21
|
$self->{default}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
###################################################################### |
61
|
|
|
|
|
|
|
###################################################################### |
62
|
|
|
|
|
|
|
sub autoincrement { # ; |
63
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
64
|
0
|
0
|
|
|
|
|
$self->{autoincrement} = shift if @_; |
65
|
0
|
|
|
|
|
|
$self->{autoincrement}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
###################################################################### |
70
|
|
|
|
|
|
|
###################################################################### |
71
|
|
|
|
|
|
|
sub autoincrement_hint { # ; |
72
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
0
|
|
|
|
my $map = $self->{autoincrement_hint} ||= {}; |
75
|
0
|
0
|
|
|
|
|
return $map unless @_; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my $key = shift; |
78
|
0
|
0
|
|
|
|
|
return $map->{$key} unless @_; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
$map->{$key} = shift; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
###################################################################### |
85
|
|
|
|
|
|
|
###################################################################### |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
package SQL::Admin::Catalog::Table::Column; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
|