ZSQL allows you to define your database once, for all platforms. The XML structure is substantially richer than the platform native SQL script, with implicit type safety and embedded documentation. Using ZSQL and the provided transformations substantially promotes reuse, especially if you need to support multiple database vendors.
ZSQL currently supports PostgreSQL 7.1(+). If you wish to port the script transformer to support another database format, your efforts will be appreciated. Please see the ZSQL project homepage for details.
To generate an SQL script from the command console (Windows NT), run the following command:
java org.apache.xalan.xslt.Process -IN {zsql_file}.xml -XSL zsql_script(pgsql).xslt >{output}.sql
replace {zsql_file}.xml with the name of your database definition file and {output}.sql with the name
of the output file
Yes - most of the important structural elements, including tables, views, columns, etc. support a build attribute that can be later matched to a build parameter passed to the stylesheet processor.
For example:
<zsql:table build="testing"> ... </zsql:table>will only process the table if a build parameter with content 'testing' is passed to the XSLT processor. For Xalan, this parameter is specified adding
-PARAM build testing
to the command-line.