Prerequisites
Before proceeding, ensure the following prerequisites are met:- Install MindsDB locally via Docker or Docker Desktop.
- To connect TimescaleDB to MindsDB, install the required dependencies following this instruction.
Connection
Establish a connection to TimescaleDB from MindsDB by executing the following SQL command and providing its handler name as an engine.user
: The username for the TimescaleDB database.password
: The password for the TimescaleDB database.host
: The hostname, IP address, or URL of the TimescaleDB server.port
: The port number for connecting to the TimescaleDB server.database
: The name of the TimescaleDB database to connect to.
schema
: The database schema to use. Default is public.
Usage
Before attempting to connect to a TimescaleDB server using MindsDB, ensure that it accepts incoming connections using this guide. The following usage examples utilize the connection to TimescaleDB made via theCREATE DATABASE
statement and named timescaledb_datasource
.
Retrieve data from a specified table by providing the integration and table name.
You can use this established connection to query your table as follows,
Troubleshooting
Database Connection Error
- Symptoms: Failure to connect MindsDB with the TimescaleDB database.
- Checklist:
- Make sure the TimescaleDB server is active.
- Confirm that host, port, user, schema, and password are correct. Try a direct TimescaleDB connection.
- Ensure a stable network between MindsDB and TimescaleDB.
SQL statement cannot be parsed by mindsdb_sql
- Symptoms: SQL queries failing or not recognizing table names containing spaces or special characters.
- Checklist:
- Ensure table names with spaces or special characters are enclosed in backticks.
- Examples:
- Incorrect: SELECT * FROM integration.travel data
- Incorrect: SELECT * FROM integration.‘travel data’
- Correct: SELECT * FROM integration.`travel data`