Skip to content

Prototype

ihull edited this page Jun 11, 2021 · 5 revisions

How to install the prototype app

As at 11 Jun 2021

At the moment, can't get electron-windows-installer to create an installation .exe, so the best we can do is provide the distribution as a .zip file. To test, a kdb server must also be running and be set up to handle WebSocket connections.

  1. Install kdb+: https://code.kx.com/q/learn/install/ . Note this requires a license key file for non-commercial use, which will be sent on request.

  2. When installation is complete, start a q server in a terminal window to reveal the q) prompt

  3. Listen on port 5005 (the prototype app is currently hard-coded to send requests to this port on locahost):
    q) \p 5005

  4. Set up the web socket message handler for asynchronous communication and format response as JSON:
    q) .z.ws:{neg[.z.w].j.j @[value;x;{`$ "'",x}];}
    For an explanation of this, see https://code.kx.com/q/wp/websockets/

  5. Next, download the current kdb-studio-2-proto-win32-x64.zip file and uncompress to a suitable location.

  6. Open kdb-studio-2-proto.exe. Assuming the app window displays, click on Connect to connect to the KDB server listening on port 5005. You should see the message 'Connected' in the output pane.

  7. It should now be possible to send q statements to the server and see the response; these should be tabulated where appropriate.

Example: create 'trades' table and see results

Following example here: https://code.kx.com/q4m3/1_Q_Shock_and_Awe/#117-example-trades-table

Note that in the prototype as it stands, each command must be sent separately to the server (replace any existing statement and click Go)

dts:2015.01.01+1000000?31
tms:1000000?24:00:00.000000000
syms:1000000?`aapl`goog`ibm
vols:10*1+1000000?1000
pxs:90.0+(1000000?2001)%100
trades:([] dt:dts; tm:tms; sym:syms; vol:vols; px:pxs)
trades:`dt`tm xasc trades
trades:update px:6*px from trades where sym=`goog
trades:update px:2*px from trades where sym=`ibm

Then to get the first 200 rows for example: 200#trades
The results should appear in an interactive table.

Clone this wiki locally