From: Ken Youens-Clark Date: Wed, 31 Mar 2004 03:25:00 +0000 (+0000) Subject: Added section on Dumper producer. X-Git-Tag: v0.06~103 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21521f167cb6576b81bf650f8033f8902a9f37d4;p=dbsrgits%2FSQL-Translator.git Added section on Dumper producer. --- diff --git a/lib/SQL/Translator/Manual.pod b/lib/SQL/Translator/Manual.pod index 82ceea0..1fa610c 100644 --- a/lib/SQL/Translator/Manual.pod +++ b/lib/SQL/Translator/Manual.pod @@ -232,6 +232,25 @@ interact with the database. Here is an example of how to do this: Then simply edit Foo.pm as needed and include it in your code. +=head1 CREATING A DATA DUMPER SCRIPT + +The Dumper producer creates a Perl script that can select the fields +in each table and then create "INSERT" statements for each record in +the database similar to the output generated by MySQL's "mysqldump" +program: + + $ sqlt -f YAML -t Dumper --dumper-db-user guest \ + > --dumper-db-pass p4ssw0rd --dumper-dsn dbi:mysql:FOO \ + > foo.yaml > foo-dumper.pl + +And then execute the resulting script to dump the data: + + $ chmod +x foo-dumper.pl + $ ./foo-dumper.pl > foo-data.sql + +The dumper script also has a number of options available. Execute the +script with the "--help" flag to read about them. + =head1 DOCUMENTING WITH SQL::TRANSLATOR SQLFairy offers two producers to help document schemas: