schema-dumper: autogenerate schema packages with DBIx::Class::Schema::Loader

This is a bit rudimentary (and rough with poor feedback) but it’s a nice stub.

Update: 25 March 2009 · I don’t recommend this right now. It’s okay but there is a really nice way to integrate it into your apps which I’ll post one of these days.

use strict;
use warnings;
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
use Getopt::Long;
use Pod::Usage;

#  Program proper

pod2usage(2) unless @ARGV;

my %config;

           "name=s"     => \$config{name},
           "dir=s"      => \$config{dir},
           "dsn=s"      => \$config{dsn},
           "user=s"     => \$config{user},
           "password=s" => \$config{password},
           "debug"      => \$config{debug},
           "help"       => sub { pod2usage(1) },
           ) or pod2usage(2);

#use Data::Dumper; die Dumper \%config;

               { debug => $config{debug} || 0,
                 dump_directory => $config{dir} },
               [ $config{dsn},

exit 0;

#  Subroutines

To handle?

=head1 NAME

schema-maker -- Generate schema packages with L<DBIx::Class::Schema::Loader>.


 schema-dumper [options]


         The class name for your schema.

         The location to write the files.

         The DSN, DB connection string.

         Passed to DBIx::Class::Schema::Loader.

         Passed to DBIx::Class::Schema::Loader.

         Passed to DBIx::Class::Schema::Loader.

         Print this message.

=head2 EXAMPLE

# should be here

=head1 SEE ALSO

L<DBIx::Class>, L<DBIx::Class::Schema::Loader>,

digg stumbleupon reddit Fark Technorati Faves