« blib/lib/DBIO/PostgreSQL/InflateColumn/Vector.pm
↑ Summary
blib/lib/DBIO/PostgreSQL/Vector/Op.pm »
| 1 | package DBIO::PostgreSQL::Diff::NoStatement; | ||||||||||||||||||||||
| 2 | # ABSTRACT: An operation the diff has no statement for is refused, not written as a comment or a placeholder | ||||||||||||||||||||||
| 3 | |||||||||||||||||||||||
| 4 | 113 | ▶ | use strict; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 5 | 113 | ▶ | use warnings; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 6 | |||||||||||||||||||||||
| 7 | 113 | our $VERSION = '0.900007'; | |||||||||||||||||||||
| 8 | |||||||||||||||||||||||
| 9 | |||||||||||||||||||||||
| 10 | |||||||||||||||||||||||
| 11 | 13 | ▶ | sub refuse_without_definition { | ||||||||||||||||||||
|
Subroutine
refuse_without_definition: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||
| 12 | 13 | my ($class, %object) = @_; | |||||||||||||||||||||
| 13 | 13 | my ($kind, $name, $from) = @object{qw( kind name from )}; | |||||||||||||||||||||
| 14 | |||||||||||||||||||||||
| 15 | die join "\n", | ||||||||||||||||||||||
| 16 | ( $object{in_database} | ||||||||||||||||||||||
| 17 | ? "refusing to diff: $kind $name is in the database and in the target, and the target model has no definition to compare it by or to write it from" | ||||||||||||||||||||||
| 18 | : "refusing to diff: $kind $name is in the target and not in the database, and the target model has no definition to create it from" ), | ||||||||||||||||||||||
| 19 | '', | ||||||||||||||||||||||
| 20 | "The diff writes every $kind as the text $from gives for it,", | ||||||||||||||||||||||
| 21 | 'and compares it by that text.', | ||||||||||||||||||||||
| 22 | ( $object{null_when_gone} | ||||||||||||||||||||||
| 23 | ? ( 'The catalog gives none for an object that is gone by the time it is asked:', | ||||||||||||||||||||||
| 24 | 'one that another session dropped while the model was read.' ) | ||||||||||||||||||||||
| 25 | : () ), | ||||||||||||||||||||||
| 26 | 'A model built by hand has none unless it is given one.', | ||||||||||||||||||||||
| 27 | ( defined $object{also} ? $object{also} : () ), | ||||||||||||||||||||||
| 28 | 'No statement was generated.', | ||||||||||||||||||||||
| 29 | '', | ||||||||||||||||||||||
| 30 | 13 | ▶ | ( $object{null_when_gone} ? 'Read the target model again and diff again.' : () ), | ||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||
| 31 | "In a model built by hand, give the $kind its definition.", | ||||||||||||||||||||||
| 32 | ''; | ||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||
| 34 | |||||||||||||||||||||||
| 35 | |||||||||||||||||||||||
| 36 | 34 | ▶ | sub throw { | ||||||||||||||||||||
|
Subroutine
throw: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||
| 37 | 34 | my ($class, $op, $object, $why) = @_; | |||||||||||||||||||||
| 38 | 34 | my $action = $op->action; | |||||||||||||||||||||
| 39 | 34 | ▶ | $why //= 'the class knows no such action'; | ||||||||||||||||||||
|
Condition100%2/2
$why //= "the class knows no such action"
MC/DC100%1/1
$why //= "the class knows no such action"
$why
Truth table100%2/2
A
A= $why
| |||||||||||||||||||||||
| 40 | |||||||||||||||||||||||
| 41 | 34 | ▶ | die sprintf "%s: no statement for %s on %s -- %s\n", | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 42 | ref $op, ( defined $action ? "action '$action'" : 'an operation without an action' ), | ||||||||||||||||||||||
| 43 | $object, $why; | ||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||
| 45 | |||||||||||||||||||||||
| 46 | |||||||||||||||||||||||
| 47 | 113 | 1; | |||||||||||||||||||||
| 48 | |||||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||||