ExeSQL
The ExeSQL component connects to a relational database and executes SQL queries. It is the core component used by Database Agents to translate natural language into SQL and return structured results.
Scenarios
Section titled “Scenarios”Use ExeSQL when your agent needs to:
- Query a MySQL, PostgreSQL, or MariaDB database in response to user questions
- Execute generated SQL and return results as a formatted table
- Auto-repair failed SQL queries through a configurable retry loop
Configuration
Section titled “Configuration”| Parameter | Type | Default | Description |
|---|---|---|---|
Database Type | string | __ | Database type: mysql, postgresql, mariadb, MsSQL, BigQuery, Snowflake, SQLite |
Host | string | __ | Database server hostname or IP address. |
Port | number | __ | Database server port. |
Database | string | __ | Name of the database to connect to. |
Username | string | __ | Database login username. |
Password | string | __ | Database login password. |
Loop | number | 3 | Maximum number of retry attempts if a query fails. |
Top N | number | 30 | Maximum number of rows to return. |
Model | string | — | The language model used for SQL regeneration or auto-repair. |
Temperature | number | 0.1 | Controls randomness in SQL regeneration. |
-
Add the ExeSQL component to your canvas.
-
Connect a Generate component (or Retrieval + Generate) upstream to produce the SQL query.
-
Fill in the database connection details (host, port, database name, username, password).
-
Set
loopto the number of auto-repair attempts allowed on query failure. -
Connect the ExeSQL output to a downstream Generate component to format the results as a human-readable response.