Skip to content

Use TablePro every day? A license adds the paid features and funds the next release. Get a licenseGet a license, fund TablePro

Write, run and understand queries

For anyone who writes SQL against a live database: write with the schema at hand, run one statement or a whole script, keep the queries worth keeping, and find out why one got slower. Everything here is in the Mac app; the last section covers iPhone and iPad.
MaciPhone & iPad

Paid features on this page: Query Insights (Starter) and Result Charts (Starter). Everything else here is free.

An editor that knows your schema

Autocomplete reads the connection’s schema as you type: tables after FROM and JOIN, the columns of an alias, and the columns of a CTE or subquery defined earlier in the statement. Highlighting uses tree-sitter, and ⌘⇧L formats the statement at the cursor without dropping your comments.

⌘⏎ runs the statement at the cursor or the selection, ⌘⇧⏎ runs them all, ⌘⌥⏎ runs without the row cap, and ⌘. cancels. A batch of ordinary statements runs in one transaction and rolls back if one fails; the exceptions are scripts that manage their own transaction, SQL Server scripts, statements no transaction can hold such as VACUUM, and DDL on MySQL, MariaDB and Oracle, which commits on its own.

  • Statement markers in the gutter, each with its own run button.
  • Find and replace, with regular expressions.
  • Vim mode with motions, registers and macros, where :w runs the query.
  • .sql files open, edit and save as query tabs.
TablePro SQL editor with a query that joins a CTE named recent_orders to users, and the autocomplete list showing the CTE's columns.

Parameters, history and saved queries

Write :customer_id in a query and TablePro asks for its value and type before running it, binding the value natively where the driver supports that.

Every query you run goes into a local history (⌘Y) with full-text search and filters for source, failures and time range. It keeps 10,000 entries for 90 days by default and is never synced.

Save a query with a keyword such as dau, then type the keyword in the editor to expand it. Saved queries keep a version history. A linked SQL folder syncs a folder of .sql files with the sidebar both ways, with Git status letters for each file; it is free, and separate from Linked Folders, the Starter feature for shared connection files.

A query using the :customer_id and :since parameters, the panel where their values are typed, and the query history drawer.

Open Quickly and tabs

Open Quickly (⌘⇧O) finds tables, views and system tables across every open connection, along with your saved and recent queries. Each tab keeps its own SQL, sort, filters and column widths, and tabs come back after you quit and reopen the app; ⌃Tab moves between the tabs you used last.

Read the plan, compare it, track it

EXPLAIN and EXPLAIN Compare

⌥⌘E shows a query’s plan as a diagram, as a tree with cost bars, or as the engine’s raw output. Pick an earlier run of the same query as the baseline and Compare tells you whether it got slower and whether the plan changed; a difference under 15% counts as noise. Both are free.

Dry-run cost estimate
Google BigQuery
SQL engines without EXPLAIN
SQL Server, Oracle, Beancount
EXPLAIN Compare for a query on orders, showing that the plan changed from Index Scan to Seq Scan and the query is slower than its baseline.

Query Insights

Query Insights: Starter plan

Query Insights reads this Mac’s query history and ranks what it finds: the queries run most, the slowest, the ones that fail, and the ones that got slower than in the period before. Queries are grouped by shape, so one statement run with different values counts once. The numbers are computed on your Mac and never uploaded.

Query Insights over the last 7 days, with a chart of succeeded and failed queries per day above the Most Run, Slowest and Got Slower lists, where one query shape is marked Got Slower.

Results as charts and maps

A result can switch from the grid to a chart or a map in the same tab, and back.

Result Charts

Result Charts: Starter plan

Draw a result as a bar, line, area or scatter chart, with a time axis for dates and one series for each value of a column you choose. A chart draws up to 2,000 points and 20 series from the first 50,000 rows, and its toolbar says when it stops short.

A line chart of monthly revenue from the orders table, with one line per order status.

Map view

When a column holds geometry, as WKT, WKB, GeoJSON, ClickHouse tuples or Elasticsearch geo_point values, the Map view draws it on Apple Maps, and selecting a shape selects its row. Your rows stay on the Mac; Apple serves the map tiles. The Map view is free.

The Map view plotting populated places from a PostGIS table, with the selected point, Paris, in the row inspector.

Engines that do not speak SQL

On a connection that does not use SQL, the editor takes that engine’s own language, and each engine’s page explains what it supports. The MongoDB editor is a mongosh-style JavaScript shell that runs inside TablePro, not mongosh itself.

Query language by engine
MongoDB (MQL), Redis (Redis CLI), Cassandra (CQL), ScyllaDB (CQL), Amazon DynamoDB (PartiQL), Elasticsearch (Query DSL), etcd (etcdctl), Apache Kafka (KafkaQL), SurrealDB (SurrealQL), Typesense (Typesense API), Weaviate (GraphQL)

On iPhone and iPad

The iPhone and iPad app has a Query tab with SQL highlighting, Run and Stop (⌘↩ with a keyboard), and a history of the last 200 queries run on that device. You can copy or share a result as JSON, CSV or SQL INSERT statements.

It has no autocomplete, formatting, parameters, EXPLAIN or saved queries, and it holds at most 10,000 rows of a result, so add a LIMIT to see the slice you need.

Where it works

Each capability on this page, the plan it needs on the Mac, and what exists of it on iPhone and iPad
Capability
SQL editor with autocomplete and formattingMac: FreeiPhone and iPad: Highlighting, Run and Stop; no autocomplete
Query parametersMac: FreeiPhone and iPad: Not available
Query historyMac: FreeiPhone and iPad: The last 200 queries on the device
Saved queries and linked SQL foldersMac: FreeiPhone and iPad: Not available
Open QuicklyMac: FreeiPhone and iPad: Not available
EXPLAIN and EXPLAIN CompareMac: FreeiPhone and iPad: Not available
Query InsightsMac: Starter planiPhone and iPad: Not available
Result ChartsMac: Starter planiPhone and iPad: Not available
Map viewMac: FreeiPhone and iPad: Not available
Copy or share resultsMac: FreeiPhone and iPad: Free

Limits worth knowing

  • A query returns at most 10,000 rows unless you raise the cap in Settings, up to 500,000, or run it with ⌘⌥⏎. A LIMIT you write yourself always wins.
  • Query history and Query Insights cover this Mac only: queries run on another Mac or on iPhone are not in them.
  • The tablepro shell command opens connections and files in the app. It does not run queries from the terminal.

Get TablePro

TablePro is open source and free to use. Paid plans add optional features to the Mac app.
Download for Mac

macOS 13 Ventura or laterApple silicon or Intel

Download on the App Store

iPhone and iPadiOS and iPadOS 18 or later

See pricing