line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
415
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
2
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::Plugin::Database::CsvProvider; |
5
|
|
|
|
|
|
|
$Footprintless::Plugin::Database::CsvProvider::VERSION = '1.00'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A CSV file provider implementation |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::Plugin::Database::CsvProvider |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
3
|
use parent qw(Footprintless::Plugin::Database::AbstractProvider); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
51
|
use overload q{""} => 'to_string', fallback => 1; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
51
|
use Footprintless::Util qw(dynamic_module_new); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
14
|
1
|
|
|
1
|
|
2
|
use Log::Any; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $logger = Log::Any->get_logger(); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub backup { |
19
|
0
|
|
|
0
|
1
|
0
|
die("not yet implemented"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _connection_string { |
23
|
20
|
|
|
20
|
|
18
|
my ($self) = @_; |
24
|
20
|
|
|
|
|
45
|
my ( $hostname, $port ) = $self->_hostname_port(); |
25
|
|
|
|
|
|
|
return |
26
|
20
|
|
|
|
|
63
|
join( '', 'DBI:CSV:', 'f_dir=', $self->{f_dir}, ';', 'csv_eol=', $self->{csv_eol}, ';' ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _init { |
30
|
7
|
|
|
7
|
|
182
|
my ( $self, %options ) = @_; |
31
|
7
|
|
|
|
|
34
|
$self->Footprintless::Plugin::Database::AbstractProvider::_init(%options); |
32
|
|
|
|
|
|
|
|
33
|
7
|
|
|
|
|
15
|
my $entity = $self->_entity( $self->{coordinate} ); |
34
|
|
|
|
|
|
|
|
35
|
7
|
|
|
|
|
84
|
$self->{f_dir} = $entity->{f_dir}; |
36
|
7
|
|
50
|
|
|
32
|
$self->{csv_eol} = $entity->{csv_eol} || "\n"; |
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
50
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub restore { |
42
|
0
|
|
|
0
|
1
|
0
|
die("not yet implemented"); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub to_string { |
46
|
15
|
|
|
15
|
0
|
398
|
my ($self) = @_; |
47
|
15
|
|
|
|
|
29
|
return $self->_connection_string(); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |