There are several IDEs available for kdb+, including the soon-to-be-released Visual Studio KX plugin, KX Developer/Analyst, Studio for kdb+, etc. Often, you find yourself working in a terminal and would simply like to execute some function on a remote kdb+ process. Typically, you start a kdb+ process, create a connection handler (h) and send the command synchronously.

If you send the command as a string then escaping quotation marks is inconvenient. On the other hand, if you send your expression as a list (function name and parameters), you might be annoyed by the extra punctuations (e.g. backtick for the function, parentheses). A simple

f 43

becomes

h "f 43"

or

h (`f; 43)

The command line tool qcon comes to rescue. If you type

$ qcon remotehost:5050
remotehost:5050>

it connects to the remote kdb+ process and provides you a prompt. Commands that you enter there are executed on the remote server. Quite convenient, isn’t it?

qcon is available for all operating system for which kdb+ binary is built. On Linux, it is recommended to use rlwrap with qcon to enable arrow keys and navigation in the command history.

Interestingly, qcon triggers callback .z.pq as opposed to .z.pg on the remote server. Be aware of this when you implement security checks.

qcon hangs till the results are returned. Geo’s con command is asynchronous, allowing you to start typing your next lengthy command immediately without waiting for the results of the previous commands.

kdb+ developers often find it frustrating that the q console lacks support for multi-line commands. Overwriting a multi-line function is a typical practice during development or root cause investigation. Another exciting qcon replica is qcon2.sh, which supports sending multi-line commands. You need to type p) (that has nothing to do with embedPy’s promopt) and can past a multi-line command.