blib/lib/PMLTQ/Command/initdb.pm

filter: Statementstmt 52.6% 10 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 46.1% 12 / 26 CC 2 SCAR 11.1
CC
2
Cov
48%
run
6.0
__ANON__
1.1
BEGIN
1.0
CRAP 3.0
« blib/lib/PMLTQ/Base.pm ↑ Summary blib/lib/PMLTQ/Command/version.pm »
1 package PMLTQ::Command::initdb;
2 1 our $AUTHORITY = 'cpan:MATY';
3 1 $PMLTQ::Command::initdb::VERSION = '2.0.1';
4 # ABSTRACT: Initialize empty database
5  
6 1 ▶use PMLTQ::Base 'PMLTQ::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use PMLTQ;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶has usage => sub { shift->extract_usage };
Subroutine __ANON__: not called CC=1 SCAR=1.2
10  
11 sub run {
12 0 ▶ my $self = shift;
Subroutine run: not called CC=2 SCAR=17.9
Pod undocumented
13  
14 0 my $config = $self->config;
15 0 my $dbh = $self->sys_db;
16  
17 0 ▶ $dbh->do("CREATE DATABASE \"$config->{db}->{name}\";") or die $dbh->errstr;
Branch: 1 branch
BranchTrueFalseTotal
$dbh->do(qq[CREATE DATABASE "$config->{"db"}{"name"}";]) or die $dbh->errstr 0 0 0
18 0 $dbh->disconnect;
19  
20 0 $dbh = $self->db;
21 0 $self->run_sql_from_file( 'init.sql', File::Spec->catfile( PMLTQ->shared_dir, 'sql' ), $dbh );
22 0 $dbh->disconnect;
23 }
24  
25 =head1 SYNOPSIS
26  
27 pmltq initdb <treebank_config>
28  
29 =head1 DESCRIPTION
30  
31 Initialize empty database.
32  
33 =head1 OPTIONS
34  
35 =head1 PARAMS
36  
37 =over 5
38  
39 =item B<treebank_config>
40  
41 Path to configuration file. If a treebank_config is --, config is readed from STDIN.
42  
43 =back
44  
45 =cut
46  
47 1 1;
« blib/lib/PMLTQ/Base.pm ↑ Summary blib/lib/PMLTQ/Command/version.pm »