line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
415
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::Plugin::Database::CsvProvider; |
5
|
|
|
|
|
|
|
$Footprintless::Plugin::Database::CsvProvider::VERSION = '1.06'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A CSV file provider implementation |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::Plugin::Database::CsvProvider |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
4
|
use parent qw(Footprintless::Plugin::Database::AbstractProvider); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
66
|
use overload q{""} => 'to_string', fallback => 1; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
55
|
use Footprintless::Util qw(dynamic_module_new); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
14
|
1
|
|
|
1
|
|
6
|
use Log::Any; |
|
1
|
|
|
|
|
2
|
|
|
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
|
|
31
|
my ($self) = @_; |
24
|
20
|
|
|
|
|
47
|
my ( $hostname, $port ) = $self->_hostname_port(); |
25
|
|
|
|
|
|
|
return |
26
|
20
|
|
|
|
|
91
|
join( '', 'DBI:CSV:', 'f_dir=', $self->{f_dir}, ';', 'csv_eol=', $self->{csv_eol}, ';' ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub _init { |
30
|
7
|
|
|
7
|
|
222
|
my ( $self, %options ) = @_; |
31
|
7
|
|
|
|
|
35
|
$self->Footprintless::Plugin::Database::AbstractProvider::_init(%options); |
32
|
|
|
|
|
|
|
|
33
|
7
|
|
|
|
|
16
|
my $entity = $self->_entity( $self->{coordinate} ); |
34
|
|
|
|
|
|
|
|
35
|
7
|
|
|
|
|
119
|
$self->{f_dir} = $entity->{f_dir}; |
36
|
7
|
|
50
|
|
|
24
|
$self->{csv_eol} = $entity->{csv_eol} || "\n"; |
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
63
|
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
|
565
|
my ($self) = @_; |
47
|
15
|
|
|
|
|
35
|
return $self->_connection_string(); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |