Open in Query Pilot
Help ID: guide.open-in-query-pilot
The Open in Query Pilot action on the Script Action Bar hands a generated change script to Query Pilot as a fresh tab, with the destination servers and databases already ticked. This is how an admin takes a Matrix or Consolidator change, tweaks it interactively against the live catalog, and runs it from Query Pilot instead of queueing into Deploy.Code.
How target scope travels
Instead of calling Query Pilot's TargetPicker.SelectTargets directly — which fails when the target list hasn't been populated at the moment the new tab opens — the action prepends a /* MINION EXEC POLICY */ header to the SQL and lets Query Pilot's existing policy parser do the picking after the tab is live. The header looks like:
/* MINION EXEC POLICY
RunMode: Check
TargetMode: Selected
Servers: SRV-A, SRV-B
Databases: db1, db2
*/
Servers: and Databases: carry the distinct names collected from ScriptActionPayload.Targets, in the same order as the strip chips. RunMode: Check is a safe default — the script arrives in a "preview before execute" posture, not primed to run on open.
QueryRunnerViewModel.OpenScriptInNewTab prepends the header through BuildMinionExecPolicyHeader, opens the tab, and calls UpdateExecutionPolicy(tab, autoApply: true) to force the policy parser to tick the matching targets immediately. The admin sees a Query Pilot tab with the Minion policy block visible at the top of the editor and the targets strip filled in; editing the policy block retargets the script just as it would for any other Query Pilot tab.
Apply vs Undo
Which SQL is sent — Apply or Undo — follows the preview's currently active tab. The Query Pilot tab title is UNDO: <original title> when the Undo tab is active, otherwise the original title. That way an admin who opens the Undo preview expecting to run the rollback is not surprised by the Apply script landing in Query Pilot.
Fallback when no targets
If the payload carries no targets (rare but possible — for example, a script loaded standalone into the preview), the action still opens the tab but reports "Opened in Query Pilot — no targets were preselected." on the Script Action Bar's status line. The admin picks targets manually in Query Pilot.
Related: Script Action Bar · Query Pilot · Consolidator.
Documentation revision: 7F90230D741EA8CD