Commit | Line | Data |
c047df29 |
1 | SQL::Translator README |
2 | |
a9dcf25b |
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 |
c4bf7f53 |
10 | XML), creating documentation (HTML and POD), and more. We also |
11 | have the ability to talk directly to a database through DBI to |
a9dcf25b |
12 | query for the structures of several databases. |
13 | |
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). |
c047df29 |
20 | |
11ad2df9 |
21 | As of version 0.06, parsers exist for the following: |
c047df29 |
22 | |
68186ea5 |
23 | Databases: |
24 | MySQL |
25 | Oracle |
26 | PostgreSQL |
a9dcf25b |
27 | SQLite |
6f20f0e3 |
28 | Sybase |
a9dcf25b |
29 | |
11ad2df9 |
30 | DBI-MySQL |
31 | DBI-PostgreSQL |
32 | DBI-SQLite |
33 | DBI-Sybase |
34 | |
68186ea5 |
35 | Other: |
a9dcf25b |
36 | xSV : arbitrarily delimited text files |
37 | Excel : Microsoft Excel spreadsheets |
38 | XML-SQLFairy : SQLFairy's XML format |
6a86d615 |
39 | YAML/Storable: Serialized schema objects |
c047df29 |
40 | |
41 | And the following producers exist: |
42 | |
68186ea5 |
43 | Databases: |
44 | MySQL |
45 | Oracle |
46 | PostgreSQL |
47 | SQLite |
48 | Sybase |
68186ea5 |
49 | |
50 | Code Generators: |
a9dcf25b |
51 | ClassDBI : Class::DBI classes |
68186ea5 |
52 | |
53 | Documentation: |
a9dcf25b |
54 | Diagram : quasi-ER diagrams using libgd |
55 | GraphViz : ER diagrams using GraphViz |
56 | HTML : HTML documentation of schema |
57 | POD : Plain Old Documenation of schema |
58 | |
59 | Serialization: |
60 | Storable : using Perl's Storable module |
61 | YAML : YAML format |
62 | XML-SQLFairy : structure of the schema described in SQLFairy's XML |
68186ea5 |
63 | |
64 | Other: |
a9dcf25b |
65 | TTSchema : to any text format via Template Toolkit |
c047df29 |
66 | |
c047df29 |
67 | Included in this distribution are a few scripts designed to be user |
68 | interfaces for the actual SQL::Translator modules. In the "bin" |
69 | directory, you will find: |
70 | |
11ad2df9 |
71 | * sqlt-diagram: interface to Diagram producer |
72 | * sqlt-diff : diff two schemas to generate schema mutation file |
73 | * sqlt-graph : interface to GraphViz producer |
74 | * sqlt-dumper : create a data dumper script from a schema |
75 | * sqlt : command-line interface for text-to-text translations |
76 | * sqlt.cgi : CGI interface for all SQLFairy functions |
67bb95f1 |
77 | |
78 | All scripts not ending in ".cgi" are meant to be run from the command |
79 | line with various switches to control the input and output of the |
80 | scripts, while the ".cgi" script is a web-form frontend. The script |
81 | you'll probably find most useful is "sqlt" which is meant to be the |
82 | main interface for translating from text-to-text. The graphic |
83 | producers, however, have many extra switches, so there are scripts |
84 | specific for each of the the GraphViz and ER-diagram producers. All |
85 | scripts start with "sqlt" so it will be easier to identify them on |
86 | your system. All the non-CGI scripts will be installed in a system |
87 | path when you "make install," but you'll have to manually place the |
88 | CGI script into your web CGI directory to use it. |
c047df29 |
89 | |
90 | If you're more interested in using the SQL::Translator modules |
91 | directly, then you might be more interested to examine some of the |
68186ea5 |
92 | test scripts in the "t" directory. The test suite is relatively |
93 | thorough and should give you an idea of how to parse a file and |
94 | manipulate the SQL::Translator::Schema objects. |
46d3d648 |
95 | |
6e220350 |
96 | INSTALLATION |
97 | |
11ad2df9 |
98 | $ perl Build.PL |
99 | $ ./Build |
100 | $ ./Build test |
101 | $ su |
102 | # ./Build install |
c4bf7f53 |
103 | |
104 | MANUAL |
105 | |
106 | To read the manual: |
107 | |
108 | $ perldoc SQL::Translator::Manual |
6e220350 |
109 | |
44659089 |
110 | COPYRIGHT |
46d3d648 |
111 | |
c047df29 |
112 | This program is free software; you can redistribute it and/or modify it |
113 | under the terms of the GNU General Public License as published by the |
114 | Free Software Foundation; version 2. |
46d3d648 |
115 | |
c047df29 |
116 | This program is distributed in the hope that it will be useful, but |
117 | WITHOUT ANY WARRANTY; without even the implied warranty of |
118 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
119 | Public License for more details. |
46d3d648 |
120 | |
c047df29 |
121 | You should have received a copy of the GNU General Public License along |
122 | with this program; if not, write to the Free Software Foundation, Inc., |
123 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2e1b1775 |
124 | |
44659089 |
125 | BUGS |
126 | |
127 | Please use http://rt.cpan.org/ for reporting bugs. |
128 | |
129 | PRAISE |
130 | |
131 | If you find this module useful, please use |
132 | "http://cpanratings.perl.org/rate/?distribution=SQL-Translator" to rate it. |
133 | |
e784dbe4 |
134 | SEE ALSO |
135 | |
136 | Check out the SQLFairy homepage at Sourceforge for more information, |
137 | mailing lists, etc.: |
138 | |
139 | http://sqlfairy.sourceforge.net/ |
44659089 |
140 | |
141 | AUTHORS |
142 | |
143 | See the included AUTHORS file. |