It would be useful to be able to get a handle on the intermediate
SQL::Translator schema object created during the call to deploy(), e.g.
to add custom indices or set specific table attributes.

The guts of DBIx::Class::Storage::DBI::deploy() is implemented in
deployment_statements() and the bit relevant to deployment via
SQL::Translator looks like:

  my $tr = SQL::Translator->new(%$sqltargs);
  SQL::Translator::Parser::DBIx::Class::parse( $tr, $schema );
  return "SQL::Translator::Producer::${type}"->can('produce')->($tr);

which could be changed to:

  my $tr = SQL::Translator->new(%$sqltargs);
  SQL::Translator::Parser::DBIx::Class::parse( $tr, $schema );
  $sqlt_callback->($tr) if $sqlt_callback;
  return "SQL::Translator::Producer::${type}"->can('produce')->($tr);

where sqlt_callback can be pulled from the existing SQL::Translator args
hash (%sqltargs) parameter; the 'sources' key in sqltargs is also a non-
standard arg so there's a precedent there.

Any comments or suggestions of a better way?

-- 

Jon

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to