The SQL editor in TableAI

AI SQL editor for Mac

Write SQL with autocomplete from your schema, rewrite a query in place with ⌘K, and ask AI to explain or fix it.

Download on App Store

What you can ask the AI SQL editor

Pick a question to watch the chat beside the editor answer it: SQL to run, or the reason a query is slow.

Agent mode. Checks your database with read-only queries and shows each one. Anything that changes data comes back as SQL for you to run.Chat mode. Writes SQL from your schema without touching the database. The query runs when you click Run.

Writing SQL in TableAI

A native editor first, with AI where it saves typing or explains what a query does.

  • Iterate with AI

    Press ⌘K, or choose Query › Iterate with AI, and describe the change. It uses the same fast model as Ask AI in the grid and works on one statement at a time.

    Keyboard shortcuts
  • Explain with AI

    Sends one query and its execution plan to your model to discuss scans, joins, row estimates and index changes. EXPLAIN ANALYZE needs your confirmation.

    Explain a query plan
  • Autocomplete from your schema

    Suggests tables, columns with their types, keywords, functions and snippets as you type, including columns after a table alias.

    Write and run SQL
  • Several statements, one result each

    Run Current runs the statement at the cursor, Run All runs the script, and each statement gets its own result. Cancel a query that runs too long.

    Run statements and scripts
  • AI chat beside the editor

    The chat sits next to the editor and can read its SQL. After you run a query from the chat, one click opens it formatted in the editor, ready to change.

    How AI works in TableAI
  • Guardrails on every run

    In Safe Mode, read-only SQL runs and anything that changes data or schema waits for your approval, including SQL the AI wrote.

    Query guardrails

How Iterate with AI changes a query

It edits the editor, never the database.

  1. Put the cursor in a statement

    TableAI shades the statement under the cursor. That statement is what the AI rewrites, even if you move the cursor later.

  2. Press ⌘K and describe the change

    A prompt bar opens under the editor. Type what to change in plain English and press Return.

  3. Read the new SQL

    The rewrite replaces the statement in place. If the AI needs more detail, it asks in the bar instead of guessing.

  4. Run it, or undo

    Nothing runs until you click Run. Press ⌘Z to get the original statement back.

What your AI provider receives

Each editor action sends only what it needs, straight from your Mac to the provider you set up, with your own key.

Iterate with AI
Your instruction, the statement under the cursor and the schema.
Explain with AI
The query and its EXPLAIN plan, with schema and earlier questions from the chat.
Chat mode
Your message, recent messages and the context you turn on: schema, the SQL in the editor and grid row counts. No table rows unless you attach them.
  • Your Mac connects straight to the database and to your AI provider. No TableAI server sits in between.
  • Database passwords, SSH secrets and AI keys are stored in the macOS Keychain.
  • No telemetry, analytics or third-party SDKs.

Everything you expect from a database client

Work with data

  • Fast data grid

    Stays smooth with many thousands of rows.

  • SQL autocomplete

    Suggests tables, columns and keywords as you type.

  • Edit data safely

    Change, add and delete rows. Nothing is saved until you click Apply.

  • JSON tree editor

    Expand, edit and move nested values without touching raw text.

Tables and trust

  • Edit table structure

    Columns, keys and indexes, with the SQL shown first.

  • Import and export

    CSV, JSON, NDJSON and SQL, with a review before import.

  • Query guardrails

    Changes to data or schema can wait for your approval.

  • Query history

    Search every query that ran, including the AI agent’s.

Safely distributed through the App Store

The Mac App Store is the safest place to get Mac apps, because App Store team reviews every app before you can install it. That’s why TableAI is available only there.

Download on the App Store
  • App Store reviewed

    Apple reviews every version before it reaches the store.

  • Code-signed and verified

    macOS checks the signature, so you know the app wasn’t changed.

  • Sandboxed by macOS

    TableAI can open only the files you choose.

Start in three steps

  1. Install TableAI

    Download it from the Mac App Store. Apple reviews every version, and updates arrive through the App Store.

    Download on the App Store
  2. Connect your database

    Choose File › New Connection, pick the database type, and enter the host or paste a connection URL. Add an SSH tunnel or SSL certificates if the server needs them.

    Connection basics
  3. Add your AI key

    Open Settings › Intelligence, choose OpenAI, Anthropic, DeepSeek, Alibaba or OpenRouter, paste your API key and turn on the models you want.

    Set up AI

AI SQL editor: questions

A SQL editor with an AI model that knows your database. In TableAI it rewrites the query under the cursor from an instruction (⌘K), explains query plans, and writes and fixes SQL in the chat beside the editor, all with your schema as context.

Put the cursor in the statement and press ⌘K, or choose Query › Iterate with AI. Describe the change and press Return. TableAI replaces that statement in the editor; press ⌘Z to undo.

No. Iterate with AI only edits the editor, and SQL from the chat runs when you click Run. Your connection’s Query Protection mode applies to every run.

The dialect of the connected database: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server or Amazon Redshift. AI requests include the dialect and the server version, so rewrites use that database’s syntax.

Yes. Ask the chat to explain the SQL in the editor, or use Explain with AI to analyze its execution plan. Explain with AI starts with plain EXPLAIN and runs EXPLAIN ANALYZE only when you confirm, because that executes the query. Explain a query plan with AI.

No. Browsing, querying, editing data, changing tables, import and export, and the Admin section all work without an AI provider. To use AI chat, the database agent or AI Database Analysis, add your own key from OpenAI, Anthropic, DeepSeek, Alibaba or OpenRouter in Settings › Intelligence.

OpenAI, Anthropic, DeepSeek, Alibaba and OpenRouter. You add your own API key in Settings › Intelligence and choose which of the provider’s models appear in TableAI. Requests go straight to that provider, and it bills you for them. How to keep AI costs down.

Yes, for one saved connection. The free plan includes every feature, including the AI tools, with no time limit. A paid plan adds unlimited saved connections and costs $12.99 to $49.99 a year, depending on your country; monthly and lifetime options are also available.

Download your new favorite database client

Everything you need to query, explore, and manage your databases in one powerful macOS app.

Download for free on theMac App Store