« blib/lib/DBIO/PostgreSQL/InflateColumn/TSVector.pm
↑ Summary
blib/lib/DBIO/PostgreSQL/Diff/Schema.pm »
| 1 | package DBIO::PostgreSQL::PgSchema; | ||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Base class for PostgreSQL schema namespaces | ||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||
| 4 | 10 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 5 | 10 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||
| 7 | 10 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||
| 9 | 10 | my (%_CLASS_ENUM_DEFS, %_CLASS_TYPE_DEFS, %_CLASS_FUNCTION_DEFS); | |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||
| 13 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 14 | 2 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||
| 15 | 2 | ▶ | $args{_enums} //= {}; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$args{"_enums"} //= {}
MC/DC0%0/1
$args{"_enums"} //= {}
$args{"_enums"}
Truth table50%1/2
A
A= $args{"_enums"}
| |||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | $args{_types} //= {}; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$args{"_types"} //= {}
MC/DC0%0/1
$args{"_types"} //= {}
$args{"_types"}
Truth table50%1/2
A
A= $args{"_types"}
| |||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | $args{_functions} //= {}; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$args{"_functions"} //= {}
MC/DC0%0/1
$args{"_functions"} //= {}
$args{"_functions"}
Truth table50%1/2
A
A= $args{"_functions"}
| |||||||||||||||||||||||||||||||
| 18 | 2 | bless \%args, $class; | |||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||
| 21 | 3 | ▶ | sub pg_schema_name { $_[0]->{pg_schema_name} } | ||||||||||||||||||||||||||||
|
Subroutine
pg_schema_name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||
| 23 | 10 | ▶ | sub _pg_enum_defs { $_CLASS_ENUM_DEFS{ ref $_[0] || $_[0] } // [] } | ||||||||||||||||||||||||||||
|
Subroutine
_pg_enum_defs: called CC=3 SCAR=12.0
Condition60%3/5
$_CLASS_ENUM_DEFS{ref $_[0] or $_[0]} // []
ref $_[0] || $_[0]
MC/DC100%1/1
$_CLASS_ENUM_DEFS{ref $_[0] or $_[0]} // []
$_CLASS_ENUM_DEFS{ref $_[0] or $_[0]}
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0]
$_[0]
Truth table100%2/2
A
A= $_CLASS_ENUM_DEFS{ref $_[0] or $_[0]}
Truth table33%1/3
A || B
A= ref $_[0]B= $_[0]
| |||||||||||||||||||||||||||||||
| 24 | 7 | ▶ | sub _pg_type_defs { $_CLASS_TYPE_DEFS{ ref $_[0] || $_[0] } // [] } | ||||||||||||||||||||||||||||
|
Subroutine
_pg_type_defs: called CC=3 SCAR=12.0
Condition60%3/5
$_CLASS_TYPE_DEFS{ref $_[0] or $_[0]} // []
ref $_[0] || $_[0]
MC/DC100%1/1
$_CLASS_TYPE_DEFS{ref $_[0] or $_[0]} // []
$_CLASS_TYPE_DEFS{ref $_[0] or $_[0]}
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0]
$_[0]
Truth table100%2/2
A
A= $_CLASS_TYPE_DEFS{ref $_[0] or $_[0]}
Truth table33%1/3
A || B
A= ref $_[0]B= $_[0]
| |||||||||||||||||||||||||||||||
| 25 | 7 | ▶ | sub _pg_function_defs { $_CLASS_FUNCTION_DEFS{ ref $_[0] || $_[0] } // [] } | ||||||||||||||||||||||||||||
|
Subroutine
_pg_function_defs: called CC=3 SCAR=12.0
Condition60%3/5
$_CLASS_FUNCTION_DEFS{ref $_[0] or $_[0]} // []
ref $_[0] || $_[0]
MC/DC100%1/1
$_CLASS_FUNCTION_DEFS{ref $_[0] or $_[0]} // []
$_CLASS_FUNCTION_DEFS{ref $_[0] or $_[0]}
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0]
$_[0]
Truth table100%2/2
A
A= $_CLASS_FUNCTION_DEFS{ref $_[0] or $_[0]}
Truth table33%1/3
A || B
A= ref $_[0]B= $_[0]
| |||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | sub pg_enum { | ||||||||||||||||||||||||||||
|
Subroutine
pg_enum: called CC=4 SCAR=16.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 30 | 6 | my ($self, $name, $values) = @_; | |||||||||||||||||||||||||||||
| 31 | 6 | ▶ | if (ref $self) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | $self->{_enums}{$name} = $values if $values; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 33 | 0 | return $self->{_enums}{$name}; | |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||
| 35 | # Class method usage for declarative API | ||||||||||||||||||||||||||||||
| 36 | 6 | my $class = $self; | |||||||||||||||||||||||||||||
| 37 | 6 | ▶ | $_CLASS_ENUM_DEFS{$class} //= []; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$_CLASS_ENUM_DEFS{$class} //= []
MC/DC0%0/1
$_CLASS_ENUM_DEFS{$class} //= []
$_CLASS_ENUM_DEFS{$class}
Truth table50%1/2
A
A= $_CLASS_ENUM_DEFS{$class}
| |||||||||||||||||||||||||||||||
| 38 | 6 | push @{ $_CLASS_ENUM_DEFS{$class} }, [$name, $values]; | |||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||
| 42 | 1 | ▶ | sub pg_type { | ||||||||||||||||||||||||||||
|
Subroutine
pg_type: called CC=4 SCAR=16.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 43 | 1 | my ($self, $name, $fields) = @_; | |||||||||||||||||||||||||||||
| 44 | 1 | ▶ | if (ref $self) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | $self->{_types}{$name} = $fields if $fields; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 46 | 0 | return $self->{_types}{$name}; | |||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||
| 48 | 1 | my $class = $self; | |||||||||||||||||||||||||||||
| 49 | 1 | ▶ | $_CLASS_TYPE_DEFS{$class} //= []; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$_CLASS_TYPE_DEFS{$class} //= []
MC/DC0%0/1
$_CLASS_TYPE_DEFS{$class} //= []
$_CLASS_TYPE_DEFS{$class}
Truth table50%1/2
A
A= $_CLASS_TYPE_DEFS{$class}
| |||||||||||||||||||||||||||||||
| 50 | 1 | push @{ $_CLASS_TYPE_DEFS{$class} }, [$name, $fields]; | |||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||
| 54 | 1 | ▶ | sub pg_function { | ||||||||||||||||||||||||||||
|
Subroutine
pg_function: called CC=4 SCAR=16.6
Pod
documented
| |||||||||||||||||||||||||||||||
| 55 | 1 | my ($self, $name, $sql) = @_; | |||||||||||||||||||||||||||||
| 56 | 1 | ▶ | if (ref $self) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | $self->{_functions}{$name} = $sql if $sql; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 58 | 0 | return $self->{_functions}{$name}; | |||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||
| 60 | 1 | my $class = $self; | |||||||||||||||||||||||||||||
| 61 | 1 | ▶ | $_CLASS_FUNCTION_DEFS{$class} //= []; | ||||||||||||||||||||||||||||
|
Condition50%1/2
$_CLASS_FUNCTION_DEFS{$class} //= []
MC/DC0%0/1
$_CLASS_FUNCTION_DEFS{$class} //= []
$_CLASS_FUNCTION_DEFS{$class}
Truth table50%1/2
A
A= $_CLASS_FUNCTION_DEFS{$class}
| |||||||||||||||||||||||||||||||
| 62 | 1 | push @{ $_CLASS_FUNCTION_DEFS{$class} }, [$name, $sql]; | |||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | sub pg_enums { | ||||||||||||||||||||||||||||
|
Subroutine
pg_enums: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 67 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 68 | 0 | return { %{ $self->{_enums} } }; | |||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | sub pg_types { | ||||||||||||||||||||||||||||
|
Subroutine
pg_types: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 73 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 74 | 0 | return { %{ $self->{_types} } }; | |||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | sub pg_functions { | ||||||||||||||||||||||||||||
|
Subroutine
pg_functions: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 79 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 80 | 0 | return { %{ $self->{_functions} } }; | |||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||
| 84 | 10 | 1; | |||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||
| 86 | __END__ | ||||||||||||||||||||||||||||||