mindsdb-execute-sql
A “mindsdb-execute-sql” tool executes a SQL statement against a MindsDB federated database.
MindsDB is the most widely adopted AI federated database that enables you to query hundreds of datasources and ML models through a single SQL interface. The following tools work with MindsDB databases:
These tools leverage MindsDB’s capabilities to:
MindsDB automatically translates your SQL queries into the appropriate APIs for hundreds of datasources:
-- Join Salesforce opportunities with GitHub activity
SELECT
s.opportunity_name,
s.amount,
g.repository_name,
COUNT(g.commits) as commit_count
FROM salesforce.opportunities s
JOIN github.repositories g ON s.account_id = g.owner_id
WHERE s.stage = 'Closed Won';
-- Analyze email patterns with Slack activity
SELECT
e.sender,
e.subject,
s.channel_name,
COUNT(s.messages) as message_count
FROM gmail.emails e
JOIN slack.messages s ON e.sender = s.user_name
WHERE e.date >= '2024-01-01';
-- Use ML model to predict customer churn
SELECT
customer_id,
customer_name,
predicted_churn_probability,
recommended_action
FROM customer_churn_model
WHERE predicted_churn_probability > 0.8;
Since MindsDB implements the MySQL wire protocol, these tools are functionally compatible with MySQL tools while providing access to MindsDB’s advanced federated database capabilities.
Here’s a complete working configuration that has been tested:
sources:
my-pg-source:
kind: mindsdb
host: 127.0.0.1
port: 47335
database: files
user: mindsdb
tools:
mindsdb-execute-sql:
kind: mindsdb-execute-sql
source: my-pg-source
description: |
Execute SQL queries directly on MindsDB database.
Use this tool to run any SQL statement against your MindsDB instance.
Example: SELECT * FROM my_table LIMIT 10
A “mindsdb-execute-sql” tool executes a SQL statement against a MindsDB federated database.
A “mindsdb-sql” tool executes a pre-defined SQL statement against a MindsDB federated database.