In the Database tool window, select the desired data source, table, or column, and do one of the following:
- Right-click selection, and choose Generate and Copy DDL.
- Press the Ctrl+Shift+CCommand Shift C keyboard shortcut.
As a result, PyCharm will place the generated statements onto the clipboard.
- In the Project tool window, create a file with the desired name and the extension .ddl.
- Open new file in the editor and paste the generated statements from the clipboard.
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.
Note that you can change the SQL dialect for any SQL or DDL file open in the editor by selecting the corresponding context menu command.