Visual Query Builder

Visual Query Builder allows you to create and edit SQL queries without writing SQL code. You can select objects and columns, define filters, configure sorting, and limit the number of rows to import using a visual interface.

To edit the generated SQL query manually, switch to the SQL Query tab.

Selecting data to import

In the Import Data Wizard, open the Visual Query Builder tab and select the MySQL object you want to import from the Object list. To find an object quickly, click the list and start typing its name.

The object’s columns and relationships appear in the Columns tree. Select the columns you want to import, or select all columns.

Note

To modify or delete imported records, make sure to include the primary key column, indicated by the The Primary Key icon. icon. If the primary key consists of multiple columns, select all of them.

To insert new records without importing all columns, you must include all required columns. To select them, right-click the root node in the Columns tree and select Select only required columns. This selects the primary key column and all required columns. You can then select any additional columns you need.

Related tables

To import columns from related objects, select the required columns in the Relations tree.

You can view imported data from related objects in Excel, but you cannot modify the related object columns and save those changes back to MySQL.

The Relations tree displaying columns from related objects.

After selecting the columns, you can use the WHERE and ORDER BY sections to filter and sort the imported data.

Configuring WHERE conditions

Use the WHERE section to define filters that determine which records are imported.

A filter consists of conditions and condition groups:

  • Condition - A logical expression that compares a column value with a specified value and determines whether a record matches the filter.
  • Condition group - A set of conditions or nested groups combined using a logical operator. Groups can contain additional nested groups, allowing you to create complex filters.

The filter starts with a root condition group, to which you can add conditions or nested groups.

Adding a condition

To add a condition to a condition group:

1. Click the Add Condition icon next to the group’s logical operator, or right-click the group and select Add Condition.

2. Click <Select a column> and select the column you want to filter.

3. Click the = operator and select a comparison operator from the list.

Comparison operators in Visual Query Builder.

The available operators depend on the data type of the selected column. The following operators can be available:

Operator Description
= Equals the specified value.
<> Does not equal the specified value.
< Is less than the specified value.
> Is greater than the specified value.
<= Is less than or equal to the specified value.
>= Is greater than or equal to the specified value.
LIKE Matches the specified pattern. Available for string columns.
NOT LIKE Does not match the specified pattern. Available for string columns.
STARTS WITH Starts with the specified value. Available for string columns.
NOT STARTS WITH Does not start with the specified value. Available for string columns.
IN (...) Matches any value in the specified list. Available for integer columns.
NOT IN (...) Does not match any value in the specified list. Available for integer columns.
IS NULL Contains a NULL value.
IS NOT NULL Does not contain a NULL value.
BETWEEN Falls within the specified range.
NOT BETWEEN Falls outside the specified range.

4. Click <Enter a value> and enter the value to compare with the selected column.

Adding a condition group

To add a condition group:

1. Click the Add Group icon next to the parent group’s logical operator, or right-click the group and select Add Group.

2. Select one of the following logical operators:

  • And - Returns records that match all conditions in the group.
  • Or - Returns records that match at least one condition in the group.
  • Not And - Returns records that do not match all conditions in the group.
  • Not Or - Returns records that do not match any condition in the group.

3. Add conditions or nested condition groups as needed.

To remove a condition or group, click the Remove icon next to it.

Configuring sorting order

Use the ORDER BY section to sort imported data by one or more columns.

By default, the primary key column is added to the ORDER BY section automatically (in ascending order, ASC) only for relational data sources. For cloud data sources, automatic sorting is disabled by default. You can change this behavior in the Filter options.

Adding a sorting criterion

To add a sorting criterion:

1. Click the Add icon next to the ORDER BY statement.

2. Click <Select a column> and select the column to sort by.

3. Click ASC and select the sorting order:

  • ASC - Ascending order.
  • DESC - Descending order.

When multiple sorting criteria are specified, data is sorted by the first column, then by the second, and so on.

Changing a sorting criterion

To change an existing sorting criterion:

1. In the ORDER BY section, click the column name.

2. Select another column from the list.

3. Click ASC or DESC to change the sorting order, if needed.

To remove a sorting criterion, click the Remove this sort criteria icon next to it. To remove all sorting criteria, click Clear all next to the ORDER BY statement.

Limiting the number of imported rows

By default, Visual Query Builder imports all records that match the specified conditions.

To limit the number of imported rows, click ALL in the FETCH ALL ROWS clause and enter the maximum number of rows to retrieve.

You can also configure the Maximum row count setting in the Filter section of the Options.