The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Schema::Data - Base class for schema-data script.

SYNOPSIS

 use App::Schema::Data;

 my $app = App::Schema::Data->new;
 my $exit_code = $app->run;

METHODS

new

 my $app = App::Schema::Data->new;

Constructor.

Returns instance of object.

run

 my $exit_code = $app->run;

Run.

Returns 1 for error, 0 for success.

ERRORS

 run():
         Cannot connect to Schema database.
                 Error: %s
         Cannot load Schema data module.
                 Module name: %s
                 Error: %s
         Schema data module must be a 'Schema::Data::Data' instance.

EXAMPLE

 # Need to deploy sqlite.db via schema-deploy dbi:SQLite:dbname=sqlite.db Schema::Commons::Vote

 use strict;
 use warnings;

 use App::Schema::Data;

 # Arguments.
 @ARGV = (
         'dbi:SQLite:dbname=sqlite.db',
         'Schema::Data::Commons::Vote',
         'creator_name=Michal Josef Špaček',
         'creator_email=michal.josef.spacek@wikimedia.cz',
 );

 # Run.
 exit App::Schema::Data->new->run;

 # Output like:
 # Schema data (v0.1.0) from 'Schema::Data::Commons::Vote' was inserted to 'dbi:SQLite:dbname=sqlite.db'.

DEPENDENCIES

English, Error::Pure, Getopt::Std, Unicode::UTF8.

REPOSITORY

https://github.com/michal-josef-spacek/App-Schema-Data

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2022 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.05