tranger2_append_record()
#
Appends a new record to a topic in the TimeRanger database. The function assigns a timestamp if __t__
is zero and returns the metadata of the newly created record.
Prototype
int tranger2_append_record(
json_t *tranger,
const char *topic_name,
uint64_t __t__,
uint16_t user_flag,
md2_record_ex_t *md2_record_ex,
json_t *jn_record
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
Pointer to the TimeRanger database instance. |
|
|
Name of the topic where the record will be appended. |
|
|
Timestamp of the record. If set to 0, the current time is used. |
|
|
User-defined flag associated with the record. |
|
|
Pointer to the metadata structure of the record. This field is required. |
|
|
JSON object containing the record data. Ownership is transferred to the function. |
Return Value
Returns 0 on success, or a negative value on failure.
Notes
The function ensures that the record is appended to the specified topic in tranger2_startup()
. If the topic does not exist, it must be created using tranger2_create_topic()
before calling this function.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples