| 1 | package Protocol::Database::PostgreSQL::Backend::DataRow; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | our $VERSION = '2.000'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 4 | ▶ | use parent qw(Protocol::Database::PostgreSQL::Backend); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Protocol::Database::PostgreSQL::Backend::DataRow | ||||||||||
| 13 | |||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||
| 15 | |||||||||||
| 16 | =cut | ||||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | use Log::Any qw($log); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | sub type { 'data_row' } | ||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub fields { shift->{fields}->@* } | ||||||||
|
Subroutine
fields: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 23 | |||||||||||
| 24 | sub new_from_message { | ||||||||||
| 25 | 0 | ▶ | my ($class, $msg) = @_; | ||||||||
|
Subroutine
new_from_message: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 26 | 0 | my (undef, undef, $count) = unpack('C1N1n1', $msg); | |||||||||
| 27 | 0 | substr $msg, 0, 7, ''; | |||||||||
| 28 | 0 | my @fields; | |||||||||
| 29 | 0 | foreach my $idx (0..$count - 1) { | |||||||||
| 30 | 0 | my ($size) = unpack('N1', substr $msg, 0, 4, ''); | |||||||||
| 31 | 0 | ▶ | if($size == 0xFFFFFFFF) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | push @fields, undef; | |||||||||
| 33 | } else { | ||||||||||
| 34 | 0 | push @fields, substr $msg, 0, $size, ''; | |||||||||
| 35 | } | ||||||||||
| 36 | } | ||||||||||
| 37 | 0 | return $class->new( | |||||||||
| 38 | fields => \@fields | ||||||||||
| 39 | ) | ||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 4 | 1; | |||||||||
| 43 | |||||||||||
| 44 | =head1 AUTHOR | ||||||||||
| 45 | |||||||||||
| 46 | Tom Molesworth <TEAM@cpan.org> | ||||||||||
| 47 | |||||||||||
| 48 | =head1 LICENSE | ||||||||||
| 49 | |||||||||||
| 50 | Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself. | ||||||||||
| 51 | |||||||||||