App-DBCritic

 view release on metacpan or  search on metacpan

bin/dbcritic  view on Meta::CPAN

#!/usr/bin/env perl

package main;
use Modern::Perl '2011';    ## no critic (Modules::ProhibitUseQuotedVersion)
use utf8;

our $VERSION = '0.023';     # VERSION
use Getopt::Long::Descriptive;
use App::DBCritic;

my ( $opt, $usage ) = describe_options(
    '%c %o',
    [ 'dsn|d=s'           => 'DBI data source name' ],
    [ 'username|user|u:s' => 'name of user to use to connect to database' ],
    [ 'password|pass|p:s' => 'password for connecting to database' ],
    [   'class_name|class|c:s' =>
            'DBIx::Class::Schema to use rather than generating one',
    ],
    [ 'help|h' => 'print usage message and exit' ],
);

if ( $opt->help ) {
    print $usage->text;
    exit;
}

my $critic = App::DBCritic->new(
    map  { $_ => $opt->$_ }
    grep { defined $opt->$_ } qw(dsn username password class_name),
);
$critic->critique();

# PODNAME: dbcritic
# ABSTRACT: Critique a database schema for best practices

__END__

=pod

=encoding UTF-8

=for :stopwords Mark Gardner cpan testmatrix url annocpan anno bugtracker rt cpants
kwalitee diff irc mailto metadata placeholders metacpan

=head1 NAME

dbcritic - Critique a database schema for best practices

=head1 VERSION

version 0.023

=head1 USAGE

    dbcritic --help
    dbcritic --dsn dbi:Oracle:HR --username scott --password tiger
    dbcritic --class_name My::Schema --dsn dbi:mysql:database=db --username perl --password pass

=head1 DESCRIPTION

This is the command line interface to L<App::DBCritic|App::DBCritic>,
a utility for scanning a database schema for violations of best practices.

=head1 CONFIGURATION



( run in 1.103 second using v1.01-cache-2.11-cpan-97f6503c9c8 )