This section provides configuration options that affect the SQL Editor functionality in MySQL Workbench.
There is also an SQL Editor section in the General preference tab, with preference settings for how the SQL Editor tabs are saved, and opened.
The SQL Editor is divided into three sections: General, Productivity, and SQL Parsing in Text Editors, as seen in the following screenshot:
Show Schema Contents in Schema Tree: Enumerating, populating, and drawing large numbers of items can significantly increase loading times. For this reason, this facility can be switched off for models containing large numbers of schemata and tables.
Show Data Dictionaries and Internal
Schemas: Whether to show data directories and
internal schemas in the schema tree (such as
INFORMATION_SCHEMA, mysql, and schemas
starting with ".").
Show Management Tools and Schema Tree in a single tab: This affects the Object Browser in the left sidebar, and this option can also be toggled from the sidebar. The management tools and schema tree can be viewable as separate tabs, or as a single long list.
DBMS connection keep-alive interval (in seconds): When executing long running queries over a slow connection, you may need to increase this value to prevent the connection being lost. Defaults to 600.
DBMS connection read time out (in seconds): Maximum amount of time that the query can take to return data from the DBMS. Defaults to 600.
The query results properties that can be set include the following:
Enable Code Completion in Editors: The SQL Editor offers Auto-complete functionality by either pressing the keyboard shortcut (Modifier + Space), or it will start automatically if the Automatically Start Code Completion preference is enabled.
Automatically Start Code Completion: Starts code completion automatically when you type something and wait a moment.
Use UPPERCASE keywords on completion: Normally keywords are shown and inserted as they come from the code editor's configuration file. This setting will always write completed keywords as uppercase.
Automatically Start Code Completion: Enabled by default, this will automatically execute the code auto-completion feature while editing SQL in the SQL Editor. If disabled, you will instead use the keyboard shortcut Modifier + Space to execute the auto-completion routine.
Reformat DDL for Views: Whether to automatically reformat the View DDL that is returned by the MySQL Server.
The MySQL Server does not store the formatting information for View definitions.
Max syntax error count: Large complex scripts may contain errors. Further, a syntax error early on can lead to subsequent syntax errors. For these reasons, it is possible to limit the number of errors displayed using this option. The default is 100 error messages.
SQL properties that can be set include the
SQL_MODE, case sensitivity of identifiers, and
the SQL delimiter used.
The document property
SQL_MODE for all operations affecting SQL
parsing at the document scope. The purpose of this option is to
preserve the consistency of SQL statements within the document.
The property has the following functions:
SQL_MODE DBMS session variable to
the value stored in the
SqlMode property of
the document when performing reverse engineering, forward
engineering, or synchronization operations.
SQL_MODE values defined in
SqlMode so that SQL parsing is correct.
Only a subset of all possible
affect the MySQL Workbench SQL parser. These values are:
PIPES_AS_CONCAT. Other values do not affect the
MySQL Workbench SQL parser and are ignored.
If the value of
SqlMode is not set, the default
value of the
SQL_MODE session variable defined
by the server stays unchanged during operations with the server.
However, the MySQL Workbench SQL parser behaves as if
SQL_MODE is also not set. This may potentially
lead to inconsistencies in parsing of SQL statements stored in the
document. If you choose to not set the
property, ensure that the default
variable defined by the server does not contain any values from
the following list:
SqlMode property is defined in two
locations: globally and at document scope. MySQL Workbench uses the
global property to initialize the document property for each new
document created. For each document, the property value defined at
document scope always has higher priority over the one defined
Copyright © 2006, 2014, Oracle and/or its affiliates. All rights reserved. Legal Notices