| 1 | package Protocol::Database::PostgreSQL::Backend::RowDescription; | ||||||||||
| 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::RowDescription | ||||||||||
| 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 description { shift->{description} } | ||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 21 | |||||||||||
| 22 | sub new_from_message { | ||||||||||
| 23 | 0 | ▶ | my ($class, $msg) = @_; | ||||||||
|
Subroutine
new_from_message: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 24 | 0 | my (undef, undef, $count) = unpack('C1N1n1', $msg); | |||||||||
| 25 | 0 | substr $msg, 0, 7, ''; | |||||||||
| 26 | 0 | my @desc; | |||||||||
| 27 | 0 | foreach my $id (0..$count-1) { | |||||||||
| 28 | 0 | my ($name, $table_id, $field_id, $data_type, $data_size, $type_modifier, $format_code) = unpack('Z*N1n1N1n1N1n1', $msg); | |||||||||
| 29 | 0 | my %data = ( | |||||||||
| 30 | name => $name, | ||||||||||
| 31 | table_id => $table_id, | ||||||||||
| 32 | field_id => $field_id, | ||||||||||
| 33 | data_type => $data_type, | ||||||||||
| 34 | data_size => $data_size, | ||||||||||
| 35 | type_modifier => $type_modifier, | ||||||||||
| 36 | format_code => $format_code | ||||||||||
| 37 | ); | ||||||||||
| 38 | 0 | ▶ | if($log->is_debug) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | $log->tracef('%s => %s', $_, $data{$_}) for sort keys %data; | |||||||||
| 40 | } | ||||||||||
| 41 | 0 | push @desc, \%data; | |||||||||
| 42 | 0 | substr $msg, 0, 19 + length($name), ''; | |||||||||
| 43 | } | ||||||||||
| 44 | 0 | return $class->new( | |||||||||
| 45 | description => \@desc | ||||||||||
| 46 | ); | ||||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | 4 | 1; | |||||||||
| 50 | |||||||||||
| 51 | =head1 AUTHOR | ||||||||||
| 52 | |||||||||||
| 53 | Tom Molesworth <TEAM@cpan.org> | ||||||||||
| 54 | |||||||||||
| 55 | =head1 LICENSE | ||||||||||
| 56 | |||||||||||
| 57 | Copyright Tom Molesworth 2010-2019. Licensed under the same terms as Perl itself. | ||||||||||
| 58 | |||||||||||