PostgreSQL, MySQL, SQLite and more

AI SQL generator for Mac

Describe the result you want. The SQL query generator in TableAI writes it for your tables, and you run it in the same window.

Download on App Store

SQL query generator examples

Pick a question to watch TableAI write the SQL, or check the data first with read-only queries.

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.

What goes into a generated query

The model writes better SQL when it sees the database. TableAI gives it the parts you allow.

  • Your schema as context

    Table and column names, types, keys, relationships, column comments and row-count estimates. Turn Database Schema off for a request that shouldn’t include it.

    What AI sees
  • Your database’s dialect

    PostgreSQL 12+, MySQL 5.7+, MariaDB 11.4+, SQL Server 2019+, SQLite 3 or Amazon Redshift. The request names the dialect and server version.

    Supported databases
  • Run, then refine in the editor

    Run sends the result to the grid. Open the query in the SQL editor, change it, and press ⌘K to have AI rewrite part of it in place.

    The AI SQL editor
  • Follow-up questions

    Ask for a filter, a column or another grouping, and the next query builds on the last one. Start a new chat to drop the earlier context.

    Get better results
  • Guardrails before anything runs

    Safe Mode runs read-only SQL and asks before SQL that changes data or schema. Confirm All asks before every query.

    Query guardrails
  • Your provider, your key

    OpenAI, Anthropic, DeepSeek, Alibaba or OpenRouter. You choose the model for each chat, and requests go straight to that provider.

    Set up a provider

Check generated SQL before you rely on it

AI-generated SQL is often right and sometimes wrong in ways that still run. These checks catch most of it.

When AI gives the wrong SQL
  • A query that runs can still be wrong

    A wrong join path, a missing filter or the wrong date column returns rows, just not the right ones. Read the joins and the WHERE clause first.

  • Compare with a number you know

    Check a total or a row count against a figure you trust before you share the result.

  • Name your terms

    Say what “active” or “revenue” means in your request, or put it in a column comment, which the schema context includes.

  • Let the agent look at the data

    When the answer depends on what is in the tables, Agent mode runs read-only probe queries and shows each one before it answers.

What your AI provider receives

The generator sends your request and the context you allow, straight from your Mac to the provider you set up. It doesn’t send table rows unless you attach them.

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.
Iterate with AI
Your instruction, the statement under the cursor and the schema.
Agent mode
The chat context, plus the SQL it runs, limited result rows (50 by default), EXPLAIN plans and database errors.
  • 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 generator: questions

A tool that turns a description of the result you want into a SQL query. In TableAI it works inside a native Mac database client: the model sees your schema, writes SQL for your database’s dialect, and you run the query in the same window.

Often, on clear requests against a well-named schema. It can also be wrong in ways that still run, such as a wrong join or a missing filter. TableAI gives the model your schema and shows the SQL before it runs; read it and check the result against a number you know. How natural language to SQL works.

Yes. On a MySQL 5.7 or later connection the generator writes MySQL, and on MariaDB 11.4 or later it writes for MariaDB. It also generates PostgreSQL, SQLite, SQL Server and Amazon Redshift SQL.

TableAI is connected to your database, so it reads the schema itself instead of asking you to paste it, and you run the query and see the rows in the same window. Requests go from your Mac straight to the AI provider you set up, with your own key; there is no TableAI server in between.

Not in Chat mode, unless you attach rows to a message. It gets your request, recent messages and the context you turn on: schema, editor SQL and row counts. Agent mode can run read-only queries and send limited results; by default it asks before its first automatic preview. What AI sees.

It writes any SQL you ask for, but nothing runs until you click Run, and your connection’s Query Protection mode applies. In Safe Mode, SQL that changes data or schema asks for approval first.

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