Skip to content


Namespaces are containers within the kdb+ workspace. Names defined in a namespace are unique only within the namespace.

Namespaces are a convenient way to divide an application between modules; also to construct and share library code.

Namespaces are identified by a leading dot in their names.

System namespaces

Kdb+ includes the following namespaces.

namespace contents
.h Functions for converting files into various formats and for web-console display
.j Functions for converting between JSON and q dictionaries
.m Objects in memory domain 1
.Q Utility functions
.q Definitions of q keywords
.z System variables and functions, and hooks for callbacks

The linked pages document some of the objects in these namespaces. (Undocumented objects are part of the namespace infrastructure and should not be used in kdb+ applications.)

These and all single-character namespaces are reserved for use by KX.


Apart from the leading dot, namespace names follow the same rules as names for q objects.

Outside its containing namespace, an object is known by the full name of its containing namespace followed by a dot and its own name.

Namespaces can contain other namespaces.

Thus is the name of object fo within namespace fi within namespace fee.


Namespaces are implemented as dictionaries. To list the objects contained in namespace .foo:

key `.foo

To list all the namespaces in the root:

key `


Referring to a namespace is sufficient to create it.

q)key `
q)key `
q)key `.fee
q)key `

Q for Mortals §12 Workspace Organization

Back to top