# DDL

> **TL;DR**
> `File | Settings | Editor | Code Style | SQL | <sql_dialect> | DDL` for Windows and Linux
>
>
>
> `IntelliJ IDEA | Settings | Editor | Code Style | SQL | <sql_dialect> | DDL` for macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) ![the Settings icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.settings.svg)
>
>
>
> As <sql_dialect>, select the SQL dialect on the [Code Style. SQL](settings-code-style-sql.html) page.

Configure code style for `CREATE`, `ALTER`, views, constraints, and other DDL structures.

Use this page to configure formatting  options for SQL files. When you change these settings, the Preview pane shows how this will affect your code.

| Item | Description |
| --- | --- |
| Place the opening parenthesis |  Align or indent the opening parenthesis under the first keyword on the line. Select On the same line to keep the opening parenthesis on the line with the keyword.  |
| Place elements | Change the position of elements in parentheses.        * Same line aligned: align all members of the clause, keep the first member on the same line with a parenthesis.    * Wrapped unindented: move all members of the clause to a new line without adding an indent.    * Wrapped aligned: align and move all members of the clause to a new line.    * Wrapped indented: add an indent and move all members of the clause to a new line.     |
| Place the closing parenthesis |     Change the position of the closing parenthesis.       * At the end: place the closing parenthesis at the same line with the last element of a clause.    * To begin: move the closing parenthesis to a new line with the last element of a clause.    * Under opening: place the closing parenthesis under the opening parenthesis.    * Under elements: place the closing parenthesis under aligned elements of a clause.     |
| Align types | Align types in a clause (for example, `serial`, `char`, `varchar`, and so on). |
| Align defaults | Align DEFAULT constraints. |
| Align nullabilities | Align NULL and NOT NULL constraints. |
| Collapse when short | Join multiline short code sections. The length of a section that will be collapsed is determined automatically by IntelliJ IDEA. |
| Wrap alter instructions | Move `ALTER` instructions to a new line. |
| Align alter instructions | Align all `ALTER` instructions. To use this option, set the Wrap alter instructions option to Do not change. |

| Item | Description |
| --- | --- |
| Wrap CONSTRAINT | Move CONSTRAINT to a new line. |
| Wrap KEY/CHECK | Move KEY and `CHECK` to a new line. |
| Wrap REFERENCES | Move REFERENCES to a new line. |
| Wrap cascade and deferrability | Move CASCADE and DEFERRED constraints to a new line. |

| Item | Description |
| --- | --- |
| Indent content | Add an indent before contents of the `CREATE SCHEMA` statement. |
| Minimum blank lines between declaration | Set the minimum number of blank lines between declarations. If you put fewer lines than declared in this option, additional lines are added automatically. |
| Maximum blank lines between declaration | Set the maximum number of blank lines between declarations. If you put more lines than declared in this option, additional lines are deleted automatically. |

| Item | Description |
| --- | --- |
| Wrap AS | Move AS clause to a new line. |
| Wrap the beginning of the query | Move the beginning of a query to a new line. |
| Indent query | Add an indent before a query. The Wrap the beginning of the query option must be enabled. |

| Item | Description |
| --- | --- |
| Wrap first option | Move the first option of the postfix expression to a new line. |
| Wrap next option | Move the second option of the postfix expression to a new line. |
| Indent options | Add an indent before options of the postfix expression. |
| Align options | Align all options of the postfix expression. |

## See also

### Procedures

[Code style schemes](configuring-code-style.html)

