Skip to content

MySQL Visual Query Builder

Builds and runs MySQL SELECT queries from a visual-style configuration, including JOINs, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT and OFFSET. It can return results in multiple formats (text+JSON, HTML table, Excel, PDF, or all) without requiring users to write raw SQL.
Preview

Usage

Use this node when you want to compose complex MySQL queries from structured inputs rather than writing SQL directly. Typical workflow: provide credentials, pick a main table and database, list the columns to return, optionally add JOIN definitions and filters, then pick the output format. Connect the outputs to viewers, exporters, or downstream processing nodes.

Inputs

FieldRequiredTypeDescriptionExample
credentials_pathTrueSTRINGPath or reference to stored MySQL credentials that match the 'mysql' credential template.
timeoutTrueINTMaximum time in seconds to wait for the query to complete.60
main_tableTrueSTRINGPrimary table to query from.users
databaseTrueSTRINGDatabase/schema name that contains the tables.mysql
selected_columnsTrueSTRINGComma-separated list of columns to select. Use '*' to select all.users.id, users.name, orders.total_amount
join_configTrueSTRINGJSON array describing JOINs. Each item must include 'type' (INNER\|LEFT\|RIGHT\|FULL\|CROSS), 'table', optional 'database', and 'on' condition (ignored for CROSS).[{"type":"INNER","table":"orders","database":"mysql","on":"users.id = orders.user_id"}]
where_conditionsFalseSTRINGOptional WHERE clause conditions without the 'WHERE' keyword.users.age > 25 AND users.city = "New York"
group_by_columnsFalseSTRINGOptional comma-separated columns for GROUP BY.users.city
having_conditionsFalseSTRINGOptional HAVING clause to use with GROUP BY, without the 'HAVING' keyword.COUNT(users.id) > 10
order_by_columnsFalseSTRINGOptional comma-separated ORDER BY columns (append DESC for descending).users.created_at DESC, users.id
limit_countTrueINTMaximum number of rows to return (must be >= 1).100
offset_countTrueINTNumber of rows to skip before starting to return rows.0
output_formatTrueSTRINGFormat of the output. Options: text, html, xlsx, pdf, all.text

Outputs

FieldTypeDescriptionExample
textSTRINGHuman-readable summary or table-like plaintext of the results, including a title.Visual Query: mysql.users Visual Query Results (100 rows): ================================================== Row 1: id: 1 name: Alice ...
jsonSTRINGJSON-serialized result payload (typically an object containing an array of rows and optional metadata).{"data":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}],"row_count":2}
htmlSTRINGHTML table rendering of the results (only when output_format is html or all).

Visual Query: mysql.users

...
idname
xlsxBYTESExcel workbook bytes representing the query results (only when output_format is xlsx or all).
pdfBYTESPDF document bytes representing the query results (only when output_format is pdf or all).

Important Notes

  • Credentials: You must provide a valid credentials_path for the 'mysql' service; the node loads credentials before building and executing the query.
  • JOIN validation: Each JOIN entry must contain 'type', 'table', and 'on' (except CROSS JOIN which ignores 'on'); invalid types will cause errors.
  • SQL generation: The node constructs a SELECT statement from inputs. WHERE/HAVING/ORDER BY must be valid SQL fragments (do not include the keywords twice).
  • Limits: LIMIT and OFFSET are appended only when greater than 0 (OFFSET is added only if > 0).
  • Output formats: Choosing 'text' returns text and JSON. 'html' returns JSON+HTML. 'xlsx' returns JSON+XLSX. 'pdf' returns JSON+PDF. 'all' returns all formats.
  • Empty inputs: If selected_columns is empty or whitespace, '*' is used. If join_config is empty/whitespace, no JOINs are added.
  • Error behavior: Invalid join_config JSON or unsupported JOIN type will raise an error and return an error message in the text/JSON outputs.

Troubleshooting

  • Invalid JSON in join_config: Ensure join_config is a JSON array. Example: [{"type":"INNER","table":"orders","database":"mysql","on":"users.id = orders.user_id"}].
  • Unknown JOIN type: Use only INNER, LEFT, RIGHT, FULL, or CROSS for 'type'.
  • Missing JOIN fields: Each join must include 'type', 'table', and 'on' (except CROSS). Add the missing fields to proceed.
  • SQL syntax errors: Verify WHERE/HAVING/ORDER BY fragments are valid SQL for MySQL and match your schema.
  • No results: Check filters (WHERE/HAVING), increase limit_count, or confirm that tables and columns exist in the specified database.
  • Timeouts: Increase the timeout input for long-running queries or optimize filters and joins.
  • Wrong database or table: Ensure 'database' and 'main_table' exist and credentials have access.