τ 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
nameincreate_schedule <name>or thetextinappend <name> <text> ...
Integer
A 64-bit unsigned integer. Used primarily for timestamps.
- Representation:
u64 - Example: The
valid_nsandexpiry_nsin theappendcommand, or thetsin theatcommand.
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
expressionincreate_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:
1τ> append my_schedule "123.45" 1000 2000Or a JSON object:
1τ> append my_schedule "{\"key\":\"value\"}" 2000 3000Since τ 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.