| 1 | package PMLTQ::Command::initdb; | ||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:MATY'; | |||||||||
| 3 | 1 | $PMLTQ::Command::initdb::VERSION = '2.0.3'; | |||||||||
| 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::Commands; | ||||||||
|
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 | |||||||||||
| 12 | 0 | ▶ | sub run { | ||||||||
|
Subroutine
run: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 13 | 0 | my $self = shift; | |||||||||
| 14 | |||||||||||
| 15 | 0 | my $config = $self->config; | |||||||||
| 16 | 0 | my $dbh = $self->sys_db; | |||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | $dbh->do("CREATE DATABASE \"$config->{db}->{name}\";") or die $dbh->errstr; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | $dbh->disconnect; | |||||||||
| 20 | |||||||||||
| 21 | 0 | $dbh = $self->db; | |||||||||
| 22 | 0 | $self->run_sql_from_file( 'init.sql', File::Spec->catfile( PMLTQ::Commands::shared_dir(), 'sql' ), $dbh ); | |||||||||
| 23 | 0 | $dbh->disconnect; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | =head1 SYNOPSIS | ||||||||||
| 27 | |||||||||||
| 28 | pmltq initdb <treebank_config> | ||||||||||
| 29 | |||||||||||
| 30 | =head1 DESCRIPTION | ||||||||||
| 31 | |||||||||||
| 32 | Initialize empty database. | ||||||||||
| 33 | |||||||||||
| 34 | =head1 OPTIONS | ||||||||||
| 35 | |||||||||||
| 36 | =head1 PARAMS | ||||||||||
| 37 | |||||||||||
| 38 | =over 5 | ||||||||||
| 39 | |||||||||||
| 40 | =item B<treebank_config> | ||||||||||
| 41 | |||||||||||
| 42 | Path to configuration file. If a treebank_config is --, config is readed from STDIN. | ||||||||||
| 43 | |||||||||||
| 44 | =back | ||||||||||
| 45 | |||||||||||
| 46 | =cut | ||||||||||
| 47 | |||||||||||
| 48 | 1 | 1; | |||||||||