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