SQL Database
The SQL Database component executes SQL queries across any SQLAlchemy-compatible database (such as PostgreSQL, MySQL, and SQLite).
Note: For CQL queries on Cassandra/DataStax databases, use the DataStax Bundle instead.
Dynamic Natural Language Querying with Agents
Rather than hardcoding static SQL queries or forcing users to write raw SQL syntax, you can enable Tool Mode on the SQL Database component and attach it to an Agent component. The agent will automatically convert natural language requests into valid SQL queries, execute them on your database, and return formatted answers.
Setup Guide
1. Configure Connection: Add an SQL Database component to your flow and enter your database connection string in the Database URL field (e.g.[scheme]:///[database-file])
2. Enable Tool Mode: Click the component header menu and toggle Tool Mode. (This clears any manual query input, allowing the agent to generate queries dynamically).
3. Add Agent Component: Add an Agent component to the flow and provide your API key/model configuration.
4. Connect Component to Agent: Connect the Toolset output of the SQL Database component to the Tools input of the Agent component.
5. Test in Playground: Open the Playground and ask a natural language question (e.g., “Which users are in my database?”).
The agent will analyze the request, generate the appropriate SQL query, run it using the database tool, and return a conversational response.
Parameters
Tip: Advanced parameters are hidden by default to keep the canvas clean. Click Controls in the component’s header menu to toggle parameter visibility.
SQL Database Parameters
| Parameter | Description |
|---|---|
| Database URL* |
The connection string for the database (for example,
[scheme]:///[database-file] or a PostgreSQL/MySQL connection URL).
(Required)
|
| SQL Query* | The SQL command or query statement to execute on the database. (Required) |
| Result Table | Output parameter that returns the queried dataset as a table/DataFrame. |