Working with DDL definitions
Edit the DDL definition of a database object
In the Database tool window ( ), click a database object.
Click the Source Editor button () on the toolbar. Alternatively, press Ctrl+B.
Generate DDL definitions for database objects
Data definition language (DDL) defines the structure of a database, including rows, columns, tables, indexes, and other elements. In DataGrip, you can generate the data definition of a database object using the SQL Generator tool window.
In the Database tool window ( ), right-click a database object and select (Ctrl+Alt+G).
In the SQL Generator window, you can configure the output, copy it to the clipboard (), save it to file (), or open it in a database console ().
Save generated DDL in SQL files
In the Database tool window ( ), right-click a database object and select (Ctrl+Alt+G).
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.
Go from a reference to its DDL definition
In the Setting/Preferences dialog (Ctrl+Alt+S), navigate to Database | General.
In the Navigation pane, clear the Prefer database view over DDL editor checkbox.
Generate a DDL definition to the database console
In the Database tool window ( ), right-click a database object and select .
Generate a DDL definition to the clipboard
In the Database tool window ( ), right-click a database object and select .