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). A keyless list accepts rkey (PCRE2 regex over the keys), and it governs both the disk load and the realtime feed.
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. Filters, sorts and pages in the server: rkey (PCRE2 regex), order=key|records + desc, and from/limit (with limit>0 the answer is a page {total_rows, pages, data}, and limit=0 keeps the plain full list).
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 as bounded JSON (expanded, lists_limit and dicts_limit. Unexpanded containers answer as [[size]]).
descDescribe topic schema.

open-iterator match conditions (all optional, and 0 or empty means 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 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.
node / nodesRetrieve one node / list a topic’s nodes (with filters).
instancesList node instances.
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.
snaps / snap-contentInspect snapshots.
import-db / export-dbBulk import/export.
treedbs / topicsList the treedbs of the tranger / the topics of a treedb.
desc / descsDescribe one topic’s schema / every topic’s.
print-trangerDump the tranger the treedb lives on as bounded JSON (kw_collapse()-truncated: unexpanded containers answer as [[size]], and lists_limit and dicts_limit bound the expansion). Pass path= (backtick-delimited, kw_find_path style, arrays by numeric index) to lazily drill into one subtree — this is what feeds the gui_treedb “Raw JSON” viewer.

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.