File Coverage

blib/lib/Protocol/Database/PostgreSQL/Backend/CopyOutResponse.pm
Criterion Covered Total %
statement 12 19 63.1
branch n/a
condition n/a
subroutine 4 8 50.0
pod 1 4 25.0
total 17 31 54.8


line stmt bran cond sub pod time code
1             package Protocol::Database::PostgreSQL::Backend::CopyOutResponse;
2              
3 1     1   7 use strict;
  1         2  
  1         32  
4 1     1   6 use warnings;
  1         2  
  1         43  
5              
6             our $VERSION = '1.005'; # VERSION
7              
8 1     1   8 use parent qw(Protocol::Database::PostgreSQL::Backend);
  1         2  
  1         5  
9              
10             =head1 NAME
11              
12             Protocol::Database::PostgreSQL::Backend::CopyOutResponse
13              
14             =head1 DESCRIPTION
15              
16             =cut
17              
18 1     1   77 use Log::Any qw($log);
  1         3  
  1         6  
19              
20 0     0 0   sub type { 'copy_out_response' }
21              
22 0     0 0   sub data_format { shift->{data_format} }
23 0     0 0   sub count { shift->{count} }
24             sub new_from_message {
25 0     0 1   my ($class, $msg) = @_;
26 0           (undef, undef, my $data_format, my $count, my @formats) = unpack('C1N1C1n1 (n1)*', $msg);
27 0           $log->tracef('COPY IN %s with %s columns, formats %s', $data_format, $count, \@formats);
28 0           return $class->new(
29             data_format => $data_format,
30             count => $count,
31             formats => \@formats
32             );
33             }
34              
35             1;
36              
37             =head1 AUTHOR
38              
39             Tom Molesworth
40              
41             =head1 LICENSE
42              
43             Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself.
44