3 SQL::Translator is a group of Perl modules that manipulate structure
4 data definitions (mostly database schemas) in interesting ways, such
5 as converting among different dialects of CREATE syntax (e.g.,
6 MySQL-to-Oracle), visualizations of schemas (pseudo-ER diagrams
7 GraphViz or GD), automatic code generation (using Class::DBI),
8 converting non-RDBMS files to SQL schemas (xSV text files, Excel
9 spreadsheets), serializing parsed schemas (via Storable, YAML and
10 XML), creating documentation (HTML and POD), and more. We also
11 have the ability to talk directly to a database through DBI to
12 query for the structures of several databases.
14 Through the separation of the code into parsers and producers with an
15 object model in between, it's possible to combine any parser with any
16 producer, to plug in custom parsers or producers, or to manipulate the
17 parsed data via the built-in object model. Presently only the
18 definition parts of SQL are handled (CREATE, ALTER), not the
19 manipulation of data (INSERT, UPDATE, DELETE).
21 As of version 0.10, parsers exist for the following:
42 xSV : arbitrarily delimited text files
43 Excel : Microsoft Excel spreadsheets
44 XML-SQLFairy : SQLFairy's XML format
45 YAML/Storable: Serialized schema objects
47 And the following producers exist:
60 ClassDBI : Class::DBI classes
61 Dumper : create a "mysqldump"-like dumper for database
62 DBIx-Class : see the DBIx::Class distribution
65 Diagram : quasi-ER diagrams using libgd
66 GraphViz : ER diagrams using GraphViz
67 HTML : HTML documentation of schema
68 POD : Plain Old Documenation of schema
69 Latex : self-explanatory
73 Storable : using Perl's Storable module
75 XML-SQLFairy : structure of the schema described in SQLFairy's XML
78 TTSchema : to any text format via Template Toolkit
80 Included in this distribution are a few scripts designed to be user
81 interfaces for the actual SQL::Translator modules. In the "bin"
82 directory, you will find:
84 * sqlt : command-line interface for text-to-text translations
85 * sqlt-diagram : interface to Diagram producer
86 * sqlt-diff : diff two schemas to generate schema mutation file
87 * sqlt-graph : interface to GraphViz producer
88 * sqlt-dumper : create a data dumper script from a schema
89 * sqlt.cgi : CGI interface for all SQLFairy functions
91 All scripts not ending in ".cgi" are meant to be run from the command
92 line with various switches to control the input and output of the
93 scripts, while the ".cgi" script is a web-form frontend. The script
94 you'll probably find most useful is "sqlt" which is meant to be the
95 main interface for translating from text-to-text. The graphic
96 producers, however, have many extra switches, so there are scripts
97 specific for each of the the GraphViz and ER-diagram producers. All
98 scripts start with "sqlt" so it will be easier to identify them on
99 your system. All the non-CGI scripts will be installed in a system
100 path when you "make install," but you'll have to manually place the
101 CGI script into your web CGI directory to use it.
103 If you're more interested in using the SQL::Translator modules
104 directly, then you might be more interested to examine some of the
105 test scripts in the "t" directory. The test suite is relatively
106 thorough and should give you an idea of how to parse a file and
107 manipulate the SQL::Translator::Schema objects.
119 $ perldoc SQL::Translator::Manual
123 This program is free software; you can redistribute it and/or modify it
124 under the terms of the GNU General Public License as published by the
125 Free Software Foundation; version 2.
127 This program is distributed in the hope that it will be useful, but
128 WITHOUT ANY WARRANTY; without even the implied warranty of
129 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
130 Public License for more details.
132 You should have received a copy of the GNU General Public License along
133 with this program; if not, write to the Free Software Foundation, Inc.,
134 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
138 Please use http://rt.cpan.org/ for reporting bugs.
142 If you find this module useful, please use
143 "http://cpanratings.perl.org/rate/?distribution=SQL-Translator" to rate it.
147 Check out the SQLFairy homepage at Sourceforge for more information,
150 http://sqlfairy.sourceforge.net/
154 See the included AUTHORS file.