Skip to main content

SQL Autocomplete

Autocomplete suggests keywords, tables, columns, and functions based on where your cursor is and what tables are in scope.
Autocomplete

Context-aware autocomplete

Suggestions appear as you type, from the first character, and after . or a space, with a 50ms debounce. There is no minimum prefix. With nothing typed yet, the popup stays hidden in clauses where listing everything is noise (for example after a comma in a SELECT list); it still opens automatically after FROM, JOIN, ON, and other clauses where browsing helps.

Completion Types

SQL Keywords

Table Names

Tables appear after FROM, JOIN, INSERT INTO, and similar keywords:
The clause is detected at the cursor, so a second or third JOIN suggests tables even when an ON condition comes before it. In a table position, tables lead the list ahead of keywords.

Column Names

Columns are suggested in SELECT, WHERE, ORDER BY, GROUP BY, and other column contexts. If a FROM clause exists anywhere in the statement (even after the cursor), columns come from those tables. If no FROM clause exists yet, columns from all cached tables appear as fallback; ambiguous names are qualified: users.id, orders.id.

Alias Resolution

Type an alias followed by . to see that table’s columns:

Derived Tables and CTEs

An alias for a subquery (derived table) or a WITH table completes the columns that subquery’s SELECT list produces, including AS renames:
Explicit (AS name), bare (country), and qualified (t.col) columns resolve. A SELECT * subquery and unaliased expressions like AVG(score) have no name to suggest, so they are skipped.

Functions

SQL functions appear in SELECT, WHERE, and expression contexts:
Functions from the connection’s SQL dialect (e.g. CONVERT_TIMEZONE on Snowflake, SAFE_CAST on BigQuery) appear alongside the common SQL functions.

Favorite Keywords

Favorites you’ve assigned a keyword to (DB-stored or linked-file @keyword frontmatter) appear in the popup as a top-priority match. Type the keyword, accept the suggestion, and the favorite’s full SQL replaces the keyword inline. A ;; in the favorite’s SQL sets where the cursor lands after expansion. See Favorites for how to assign keywords and place the marker.

Schema Names

For databases with multiple schemas (PostgreSQL):
Schema-qualified names like public.users resolve in FROM, JOIN, UPDATE, INSERT INTO, and CREATE INDEX. For databases organized as database, schema, table (Snowflake, BigQuery), every segment completes. Tables of schemas you haven’t opened in the sidebar are fetched on demand:

Schema Cache

On connection, TablePro fetches table names and loads columns in the background. The column cache holds up to 50 tables with LRU eviction. There is no time-based expiry: cached columns stay until you switch databases or refresh the connection. A failed schema load waits 30 seconds before retrying, to avoid hammering the server. After external schema changes (migrations, CLI work), right-click the connection and select Refresh to reload.

Performance

Works on files of any size, including multi-megabyte dumps. For files over 500 KB, only a ~10 KB window around the cursor is analyzed.