Hi Jess,

Quite right, darn the documentation for not saying what I want it to
say.  :-)

I'd forgotten that I already solved this problem once before using
filters:

my $translator  = SQL::Translator->new(
  from          => 'PostgreSQL',
  to            => 'TTSchema',
  filename      => [EMAIL PROTECTED],
  producer_args => {
    tt_vars => {
      db_user     => $db_username,
      db_pass     => $db_password,
      db_dsn      => $dsn,
      baseclass   => 'Chado::DBI',
      format_fk   => \&generate_file_y,
      format_node => \&format_table_name,
    },
    ttfile    => "/home/scott/dbi.tt2",
  },
  filters       => [
                   sub {
                     my $schema = shift;
                     foreach (@skip_tables) {
                       $schema->drop_table($_);
                     }
                   },
  ],
);

my $output = $translator->translate or die $translator->error;
print $output;

Thanks,
Scott


On Thu, 2006-12-07 at 14:04 +0000, Jess Robinson wrote:
> 
> On Wed, 6 Dec 2006, Scott Cain wrote:
> 
> > Hello,
> >
> > I am trying to execute this command:
> >
> >  sqlt -f PostgreSQL -t TTSchema --skip gencode_codon_aa --template 
> > ~/dbi.tt2 modules/nofuncs.sql
> >
> > and when I do, I get this message:
> >
> > Error: translate: Error with producer 
> > 'SQL::Translator::Producer::TTSchema': Error processing template 
> > '/home/scott/dbi.tt2': undef error - SQL::Translator::Schema::Graph table 
> > gencode_codon_aa doesn't have a primary key! at 
> > /usr/lib/perl5/site_perl/5.8.8/SQL/Translator/Schema/Graph.pm line 38.
> >
> > So it is ignoring my request to skip the gencode_codon_aa table.  Any
> > ideas why?  I am using the cvs version of sqlt.
> >
> 
> Hi Scott,
> 
> Because you're reading the docs incorrectly ;)
> 
> The --skip arg is only listed underneath the section "Dumper Producer 
> Options", which means only the producer named "Dumper" honours it.
> 
> Feel free to provide a patch to make other parsers/producers also make use 
> of this argument.
> 
> Jess
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-- 
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   [EMAIL PROTECTED]
GMOD Coordinator (http://www.gmod.org/)                     216-392-3087
Cold Spring Harbor Laboratory

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-- 
sqlfairy-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlfairy-developers

Reply via email to