Database Commands

A comprehensive reference for all the commands available in the τ database REPL and server.

The primary way to interact with the τ database is through a simple, text-based command protocol. Each command follows a command_name <...args> format.

Here is a complete list of available commands.

Core Primitives

create_schedule

Creates a new, empty schedule with the given name.

  • Syntax: create_schedule <name>
  • name: The unique identifier for the new schedule.
Example
1create_schedule sensor_a

create_frame

Creates a new frame that groups multiple schedules together.

  • Syntax: create_frame <frame_name> <schedule1_name> [<schedule2_name> ...]
  • frame_name: The unique identifier for the new frame.
  • schedule_names: A space-separated list of at least one existing schedule to include in the frame.
Example
1create_schedule sensor_a
2create_schedule sensor_b
3create_frame all_sensors sensor_a sensor_b

create_lens

Creates a new, reusable Lens for transforming data.

  • Syntax: create_lens <lens_name> '<expression>'
  • lens_name: The unique identifier for the new lens.
  • expression: The mathematical or logical expression for the transformation, enclosed in single quotes.
Example
1# Note: Input variables (e.g., 'temp_c') are added separately
2create_lens to_fahrenheit '(temp_c * 9/5) + 32'

append

Appends a new data point (Tau) to a schedule.

  • Syntax: append <schedule_name> <data> <valid_ns> <expiry_ns>
  • schedule_name: The name of the schedule to append to.
  • data: The data value for the Tau.
  • valid_ns: The start of the Tau's validity period (nanosecond timestamp).
  • expiry_ns: The end of the Tau's validity period (nanosecond timestamp).
Example
1# Appends the value 15.5 to 'sensor_a' with a specific validity range
2append sensor_a 15.5 1672531200000000000 1672531201000000000

Query Commands

at

Retrieves the exact Tau from a schedule at a specific nanosecond timestamp.

  • Syntax: at <schedule_name> <timestamp_ns>
  • schedule_name: The name of the schedule or lens to query.
  • timestamp_ns: The exact nanosecond timestamp to look up.
Example
1at sensor_a 1672531200500000000

range

Retrieves all Taus within a schedule that fall within a given nanosecond time range.

  • Syntax: range <schedule_name> <start_ns> <end_ns>
  • schedule_name: The name of the schedule or lens to query.
  • start_ns: The start of the time range (inclusive).
  • end_ns: The end of the time range (inclusive).
Example
1range sensor_a 1672531200000000000 1672531210000000000

valid_at

Retrieves the Tau that is considered "valid" at a specific point in time. This is useful for bitemporal queries where you need to know the value "as of" a certain time.

  • Syntax: valid_at <schedule_name> <timestamp_ns>
  • schedule_name: The name of the schedule or lens to query.
  • timestamp_ns: The nanosecond timestamp to check for validity.
Example
1# What was the value in sensor_a at this exact moment?
2valid_at sensor_a 1672531205000000000

valid_after

Retrieves all Taus that are valid at or after a specific point in time.

  • Syntax: valid_after <schedule_name> <timestamp_ns>
  • schedule_name: The name of the schedule or lens to query.
  • timestamp_ns: The nanosecond timestamp to start checking from.
Example
1# Get all values from this point forward
2valid_after sensor_a 1672531200000000000

Last updated: 2/1/2026