MySQL
Parameterised queries with a server-enforced read-only session and transaction (DDL refused too), timeouts and row/byte caps, writes and DDL (nodes, or agents with an opt-in), tables, columns and plans
Stable v0.1.1 Node.js 5 actions
About
A Graphrt plugin that runs parameterised SQL on MySQL and MariaDB with the mysql2 driver. Agents get read-only access by default: query runs with the session and the transaction set to READ ONLY, so the server itself refuses writes and DDL.
What it can do
- query: one parameterised statement (? placeholders) in a read-only transaction. Returns rows (objects), fields (name and type), row_count and truncated.
- execute: one INSERT/UPDATE/DELETE/DDL statement, autocommitted. Returns affected_rows, changed_rows, insert_id and warning_count. Workflow nodes only, unless MYSQL_TOOL_ALLOW_WRITES=1.
- explain: EXPLAIN as rows, JSON or a tree, or EXPLAIN ANALYZE (MySQL 8.0.18+), read-only.
- list_tables and describe_table: tables and views with approximate row counts, columns (type, nullable, default, key, extra, comment), primary key, indexes and foreign keys.
- Every operation is a node mysql.<operation> and an agent tool. The full reference is in OPERATIONS.md.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Run a read-only query
mysql.query - Run a write or DDL statement
mysql.execute - Explain a query plan
mysql.explain - List tables
mysql.list_tables - Describe a table
mysql.describe_table
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
MYSQL_URL(none)Connection URL, e.g. mysql://app:secret@db.example.com:3306/shop?ssl-mode=VERIFY_IDENTITY (mariadb:// works too). Percent-encode special characters. Only ssl-mode / sslmode is read from the query string, other parameters are ignored. -
MYSQL_HOSTPort 3306Used when MYSQL_URL is unset -
MYSQL_SSL_MODEDisabledisable, require (TLS without certificate checks) or verify-full, MySQL's DISABLED, REQUIRED and VERIFY_IDENTITY work too -
MYSQL_STATEMENT_TIMEOUT_MS30000Default statement timeout (100 to 600000). Nodes may pass any statement_timeout_ms, for agent tool calls this value is also the ceiling. -
MYSQL_CONNECT_TIMEOUT_MS10000Connect timeout -
MYSQL_MAX_RESULT_BYTES1000000Most JSON bytes of returned rows per call (1000 to 8000000) -
MYSQL_POOL_MAX4Connections per pool -
MYSQL_TOOL_ALLOW_WRITES(off)1 lets agents call execute. Leave it off unless the user itself is limited. -
MYSQL_PORT -
MYSQL_USER -
MYSQL_PASSWORD -
MYSQL_DATABASE
How to use it
In Graphrt Desktop
- Open Plugins and search for MySQL.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install mysql workflow.yaml
- id: orders
type: mysql.query
sql: "SELECT id, total, created_at FROM orders WHERE customer_id = ? AND created_at >= ? ORDER BY created_at DESC"
params: ["{{#start.customer_id#}}", "2026-11-01"]
max_rows: 50
- id: mark
type: mysql.execute
sql: "UPDATE orders SET status = ? WHERE id = ?"
params: ["shipped", "{{#orders.data.rows.0.id#}}"]