SiwenZhang / q_practice

Introduction to Q, the scripting language for KDB+ databases.

Home Page:https://samkennerly.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

q_practice

Join the continuum.

Mariachi band

abstract

Example scripts written in q, the query language for kdb+ databases.

basics

  1. Clone this repo or use it as a template.
  2. Open a terminal and cd to this folder.
  3. Start q and enter \l src/init.q to load src/init.q.

contents

Comments, lists, symbols, functions, show, delete, each, 0N!, ?.

Functions, iterators, lambdas, projections, dot apply, etc.

Pseudorandom normal samples with a Box-Muller transform similar to qtips/stat.q.

System commmands, navigation, file handles, current time.

Example dictionaries, tables, and keys.

One script to run them all and to test/output write them.

dependencies

  • q 3.4+ 64-bit or 32-bit version

examples

Create an alias in a startup file to run q with rlwrap.

export QARCH='m32'
export QHOME="$HOME/q"
alias q='rlwrap --complete-filenames --remember "$QHOME/$QARCH/q"'

Run a q script and interact with it.

q src/tables.q

Run a q script and close the interpreter.

q src/tables.q < /dev/null

Run a q script and save [STDOUT] to a file.

q src/init.q > test/output/init.txt

faq

Where else can I find Q tutorials?

WTF are all these cryptic type values?

I never remember them, so I made a table of datatypes.

About

Introduction to Q, the scripting language for KDB+ databases.

https://samkennerly.github.io/

License:BSD 2-Clause "Simplified" License


Languages

Language:q 96.0%Language:Shell 4.0%