Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Data GClasses

Time-series, graph database, and resource persistence.

Source: kernel/c/root-linux/src/c_tranger.c, c_treedb.c, c_node.c, c_resource2.c


C_TRANGER

Time-range database manager — wraps timeranger2 for CRUD operations on time-series topics.

PropertyValue
StatesST_STOPPED, ST_IDLE

Commands

CommandDescription
topicsList all topics: their names, or with expanded=1 a desc each ({topic_name, system_flag, pkey, tkey, topic_version}). system_flag is what tells whether the topic’s t/tm are seconds or milliseconds (sf_t_ms / sf_tm_ms).
create-topicCreate a new topic.
open-topicOpen an existing topic.
delete-topicDelete a topic.
open-list / close-listOpen or close a record list (one-shot snapshot with return_data=1, else a live list collecting realtime appends).
get-list-dataRetrieve an open list’s data.
list-keysList a topic’s keys with their record counts and their time span on both axes: [{key, records, fr_t, to_t, fr_tm, to_tm}]. Lets a client bound a time picker to what the key really holds without reading a record.
open-iterator / close-iteratorOpen/close a stateful per-key iterator (row index only, no upfront load) for cursor pagination. Takes the match conditions below; a filtered iterator indexes the matching rows at open, so total_rows and the pages count only those.
get-pageGet a page {total_rows, pages, data} from an open iterator (limit, optional backward). from_rowid is 1-based and, on a filtered iterator, is a position among the MATCHING rows (a global rowid only when the iterator does not filter).
open-rt / close-rtOpen/close a realtime feed on a topic key (no history load); new appends are published as EV_TRANGER_RECORD_ADDED to subscribers.
add-recordAppend a record.
print-trangerDump tranger state.
descDescribe topic schema.

open-iterator match conditions (all optional; 0/empty = unset): from_t/to_t, from_tm/to_tm, from_rowid/to_rowid, backward, and the user_flag conditions (user_flag, not_user_flag, user_flag_mask_set, user_flag_mask_notset). They are ANDed, and every one is honored per record.

A tranger record carries two independent timestamps, and a browser of raw records needs both:

AxisMeaning
tPersistence time — when the record was appended to the topic.
tmMessage time — when the event it carries actually happened (the record’s tkey field, set by the producer).

They diverge whenever data is backfilled or a device uploads a buffered batch late. Both are expressed in the topic’s unit — seconds, unless its system_flag sets sf_t_ms / sf_tm_ms (ask topics expanded=1).


C_TREEDB

Hierarchical tree database manager — manages TreeDB instances on top of timeranger with JSON schema support.

PropertyValue
StatesST_STOPPED, ST_IDLE

Key attributes

AttributeTypeDescription
pathstringStorage path.
filename_maskstringFilename pattern.
masterboolTRUE for master, FALSE for read-only replica.
exit_on_errorboolExit on schema errors.

Commands

CommandDescription
open-treedb / close-treedbOpen or close a treedb instance.
delete-treedbDelete a treedb and its data.
create-topic / delete-topicManage topics within a treedb.

C_NODE

Node resource interface for TreeDB — full CRUD and graph operations on tree nodes with linking, snapshots, and import/export.

PropertyValue
StatesST_STOPPED, ST_IDLE

Commands

CommandDescription
create-node / update-node / delete-nodeCRUD operations on nodes.
get-node / list-nodesRetrieve nodes.
link-nodes / unlink-nodesManage parent-child relationships.
parents / childrenNavigate the graph.
hooks / linksInspect hook and fkey relationships.
jtreeGet a node’s full subtree as JSON.
shoot-snap / activate-snap / deactivate-snapSnapshot management.
list-snaps / snap-contentInspect snapshots.
import-db / export-dbBulk import/export.
descDescribe topic schema.

C_RESOURCE2

Simple resource persistence — stores each resource as a flat JSON file.

PropertyValue
StatesST_STOPPED, ST_IDLE

Key attributes

AttributeTypeDescription
strictboolEnable schema validation.
json_descjsonResource schema descriptor.
persistentboolPersist to disk.
servicestringService name.
databasestringDatabase name.