X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=script%2Fdbicdump;h=2fdae37eeed98b91b9c741f8ba091d0a5bd45801;hb=464bbc0a452a828139ac03859b2d777525b8bfea;hp=c1d14f590c9183534c87a113cc21348089ad9a15;hpb=ca12f6c9ea89282afe711aa4ec543630feb4a1ae;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/script/dbicdump b/script/dbicdump index c1d14f5..2fdae37 100644 --- a/script/dbicdump +++ b/script/dbicdump @@ -1,19 +1,76 @@ #!/usr/bin/perl +=encoding UTF-8 + =head1 NAME dbicdump - Dump a schema using DBIx::Class::Schema::Loader =head1 SYNOPSIS - dbicdump [-o = ] + dbicdump + dbicdump [-I ] [-o = ] \ + + +Examples: + + $ dbicdump schema.conf + + $ dbicdump -o dump_directory=./lib \ + -o components='["InflateColumn::DateTime"]' \ + MyApp::Schema dbi:SQLite:./foo.db + + $ dbicdump -o dump_directory=./lib \ + -o components='["InflateColumn::DateTime"]' \ + MyApp::Schema dbi:SQLite:./foo.db '{ quote_char => "\"" }' + + $ dbicdump -Ilib -o dump_directory=./lib \ + -o components='["InflateColumn::DateTime"]' \ + -o preserve_case=1 \ + MyApp::Schema dbi:mysql:database=foo user pass '{ quote_char => "`" }' + + $ dbicdump -o dump_directory=./lib \ + -o components='["InflateColumn::DateTime"]' \ + MyApp::Schema 'dbi:mysql:database=foo;host=domain.tld;port=3306' user pass + +On Windows that would be: + + $ dbicdump -o dump_directory=.\lib ^ + -o components="[q{InflateColumn::DateTime}]" ^ + -o preserve_case=1 ^ + MyApp::Schema dbi:mysql:database=foo user pass "{ quote_char => q{`} }" + +Configuration files must have schema_class and connect_info sections, +an example of a general config file is as follows: + + schema_class MyApp::Schema + + lib /extra/perl/libs + + # connection string + + dsn dbi:mysql:example + user root + pass secret + + + # dbic loader options + + dump_directory ./lib + components InflateColumn::DateTime + components TimeStamp + + +Using a config file requires L installed. + +The optional C key is equivalent to the C<-I> option. =head1 DESCRIPTION Dbicdump generates a L schema using L and dumps it to disk. -You can pass any L constructor option using +You can pass any L constructor option using C<< -o