Docs
Docs /SQL Editor /Ghost completions
SQL EditorCompletions

Ghost completions

Gray inline text that finishes the part of a query the editor can already predict (an alias, the GROUP BY list, a join condition) so you press Tab instead of typing it. Where the dropdown shows every match, ghost text shows one suggestion, and it disappears the moment you keep typing.

Query 1 · PlaygroundTab accepts
123
SELECT user_id, country, COUNT(*) AS total
FROM `ace-analytics.warehouse.users`
GROUP BY user_id, country

Accepting and dismissing

Ghost completions come from Prism’s own analysis of your query and schema, with no model call and no latency. That is also why they only appear for patterns where the answer is unambiguous.

1
SELECT COUNT(*) AS count
  • Tab accepts.
  • Enter does not accept — it inserts a newline and dismisses, so formatting your query never accidentally takes a suggestion.
  • Esc or any other key dismisses.

Ghost vs. dropdown

Dropdown completionsGhost completions
AppearanceList in a menuInline gray text
OptionsEvery matchOne suggestion
Accept withTab or EnterTab only
ShownOn trigger or CtrlSpaceOnly for the patterns below
Covers the code belowYesNo

Both can be visible at once. With c¦ount the dropdown also lists count, country, created_at; Tab takes the ghost text, the arrow keys take the dropdown, typing filters both.

The seven patterns

1. Alias after AS

After AS in a SELECT list, the alias is the first letter of each word.

1
SELECT FactPayment AS fp
  • user_accounts ASua
  • COUNT(*) AScount
  • total_revenue AStr

If the alias is taken (say u1) it suggests u2, u3, and so on.

2. GROUP BY column list

After GROUP BY, every non-aggregate column from your SELECT, in order. One Tab takes all of them. That is the example at the top of this page.

  • SELECT has non-aggregate columns
  • Nothing typed after GROUP BY yet
  • More than one column needs grouping

3. JOIN condition

After JOIN table ON, the condition, when there is an obvious key relationship.

12
FROM users u
JOIN orders o ON u.user_id = o.user_id
  • Both tables have a column with the same name and type
  • Exactly one such pair, so there is no ambiguity
  • Nothing typed after ON yet

4. Date filter

For a DATE or TIMESTAMP column in a WHERE clause, the common “last 30 days” filter.

1
WHERE created_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)

5. Right side of a join comparison

After the left side of a comparison in an ON clause, the matching column on the other table. Same matching rules as pattern 3.

12
FROM fact_defect fd
JOIN dim_defect_type ddt ON fd.defect_type = ddt.defect_type_key

6. IS NULL

After IS, NULL. The dropdown still lists both NULL and NOT NULL, so either path works.

1
WHERE status IS NULL

7. Closing syntax

When the closing position is deterministic (a parenthesis, a quote), ghost text closes it. Nested parentheses close in the right order.

1
SELECT (user_id * 100)

When nothing appears

Ghost text needs certainty. You won’t see it when:

  • you’re already typing a partial word (the dropdown handles that)
  • more than one answer is valid
  • the content is already there: a finished alias, a typed condition, a column list in progress
  • schema information isn’t available for the tables involved

To turn ghost completions off, clear Enable ghost completions under Settings → Editor → SQL Editor → Completions. While on, they only show in the cases above, and any key other than Tab makes them disappear.