JetBrains Rider 2019.2 Help

Keymap:

Run a query

To run a query, create a new or open an existing SQL file, connect it to a data source, and run your code. In the Services tool window, you can view data sources (1), connection sessions (2), and attached files (3). The small green light indicates that you are connected to a data source.

A database console is an SQL file that is already connected to a data source, so you can type and run your code right away.

Run statements from an opened file

In JetBrains Rider, you can open and run an SQL file. Limitation for the SQL file size is 20 MB. When you open a file that is larger than 20 MB, you see only first 2.5 MB of the file.

Click the statement that you want to execute. To run a selection of several statements, select (highlight) the statements.

Press Ctrl+Enter or select Execute from the context menu.

(Optional) If the SQL file is not connected to a data source, select or create a connection session in the Sessions window. For more information about sessions, see Managing connection sessions.

In the Statements window, press Enter to run the selected statement. You can switch between other entries to run another set of statements. Statements that you are going to execute are highlighted in the editor.

Open F4 or create (Ctrl+F5 | New Console) a database console. For more information about working with consoles, see Working with consoles.

Type or paste the statement that you want to execute.

Press Ctrl+Enter. Alternatively, click the Execute icon on the toolbar.

If you have several statements, select whether you want to execute all statements or a single statement. The suggestion list always contains an item for running all the statements.

New console means a new connection to a data source. You can work with just one connection for the data source and have all consoles use that same one connection. Read more about the single connection mode in Enable single connection mode.

Managing connection sessions

Action

Description

Create a connection session to a data source

Click the <session> list and select New session.

Attach to an existing connection session

Click the <session> list and select an existing session.

Detach a connection session

Click the <session_name> list and select an existing session.

Rename a connection session

In the Services tool window, right-click a session and select Rename Session.

Move a session or a data source to a separate tab

In the Services tool window, right-click a session or a data source and select Show in New Tab. To revert this action, close the separated tab.

Close all connection sessions

In the Services tool window, right-click a data source and select Close All Sessions.

Productivity tips

Execute a file from the search dialog

Press Shift twice.

In the Search Everywhere dialog, type the filename.

Select a file by using Up and Down arrows.

Press Ctrl+F5.

Select data sources for which you want to run the file and click OK.

Create a database console

To create a console, use one of the following actions in the Database tool window (View | Tool Windows | Database).

Click a data source and select File | New | Console.

Right-click a data source and select New | Console.

Click a data source, press Ctrl+N, and select Console.

Click a data source, press Ctrl+Shift+F10, and select New console.

New console means a new connection to a data source. You can work with just one connection for the data source and have all consoles use that same one connection. Read more about the single connection mode in Enable single connection mode.