Data Types

Understand the primitive data types used in τ commands.

τ does not enforce a strict, predefined set of data types at the storage layer. Instead, it treats most data as opaque byte arrays ([]const u8) and relies on command-level interpretation. However, when sending commands to the server, arguments are expected to conform to a few primitive types.

Core Primitives

The command parser interprets arguments based on the following fundamental types.

String

A sequence of UTF-8 characters. In command arguments, strings are typically represented as a sequence of bytes. When used for names of primitives like Schedules or Frames, they must not contain spaces. When used as data, they can contain any character.

  • Representation: []const u8
  • Example: The name in create_schedule <name> or the text in append <name> <text> ...

Integer

A 64-bit unsigned integer. Used primarily for timestamps.

  • Representation: u64
  • Example: The valid_ns and expiry_ns in the append command, or the ts in the at command.

Expression

A special string that represents a Lens transformation. It is a simple mathematical expression that operates on the values of Schedules within a Frame.

  • Representation: []const u8
  • Example: The expression in create_lens <name> <expression>. For example, 'price * 2'.

Data in Schedules

When you append data to a Schedule, the text argument is treated as a simple string or byte array. There is no validation of its contents. This flexible approach allows you to store any kind of data, such as:

  • Plain text
  • Numbers (as strings)
  • JSON objects
  • Serialized data from any format

Example: Storing Different Data Formats

You can append a stringified number:

REPL
1τ> append my_schedule "123.45" 1000 2000

Or a JSON object:

REPL
1τ> append my_schedule "{\"key\":\"value\"}" 2000 3000

Since τ treats appended data as opaque bytes, it is the client's responsibility to serialize and deserialize data as needed. The Lens engine, however, will attempt to interpret values as numbers when performing mathematical operations.

Last updated: 2/1/2026