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