File | Settings | Tools | Database for Windows and Linux
PyCharm | Preferences | Tools | Database for macOS
The Database section contains database and SQL settings.
Execute in console
Item
Description
Prefer database view over DDL editor
Select the checkbox to go from a reference to a definition in the Database tool window. Clear the checkbox to go from a reference in the editor to a DDL definition.
To jump from a reference in the editor to a to a definition in the Database tool window, press Ctrl and click a reference.
Prefer data editor over DDL editor
Clear the checkbox to open a DDL definition of the object from the Database tool window. Select the checkbox to see the table view of the definition.
To open a DDL definition or a table view, double-click the object in the Database tool window.
Execute in console
The settings in this section relate to showing various information in database consoles.
Item
Description
When inside statement execute
If the cursor is inside a statement, perform the following actions:
Ask what to execute: display a popup where you can select what part of a statement or statements to execute.
Smallest statement: execute the smallest statement from the script. For example, when the cursor is inside a subquery, the subquery is executed.
Largest statement: execute the largest statement from the script. For example, when the cursor is inside a subquery, an outer statement is executed.
Largest statement or batch: execute the largest statement or a batch of statements from the script. For Transact-SQL (SQL Server and Sybase), the current batch of statements is executed. For all other dialects, the same as the previous option.
Whole script: execute the whole script.
Everything from caret: execute everything below the caret.
otherwise execute
If the cursor is outside of a statement (for example, on a blank line or within a comment), perform one of the following actions:
Nothing: stop execution.
Whole script: execute the whole script.
Everything below caret: execute everything below the caret.
for selection execute
If the code is selected (highlighted), perform one of the following options:
Exactly as one statement: execute exactly what is selected as a single statement.
Exactly as statements: execute exactly what is selected. If the selection contains more than one statement, the statements are executed as separate statements.
Smart expand to script: expand a selection to form a sequence of valid statements. For example, if there is at least one statement border within the selection, the selection is expanded to form a sequence of valid statements. This sequence is then executed. Otherwise, execute what is selected.
Open results in new tab
You can select to view query results on individual tabs, or on one and the same tab. For the single tab, the tab is updated for each query.
Select the checkbox to create a new tab with query results each time you run the SELECT query. Using this approach, you can keep results of all the queries that you have run.
If the checkbox is cleared, the same tab is used to show query results. Information on the tab is updated to show the result.
In this case, when you get the result that you want to keep, you can pin the tab to the tool window () on the toolbar or Pin Tab in the context menu for the tab).
Show error notifications in editor
Clear this checkbox to display information about errors in the output pane only. Select the checkbox to display errors in output and input panes.
The error notification bar might be useful when you run sequences of SQL statements. If an error occurs, you see a notification bar with possible actions to fix the error.
Review parameters before execution
When you run a statement with parameters, PyCharm saves parameter values in memory. Select this checkbox and next time you execute the statement, PyCharm will show you the last used parameter values. You can change them before running the statement.
Clear this checkbox and PyCharm will execute the statement immediately without showing you the parameter values.
Always show console toolbar in editor
Select to display the console toolbar in the editor.
Show warning before executing potentially unsafe queries
Select to display warnings for potentially unsafe queries.
If you forgot to put the WHERE clause in DELETE and UPDATE statements, PyCharm displays a notification to remind you about that. If you omitted the WHERE clause intentionally, you can execute current statements as you planned.
Create title for results from query
You can define a tab title in the comment section before the query. In the Treat text as title after field, you can reserve a combination of symbols or characters, and any text after this combination will be treated as a tab title. By default, no combination is used, so any text after -- or /* is treated as a tab title.
To disable this feature, open settings Ctrl+Alt+S, navigate to %database_general%, and clear the Create title for results from comment before query checkbox.
In settings Ctrl+Alt+S, navigate to %database_general%. In the Treat text as title after field, define a combination for tab titles.
Other
Item
Description
Show first N rows documentation
Limit number of rows for a quick documentation popup. To see quick documenation, press Ctrl+Q.
Always show qualified names for database objects
Adds a schema name to the table name for the tab. If the checkbox is selected, double-click the table in the Database tool window to see a qualified tab name.
On
Off
Confirm cancellation for dialogs that modify schema
Show a confirmation dialog when you close Add Database, Add Schema, Create New Table, or Modify Table dialogs. Close means clicking Cancel or pressing Escape. If the checkbox is cleared, the dialog closes instantly.