Working with DDL definitions
Available only in PyCharm Professional: download to try or compare editions
This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in PyCharm by default. If the relevant features aren't available, make sure that you didn't disable the plugin.
note
The Database Tools and SQL plugin is available only in PyCharm Professional.
Press CtrlAlt0S to open the IDE settings and then select Plugins.
Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.
In the Database tool window ( View | Tool Windows | Database) , click a database object.
Click the Source Editor button (
) on the toolbar. Alternatively, press Ctrl0B.
![Edit the DDL definition of a database object Edit the DDL definition of a database object](https://resources.jetbrains.com/help/img/idea/2023.2/db_view_ddl_definition_of_db_object.png)
In the Database tool window ( View | Tool Windows | Database) , right-click a database object and select SQL Scripts | SQL Generator CtrlAlt0G.
In the SQL Generator tool window, click the File Output Options icon (
).
From the Layout list, select a method that you want to use:
File per object: generates a set of SQL files.
File per object with order: generates a numbered set of SQL files.
tip
SQL files are generated by a groovy script. To change the script, click the Settings icon (
) and select Edit.
Thanks for your feedback!