SQL::Translator

Manipulate structured data definitions (SQL and more)
Download

SQL::Translator Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Arthur Axel Schmidt
  • Publisher web site:
  • http://search.cpan.org/~frew/

SQL::Translator Tags


SQL::Translator Description

This documentation covers the API for SQL::Translator. For a more general discussion of how to use the modules and scripts, please see SQL::Translator::Manual.SQL::Translator is a group of Perl classes that converts vendor-specific SQL table definitions into other formats, such as other vendor-specific SQL, ER diagrams, documentation (POD and HTML), XML, and Class::DBI classes. The main focus of SQL::Translator is SQL, but parsers exist for other structured data formats, including Excel spreadsheets and arbitrarily delimited text files. Through the separation of the code into parsers and producers with an object model in between, it's possible to combine any parser with any producer, to plug in custom parsers or producers, or to manipulate the parsed data via the built-in object model. Presently only the definition parts of SQL are handled (CREATE, ALTER), not the manipulation of data (INSERT, UPDATE, DELETE).SYNOPSIS use SQL::Translator; my $translator = SQL::Translator->new( # Print debug info debug => 1, # Print Parse::RecDescent trace trace => 0, # Don't include comments in output no_comments => 0, # Print name mutations, conflicts show_warnings => 0, # Add "drop table" statements add_drop_table => 1, # to quote or not to quote, thats the question quote_identifiers => 1, # Validate schema object validate => 1, # Make all table names CAPS in producers which support this option format_table_name => sub {my $tablename = shift; return uc($tablename)}, # Null-op formatting, only here for documentation's sake format_package_name => sub {return shift}, format_fk_name => sub {return shift}, format_pk_name => sub {return shift}, ); my $output = $translator->translate( from => 'MySQL', to => 'Oracle', # Or an arrayref of filenames, i.e. filename => $file, ) or die $translator->error; print $output;Product's homepage


SQL::Translator Related Software