Integrate MindsDB with Astra DB Serverless
MindsDB provides a federated query engine, aggregating all of your data sources into a unified search experience. You can use Astra DB Serverless databases as a data source for MindsDB.
Prepare Astra
-
Create an Astra DB Serverless database or use an existing one, and load data that you want to query through MindsDB.
-
Generate an application token with a role that can read from your database.
-
Download your database’s Secure Connect Bundle (SCB).
Connect MindsDB
-
If you haven’t done so already, install MindsDB and the Astra dependencies.
The MindsDB integration uses the ScyllaDB Python driver, which is a fork of the DataStax Python driver.
-
Use the MindsDB API’s
CREATE DATABASE
command to connect your Astra data source:CREATE DATABASE astra_connection WITH engine = "astra", parameters = { "user": "token", "password": "APPLICATION_TOKEN", "secure_connect_bundle": "PATH/TO/SCB.zip" };
Replace the following:
-
APPLICATION_TOKEN
: Your Astra application token. -
PATH/TO/SCB.zip
: The path to your database’s SCB zip file.
-
Query your Astra data source
After you establish the connection, you can query your Astra DB Serverless database. For example:
SELECT *
FROM astra_connection.keystore.example_table
LIMIT 10;