Re-posting for public visibility:
----
Hi Jer,
Officially the WebSocket plugin does not support TorQ Gateway's .gw functionality. For that users should migrate over to the backend plugin which supports .gw.syncexecjt and its derivatives (.gw.syncexecj, .gw.syncexec).
Alternatively, as you are aware users can setup a relay process to call .gw functions on the Gateway in a synchronous manner.
If that is not possible, you can manipulate .
z.ws and add custom .gw functions to the TorQ Gateway to provide limited .gw.asyncexecjpts functionality, e.g.:
.gw.grafasyncexecjpt:{[q;p;j;t;s;id].gw.asyncexecjpt[q;p;{[res;j;id]-8! `o`ID!(`payload`id`error`success!({`columns`rows!(enlist ([]text:cols x);enlist flip value flip x)}@[j;res];"";"OK";1b);id)}[;j;id];();0Wn]};
.gw.grafasyncexec:.gw.grafasyncexecjpt[;;raze;();0Wn]
.z.ws:{ds:-9!x;if[not `function~ds[`i;1;`queryParam;`query;`type];neg[.z.w]-8!`o`ID!("'GW only supports function queries";ds[`ID])];@[value;ds[`i;1;`queryParam;`query;`value]][ds`ID]}
This would enable queries to be run from the WebSocket plugin on the Gateway such as:
.gw.grafasyncexec["delete date from select from trade where sym=`AMD";`hdb`rdb]
This would be dependent on each user's conditions and requirements though; the above setup for example will only work with Free-Form Queries, does not support row-limits or conflation, and
only supports queries which call these new functions. It also does not support error handling, so would be difficult to debug.
Overall, if possible, your best bet would be migrating over to the new backend plugin as that already has support for .gw.syncexec as well as a number of other newer Grafana features. The backend plugin is what we will be supporting going forward, with only legacy support for the WebSocket plugin.
Thanks,
Daniel