DDL data sources allow you to model structures of databases that do not yet exist or that you do not have access to. A DDL data source is based on a data structure definition specified in a .ddl file. PyCharm reads DDL statements from this file and creates the corresponding structure in the new DDL data source.

DDL data sources can be used for various purposes. For example, if your target is to prepare a data source structure definition file to use in the future, you may need to check that it determines the correct data structure. You can also check whether the structure generated through your definition file is consistent with the target database. To do so, specify the JDBC data source that provides access to the target database as the parent data source.

PyCharm provides various coding assistance for handling data structure definition files. You can navigate from statements in a .ddl file to the corresponding tables or columns in the Data Sources tool window. Any changes made to the tables in the data source are reflected in the .ddl file.

You can create a data structure definition file manually, or copy it from another location, or generate it based on an entire configured data source or any table or column accessible through it.

DDL data sources only exist on the project level.

  1. Start creating a new DDL data source.
  2. In the DDL Data Source Properties dialog box, type the name of the new data source.
  3. Click the Add DDL File button add.png and specify the desired data structure definition file.

    PyCharm parses the specified file according to the SQL dialect assigned to it or its parent. To have the data structure created successfully, this dialect should support DDL statements. SQL dialect settings are specified in the SQL Dialects page of the Settings dialog box.

  4. Select the parent data source from the list of already configured data sources.

    You can leave these properties undefined, and change them later, adding SQL files, or specifying parent data sources.

  5. Click OK.

See Also

Concepts:

Procedures:

Reference:

Web Resources: