Import Mappings Dialog

The import mappings dialog allows users to create import mappings when importing a schema from another database. The user can open this dialog using the File->Import Mappings menu item.

Shown below is an example of the import mappings dialog :


Import Mappings Dialog

 

Goat comes with pre-built definitions for import-mappings, but they can be customized as needed. The column on the left contains the java.sql.Types supported by Goat for exporting/importing data across different databases. The first column is the "default" database whose mappings are used when an import mapping is not specified for the given database.

You can edit the import mappings for each database by double clicking on the mapping. Import Mappings follow a specific syntax. For example, for the type java.sql.BINARY, the import mapping for the database "mysql" is defined as binary(n). This indicates that during a schema import from a schema file (*.schema) when the BINARY type is encountered for a column, goat will use binary as the column type when generating sql for the table. The (n) indicates that size of the column is required when creating the column definition, and it will use the size defined in the schema. For some types, size may not be necessary [in postgresql for example, the equivalent is the bytea type without a size requirement] If the column definition requires a decimal precision, you can use (n,n) as the syntax for the column type.

You can also add or remove import mappings for your own database by clicking the "Add Database" or "Remove Database" buttons.

 

Add Database

Add Database

 

You can add your own database to the list of import mappings. Each new database must have a unique name, and it's name must match the database product name as shown in the Database Properties dialog. The name does not have to be case sensitive.