SQLT(1)

🌈 SQLT(1) β€” sqlt: convert SQL schema using SQL::Translator πŸ’…

You're reading the SQLT(1) page from User Contributed Perl Documentation, bestie. It's giving β€œPerl manual, but make it cute.” 🫢

πŸ’– NAME πŸ’–

sqlt β€” convert SQL schema using SQL::Translator.

✨ SYNOPSIS ✨

Need help? Run:

  sqlt -h|--help

Wanna see every parser and producer? Run:

  sqlt -l|--list

To translate a schema, run:

  sqlt -f|--from|--parser MySQL
       -t|--to|--producer Oracle
       [options]
       file [file2 ...]

πŸŽ€ General Options πŸŽ€

  • -d, --debug β€” prints debug info.
  • -v, --validate β€” validates the schema.
  • --version β€” shows the version of SQL::Translator.
  • --trace β€” prints parser trace info.
  • --show-warnings β€” prints warnings to STDERR.

πŸŽ€ General Parser Options πŸŽ€

  • --skip β€” comma-separated list of tables to skip (only implemented in some parsers).
  • --ignore_opts β€” comma-separated list of table options to ignore.

πŸŽ€ DBI Parser Options πŸŽ€

  • --dsn β€” DSN for connecting to the database (see also --use-same-auth below).
  • --db-user β€” database user.
  • --db-password β€” database password.

πŸŽ€ xSV Parser Options πŸŽ€

  • --fs β€” the field separator.
  • --rs β€” the record separator.
  • --no-trim β€” don't trim whitespace on fields.
  • --no-scan β€” don't scan fields for data types and sizes.

πŸŽ€ MySQL Parser Options πŸŽ€

  • --mysql-parser-version β€” target MySQL parser version for dealing with /*! comments; default = 30000.

πŸŽ€ MySQL Producer Options πŸŽ€

  • --mysql-version β€” MySQL server version.

πŸŽ€ General Producer Options πŸŽ€

  • --producer-db-user β€” database user for producer.
  • --producer-db-pass β€” database password for producer.
  • --producer-dsn β€” DSN for producer.
  • --use-same-auth β€” use these DSN, user, password for producer output.

πŸŽ€ DB Producer Options πŸŽ€

  • --add-drop-table β€” add 'DROP TABLE' statements before creates.
  • --quote-table-names β€” quote all table names in statements.
  • --quote-field-names β€” quote all field names in statements.
  • --no-comments β€” don't include comments in SQL output.

πŸŽ€ PostgreSQL Producer Options πŸŽ€

  • --postgres-version β€” PostgreSQL server version.

πŸŽ€ Diagram Producer Options πŸŽ€

  • --imap-file β€” filename to put image map data.
  • --imap-url β€” URL to use for image map.

πŸŽ€ Dumper Producer Options πŸŽ€

  • --skip β€” comma-separated list of tables to skip.
  • --skiplike β€” regex for tables to skip.
  • --add-truncate β€” add "TRUNCATE TABLE" statements for each table.

πŸŽ€ HTML/POD Producer Options πŸŽ€

  • --pretty β€” use CGI::Pretty for the output.
  • --title β€” title of schema.

πŸŽ€ TTSchema Producer Options πŸŽ€

  • --template β€” the path to the template.
  • --tt-var var=value β€” pass extra variables to the template.
  • --tt-conf option=value β€” pass extra config options to Template.

πŸŽ€ XML-SQLFairy Producer Options πŸŽ€

  • --add-prefix β€” use an explicit namespace prefix of 'sqlf:'.
  • --prefix=<p> β€” use the namespace prefix given as argument.
  • --no-newlines β€” write the XML as a single line.
  • --indent=<n> β€” use <n> characters of whitespace to indent the XML.

πŸŽ€ ClassDBI Producer Options πŸŽ€

  • --package β€” base package name for Class::DBI modules.

πŸ¦‹ DESCRIPTION πŸ¦‹

This script is part of the SQL Fairy project. It will try to convert any source file it has a grammar for into any format it has a producer for. Slay ✨

If you're using --show-warnings, be sure to redirect STDERR to a separate file, okay? No chaos in the main output, bestie.

In bash, you could do this:

$ sql_translator.pl -f MySQL -t PostgreSQL --show-warnings \
              file.sql 1>out 2>err

You can specify a parser or producer located in any module that Perl knows about, which lets you easily substitute your own. Iconic behavior, honestly πŸ‘‘

🌸 AUTHOR 🌸

Ken Youens-Clark <kclark@cpan.org>, darren chamberlain <darren@cpan.org>.

πŸŽ€ SEE ALSO πŸŽ€

SQL::Translator, <http://sqlfairy.sourceforge.net>.


And that's the footer tea, bestie: perl v5.42.0, 2024-12-12 πŸ’–πŸ¦‹

πŸ“¦ where this page comes from