« blib/lib/auto/share/dist/Cmd-Dwarf/app/lib/Dwarf/Validator/Upload.pm
↑ Summary
blib/lib/auto/share/dist/Cmd-Dwarf/app/lib/App/Controller/Api/ShowSession.pm »
| 1 | package App::Controller::Cli::LoadSchema; | ||
| 2 | use Dwarf::Pragma; | ||
| 3 | use parent 'App::Controller::CliBase'; | ||
| 4 | use Dwarf::DSL; | ||
| 5 | use DBI; | ||
| 6 | use App::DB::Schema::Dumper; | ||
| 7 | |||
| 8 | sub any { | ||
| 9 | # コマンドラインからしか呼び出せない | ||
| 10 | not_found if not is_cli; | ||
| 11 | |||
| 12 | my $connect_info = conf('db'); | ||
| 13 | my $dbh = DBI->connect( | ||
| 14 | $connect_info->{master}->{dsn}, | ||
| 15 | $connect_info->{master}->{username}, | ||
| 16 | $connect_info->{master}->{password}, | ||
| 17 | $connect_info->{master}->{opts}, | ||
| 18 | ) or die; | ||
| 19 | |||
| 20 | print App::DB::Schema::Dumper->dump( | ||
| 21 | dbh => $dbh, | ||
| 22 | namespace => c->namespace . '::DB', | ||
| 23 | base_row_class => c->namespace . '::DB::Row', | ||
| 24 | dt_rules => qr/--------------$/, | ||
| 25 | ); | ||
| 26 | |||
| 27 | return; | ||
| 28 | } | ||
| 29 | |||
| 30 | 1; | ||
| 31 |