block-quote On this pagechevron-down
copy Copy chevron-down
bullseye-arrow Target SQL scriptsSpecific rules If your database is not part of the predefined databases, or if the generated SQL does not match your needs, you can define your own SQL generation rules.
To do this, you just need to create a file containing the conversion rules .
The rules file can be specified in the template files (.vm) using the following directive:
Copy #set ( $env.databaseConvFile = $myOwnFile ) Examples:
Copy #set ( $env.databaseConvFile = $fn.fileFromBundle('mydb.properties') )
#set ( $env.databaseConvFile = $fn.fileFromModel('mydb.properties') ) Defining specific conversion rules in a file
A specific rules file is a text file (properties file) containing 2 parts:
Naming conventions (prefix "conv.")
Type conversion (prefix "type.")
1) Naming conventions:
You can set the naming convention to be applied for tables , columns , primary keys and foreign keys .
There are 4 naming standards (choose one of these):
Examples:
2) Type conversion:
This part defines how to convert a neutral type (Telosys model type) to an SQL type (in the database).
Syntax:
Left side:
the neutral type with "type." prefix and optionally the ".autoincr" suffix
if used for autoincremented attribute
Right side:
any string to be used as the SQL type for this neutral type
with placeholders for "size " and "precision ":
"(%p) " : precision (optional)
"(%P) " : precision mandatory
See type size and precision for more information
Examples: