The Sidebar contains several panels. These are:

  • Connection Information Panel

  • Object Browser

Each of these is described in more detail in the following sections. Connection Information Panel

This section provides a summary of the current connection to the server.

Figure 16.35. SQL Editor - Connection Information Palette

SQL Editor - Connection Information
              Palette Object Browser

The Object Browser contains a drop down listbox and a schemata explorer control.

Default Schema Listbox

The drop down listbox lists the schema that are available on the currently connected server. It is possible to select a schema to become the currently active schema using this facility.

This selector executes a USE DB statement. Once set, subsequent statements without schema qualifiers will be executed against this default schema. Note that this will only be set for the query session. If you wish to set a default schema for multiple MySQL Workbench sessions, you will need to set the default schema for the stored connection. To do this from the Home screen click Manage Connections, then in the Manage DB Connection dialog set the desired default schema on the Parameters tab.

Figure 16.36. SQL Editor - Default Schema Listbox

SQL Editor - Default Schema

Schemata Explorer

This area enables you to explore the schemata available on the currently connected server.

Figure 16.37. SQL Editor - Schemata Explorer

SQL Editor - Schemata Explorer

A useful feature that was introduced in MySQL Workbench 5.2.9 is the ability to rapidly enter the names of columns, tables and views into the SQL Statement area. Double-clicking views, tables, and column names in the schemata explorer will insert the corresponding name into the SQL Query area. This reduces typing significantly when entering SQL statements containing several tables, columns or views.

The Object Browser also features a context menu which can be displayed by right-clicking, for example, a table. Right-clicking a table would display the following menu items:

  • Select Rows - Limit 1000: Pulls up to 1000 records of table data from the live server into a Results tabsheet.

  • Edit Table Data: Pulls table data from the live server into a named tabsheet, and allows editing. Data can be saved directly to the live server.

  • Copy to Clipboard: There are various sub-menus:

    • Name (short): Copies the table name to the clipboard.

    • Name (long): Copies the table name to the clipboard in the form `schema`.`table`.

    • Column Names: Copies the column names to the clipboard in the form `table`.`column1`, `table`.`column2`,....

    • Select All Statement: Copies a SELECT all columns statement to the clipboard in the form:

      FROM `schema`.`table`;
    • Insert Statement: Copies an INSERT all columns statement to the clipboard.

    • Update Statement: Copies an UPDATE all columns statement to the clipboard.

    • Delete Statement: Copies a DELETE statement to the clipboard in the form DELETE FROM `world`.`country` WHERE <where_condition>;.

  • Send to SQL Editor: Provides similar functionality to Copy to Clipboard. However, this options inserts the SQL code directly into the SQL Query panel, where it can be edited further as required.

  • Alter Table: Displays the table editor loaded with the details of the table clicked on.

  • Create Table: Launches a dialog to allow you to create a new table.

  • Drop Table: Drops a table. All data will be lost if this operation is carried out.

  • Refresh All: Refreshes all schemata in the explorer by resynching with the server.

Right-clicking an empty area inside the object browser displays the following menu options:

  • Create Schema: This enables you to create a new schema on the connected server. You can apply your changes to synchronize with the live server by clicking the Apply button.

  • Refresh All: Simply synchronizes with the live server so that information with the schemata explorer is updated.

Copyright © 2010-2022 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout