Skip to content

Reference card

PeachQ REPL help

Use \? in the REPL to open the help index, \?name for a summary (for example, \?select), or \??name for the full help entry.

Keywords

abs cor ej gtime like mins prev scov system wavg
acos cos ema hclose lj ljf mmax prior sdev tables where
aj aj0 count enlist hcount load mmin rand select tan while
ajf ajf0 cov eval hdel log mmu rank set til within
all cross except hopen lower mod ratios setenv trim wj wj1
and csv exec hsym lsq msum raze show type wsum
any cut exit iasc ltime neg read0 signum uj ujf xasc
asc delete exp idesc ltrim next read1 sin ungroup xbar
asin deltas fby if mavg not reciprocal sqrt union xcol
asof desc fills ij ijf max null reval ss update xcols
atan dev first in maxs or reverse ssr upper xdesc
attr differ fkeys insert mcount over rload string upsert xexp
avg distinct flip inter md5 parse rotate sublist value xgroup
avgs div floor inv mdev peach rsave sum var xkey
bin binr do get key med pj rtrim sums view xlog
ceiling dsave getenv keys meta prd save sv views xprev
cols each group last min prds scan svar vs xrank

By category

control do, exit, if, while
env getenv, gtime, ltime, setenv
interpret eval, parse, reval, show, system, value
io dsave, get, hclose, hcount, hdel, hopen, hsym, load, read0, read1, rload, rsave, save, set
iterate each, over, peach, prior, scan
join aj aj0, ajf ajf0, asof, ej, ij ijf, lj ljf, pj, uj ujf, wj wj1
list count, cross, cut, enlist, except, fills, first, flip, group, in, inter, last, mcount, next, prev, raze, reverse, rotate, sublist, sv, til, union, vs, where, xprev
logic all, and, any, not, or
math abs, acos, asin, atan, avg, avgs, ceiling, cor, cos, cov, deltas, dev, div, ema, exp, floor, inv, log, lsq, mavg, max, maxs, mdev, med, min, mins, mmax, mmin, mmu, mod, msum, neg, prd, prds, rand, ratios, reciprocal, scov, sdev, signum, sin, sqrt, sum, sums, svar, tan, var, wavg, within, wsum, xexp, xlog
meta attr, null, tables, type, view, views
query delete, exec, fby, select, update
sort asc, bin binr, desc, differ, distinct, iasc, idesc, rank, xbar, xrank
table cols, csv, fkeys, insert, key, keys, meta, ungroup, upsert, xasc, xcol, xcols, xdesc, xgroup, xkey
text like, lower, ltrim, md5, rtrim, ss, ssr, string, trim, upper

.Q.id (sanitize), .Q.res (reserved words)

Operators

. Apply, Index, Trap, Amend @ Apply At, Index At, Trap At, Amend At
$ Cast, Tok, Enumerate, Pad, mmu
! Dict, Enkey, Unkey, Enumeration, Flip Splayed, Display, internal, Update, Delete, lsq
? Find, Roll, Deal, Enum Extend, Select, Exec, Simple Exec, Vector Conditional
+ - * %Add, Subtract, Multiply, Divide
= <> ~Equals, Not Equals, Match
< <= >= > Less Than, Up To, At Least, Greater Than
| &Greater (OR), Lesser, AND
# Take, Set Attribute _ Cut, Drop : Assign
^ Fill, Coalesce , Join ' Compose
0: 1: 2:File Text, File Binary, Dynamic Load
0 ±1 ±2 ±nwrite to console, stdout, stderr, handle n
.: @: $: !: ?: +: -: *: %: =: ~: <: >: |: &: #: _: ^: ,:Assign through operator

Overloaded glyphs

Iterators

Execution control

Debugging

Other

` pop stack :: identity \x system cmd x . push stack generic null \ abort global amend \\ quit q set view / comment

() precedence [;] expn block {} lambda ` symbol (;) list argt list ; separator `: filepath ([]..) table

Attributes

g grouped p parted s sorted u unique

Set Attribute

Command-line options and system commands

file
\a tables \r rename
-b blocked -s \s secondary processes
\b \B views -S \S random seed
-c \c console size -t \t timer ticks
-C \C HTTP size \ts time and space
\cd change directory -T \T timeout
\d directory -u -U \u usr-pwd
-e \e error traps -u disable syscmds
-E \E TLS server mode \v variables
\f functions -w \w memory
-g \g garbage collection -W \W week offset
\l load file or directory \x expunge
-l -L log sync -z \z date format
-o \o UTC offset \1 \2 redirect
-p \p listening port \_ hide q code
-P \P display precision \ terminate
-q quiet mode \ toggle q/k
-r \r replicate \\ quit

system

Command-line options, System commands, OS commands

Datatypes

Basic datatypes n c name sz literal null inf SQL Java .Net ------------------------------------------------------------------------------------ 0 * list 1 b boolean 1 0b Boolean boolean 2 g guid 16 0Ng UUID GUID 4 x byte 1 0x00 Byte byte 5 h short 2 0h 0Nh 0Wh smallint Short int16 6 i int 4 0i 0Ni 0Wi int Integer int32 7 j long 8 0j 0Nj 0Wj bigint Long int64 0 0N 0W 8 e real 4 0e 0Ne 0We real Float single 9 f float 8 0.0 0n 0w float Double double 0f 0Nf 10 c char 1 " " " " Character char 11 s symbol ` ` varchar 12 p timestamp 8 dateDtimespan 0Np 0Wp Timestamp DateTime (RW) 13 m month 4 2000.01m 0Nm 14 d date 4 2000.01.01 0Nd 0Wd date Date 15 z datetime 8 dateTtime 0Nz 0wz timestamp Timestamp DateTime (RO) 16 n timespan 8 00:00:00.000000000 0Nn 0Wn Timespan TimeSpan 17 u minute 4 00:00 0Nu 0Wu 18 v second 4 00:00:00 0Nv 0Wv 19 t time 4 00:00:00.000 0Nt 0Wt time Time TimeSpan

Columns: n short int returned by type and used for Cast, e.g. 9h$3 c character used lower-case for Cast and upper-case for Tok and Load CSV sz size in bytes inf infinity (no math on temporal types); 0Wh is 32767h

RO: read only; RW: read-write

Other datatypes 20-76 enums 77 anymap 104 projection 78-96 77+t – mapped list of lists of type t 105 composition 97 nested sym enum 106 f' 98 table 107 f/ 99 dictionary 108 f\ 100 lambda 109 f': 101 unary primitive 110 f/: 102 operator 111 f\: 103 iterator 112 dynamic load

Above, f is an applicable value.

Nested types are 77+t (e.g. 78 is boolean. 96 is time.)

Cast $: where char is from the c column above char$data:CHAR$string

dict:`a`b!…
table:([]x:…;y:…)
date.(year month week mm dd)
time.(minute second mm ss)
milliseconds: time mod 1000

Namespaces

.h (markup)

HTTP, markup and data conversion.

.j (JSON)

De/serialize as JSON.

.m (modules)

The currently loaded modules. In kdb+ 4.x, .m is reserved for memory domain 1 objects. In kdb+ 5.0 and later, .m is used for modules.

.Q (utils)

Utilities: general, environment, IPC, datatype, database, partitioned database state, segmented database state, file I/O, debugging, profiling.

.z (environment, callbacks)

Environment, callbacks