MySQL Workbench Manual  /  ...  /  General Editors Preferences

3.2.1 General Editors Preferences

This section describes the preference options that apply to general-purpose editors (see the figure that follows).

Figure 3.5 Preferences: General Editors

Content is described in the surrounding text.

SQL Parsing in Code Editors

SQL properties that can be set include the SQL_MODE, case-sensitivity of identifiers, and the SQL delimiter used.

  • Default SQL_MODE for syntax checker: [ blank ]

    Optionally configure the SQL_MODE for the SQL editor's SQL syntax checker.

    The document property SqlMode defines 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:

    • Sets the 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.

    • Honors the SQL_MODE values defined in SqlMode so that SQL parsing is correct.

    Only a subset of all possible SQL_MODE values affect the MySQL Workbench SQL parser. These values are: ANSI_QUOTES, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_BACKSLASH_ESCAPES, 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 SqlMode property, ensure that the default SQL_MODE variable defined by the server does not contain any values from the following list: ANSI_QUOTES, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_BACKSLASH_ESCAPES, PIPES_AS_CONCAT.

    The 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 globally.

  • SQL Identifiers are Case Sensitive: Enabled by default. Whether to treat identifiers separately if their names differ only in letter case.

  • Non-Standard SQL Delimiter: [$$]. Define the SQL statement delimiter to be different from the normally used delimiter (such as the ; character). Change this value if the delimiter you normally use, specifically in stored routines, happens to be the current setting.

Indentation

  • Tab key inserts spaces instead of tabs

  • Indent width: [4] How many spaces to insert when indenting with the tab key.

    The number of spaces inserted after pressing the Tab key -- this assumes that the Tab key inserts spaces instead of tabs option is enabled.

  • Tab width: [4] How many spaces wide are tab characters.

    The number of spaces defined for tab characters within MySQL Workbench.