E.1. dia2sql

E.1.1. Description

dia2sql generates sql scripts from native Dia [1] files.

E.1.2. Requirements

In order to use dia2sql, you need:

Technically, you dont have to have Dia, you just need a Dia file to parse. Make sure, to save the dia-files uncompressed.

E.1.3. Usage


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.
        

Notes

[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.