Skip to main content

SQL Autocomplete

Autocomplete analyzes your cursor position, the SQL syntax context, referenced tables and aliases, and your database schema to suggest only relevant completions at each point in the query.
Autocomplete

How Autocomplete Works

The autocomplete engine analyzes four things:
  1. Your current position in the query
  2. SQL syntax context (SELECT, FROM, WHERE, etc.)
  3. Referenced tables and their aliases
  4. Your database schema (tables, columns, functions)
Suggestions are filtered to what makes sense at the cursor.

Triggering Autocomplete

Autocomplete appears automatically as you type (after 1-2 characters, after . for column access, or after keywords like SELECT/FROM/JOIN). Press Escape to dismiss or continue typing to filter suggestions.

Completion Types

SQL Keywords

Keywords are suggested based on SQL syntax context:
SEL|  -- Suggests: SELECT
FROM users WH|  -- Suggests: WHERE
SELECT * FROM users WHERE name LIKE '%test%' ORD|  -- Suggests: ORDER
Keyword suggestions
Suggested keywords include:
CategoryKeywords
StatementsSELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP
ClausesFROM, WHERE, JOIN, ON, GROUP BY, ORDER BY, HAVING, LIMIT
OperatorsAND, OR, NOT, IN, LIKE, BETWEEN, IS NULL, EXISTS
JoinsINNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN

Table Names

Tables are suggested after keywords that expect table references:
SELECT * FROM |  -- Suggests all tables
SELECT * FROM us|  -- Suggests tables starting with "us": users, user_roles
SELECT * FROM users JOIN |  -- Suggests all tables
Table suggestions

Column Names

Columns are suggested based on referenced tables:
SELECT | FROM users  -- Suggests columns from users table
SELECT u.| FROM users u  -- Suggests columns with "u." prefix
SELECT * FROM users WHERE |  -- Suggests columns from users

After Table Alias

Typing an alias followed by . shows that table’s columns:
SELECT
    u.|  -- Shows: id, name, email, created_at (from users)
FROM users u
JOIN orders o ON u.id = o.|  -- Shows: id, user_id, total (from orders)
Alias suggestions

Functions

SQL functions are suggested in appropriate contexts:
SELECT |  -- Suggests: COUNT, SUM, AVG, MAX, MIN, etc.
SELECT COUNT(|  -- Suggests columns and *
WHERE date_column > |  -- Suggests: NOW(), CURRENT_DATE, etc.
Common function suggestions:
CategoryFunctions
AggregateCOUNT, SUM, AVG, MAX, MIN
StringCONCAT, SUBSTRING, UPPER, LOWER, TRIM
DateNOW, CURRENT_DATE, DATE_FORMAT, DATEADD
MathROUND, ABS, CEIL, FLOOR
ConditionalCOALESCE, NULLIF, CASE, IF
SQL function suggestions

Schema Names

For databases with multiple schemas (PostgreSQL):
SELECT * FROM |  -- Suggests: public, schema1, schema2
SELECT * FROM public.|  -- Suggests tables in public schema

Context-Aware Suggestions

Suggestions adapt to SQL context: after SELECT, shows columns and aggregate functions; after FROM/JOIN, shows table names; after WHERE, shows columns and operators; after ON (JOIN), shows columns from both tables; after GROUP BY/ORDER BY, shows relevant columns and modifiers.

Using Completions

Use arrow keys to navigate, Enter or Tab to accept, Escape to dismiss. Continue typing to filter suggestions; accepted suggestions replace the typed prefix and move the cursor to the end.

Schema Caching

On connection, TablePro fetches and caches all table and column information. If you make schema changes, right-click the connection and select Refresh, or disconnect and reconnect. Schema changes made in TablePro (via Structure tab) are auto-reflected.

Performance

Autocomplete works on files of any size, including multi-megabyte dumps. For files >500 KB, it analyzes only a ~10 KB window around the cursor. For large schemas (100+ tables), initial loading may take a moment, but remains responsive after caching. Use aliases to narrow suggestions faster and let the cache work.