| 1 | |||||||||||||
| 2 | package SQL::Admin::Catalog::Table::Column; | ||||||||||||
| 3 | 2 | ▶ | use base qw( SQL::Admin::Catalog::Table::Object ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | our $VERSION = v0.5.0; | |||||||||||
| 9 | |||||||||||||
| 10 | ###################################################################### | ||||||||||||
| 11 | ###################################################################### | ||||||||||||
| 12 | 0 | ▶ | sub add { # ; | ||||||||||
|
Subroutine
add: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 13 | 0 | my ($self, $what, @params) = @_; | |||||||||||
| 14 | |||||||||||||
| 15 | 0 | my $obj = $self->catalog->add ($what, column => $self, @params); | |||||||||||
| 16 | |||||||||||||
| 17 | ################################################################## | ||||||||||||
| 18 | |||||||||||||
| 19 | 0 | ▶ | return $self->not_null ($obj) if $what eq 'not_null'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 20 | 0 | ▶ | return $self->default ($obj) if $what eq 'default'; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | |||||||||||||
| 24 | ###################################################################### | ||||||||||||
| 25 | ###################################################################### | ||||||||||||
| 26 | 8 | ▶ | sub type { # ; | ||||||||||
|
Subroutine
type: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 27 | 8 | my $self = shift; | |||||||||||
| 28 | 8 | ▶ | $self->{type} = shift if @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 8 | $self->{type}; | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | |||||||||||||
| 33 | ###################################################################### | ||||||||||||
| 34 | ###################################################################### | ||||||||||||
| 35 | 13 | ▶ | sub fullname { # ; | ||||||||||
|
Subroutine
fullname: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 36 | 13 | my $self = shift; | |||||||||||
| 37 | |||||||||||||
| 38 | 13 | $self->table->fullname . '.' . $self->name; | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | |||||||||||||
| 42 | ###################################################################### | ||||||||||||
| 43 | ###################################################################### | ||||||||||||
| 44 | 7 | ▶ | sub not_null { # ; | ||||||||||
|
Subroutine
not_null: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 45 | 7 | my $self = shift; | |||||||||||
| 46 | 7 | ▶ | $self->{not_null} = shift if @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 47 | 7 | $self->{not_null}; | |||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | |||||||||||||
| 51 | ###################################################################### | ||||||||||||
| 52 | ###################################################################### | ||||||||||||
| 53 | 5 | ▶ | sub default { # ; | ||||||||||
|
Subroutine
default: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 54 | 5 | my $self = shift; | |||||||||||
| 55 | 5 | ▶ | $self->{default} = shift if @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 56 | 5 | $self->{default}; | |||||||||||
| 57 | } | ||||||||||||
| 58 | |||||||||||||
| 59 | |||||||||||||
| 60 | ###################################################################### | ||||||||||||
| 61 | ###################################################################### | ||||||||||||
| 62 | 0 | ▶ | sub autoincrement { # ; | ||||||||||
|
Subroutine
autoincrement: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 63 | 0 | my $self = shift; | |||||||||||
| 64 | 0 | ▶ | $self->{autoincrement} = shift if @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 65 | 0 | $self->{autoincrement}; | |||||||||||
| 66 | } | ||||||||||||
| 67 | |||||||||||||
| 68 | |||||||||||||
| 69 | ###################################################################### | ||||||||||||
| 70 | ###################################################################### | ||||||||||||
| 71 | 0 | ▶ | sub autoincrement_hint { # ; | ||||||||||
|
Subroutine
autoincrement_hint: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||
| 72 | 0 | my $self = shift; | |||||||||||
| 73 | |||||||||||||
| 74 | 0 | ▶ | my $map = $self->{autoincrement_hint} ||= {}; | ||||||||||
|
Condition0%0/2
$self->{"autoincrement_hint"} ||= {}
MC/DC0%0/1
$self->{"autoincrement_hint"} ||= {}
$self->{"autoincrement_hint"}
Truth table0%0/2
A
A= $self->{"autoincrement_hint"}
| |||||||||||||
| 75 | 0 | ▶ | return $map unless @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 76 | |||||||||||||
| 77 | 0 | my $key = shift; | |||||||||||
| 78 | 0 | ▶ | return $map->{$key} unless @_; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 79 | |||||||||||||
| 80 | 0 | $map->{$key} = shift; | |||||||||||
| 81 | } | ||||||||||||
| 82 | |||||||||||||
| 83 | |||||||||||||
| 84 | ###################################################################### | ||||||||||||
| 85 | ###################################################################### | ||||||||||||
| 86 | |||||||||||||
| 87 | package SQL::Admin::Catalog::Table::Column; | ||||||||||||
| 88 | |||||||||||||
| 89 | 2 | 1; | |||||||||||
| 90 | |||||||||||||