Docs
Docs /SQL Editor /Code navigation
SQL EditorNavigation

Code navigation

Prism resolves every name in your query (CTEs, aliases, columns, tables), so the editor can jump to where a thing is defined, list every place it's used, rename it everywhere at once, and tell you what it is when you hover.

hover a column
12345678910
WITH failed_tests AS (
SELECT
  vehicle_id,
  make,
  completed_date
FROM `ace-analytics.warehouse.fact_mot_test`
WHERE test_result = 'FAILED'
)
SELECT f.vehicle_id, f.make
FROM failed_tests AS f
vehicle_id
TypeSTRING
Sourcefact_mot_test
NullableNo

Keyboard shortcuts

ActionKeysAlso
Go to DefinitionF12⌘-click (Ctrl-click on Windows and Linux); right-click → Go to Definition
Go to ReferencesF12 (ShiftF12 on Windows and Linux)right-click → Go to References
Rename SymbolF2right-click → Rename Symbol
Peek DefinitionF12 (CtrlF12 on Windows and Linux)

Go to Definition only appears in the right-click menu when the cursor is on something Prism can resolve. Peek Definition, despite the name, currently behaves like Go to Definition: it selects the target instead of opening an inline preview.

Go to Definition

What happens depends on what the name is:

  • A CTE name (FROM failed_tests): the cursor moves to the CTE in the WITH clause.
  • A table alias (f.make): the cursor moves to AS f. F12 again on the alias declaration goes on to the CTE or table.
  • A column alias (ORDER BY defect_count): the cursor moves to the AS defect_count that defines it.
  • A column from a CTE: an aliased or computed column goes to its definition inside the CTE; a plain pass-through column goes to the base table’s schema.
  • A schema table: opens the table’s entity tab in the schema tree. Tables you haven’t expanded are loaded on demand; a table you can’t access shows a warning.
  • A schema column: opens the table’s Schema tab with that column highlighted. STRUCT fields and UNNEST aliases are traced back to the array column.
  • A temp table (CREATE TEMP TABLE): treated like a CTE; the cursor moves to the declaration.
  • A pipe-syntax alias (|> EXTEND … AS x): the cursor moves to the alias.
  • A GQL graph variable or label: the MATCH pattern, or the LABEL clause in an in-file CREATE PROPERTY GRAPH.
  • A function or a DECLARE variable: nothing.

Works the same in dbt and Dataform files after preprocessing; inside a Jinja expression nothing resolves.

Go to References

F12 (ShiftF12 on Windows and Linux) opens the references peek under the line: every occurrence, definition included, click to jump.

12345678
WITH user_stats AS (
SELECT user_id, COUNT(*) AS n
FROM `ace-analytics.warehouse.events`
GROUP BY user_id
)
SELECT * FROM user_stats
UNION ALL
SELECT * FROM user_stats
Go to References on user_stats lists three locations: the definition and both FROM clauses.

References are found for CTEs, table aliases, column aliases, temp tables, pipe aliases, graph variables, and schema columns (every use of vehicle_id from that table, qualified or not). For a CTE the list also includes its aliases and their alias.column uses. Schema tables and functions have no reference search.

Rename

F2 on a CTE, a table alias, a column alias, a temp table, a pipe alias or a graph variable renames the definition and every reference in the current editor. A CTE rename leaves aliases pointing at it alone (FROM failed_tests AS f keeps f).

Schema tables, schema columns, functions and query parameters can’t be renamed; F2 on them does nothing, silently. There is no check on the new name: if you rename an alias to a reserved word, the next diagnostic pass reports it.

Hover

Every resolvable identifier shows a Property / Value card. The rows vary by kind:

KindRows
Schema columnType, Source (table), Nullable, then the column description
STRUCT fieldType, Source struct_column (table), Nullable
Column aliasType: Column Alias, Alias of, Data Type, Source
TableType: Table, Rows, Last Updated, Partitioned By, Clustered By, then the description and a column list
CTEType: Common Table Expression, Defined at: line N, Columns
Table aliasType: Alias, References, Target Type
FunctionType: Function, Returns, Parameters (optional ones marked ?)
DECLARE variableType: Script variable (INT64), Declared at: line N
Named windowType: Named Window, Partition By, Order By
hover a table
12
SELECT vehicle_id, completed_date
FROM `ace-analytics.warehouse.fact_mot_test`
ace-analytics.warehouse.fact_mot_test
TypeTable
Rows41,203,118
Partitioned Bycompleted_date (MONTH)
Clustered Byvehicle_id, test_result, make
MOT test fact table.
mot_test_id: STRING · vehicle_id: STRING · completed_date: DATE · completed_timestamp: TIMESTAMP · expiry_date: DATE? · test_result: STRING

When column lineage knows the position, the card gains Derives from and Side inputs rows. An unresolvable qualified column (x.foo with no x) shows no card at all; the diagnostic reports it instead. Signature help for functions is covered in auto-completions.

Inlay hints

Gray annotations Prism adds inline, no hover needed:

12345
SELECT make, test_result, COUNT(*) AS tests
FROM `ace-analytics.warehouse.fact_mot_test` AS t
JOIN `ace-analytics.warehouse.dim_vehicle` AS v USING (vehicle_id)
GROUP BY 1, 2
ORDER BY 3 DESC ← tests
  • GROUP BY 1, ORDER BY 2, PARTITION BY 1← column after the number (alias if there is one, else the expression). Not inside OVER (…) or inside aggregates like ARRAY_AGG(x ORDER BY 1).
  • GROUP BY ALL← make, test_result, the columns it will group by. Suppressed when the SELECT has *.
  • Unqualified columns in a query with JOINs → [t.] before the column, so you can see which table it came from. Not shown if the column is ambiguous.
  • ROWS BETWEEN 2 PRECEDING AND CURRENT ROW← 3 rows total. ROWS frames only, and only when the size is fixed.
  • -- querylab:tablesample=1 TABLESAMPLE 1% after each table that will be sampled; see TABLESAMPLE.
  • In dbt and Dataform files, the compiled table name after ref(), source(), resolve().

Settings → Editor → SQL Editor → Inlay Hints (also listed under Settings):

Inlay Hints
Show parameter namesDisplay parameter names inline for function calls (e.g., x: value, y: value)
Show return typesDisplay return types inline for expressions (e.g., : STRING)
Show variable typesDisplay inferred types for columns and variables (e.g., : INT64)

The helper texts describe a different feature than the toggles control today. Show parameter names turns the GROUP BY / ORDER BY / PARTITION BY position hints on and off; Show return types controls the table-source and window-frame hints; Show variable types has no effect. The dbt and Dataform hints have their own switches under Settings → SQL Frameworks.