Extract and Analyse a Data Model via DDL Files

In some environments, direct access to the application database may not be available due to security restrictions, network limitations, or infrastructure constraints. In such cases, analysing the database schema directly from the source system is not possible. However, the data model can still be extracted and analysed using DDL (Data Definition Language) files.

DDL files contain the structural definitions of database objects such as tables, indexes, views, and other schema components. These files can be generated by a Database Administrator (DBA) or exported from the database management system. By importing these DDL scripts into Visual Expert, the tool can reconstruct the database structure and integrate it into the project analysis.

This approach allows teams to analyse the data model, understand database relationships, and include database objects in the overall application documentation — even when a direct connection to the database is unavailable. It ensures that database structures remain part of the application analysis and documentation process within Visual Expert.

Steps to Import DDL Files into Visual Expert

If Visual Expert cannot connect directly to the application database, you can still analyse the data model by importing DDL files containing the definitions of the database objects.

Follow the steps below:

Step 1: Generate the DDL Files

Create text files containing the DDL statements that define the structure of the database. These files typically include statements such as:

  • CREATE TABLE
  • CREATE INDEX
  • CREATE VIEW
  • Other database object definitions

In some cases, these scripts may already exist as part of the project resources. If not, a Database Administrator (DBA) can generate them directly from the database.

Step 2: Store the DDL Files in a Folder

Once the scripts are generated, place all the DDL files in a folder that is accessible by Visual Expert. This folder will be used as the source from which Visual Expert reads and analyses the database object definitions.

Step 3: Add a New Source to the Visual Expert Project

You must add the folder containing the DDL files as a new source of code in your Visual Expert project.

To do this:

  • Open Project Settings in Visual Expert.
  • Navigate to the Source code section.
  • Click Add Source.
  • Select the language of the code you wish to analyse.
  • Select the folder containing the DDL files.

For quick reference on adding a source, see the articles below:

Step 4: Select the Appropriate Source Type

When adding the source, choose the source type according to the database used by the application:

  • For Oracle or PostgreSQL databases, add an Oracle source.
  • For all other databases, add an SQL Server source.

This allows Visual Expert to correctly interpret the database definitions contained in the DDL files.

Step 5: Declare the Dependency with the Application Source

You must declare a dependency between the application source code and the database source so that Visual Expert can link the database objects with the application.

To configure this:

  • Open Project Settings.
  • Go to the Application Dependencies tab.
  • Declare a dependency from the application source to the new source containing the database objects.

For more guidelines on adding source code and dependencies, refer to: Define Cross-Application Dependencies.

After completing these steps, run the project analysis so Visual Expert can parse the DDL files and integrate the database objects into the project documentation and analysis.

Important Notes

  • Ensure DDL completeness
    The DDL files should include the definitions of the main database objects such as tables, views, and indexes so that Visual Expert can correctly reconstruct the data model.
  • Use clean and valid SQL scripts
    Ensure that the DDL files do not contain incomplete statements or database-specific commands that could prevent Visual Expert from parsing the scripts correctly.
  • Organize scripts properly
    If multiple scripts are used, store them in a well-structured folder. This keeps the database objects organized and makes maintenance easier.
  • Declare dependencies correctly
    Declaring the dependency between the application source and the database source is essential for Visual Expert to identify interactions between the code and database objects.
  • Verify analysis results
    After running the project analysis, review the detected database objects to ensure that the tables, views, and other elements have been correctly imported.

 

More from Visual Expert Code Analysis