SQL Reverse Engineering

Top Previous Next

You can reverse engineer an SQL script. This means that you can extract tables, attributes, relationships, indexes and other objects. It is possible with the SQL Reverse Engineering tool, which parses an SQL Script using internal parser fully compatible with PostgreSQL standards.

To reverse engineer a script:

1. Select File | Reverse Engineer | SQL Script... menu item.

2. If the currently opened diagram already contains some objects, the following dialog box will appear:


It requests you to create a new diagram to place the reversed objects into it, or use the currently opened diagram. Click Yes to create a new diagram, No to use the currently opened diagram, or Cancel to cancel reverse engineering. Select Do not show this dialog again to disable future notifications.

3. The SQL Reverse Engineering dialog will be shown. First, you should provide options needed for desired behavior of the parser in the Options tab.


Click on the ... button to call the standard system Open File dialog window.

You can set the following SQL reverse engineering options:

Ignore logical errors

This will cause parser to ignore non syntax errors, e.g. missing referenced objects, name duplicates etc. However, use this option carefully. This may bring some troubles keeping in mind, that the model will not be well-formed in this case.

Automatically create nonexistent referenced objects

Designer will take a try to create necessary missing objects referenced by other ones.

Merge objects with the same name

Objects with the same name will be merged in case this option is checked. The last object in the script has an advantage if some properties can not be merged, e.g. TABLESPACE property of an index or a table and so on.

Build references

This option enables extracting foreign keys from the script and creating corresponding references in your diagram.

4. On the SQL tab you can manually edit script loaded from file.


5. Click OK to start the database reverse engineering process. The Output -> Reverse docking window will display the state of the process.

6. The reversed database objects will be placed in your diagram.

See also:
Reverse Engineering and Import: Reverse Engineering and Import Overview | Reverse Engineering PostgreSQL Database | Import from Access Database | Universal Reverse Engineering