Likewise I couldn't get sqlt to work with DBIx::Class; it doesn't seem
to be set up to take the DBIx::Class options.  But you can achieve the
same end like this:

use SQL::Translator;

my $translator = SQL::Translator->new(
                                      debug => 0,
                                      trace => 0,
                                      parser => 
'SQL::Translator::Parser::DBIx::Class',
                                      parser_args => { 'DBIx::Schema' => 
'Your::Schema' },
                                      to => 'MySQL',
                                      );
my $output = $translator->translate();
print STDERR $translator->error unless $output;
print $output;


On Mon, 2006-12-25 at 07:21 -0800, Octavian Rasnita wrote:

> But I have another question about using the DBIx::Class, or better said 
> about SQL::Translator...
> 
> I have read in the POD docs that an .sql file can be created from a 
> DBIx::Class schema, and I have tried doing this in more ways, but without 
> success. If you know the syntax of the command line, can you please tell me?
> 
> I have tried:
> 
> sqlt --from DBIx::Class --to MySQL Schema.pm > mysql.sql
> 
> It gives an error telling that there is no subroutine DBIx::Class::Parser.
> 
> Thank you.
> 
> Octavian
> 


_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to