Run SOQL¶
The editor¶
2 opens /soql. The editor is a multi-line textarea with
autocomplete against the active org's schema.
Autocomplete fires as you type:
- Field names — after
SELECTand inWHERE/ORDER BY - sObject names — after
FROM - Picklist values —
Ctrl+Spaceon aWHERE foo =cursor position fetches distinct values from the org - Relationship names — typing
Account.offers parent + child references
Esc leaves input mode without running. Ctrl+C aborts a running
query.
Tooling vs. standard API¶
Some objects (Flow, ApexClass, ValidationRule, FieldDefinition,
…) live on the Tooling API, not the standard one. Press T on the
editor to toggle Tooling mode — sf-deck shows the active mode in
the editor border.
Saving for later¶
After running a query, s opens a save dialog. Pick a name + an
optional description. Saved queries live in your saved-query
library, accessible from any sf-deck session.
sf-deck soql saved create --name "Open opps" --query "SELECT ..." --json
sf-deck soql saved list --json
Recall¶
From /soql, Shift+2 jumps to the Saved subtab. Cursor onto a
query, Enter to load it into the editor and run.
Browsing history¶
Shift+3 (or whatever subtab History sits on) shows every query
you've run recently — both from the TUI and from sf-deck soql run.
Each row has timestamp, duration, row count, and the error message
if it failed.
Driving the editor from an agent¶
The IPC verb soql.seed pushes a query straight into the live
TUI's editor. With "run": true it also fires the run, same as if
the user had pressed Enter.
echo '{"command":"soql.seed","args":{"query":"SELECT Id, Name FROM Account LIMIT 5","run":true}}' | nc -U ~/.sf-deck/control-1.sock
Useful for "I drafted this query; show it to the user so they can edit + run" workflows.
Export¶
Two ways to get results out:
- From the editor —
eopens a format picker (CSV, XLSX, JSON, Bulk-API CSV for big result sets). - From the CLI —
sf-deck soql export --org <a> --query <q> --output result.csv.
Related¶
- Reference → CLI — every
soql.*subcommand. - Reference → IPC —
soql.seed,soql.run,soql.history.list,soql.saved.*.