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.
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.
| Field | Required | Type | Description | Example |
| credentials_path | True | STRING | Path or reference to stored MySQL credentials that match the 'mysql' credential template. | |
| timeout | True | INT | Maximum time in seconds to wait for the query to complete. | 60 |
| main_table | True | STRING | Primary table to query from. | users |
| database | True | STRING | Database/schema name that contains the tables. | mysql |
| selected_columns | True | STRING | Comma-separated list of columns to select. Use '*' to select all. | users.id, users.name, orders.total_amount |
| join_config | True | STRING | JSON 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_conditions | False | STRING | Optional WHERE clause conditions without the 'WHERE' keyword. | users.age > 25 AND users.city = "New York" |
| group_by_columns | False | STRING | Optional comma-separated columns for GROUP BY. | users.city |
| having_conditions | False | STRING | Optional HAVING clause to use with GROUP BY, without the 'HAVING' keyword. | COUNT(users.id) > 10 |
| order_by_columns | False | STRING | Optional comma-separated ORDER BY columns (append DESC for descending). | users.created_at DESC, users.id |
| limit_count | True | INT | Maximum number of rows to return (must be >= 1). | 100 |
| offset_count | True | INT | Number of rows to skip before starting to return rows. | 0 |
| output_format | True | STRING | Format of the output. Options: text, html, xlsx, pdf, all. | text |
Outputs
| Field | Type | Description | Example |
| text | STRING | Human-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 ... |
| json | STRING | JSON-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} |
| html | STRING | HTML table rendering of the results (only when output_format is html or all). | Visual Query: mysql.users |
| xlsx | BYTES | Excel workbook bytes representing the query results (only when output_format is xlsx or all). | |
| pdf | BYTES | PDF 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.