Documentation Home
MySQL Shell for VS Code


Pre-General Availability: 2023-01-18

4.4 DB Notebook Toolbar

The DB Notebook toolbar provides quick actions for modifying queries written as SQL statements, in scripts, or as query strings within MySQL Shell functions such as runSql(). The toolbar changes depending on the type of editor and the block language (in multi-language editors) in which the caret is located. For example, in SQL mode you can execute individual statements from the toolbar with a button to execute the statement at the caret or the selected statement. This is not the case for scripting languages, which are always executed as a whole (either an entire script in the standalone editor or the entire code block in a multi-language editor).

The following figure shows the set icon actions in the toolbar, located within an active connection tab.

Figure 4.4 MySQL Shell for VS Code - DB Notebook Toolbar

Content is described in the surrounding text.

Toolbar actions (from left to right) are:

  • Editor list: Provides quick access to the DB Connection Browser and each active connection. The list enables you to consolidate your active connections within a single tab rather than generating a separate tab for each connection.

    Each active connection has:

    A second quick-access list enables you to open new documents by clicking:

    • New DB Notebook

    • New SQL Script

    • New TS Script

    • New JS Script

  • Execute selection or full block and create a new block: Provides a simple way to execute the entire query or a subset of the query within a block, and then adds a new prompt-output block in the same language below the query.

    Notebook editor in SQL mode only: this action does not apply when you run the script editor.

  • Execute the statement at the caret position: Uses the position the keyboard cursor to identify and execute the query.

    SQL mode only.

  • Stop execution of the current statement/script: Not active until statement or script execution begins.

    SQL mode only.

  • Stop execution of the current statement/script in case of errors: Not enabled by default.

    SQL mode only.

  • Commit DB changes: Not active until you execute a query that alters data.

    SQL mode only.

  • Rollback DB changes: Not active until you commit changes to the database.

    SQL mode only.

  • Auto commit DB changes: When enabled, each statement is committed immediately.

    SQL mode only.

  • Format current block or script: By default, keywords are changed to uppercase.

    TypeScript and JavaScript modes only.

  • Find: Opens the Find panel that supports matching case, matching whole words, and using regular expressions. Up and down arrows enable you to navigate across blocks to each matching instance that is found.

  • Show hidden characters: When enabled, displays invisible characters, such as newlines, spaces, and tabs. A new line is represented as [LF], a space as a single dot (.), and a tab as a right arrow.

  • Soft wrap lines: When enabled, wraps long lines in the editor to eliminate the need to scroll. Disabling this feature for long files is recommended.