• DATA MODIFICATION
  • SCHEMA CONTROL
  • DATA ANALYSIS
  • HUMAN REVIEW

How to run SQL queries with your AI client

Connect QuestDB to your AI client once. From then on, you can manage your time-series data using plain English.

Ask AI about this page

Short answer

Can I run SQL through my AI?

Yes. You can use your agent to send DDL and DML commands straight to QuestDB. This lets you create tables, insert data, or query records without writing manual scripts. You'll see exactly how the data is handled.

The outcomes

What your AI delivers

The agent handles the syntax so you can focus on the data.

DATA MODIFICATION

Update your tables

The AI uses execute_sql to run DML commands. You can add new time-series points or update existing records through chat.

SCHEMA CONTROL

Manage database structure

Use DDL commands to create or alter tables. Your agent handles the table definitions for you.

DATA ANALYSIS

Query time-series data

Ask questions about your metrics. The agent translates your words into SQL to pull specific data points from QuestDB.

HUMAN REVIEW

Verify query logic

The AI shows you the SQL it intends to run. You decide if the command is safe before it hits your database.

The workflow

What your AI does when a command arrives.

Your agent acts as the bridge between your intent and the database engine.

  1. Translate intent

    Your AI interprets your request for a specific time-series operation. It maps your words to the correct SQL syntax.

    execute_sql
  2. Generate SQL

    The agent builds the exact DDL or DML statement needed for QuestDB. It ensures the syntax matches your specific table schema.

    execute_sql
  3. Execute command

    The command is sent to the database to perform the requested action. This happens through the direct connection to your time-series instance.

    execute_sql
  4. Return results

    The AI receives the data or the success confirmation. It presents the rows or the status update in a readable format.

    execute_sql

Try it

Copy these to start.

Use these prompts to test the connection.

Starting points

Swap out the table names and column names for your actual QuestDB schema.

QuestDB Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_2JOk1hTa0Hc7TZSrk9PX0JHkHMR9yGZEnj7dIpoE/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — QuestDB capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "questdb-time-series-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_2JOk1hTa0Hc7TZSrk9PX0JHkHMR9yGZEnj7dIpoE/mcp"
    }
  }
}
Copy into chat04
  • Create a new table named sensor_data with columns for timestamp, device_id, and temperature.

  • Insert a new record into the telemetry table with a timestamp from five minutes ago.

  • Show me the average temperature from the weather_logs table for the last hour.

  • Drop the old_test_metrics table from the database.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect QuestDB once, then ask.

Follow the link to link your instance. Your credentials stay encrypted, and you can immediately start chatting with your data.

Connect QuestDB to your AI

FAQ

How the SQL execution works

  • 01

    Can the AI delete my entire database?

    No. The AI only executes the specific SQL commands you request through the tool.

  • 02

    Does the AI write the SQL for me?

    Yes. It translates your natural language instructions into valid SQL statements.

  • 03

    Can I review the SQL before it runs?

    Yes. You should always check the generated SQL in your AI client before confirming the execution.

  • 04

    Can the AI create new tables?

    Yes. It can run DDL commands to create or modify your database schema.

  • 05

    Does the AI manage my database users?

    No. This connector is for executing SQL commands, not for managing database user permissions or roles.

  • More questions about QuestDB? The Connector page answers them. See everything the QuestDB Connector can do

Connect QuestDB to Claude, Cursor, ChatGPT & more