| The Standard Mp3 Database Project - Documentation | ||
|---|---|---|
| Prev | Appendix E. Utility Programs | |
dia2sql generates sql scripts from native Dia [1] files.
In order to use dia2sql, you need:
Perl: any version greater 5.00x will work.
The expat library, you can find it here: http://www.jclark.com/xml/expat.html
XML::Parser from CPAN, you can install it via the CPAN shell (at least on *nix systems you can :)
dia2sql.pl v1.2 smdp-pl7 - \$Revision: 1.2 $
original author: 2001 by Alexander Troppmann
heavily patched by the SMDP-Group
Usage: dia2sql.pl [options] infile.dia [outfile.sql]
Options may be:
-h print this help.
--mysql create SQL for mysql
--postgresql create SQL for postgresql
--mssql create SQL for ms-sql-server
--debug enter debug-mode
--with-comments write comments
--with-create write create statements for tables
--with-html-output writes print-statements with html-stuff
into sql-script. Only useful for
database-parsers that will display that
like isql.exe from MS-SQL Server.
--absolute-clean write drop/create statements for the
database and all tables. use it wisely!
--create-indices create indeces (postgres-only)
--convert convert datatypes to fit target db
--database=<database>
name of the database to be used for the
create-statement if not given, defaults
to smdp.
--datatype=<file> file needs to hold the mapping of the
datatypes. (defaults to datatypes.txt)
--input=<input-type> Datatypes in input belong to
<input-type>.
valid values: mysql (for mysql)
mssql (for ms-sql)
pgsql (for postgresql)
Converts xml data input from Dia to sql statements. If outfile.sql is not
specified the sql statements will be printed to STDOUT.
Edit dia2sql.pl and change the configuration at top of the Perl script.
Make sure you have defined the right database (MySQL or PostgreSQL) for
SQL output.
|
| [1] | Dia is a gtk+ based diagram creation program released under the GPL license. See http://www.lysator.liu.se/~alla/dia/ for more information. |